Skip to content

MT6589 DRM and Blade panels#33

Draft
akku1139 wants to merge 90 commits into
blade/v6.16from
dev/v6.16/mt6589-drm
Draft

MT6589 DRM and Blade panels#33
akku1139 wants to merge 90 commits into
blade/v6.16from
dev/v6.16/mt6589-drm

Conversation

@akku1139

@akku1139 akku1139 commented Mar 14, 2026

Copy link
Copy Markdown
Member

akku1139 and others added 6 commits January 2, 2026 22:50
The mt65xx SoC family uses an earlier version of the SMI, which we refer
to as gen 0. Unlike gen 1 or gen 2, gen 0 requires simultaneous access to
two distinct MMIO ranges: an AO base for IOMMU configuration and ext base
for OSTD, FIFO, and bandwidth limiter setup.

Remove the union in struct mtk_smi to allow simultaneous use of
smi_ao_base and base. Refactor the probe function into a switch statement
to handle the different generation requirements cleanly.

Signed-off-by: rva3 <rva333@protonmail.com>
The mt65xx SoC family utilizes a larb design that incorporates features
from both gen 1 and gen 2 architectures.

Introduce a specific configuration callback for this generation, which
implements the port security configuration typical for gen 1 while
including the ostd settings found in gen 2. Additionally, add a bandwidth
calibration flag for some of the gen 0 SoCs.

Signed-off-by: rva3 <rva333@protonmail.com>
The mt65xx SoC family utilizes an earlier version of the IOMMU which
shares the same v1 architecture but has minor hardware differences
compared to mt2701.

Introduce mtk_iommu_type to distinguish between mt2701 and mt65xx
variants and apply the necessary logic.

Signed-off-by: rva3 <rva333@protonmail.com>
@akku1139

akku1139 commented Mar 14, 2026

Copy link
Copy Markdown
Member Author

rva3 and others added 16 commits March 14, 2026 14:16
XXX: maybe we should drop this?..
Signed-off-by: rva3 <rva333@protonmail.com>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Add a header for the IOMMU ports on the MediaTek MT6589 SoC.

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Add platform data for the SMI common on the MT6589 SoC.

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Make sure to drop the reference taken when looking up the SMI device
during common probe on late probe failure (e.g. probe deferral) and on
driver unbind.

Fixes: 4740475 ("memory: mtk-smi: Add device link for smi-sub-common")
Fixes: 038ae37 ("memory: mtk-smi: add missing put_device() call in mtk_smi_device_link_common")
Cc: stable@vger.kernel.org	# 5.16: 038ae37
Cc: stable@vger.kernel.org	# 5.16
Cc: Yong Wu <yong.wu@mediatek.com>
Cc: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251121164624.13685-2-johan@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Make sure to drop the reference taken when looking up the SMI device
during larb probe on late probe failure (e.g. probe deferral) and on
driver unbind.

Fixes: cc8bbe1 ("memory: mediatek: Add SMI driver")
Fixes: 038ae37 ("memory: mtk-smi: add missing put_device() call in mtk_smi_device_link_common")
Cc: stable@vger.kernel.org	# 4.6: 038ae37
Cc: stable@vger.kernel.org	# 4.6
Cc: Yong Wu <yong.wu@mediatek.com>
Cc: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251121164624.13685-3-johan@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Clean up device link creation by bailing out early in case the SMI
platform device lookup fails.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251121164624.13685-4-johan@kernel.org
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
@akku1139

akku1139 commented Mar 14, 2026

Copy link
Copy Markdown
Member Author

TODO:

mmsys (done by claude)
mt6572-mainline@7278659

mutex (done)
mt6572-mainline@a0b799a

ovl (done)
mt6572-mainline@39086e4

dsi (done)
mt6572-mainline@af8df08

drm main (done with mt2701_mmsys_driver_data)
mt6572-mainline@4fe7dec

In MT6589, this IP is called "dispsys" for some reason.
I don't know more than that.

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
It's in
Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml
now.

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
everyone will say "fixme"

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
@akku1139

Copy link
Copy Markdown
Member Author

mmsys routing: ddp_path.c

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
@akku1139

Copy link
Copy Markdown
Member Author
#define REG_SMI_SECUR_CON(x)       	  (0x05C0+SMI_COMMON_AO_BASE+((x)<<2))
#define REG_SMI_SECUR_CON_OF_PORT(port)     REG_SMI_SECUR_CON(((m4u_port_2_smi_port(port))>>3))
    #define F_SMI_SECUR_CON_SECURE(port)        ((1)<<(((m4u_port_2_smi_port(port))&0x7)<<2))
    #define F_SMI_SECUR_CON_DOMAIN(port, val)   (((val)&0x3)<<((((m4u_port_2_smi_port(port))&0x7)<<2)+1))
    #define F_SMI_SECUR_CON_VIRTUAL(port)       ((1)<<((((m4u_port_2_smi_port(port))&0x7)<<2)+3))
    #define F_SMI_SECUR_CON_MASK(port)          ((0xf)<<((((m4u_port_2_smi_port(port))&0x7)<<2)))

https://github.com/bq/aquaris-5/blob/bc1d0d0e35c969670e2d869001be944ad0c9c5e5/mediatek/platform/mt6589/kernel/drivers/m4u/m4u_reg.h#L338-L343

@akku1139

Copy link
Copy Markdown
Member Author
/* Below are about mmu enable registers, they are different in SoCs */
/* gen1: mt2701 */
#define REG_SMI_SECUR_CON_BASE		0x5c0


/* every register control 8 port, register offset 0x4 */
#define REG_SMI_SECUR_CON_OFFSET(id)	(((id) >> 3) << 2)
#define REG_SMI_SECUR_CON_ADDR(id)	\
	(REG_SMI_SECUR_CON_BASE + REG_SMI_SECUR_CON_OFFSET(id))

/* Below are about mmu enable registers, they are different in SoCs */
/* gen1: mt2701 */
#define REG_SMI_SECUR_CON_BASE 0x5c0
/* every register control 8 port, register offset 0x4 */
#define REG_SMI_SECUR_CON_OFFSET(id) (((id) >> 3) << 2)
#define REG_SMI_SECUR_CON_ADDR(id) \
(REG_SMI_SECUR_CON_BASE + REG_SMI_SECUR_CON_OFFSET(id))

@akku1139

Copy link
Copy Markdown
Member Author

1369 page:
Smi_larb0
Smi_larb1
Smi_larb2
Smi_larb3
Smi_larb4
Audio
G3D

@akku1139

akku1139 commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

drivers/memory/mtk-smi.c .port_in_larb = { 0, 10, 17, 29, 43, 53, 54, 54 },

drop too many ports

static unsigned int smi_port0_in_larbx[SMI_LARB_NR+1] = {0, 10, 17, 29, 44 ,56};
static unsigned int m4u_port0_in_larbx[SMI_LARB_NR+1] = {0, 10, 17, 29, 43 ,53};

needs fix

@akku1139

Copy link
Copy Markdown
Member Author

1380: SMI_L1ARB6

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
@akku1139

akku1139 commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
@akku1139

Copy link
Copy Markdown
Member Author

akku1139 added 2 commits June 22, 2026 23:52
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
@akku1139

Copy link
Copy Markdown
Member Author

@akku1139

Copy link
Copy Markdown
Member Author
static unsigned int m4u_index_of_larb[SMI_LARB_NR] = {0,0,1,0,1};
static unsigned int m4u_index_of_larb5 = 0,  m4u_index_of_larb6 = 0;
static unsigned int smi_port0_in_larbx[SMI_LARB_NR+1] = {0, 10, 17, 29, 44 ,56};
static unsigned int m4u_port0_in_larbx[SMI_LARB_NR+1] = {0, 10, 17, 29, 43 ,53};
static unsigned int m4u_port_size_limit[M4U_PORT_NR] = {};

https://github.com/bq/aquaris-5/blob/bc1d0d0e35c969670e2d869001be944ad0c9c5e5/mediatek/platform/mt6589/kernel/drivers/m4u/m4u.c#L278-L282

@akku1139

akku1139 commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants