Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d283504
misc: pvrsgx-mt6589: init (broken)
akku1139 Mar 8, 2026
2a2c741
arm: configs: lenovo-blade: add CONFIG_PVR_SGX_MT6589
akku1139 Mar 8, 2026
fafd925
misc: pvrsgx-mt6589: remove mt65xx_reg_sync_writel (TODO: use ioremap)
akku1139 Mar 8, 2026
6a5fb98
misc: pvrsgx-mt6589: fix include path
akku1139 Mar 8, 2026
4e0333c
misc: pvrsgx-mt6589: remove mt65xx_reg_sync_writel (TODO: use ioremap) 2
akku1139 Mar 8, 2026
0e605bf
misc: pvrsgx-mt6589: #define LINUX
akku1139 Mar 8, 2026
1b958e4
misc: pvrsgx-mt6589: fix access_ok
akku1139 Mar 8, 2026
cefa3a0
misc: pvrsgx-mt6589: set -Wno-declaration-after-statement
akku1139 Mar 8, 2026
a063c2b
misc: pvrsgx-mt6589: fix Makefile
akku1139 Mar 8, 2026
d26b0de
misc: pvrsgx-mt6589: no ION
akku1139 Mar 8, 2026
8c46425
arm: defconfig: lenovo-blade: add CONFIG_PREEMPT=y
akku1139 Mar 8, 2026
3772149
misc: pvrsgx-mt6589: fix build (wip)
akku1139 Mar 8, 2026
05eedc8
misc: pvrsgx-mt6589: fix build (wip2)
akku1139 Mar 8, 2026
b1ec08d
misc: pvrsgx-mt6589: fix mmap.c wip
akku1139 Mar 8, 2026
b20171c
misc: pvrsgx-mt6589: fix module.c
akku1139 Mar 8, 2026
2925c44
misc: pvrsgx-mt6589: add struct sync_fence;
akku1139 Mar 8, 2026
f2e0b3b
misc: pvrsgx-mt6589: fix proc.c
akku1139 Mar 8, 2026
6041f98
misc: pvrsgx-mt6589: fix pvr_debug.c
akku1139 Mar 8, 2026
665828b
misc: pvrsgx-mt6589: fix stdarg.h include
akku1139 Mar 8, 2026
83500d2
misc: pvrsgx-mt6589: remove all KERNEL_VERSION
akku1139 Jun 27, 2026
d2b0ffa
misc: pvrsgx-mt6589: replace license header with SPDX-License-Identifier
akku1139 Jun 27, 2026
bbd1fb3
misc: pvrsgx-mt6589: replace more license header with SPDX-License-Id…
akku1139 Jun 27, 2026
da7b845
misc: pvrsgx-mt6589: replace more and more license header with SPDX-L…
akku1139 Jun 27, 2026
a1ae512
misc: pvrsgx-mt6589: restore too removed lines
akku1139 Jun 27, 2026
80f9f48
misc: pvrsgx-mt6589: rewrite pvr_sync
akku1139 Jun 27, 2026
786f143
misc: pvrsgx-mt6589: fix mm.c
akku1139 Jun 27, 2026
422360a
misc: pvrsgx-mt6589: fix mutex.c
akku1139 Jun 27, 2026
2460388
misc: pvrsgx-mt6589: remove duplicated MIN/MAX macros
akku1139 Jun 27, 2026
5b5fd52
misc: pvrsgx-mt6589: remove SUPPORT_PVRSRV_ANDROID_SYSTRACE
akku1139 Jun 27, 2026
cc37a7d
misc: pvrsgx-mt6589: fix devicemem.c
akku1139 Jun 27, 2026
50e95e4
misc: pvrsgx-mt6589: fix deviceclass.c
akku1139 Jun 27, 2026
392469f
misc: pvrsgx-mt6589: stddef.h -> linux/stddef.h
akku1139 Jun 27, 2026
f99e8af
misc: pvrsgx-mt6589: disable PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC
akku1139 Jun 27, 2026
6e5eb43
misc: pvrsgx-mt6589: use user build
akku1139 Jun 27, 2026
73db06e
arm: dts: mediatek: mt6589: add missing mfgsys reset
akku1139 Jun 27, 2026
8fdd3b0
misc: pvrsgx-mt6589: remove xlog
akku1139 Jun 28, 2026
fdca83e
misc: pvrsgx-mt6589: refix mutex
akku1139 Jun 28, 2026
c1e27ea
misc: pvrsgx-mt6589: fix fb_open/fb_release
akku1139 Jun 28, 2026
c1019f2
misc: pvrsgx-mt6589: remove MODULE_SUPPORTED_DEVICE
akku1139 Jun 28, 2026
d1e38ad
misc: pvrsgx-mt6589: fix mtklfb_linux.c
akku1139 Jun 28, 2026
d8cabc3
misc: pvrsgx-mt6589: remove mach/mt_clkmgr.h includes
akku1139 Jun 28, 2026
40da1ec
misc: pvrsgx-mt6589: fix mtk_pp.c
akku1139 Jun 28, 2026
35002e0
misc: pvrsgx-mt6589: fix mtklfb_displayclass.c (hack)
akku1139 Jun 28, 2026
f439e6f
Merge branch 'blade/v6.16' into dev/v6.16/pvr-sgxddk-1.12.2824438-and…
akku1139 Jun 29, 2026
078c959
arm: dts: mediatek: mt6589: add power-domains to gpu
akku1139 Jun 29, 2026
ad7a4ea
misc: pvrsgx-mt6589: drop tools dir
akku1139 Jun 30, 2026
61d76d9
misc: pvrsgx-mt6589: drop PCI support
akku1139 Jun 30, 2026
febac74
misc: pvrsgx-mt6589: probe from dt
akku1139 Jun 30, 2026
f95896d
misc: pvrsgx-mt6589: fix
akku1139 Jun 30, 2026
b9c5695
Merge branch 'blade/v6.16' into dev/v6.16/pvr-sgxddk-1.12.2824438-and…
akku1139 Jun 30, 2026
dd712eb
Merge branch 'blade/v6.16' into dev/v6.16/pvr-sgxddk-1.12.2824438-and…
akku1139 Jun 30, 2026
37fb95e
pvrsgx: fix of
akku1139 Jun 30, 2026
7748ea8
pvrsgx: always enable PVR_LDM_PLATFORM_MODULE
akku1139 Jun 30, 2026
629d942
pvrsgx: always enable PVR_LDM_MODULE
akku1139 Jun 30, 2026
ba14869
pvrsgx: always use sysutils_linux.c
akku1139 Jun 30, 2026
8f300da
arm: dts: mediatek: mt6589: add gpu_opp_table
akku1139 Jun 30, 2026
bd2ce74
pvrsgx: remove LDM_DEV, LDM_DRV alias
akku1139 Jun 30, 2026
5ee4bfa
pvrsgx: remove INLINE_IS_PRAGMA
akku1139 Jun 30, 2026
d7b6257
pvrsgx: always enable SUPPORT_ACTIVE_POWER_MANAGEMENT
akku1139 Jun 30, 2026
8e3db36
pvrsgx: always disable NO_HARDWARE
akku1139 Jun 30, 2026
eb1f715
pvrsgx: remove __cplusplus
akku1139 Jun 30, 2026
c3f720d
pvrsgx: pass platform_device to SysInitialise
akku1139 Jun 30, 2026
2ae9138
pvrsgx: always enable PVR_LINUX_DYNAMIC_SGX_RESOURCE_INFO
akku1139 Jun 30, 2026
76960fe
pvrsgx: get clk from dt
akku1139 Jun 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 151 additions & 2 deletions arch/arm/boot/dts/mediatek/mt6589.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,152 @@
};
};

/*
* GPU OPP table derived from mt_gpufreq.c and mtk_sysfreq.c.
*
* == DVFS Governor Logic (besides clock/voltage) ==
* The driver uses a load-based governor. The effective load is calculated as:
* adjusted_load = (original_load * gpufreq_remap) / 100
* The adjusted load is then matched against the gpufreq_lower_bound and
* gpufreq_upper_bound to select the target OPP.
*
* == Actual Tables Registered in mtk_sysfreq.c ==
* 1. TBLTYPE1 (freqs_special_vrf18_2):
* - F3 (357.5 MHz): lower=40, upper=100, remap=100, volt=1.15V
* - F5 (286 MHz) : lower=0, upper=40, remap=80, volt=1.05V
*
* 2. TBLTYPE2 (freqs_special2_vrf18_2):
* - F2 (403 MHz) : lower=60, upper=100, remap=100, volt=1.15V
* - F3 (357.5 MHz): lower=30, upper=60, remap=90, volt=1.15V
* - F5 (286 MHz) : lower=0, upper=30, remap=75, volt=1.05V
*
* 3. TBLTYPE3 (freqs_special3_vrf18_2):
* - F1 (476.666 MHz): lower=60, upper=100, remap=100, volt=1.15V
* - F3 (357.5 MHz) : lower=30, upper=60, remap=90, volt=1.15V
* - F5 (286 MHz) : lower=0, upper=30, remap=75, volt=1.05V
*
* The MTKSetFreqInfo() function in mtk_sysfreq.c sets the initial frequency
* and then always calls MtkInitSetFreqTbl(TBLTYPE0) -> mt_gpufreq_non_register()
* in the provided code path. However, the actual OPP structures are defined
* above. The effective OPPs used in the kernel are F1, F2, F3, and F5.
*
* F4 (312 MHz), F6 (268.666 MHz), F7 (238.333 MHz), and F8 (156 MHz)
* are defined in the header but are NOT used in any of the registered tables.
* They are kept here as "disabled" for reference.
*
* == Other Non-Clock/Voltage Settings from Code ==
* - PMIC_SETTLE_TIME: 40 us (settling delay for voltage switching).
* - MT_BUCK_ADJUST: Enabled. Allows VRF18_2 voltage scaling.
* - GPU_CLOCK_RATIO: Enabled. Calculates GPU busy time ratio for load.
* - GPU_KEEP_FREQ_NON_OD_BYPASS: Bypass flag for fixed frequency requests.
* - mt_gpufreq_keep_specific_frequency: Allows userspace to fix a specific OPP.
* - mt_gpufreq_thermal_protect: Allows thermal driver to limit max frequency via
* "limited_power" (which maps to a max frequency ID).
*/
gpu_opp_table: opp-table-gpu {
compatible = "operating-points-v2";

/*
* OPP: 476.666 MHz, 1.15V
* Used in: TBLTYPE3 (freqs_special3_vrf18_2)
* Load bounds: 60 < load <= 100 (after remap)
* Remap: 100 (no scaling)
*/
opp-476666000 {
opp-hz = /bits/ 64 <476666000>;
opp-microvolt = <1150000>;
/* Note: Driver uses lower_bound=60, upper_bound=100, remap=100 */
};

/*
* OPP: 403 MHz, 1.15V
* Used in: TBLTYPE2 (freqs_special2_vrf18_2)
* Load bounds: 60 < load <= 100 (after remap)
* Remap: 100 (no scaling)
*/
opp-403000000 {
opp-hz = /bits/ 64 <403000000>;
opp-microvolt = <1150000>;
/* Note: Driver uses lower_bound=60, upper_bound=100, remap=100 */
};

/*
* OPP: 357.5 MHz, 1.15V
* Used in: TBLTYPE1, TBLTYPE2, TBLTYPE3
* TBLTYPE1: lower=40, upper=100, remap=100
* TBLTYPE2/TBLTYPE3: lower=30, upper=60, remap=90
*/
opp-357500000 {
opp-hz = /bits/ 64 <357500000>;
opp-microvolt = <1150000>;
/* Note: Driver uses variable bounds/remap depending on table */
};

/*
* OPP: 312 MHz
* NOT USED in any registered table.
* Defined in header as GPU_UNIVPLL1_D2 (F4).
* Kept for reference.
*/
opp-312000000 {
status = "disabled";
opp-hz = /bits/ 64 <312000000>;
opp-microvolt = <1050000>; /* Estimated, not used in code */
/* Note: Not present in any mt_gpufreq_info table */
};

/*
* OPP: 286 MHz, 1.05V
* Used in: TBLTYPE1, TBLTYPE2, TBLTYPE3
* TBLTYPE1: lower=0, upper=40, remap=80
* TBLTYPE2/TBLTYPE3: lower=0, upper=30, remap=75
*/
opp-286000000 {
opp-hz = /bits/ 64 <286000000>;
opp-microvolt = <1050000>;
/* Note: Driver uses variable bounds/remap depending on table */
};

/*
* OPP: 268.666 MHz
* NOT USED in any registered table.
* Defined in header as GPU_SYSPLL_D3 (F6).
* Kept for reference.
*/
opp-268666000 {
status = "disabled";
opp-hz = /bits/ 64 <268666000>;
opp-microvolt = <1050000>; /* Estimated, not used in code */
/* Note: Not present in any mt_gpufreq_info table */
};

/*
* OPP: 238.333 MHz
* NOT USED in any registered table.
* Defined in header as GPU_MMPLL_D6 (F7).
* Kept for reference.
*/
opp-238333000 {
status = "disabled";
opp-hz = /bits/ 64 <238333000>;
opp-microvolt = <1050000>; /* Estimated, not used in code */
/* Note: Not present in any mt_gpufreq_info table */
};

/*
* OPP: 156 MHz
* NOT USED in any registered table.
* Defined in header as GPU_UNIVPLL1_D4 (F8).
* Kept for reference.
*/
opp-156000000 {
status = "disabled";
opp-hz = /bits/ 64 <156000000>;
opp-microvolt = <1050000>; /* Estimated, not used in code */
/* Note: Not present in any mt_gpufreq_info table */
};
};

soc {
#address-cells = <1>;
#size-cells = <1>;
Expand Down Expand Up @@ -190,6 +336,7 @@
compatible = "mediatek,mt6589-mfgsys", "syscon";
reg = <0x10206000 0x1000>;
#clock-cells = <1>;
#reset-cells = <1>;
};

apmixedsys: syscon@10209000 {
Expand Down Expand Up @@ -314,8 +461,8 @@

spi1: spi@11016000 {
compatible = "mediatek,mt6589-spi";
#address-cells = <1>;
#size-cells = <0>;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x11016000 0x1000>;
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_LOW>;
clocks = <&clk26m>, /* FIXME */
Expand All @@ -333,6 +480,8 @@
<&mfgsys CLK_MFG_MEM>,
<&mfgsys CLK_MFG_AXI>;
clock-names = "core", "mem", "sys";
power-domains = <&spm MT6589_POWER_DOMAIN_MFG>;
operating-points-v2 = <&gpu_opp_table>;
};

dispsys: syscon@14000000 {
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/configs/lenovo-blade_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
## Video Accelerator

## GPU
#CONFIG_SGX=y # not ported
CONFIG_PVR_SGX_MT6589=y
CONFIG_PREEMPT=y

## Networking
CONFIG_NET=y
Expand Down
5 changes: 5 additions & 0 deletions drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,11 @@ config MCHP_LAN966X_PCI
- lan966x-miim (MDIO_MSCC_MIIM)
- lan966x-switch (LAN966X_SWITCH)

config PVR_SGX_MT6589
tristate "MediaTek MT6589 GPU Driver"
help
WIP

source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/cb710/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ lan966x-pci-objs += lan966x_pci.dtbo.o
obj-$(CONFIG_MCHP_LAN966X_PCI) += lan966x-pci.o
obj-y += keba/
obj-y += amd-sbi/
obj-$(CONFIG_PVR_SGX_MT6589) += pvrsgx-mt6589/
Loading