Skip to contentSkip to conversation

Support display (and even more) on the BSH SMM S2/PRO boards

PATCH In review Dario Binacchi 2 participants 28 messages Nov 21 – Nov 25

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v2 cover Support display (and even more) on the BSH SMM S2/PRO boards

This series was created out of the need to support simple-framebuffer for BSH boards SMM_S2 and SMM_S2PRO. To achieve this goal, it was necessary to develop additional code and/or drivers for all the required components (i. e. clock, power domain, video, etc.). This series has a Linux counterpart that will also be submitted upstream as soon as possible.

Sorry for the long time it took to send this v2. Compared to v1, the series is rebased on top of the clock reparenting rework that came out of the discussion with Miquel [1], the board-specific PLL enabling is replaced by a generic handling of the critical clocks in the clock framework, the patches already merged have been dropped, and the i.MX8MP media block control is left to the imx8mp-mediamix driver.

Tested on the BSH SMM S2 PRO.

[1] https://lore.kernel.org/all/[email protected]/

Changes in v2:
- Add patch, replacing "clk: imx8mn: Mark IMX8MN_SYS_PLL2 and IMX8MN_SYS_PLL3 as enabled" with a generic solution
- Reword subject and commit message to describe the change
- Fix the coding style of the new clocks
- Add patch
- Rebase on top of the parent enabling now done by clk_set_parent()
- Read the flags from the private clock
- Add CLK_SET_RATE_UNGATE support
- Treat an error pointer returned by clk_get_parent() as no parent
- Reword subject and commit message
- Fix build error
- Drop i.MX8MP support, already provided by the imx8mp-mediamix driver
- Let the power domain uclass count the domain references
- Check the domains allocation
- Reword subject and commit message
- Look up a device as a bridge before looking it up as a DSI host
- Reword commit message
- Add patch, split from "video: Update mxsfb video drivers for iMX8MM/iMX8MN display"
- Add patch, split from "video: Update mxsfb video drivers for iMX8MM/iMX8MN display"
- Move the coding style fix and the DE polarity change to separate patches
- Bind the DSI host to the DSIM node and drop the "samsung,sec-mipi-dsi" compatible
- Fix typo in a comment
- Drop the dsi-host node
- Add commit message
- Drop the custom boot-on properties added to the Linux device tree
- Drop the #if guard around smm_s2_setup_simplefb()
- Fix the style of a comment

Dario Binacchi (9):
clk: ccf: enable the critical clocks when they are registered
clk: clk-uclass: fix parent reference counting in clk_set_parent()
video: mxsfb: add missing space after if
boot: fdt_simplefb: add a debug message
video: mxsfb: support simple frame-buffer
video: bridge: samsung: support simple frame-buffer imx8mn_bsh_smm_s2/pro: support simple frame-buffer imx8mn_bsh_smm_s2/pro: enable simple frame-buffer imx8mn_bsh_smm_s2/pro: add splash screen with BSH logo

Michael Trimarchi (16):
clk: imx8mn: register the main_axi, noc and gic clocks as critical
clk: implement CLK_OPS_PARENT_ENABLE and CLK_SET_RATE_UNGATE
clk: imx8mn: add video clocks support
power: domain: add i.MX8MM/i.MX8MN display block control driver
video: Add video link framework
video: bridge: Add check_timing interface
video: dsi_host: add disable host interface
video: mxsfb: set the DE polarity from the display timings
video: Update mxsfb video drivers for iMX8MM/iMX8MN display
video: Enable DM_UC_FLAG_SEQ_ALIAS for display and bridge
phy: dphy: add support to calculate the timing based on hs_clk_rate
phy: dphy: Correct lpx parameter and its derivatives(ta_{get,go,sure})
phy: dphy: Correct clk_pre parameter
video: bridge: Add Samsung DSIM bridge
video: Add Synaptics R63353 panel driver imx8mn_bsh_smm_s2/pro: Enable display on reference design

 .../dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi  |   16 +
 board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c       |   72 +
 boot/fdt_simplefb.c                           |    2 +
 common/stdio.c                                |    4 +
 configs/imx8mn_bsh_smm_s2_defconfig           |   21 +
 configs/imx8mn_bsh_smm_s2pro_defconfig        |   21 +
 drivers/clk/clk-uclass.c                      |   70 +-
 drivers/clk/clk.c                             |   15 +
 drivers/clk/imx/clk-imx8mn.c                  |  105 ++
 drivers/phy/meson-axg-mipi-dphy.c             |    2 +-
 drivers/phy/phy-core-mipi-dphy.c              |   36 +-
 drivers/power/domain/Kconfig                  |    7 +
 drivers/power/domain/Makefile                 |    1 +
 drivers/power/domain/imx8m-blk-ctrl.c         |  355 ++++
 drivers/power/domain/imx8m-power-domain.c     |  166 +-
 drivers/video/Kconfig                         |   14 +
 drivers/video/Makefile                        |    2 +
 drivers/video/bridge/Kconfig                  |   13 +
 drivers/video/bridge/Makefile                 |    1 +
 drivers/video/bridge/samsung-dsi-host.c       | 1570 +++++++++++++++++
 drivers/video/bridge/samsung-dsim.c           |  165 ++
 drivers/video/bridge/samsung-dsim.h           |   20 +
 drivers/video/bridge/video-bridge-uclass.c    |   11 +
 drivers/video/display-uclass.c                |    1 +
 drivers/video/dsi-host-uclass.c               |   10 +
 drivers/video/mxsfb.c                         |  142 +-
 drivers/video/synaptics-r63353.c              |  228 +++
 drivers/video/video_link.c                    |  448 +++++
 include/configs/imx8mn_bsh_smm_s2.h           |    1 +
 include/configs/imx8mn_bsh_smm_s2_common.h    |    4 +
 include/configs/imx8mn_bsh_smm_s2pro.h        |    1 +
 include/dsi_host.h                            |    8 +
 include/linux/clk-provider.h                  |   12 +-
 include/phy-mipi-dphy.h                       |    3 +
 include/video_bridge.h                        |   20 +
 include/video_link.h                          |   19 +
 tools/logos/bsh.bmp                           |  Bin 0 -> 10644 bytes
 37 files changed, 3521 insertions(+), 65 deletions(-)
 create mode 100644 drivers/power/domain/imx8m-blk-ctrl.c
 create mode 100644 drivers/video/bridge/samsung-dsi-host.c
 create mode 100644 drivers/video/bridge/samsung-dsim.c
 create mode 100644 drivers/video/bridge/samsung-dsim.h
 create mode 100644 drivers/video/synaptics-r63353.c
 create mode 100644 drivers/video/video_link.c
 create mode 100644 include/video_link.h
 create mode 100644 tools/logos/bsh.bmp

---
base-commit: c1958b5f6cce03956d309ce422b5d9f819955d4a
branch: bsh-smm-s2-display

Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/25 clk: ccf: enable the critical clocks when they are registered

CLK_IS_CRITICAL only prevents clk_disable() from gating a clock. Since nobody enables a critical clock, its parents don't account for it, and a parent shared with other clocks is disabled as soon as its last non-critical user goes away, e.g. on reparenting. On the i.MX8MN this turns SYS_PLL2 off while the display clocks are set up, and the system hangs.

Enable the critical clocks as soon as they get an ID, as Linux does at registration, so that their whole parent chain is accounted for.

---

Changes in v2:
- Add patch, replacing "clk: imx8mn: Mark IMX8MN_SYS_PLL2 and IMX8MN_SYS_PLL3 as enabled" with a generic solution

 drivers/clk/clk.c            | 15 +++++++++++++++
 include/linux/clk-provider.h | 12 ++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)
drivers/clk/clk.c +15 -0
index b8c2e8d531b9..1e735c8fb2b4 100644
@@ -13,6 +13,21 @@
 #include <dm/uclass.h>
 #include <dm/lists.h>
 #include <dm/device-internal.h>
+#include <linux/clk-provider.h>
+
+/* Let the parents of a critical clock account for it, as Linux does */
+void clk_enable_critical(struct clk *clk)
+{
+	int ret;
+
+	if (!(clk->flags & CLK_IS_CRITICAL))
+		return;
+
+	ret = clk_enable(clk);
+	if (ret)
+		log_warning("%s: failed to enable critical clock %s (%d)\n",
+			    __func__, clk->dev->name, ret);
+}
 
 int clk_register(struct clk *clk, const char *drv_name,
 		 const char *name, const char *parent_name)
include/linux/clk-provider.h +10 -2
index 366f2d968a33..c09f56b2b57d 100644
@@ -15,17 +15,25 @@
 
 struct udevice;
 
+void clk_enable_critical(struct clk *clk);
+
 /* update clock ID for the dev = clock provider, compatible with CLK_AUTO_ID */
 static inline void dev_clk_dm(const struct udevice *dev, ulong id, struct clk *clk)
 {
-	if (!IS_ERR(clk))
+	if (!IS_ERR(clk)) {
 		clk->id = CLK_ID(dev, id);
+		if (CONFIG_IS_ENABLED(CLK_CCF))
+			clk_enable_critical(clk);
+	}
 }
 
 static inline void clk_dm(ulong id, struct clk *clk)
 {
-	if (!IS_ERR(clk))
+	if (!IS_ERR(clk)) {
 		clk->id = CLK_ID(clk->dev, id);
+		if (CONFIG_IS_ENABLED(CLK_CCF))
+			clk_enable_critical(clk);
+	}
 }
 
 /*
Signature · 1 line
2.43.0
#2 lore raw

PATCH v2 2/25 clk: imx8mn: register the main_axi, noc and gic clocks as critical

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

The main_axi, noc and gic clocks feed the system interconnect and the interrupt controller, and must never be gated. Register them as critical, as Linux does, so that their parent PLLs are kept running.

---

Changes in v2:
- Reword subject and commit message to describe the change
- Fix the coding style of the new clocks

 drivers/clk/imx/clk-imx8mn.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/clk/imx/clk-imx8mn.c +25 -0
index 2dfa860bf375..56d44192e35e 100644
@@ -29,10 +29,19 @@ static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl
 					       "sys_pll2_1000m", "sys_pll1_800m", "sys_pll1_400m",
 					       "audio_pll1_out", "sys_pll3_out", };
 
+static const char * const imx8mn_noc_sels[] = {"osc_24m", "sys_pll1_800m", "sys_pll3_out",
+					       "sys_pll2_1000m", "sys_pll2_500m", "audio_pll1_out",
+					       "video_pll_out", "audio_pll2_out", };
+
 static const char * const imx8mn_ahb_sels[] = {"osc_24m", "sys_pll1_133m", "sys_pll1_800m",
 					       "sys_pll1_400m", "sys_pll2_125m", "sys_pll3_out",
 					       "audio_pll1_out", "video_pll_out", };
 
+static const char * const imx8mn_main_axi_sels[] = {"osc_24m", "sys_pll2_333m", "sys_pll1_800m",
+						    "sys_pll2_250m", "sys_pll2_1000m",
+						    "audio_pll1_out", "video_pll_out",
+						    "sys_pll1_100m", };
+
 static const char * const imx8mn_enet_axi_sels[] = {"osc_24m", "sys_pll1_266m", "sys_pll1_800m",
 						    "sys_pll2_250m", "sys_pll2_200m", "audio_pll1_out",
 						    "video_pll_out", "sys_pll3_out", };
@@ -67,6 +76,10 @@ static const char * const imx8mn_usdhc2_sels[] = {"osc_24m", "sys_pll1_400m", "s
 						  "sys_pll2_500m", "sys_pll3_out", "sys_pll1_266m",
 						  "audio_pll2_out", "sys_pll1_100m", };
 
+static const char * const imx8mn_gic_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m",
+					       "sys_pll2_100m", "sys_pll1_800m", "clk_ext2",
+					       "clk_ext4", "audio_pll2_out", };
+
 #if CONFIG_IS_ENABLED(DM_SPI)
 static const char * const imx8mn_ecspi1_sels[] = {"osc_24m", "sys_pll2_200m", "sys_pll1_40m",
 						  "sys_pll1_160m", "sys_pll1_800m", "sys_pll3_out",
@@ -302,6 +315,11 @@ static int imx8mn_clk_probe(struct udevice *dev)
 	clk_dm(IMX8MN_CLK_IPG_ROOT,
 	       imx_clk_divider2(dev, "ipg_root", "ahb", base + 0x9080, 0, 1));
 
+	/* BUS */
+	clk_dm(IMX8MN_CLK_MAIN_AXI,
+	       imx8m_clk_composite_critical(dev, "main_axi",
+					    imx8mn_main_axi_sels,
+					    base + 0x8800));
 	clk_dm(IMX8MN_CLK_ENET_AXI,
 	       imx8m_clk_composite(dev, "enet_axi", imx8mn_enet_axi_sels,
 				   base + 0x8880));
@@ -311,6 +329,9 @@ static int imx8mn_clk_probe(struct udevice *dev)
 					    base + 0x8900));
 	clk_dm(IMX8MN_CLK_USB_BUS,
 		imx8m_clk_composite(dev, "usb_bus", imx8mn_usb_bus_sels, base + 0x8b80));
+	clk_dm(IMX8MN_CLK_NOC,
+	       imx8m_clk_composite_critical(dev, "noc", imx8mn_noc_sels,
+					    base + 0x8d00));
 
 	/* IP */
 	clk_dm(IMX8MN_CLK_USDHC1,
@@ -422,6 +443,10 @@ static int imx8mn_clk_probe(struct udevice *dev)
 	       imx_clk_gate4(dev, "pwm4_root_clk", "pwm4", base + 0x42b0, 0));
 #endif
 
+	clk_dm(IMX8MN_CLK_GIC,
+	       imx8m_clk_composite_critical(dev, "gic", imx8mn_gic_sels,
+					    base + 0xb200));
+
 #if CONFIG_IS_ENABLED(DM_SPI)
 	clk_dm(IMX8MN_CLK_ECSPI1,
 	       imx8m_clk_composite(dev, "ecspi1", imx8mn_ecspi1_sels, base + 0xb280));
Signature · 1 line
2.43.0
#3 lore raw

Re: [PATCH v2 02/25] clk: imx8mn: register the main_axi, noc and gic clocks as critical

Quoted 22 lines · On Sat, 21 Nov 2026 13:33:52 +0100 Dario Binacchi…

From: Michael Trimarchi <[email protected]>

The main_axi, noc and gic clocks feed the system interconnect and the interrupt controller, and must never be gated. Register them as critical, as Linux does, so that their parent PLLs are kept running.

---

Changes in v2:
- Reword subject and commit message to describe the change
- Fix the coding style of the new clocks

 drivers/clk/imx/clk-imx8mn.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/clk/imx/clk-imx8mn.c +0 -0
index 2dfa860bf375..56d44192e35e 100644

drivers/clk/imx/clk-imx8mn.c static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl · line 35

Quoted 7 lines
drivers/clk/imx/clk-imx8mn.c +4 -0
@@ -29,10 +29,19 @@ static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl
 					       "sys_pll2_1000m", "sys_pll1_800m", "sys_pll1_400m",
 					       "audio_pll1_out", "sys_pll3_out", };
 
+static const char * const imx8mn_noc_sels[] = {"osc_24m", "sys_pll1_800m", "sys_pll3_out",
+					       "sys_pll2_1000m", "sys_pll2_500m", "audio_pll1_out",
+					       "video_pll_out", "audio_pll2_out", };
+

sys_pll1/2 are fixed clock. I not see the point of switching mux for noc/gic/axi to other parents.

Regards
Peng

#4 lore raw

Re: [PATCH v2 02/25] clk: imx8mn: register the main_axi, noc and gic clocks as critical

Hi Peng,

Quoted 28 lines · Peng Fan (OSS)
Quoted 25 lines · On Sat, 21 Nov 2026 13:33:52 +0100 Dario Binacchi…

From: Michael Trimarchi <[email protected]>

The main_axi, noc and gic clocks feed the system interconnect and the interrupt controller, and must never be gated. Register them as critical, as Linux does, so that their parent PLLs are kept running.

---

Changes in v2:
- Reword subject and commit message to describe the change
- Fix the coding style of the new clocks

 drivers/clk/imx/clk-imx8mn.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/clk/imx/clk-imx8mn.c +0 -0
index 2dfa860bf375..56d44192e35e 100644
@@ -29,10 +29,19 @@ static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl
                                             "sys_pll2_1000m", "sys_pll1_800m", "sys_pll1_400m",
                                             "audio_pll1_out", "sys_pll3_out", };
 
Quoted 6 lines

drivers/clk/imx/clk-imx8mn.c static const char * const imx8mn_a53_sels[] = {"osc_24m", "arm_pll_out", "sys_pl · line 35

Quoted 4 lines
drivers/clk/imx/clk-imx8mn.c +4 -0
+static const char * const imx8mn_noc_sels[] = {"osc_24m", "sys_pll1_800m", "sys_pll3_out",
+                                            "sys_pll2_1000m", "sys_pll2_500m", "audio_pll1_out",
+                                            "video_pll_out", "audio_pll2_out", };
+

sys_pll1/2 are fixed clock. I not see the point of switching mux for noc/gic/axi to other parents.

The patch doesn't switch their parents, they stay as the SPL left them. The parent names are only what the composite clock needs to be registered, the same as in Linux.

The point is the enable count. The rate of sys_pll1/2 is fixed, but they are gated by clk_disable() like any other clock. On this board main_axi and gic run from sys_pll2 and noc from sys_pll3, but since they are not registered nothing accounts for them. When the display clocks are reparented to video_pll, the last registered user of sys_pll2 goes away, the PLL is turned off and the system hangs. Registering the three clocks as critical, together with patch 01, keeps their PLLs enabled, as in Linux.

Thanks and regards,
Dario

Quoted 3 lines

Regards
Peng

--
Dario Binacchi
Senior Embedded Software Engineer
M. +39 328 0625246
[email protected]
―――――――――――――――
Amarula Solutions SRL
Via Felice Cavallotti 25D, 41012 Carpi, MO, IT
[email protected]
www.amarulasolutions.com

#5 lore raw

PATCH v2 3/25 clk: clk-uclass: fix parent reference counting in clk_set_parent()

In reply to Dario Binacchi

clk_set_parent() enables the new parent only if the clock is enabled, but on failure it disables it unconditionally, dropping a reference it never took. On success, it never releases the reference the clock holds on its old parent, which then keeps running forever.

Disable the new parent on failure only if it was enabled, and release the old parent once the clock has moved away from it, as Linux does in __clk_set_parent_after().

Fixes ac30d90f3367 ("clk: Ensure the parent clocks are enabled while reparenting")
Fixes b493db39ea7f ("clk: Only enable the parent clock if the clock was enabled before reparenting")

---

Changes in v2:
- Add patch

 drivers/clk/clk-uclass.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/clk/clk-uclass.c +15 -8
index 0069ce9a8875..c503f6733907 100644
@@ -631,6 +631,7 @@ ulong clk_set_rate(struct clk *clk, ulong rate)
 int clk_set_parent(struct clk *clk, struct clk *parent)
 {
 	const struct clk_ops *ops;
+	struct clk *old_parent = NULL;
 	int ret;
 
 	debug("%s(clk=%p, parent=%p)\n", __func__, clk, parent);
@@ -641,6 +642,12 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 	if (!ops->set_parent)
 		return -ENOSYS;
 
+	if (CONFIG_IS_ENABLED(CLK_CCF)) {
+		old_parent = clk_get_parent(clk);
+		if (IS_ERR(old_parent))
+			old_parent = NULL;
+	}
+
 	if (clk->enable_count) {
 		ret = clk_enable(parent);
 		if (ret && ret != -ENOSYS) {
@@ -650,18 +657,18 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 	}
 
 	ret = ops->set_parent(clk, parent);
+	if (!ret && CONFIG_IS_ENABLED(CLK_CCF))
+		ret = device_reparent(clk->dev, parent->dev);
+
 	if (ret) {
-		clk_disable(parent);
+		if (clk->enable_count)
+			clk_disable(parent);
 		return ret;
 	}
 
-	if (CONFIG_IS_ENABLED(CLK_CCF)) {
-		ret = device_reparent(clk->dev, parent->dev);
-		if (ret) {
-			clk_disable(parent);
-			return ret;
-		}
-	}
+	/* The clock no longer keeps its old parent running */
+	if (clk->enable_count && old_parent)
+		clk_disable(old_parent);
 
 	return 0;
 }
Signature · 1 line
2.43.0
#6 lore raw

PATCH v2 4/25 clk: implement CLK_OPS_PARENT_ENABLE and CLK_SET_RATE_UNGATE

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

In Linux, CLK_OPS_PARENT_ENABLE marks the clocks whose parents must be running while they are reparented or their rate is changed, such as the i.MX8M composite clocks, and CLK_SET_RATE_UNGATE the clocks which must be enabled while their rate is changed.

Support both flags in clk_set_rate() and clk_set_parent(), reading them from the private clock like the other CCF flags.

---

Changes in v2:
- Rebase on top of the parent enabling now done by clk_set_parent()
- Read the flags from the private clock
- Add CLK_SET_RATE_UNGATE support
- Treat an error pointer returned by clk_get_parent() as no parent
- Reword subject and commit message

 drivers/clk/clk-uclass.c | 49 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)
drivers/clk/clk-uclass.c +48 -1
index c503f6733907..4f7830a5c9c8 100644
@@ -598,7 +598,9 @@ static void clk_clean_rate_cache(struct clk *clk)
 ulong clk_set_rate(struct clk *clk, ulong rate)
 {
 	const struct clk_ops *ops;
+	struct clk *pclk = NULL;
 	struct clk *clkp;
+	ulong ret;
 
 	debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate);
 	if (!clk_valid(clk))
@@ -625,13 +627,42 @@ ulong clk_set_rate(struct clk *clk, ulong rate)
 	/* Clean up cached rates for us and all child clocks */
 	clk_clean_rate_cache(clkp);
 
-	return ops->set_rate(clk, rate);
+	if (clkp->flags & CLK_SET_RATE_UNGATE) {
+		ret = clk_enable(clk);
+		if (ret)
+			return ret;
+	}
+
+	if (clkp->flags & CLK_OPS_PARENT_ENABLE) {
+		pclk = clk_get_parent(clk);
+		if (IS_ERR(pclk))
+			pclk = NULL;
+
+		if (pclk) {
+			ret = clk_enable(pclk);
+			if (ret)
+				goto out;
+		}
+	}
+
+	ret = ops->set_rate(clk, rate);
+
+	if (pclk)
+		clk_disable(pclk);
+
+out:
+	if (clkp->flags & CLK_SET_RATE_UNGATE)
+		clk_disable(clk);
+
+	return ret;
 }
 
 int clk_set_parent(struct clk *clk, struct clk *parent)
 {
 	const struct clk_ops *ops;
 	struct clk *old_parent = NULL;
+	struct clk *clkp;
+	bool parents_enable;
 	int ret;
 
 	debug("%s(clk=%p, parent=%p)\n", __func__, clk, parent);
@@ -642,6 +673,9 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 	if (!ops->set_parent)
 		return -ENOSYS;
 
+	clk_get_priv(clk, &clkp);
+	parents_enable = clkp->flags & CLK_OPS_PARENT_ENABLE;
+
 	if (CONFIG_IS_ENABLED(CLK_CCF)) {
 		old_parent = clk_get_parent(clk);
 		if (IS_ERR(old_parent))
@@ -656,10 +690,23 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 		}
 	}
 
+	/* Both the old and the new parent must be running while switching */
+	if (parents_enable) {
+		if (old_parent)
+			clk_enable(old_parent);
+		clk_enable(parent);
+	}
+
 	ret = ops->set_parent(clk, parent);
 	if (!ret && CONFIG_IS_ENABLED(CLK_CCF))
 		ret = device_reparent(clk->dev, parent->dev);
 
+	if (parents_enable) {
+		clk_disable(parent);
+		if (old_parent)
+			clk_disable(old_parent);
+	}
+
 	if (ret) {
 		if (clk->enable_count)
 			clk_disable(parent);
Signature · 1 line
2.43.0
#7 lore raw

PATCH v2 5/25 clk: imx8mn: add video clocks support

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Add clocks support for the video subsystem.

---

(no changes since v1)

 drivers/clk/imx/clk-imx8mn.c | 80 ++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
drivers/clk/imx/clk-imx8mn.c +80 -0
index 56d44192e35e..229760ce931e 100644
@@ -17,6 +17,7 @@
 static u32 share_count_nand;
 
 static const char * const pll_ref_sels[] = { "osc_24m", "dummy", "dummy", "dummy", };
+static const char * const video_pll_bypass_sels[] = {"video_pll", "video_pll_ref_sel", };
 static const char * const dram_pll_bypass_sels[] = {"dram_pll", "dram_pll_ref_sel", };
 static const char * const arm_pll_bypass_sels[] = {"arm_pll", "arm_pll_ref_sel", };
 static const char * const sys_pll1_bypass_sels[] = {"sys_pll1", "sys_pll1_ref_sel", };
@@ -47,6 +48,39 @@ static const char * const imx8mn_enet_axi_sels[] = {"osc_24m", "sys_pll1_266m",
 						    "video_pll_out", "sys_pll3_out", };
 
 #ifndef CONFIG_XPL_BUILD
+static const char * const imx8mn_disp_axi_sels[] = {"osc_24m", "sys_pll2_1000m",
+						    "sys_pll1_800m", "sys_pll3_out", "sys_pll1_40m",
+						    "audio_pll2_out", "clk_ext1", "clk_ext4", };
+
+static const char * const imx8mn_disp_apb_sels[] = {"osc_24m", "sys_pll2_125m",
+						    "sys_pll1_800m", "sys_pll3_out", "sys_pll1_40m",
+						    "audio_pll2_out", "clk_ext1", "clk_ext3", };
+
+static const char * const imx8mn_disp_pixel_sels[] = {"osc_24m", "video_pll_out",
+						      "audio_pll2_out", "audio_pll1_out",
+						      "sys_pll1_800m", "sys_pll2_1000m",
+						      "sys_pll3_out", "clk_ext4", };
+
+static const char * const imx8mn_dsi_core_sels[] = {"osc_24m", "sys_pll1_266m",
+						    "sys_pll2_250m", "sys_pll1_800m",
+						    "sys_pll2_1000m", "sys_pll3_out",
+						    "audio_pll2_out", "video_pll_out", };
+
+static const char * const imx8mn_dsi_phy_sels[] = {"osc_24m", "sys_pll2_125m",
+						   "sys_pll2_100m", "sys_pll1_800m",
+						   "sys_pll2_1000m", "clk_ext2",
+						   "audio_pll2_out", "video_pll_out", };
+
+static const char * const imx8mn_dsi_dbi_sels[] = {"osc_24m", "sys_pll1_266m",
+						   "sys_pll2_100m", "sys_pll1_800m",
+						   "sys_pll2_1000m", "sys_pll3_out",
+						   "audio_pll2_out", "video_pll_out", };
+
+static const char * const imx8mn_camera_pixel_sels[] = {"osc_24m", "sys_pll1_266m",
+							"sys_pll2_250m", "sys_pll1_800m",
+							"sys_pll2_1000m", "sys_pll3_out",
+							"audio_pll2_out", "video_pll_out", };
+
 static const char * const imx8mn_enet_ref_sels[] = {"osc_24m", "sys_pll2_125m", "sys_pll2_50m",
 						    "sys_pll2_100m", "sys_pll1_160m", "audio_pll1_out",
 						    "video_pll_out", "clk_ext4", };
@@ -168,6 +202,10 @@ static const char * const imx8mn_usb_phy_sels[] = {"osc_24m", "sys_pll1_100m", "
 						   "sys_pll2_100m", "sys_pll2_200m", "clk_ext2",
 						   "clk_ext3", "audio_pll2_out", };
 
+#ifndef CONFIG_XPL_BUILD
+static unsigned int share_count_disp;
+#endif
+
 static int imx8mn_clk_probe(struct udevice *dev)
 {
 	struct clk osc_24m_clk;
@@ -191,6 +229,9 @@ static int imx8mn_clk_probe(struct udevice *dev)
 	clk_dm(IMX8MN_SYS_PLL3_REF_SEL,
 	       imx_clk_mux(dev, "sys_pll3_ref_sel", base + 0x114, 0, 2,
 			   pll_ref_sels, ARRAY_SIZE(pll_ref_sels)));
+	clk_dm(IMX8MN_VIDEO_PLL_REF_SEL,
+	       imx_clk_mux(dev, "video_pll_ref_sel", base + 0x28, 0, 2,
+			   pll_ref_sels, ARRAY_SIZE(pll_ref_sels)));
 
 	clk_dm(IMX8MN_DRAM_PLL,
 	       imx_clk_pll14xx("dram_pll", "dram_pll_ref_sel",
@@ -207,6 +248,9 @@ static int imx8mn_clk_probe(struct udevice *dev)
 	clk_dm(IMX8MN_SYS_PLL3,
 	       imx_clk_pll14xx("sys_pll3", "sys_pll3_ref_sel",
 			       base + 0x114, &imx_1416x_pll));
+	clk_dm(IMX8MN_VIDEO_PLL1,
+	       imx_clk_pll14xx("video_pll", "video_pll_ref_sel",
+			       base + 0x28, &imx_1443x_pll));
 
 	/* PLL bypass out */
 	clk_dm(IMX8MN_DRAM_PLL_BYPASS,
@@ -219,6 +263,11 @@ static int imx8mn_clk_probe(struct udevice *dev)
 				 arm_pll_bypass_sels,
 				 ARRAY_SIZE(arm_pll_bypass_sels),
 				 CLK_SET_RATE_PARENT));
+	clk_dm(IMX8MN_VIDEO_PLL_BYPASS,
+	       imx_clk_mux_flags(dev, "video_pll_bypass", base + 0x28, 16, 1,
+				 video_pll_bypass_sels,
+				 ARRAY_SIZE(video_pll_bypass_sels),
+				 CLK_SET_RATE_PARENT));
 	clk_dm(IMX8MN_SYS_PLL1_BYPASS,
 	       imx_clk_mux_flags(dev, "sys_pll1_bypass", base + 0x94, 4, 1,
 				 sys_pll1_bypass_sels,
@@ -239,6 +288,9 @@ static int imx8mn_clk_probe(struct udevice *dev)
 	clk_dm(IMX8MN_DRAM_PLL_OUT,
 	       imx_clk_gate(dev, "dram_pll_out", "dram_pll_bypass",
 			    base + 0x50, 13));
+	clk_dm(IMX8MN_VIDEO_PLL_OUT,
+	       imx_clk_gate(dev, "video_pll_out", "video_pll_bypass",
+			    base + 0x28, 13));
 	clk_dm(IMX8MN_ARM_PLL_OUT,
 	       imx_clk_gate(dev, "arm_pll_out", "arm_pll_bypass",
 			    base + 0x84, 11));
@@ -413,6 +465,34 @@ static int imx8mn_clk_probe(struct udevice *dev)
 
 	/* clks not needed in SPL stage */
 #ifndef CONFIG_XPL_BUILD
+	clk_dm(IMX8MN_CLK_DISP_AXI,
+	       imx8m_clk_composite(dev, "disp_axi", imx8mn_disp_axi_sels, base + 0x8a00));
+	clk_dm(IMX8MN_CLK_DISP_APB,
+	       imx8m_clk_composite(dev, "disp_apb", imx8mn_disp_apb_sels, base + 0x8a80));
+	clk_dm(IMX8MN_CLK_DISP_PIXEL,
+	       __imx8m_clk_composite(dev, "disp_pixel", imx8mn_disp_pixel_sels, base + 0xa500,
+				     CLK_SET_RATE_PARENT));
+	clk_dm(IMX8MN_CLK_DSI_CORE,
+	       imx8m_clk_composite(dev, "dsi_core", imx8mn_dsi_core_sels, base + 0xbb00));
+	clk_dm(IMX8MN_CLK_DSI_PHY_REF,
+	       imx8m_clk_composite(dev, "dsi_phy_ref", imx8mn_dsi_phy_sels, base + 0xbb80));
+	clk_dm(IMX8MN_CLK_DSI_DBI,
+	       imx8m_clk_composite(dev, "dsi_dbi", imx8mn_dsi_dbi_sels, base + 0xbc00));
+	clk_dm(IMX8MN_CLK_CAMERA_PIXEL,
+	       imx8m_clk_composite(dev, "camera_pixel", imx8mn_camera_pixel_sels, base + 0xbd00));
+
+	clk_dm(IMX8MN_CLK_DISP_AXI_ROOT,
+	       imx_clk_gate2_shared2(dev, "disp_axi_root_clk", "disp_axi", base + 0x45d0, 0,
+				     &share_count_disp));
+	clk_dm(IMX8MN_CLK_DISP_APB_ROOT,
+	       imx_clk_gate2_shared2(dev, "disp_apb_root_clk", "disp_apb", base + 0x45d0, 0,
+				     &share_count_disp));
+	clk_dm(IMX8MN_CLK_CAMERA_PIXEL_ROOT,
+	       imx_clk_gate2_shared2(dev, "camera_pixel_clk", "camera_pixel", base + 0x45d0, 0,
+				     &share_count_disp));
+	clk_dm(IMX8MN_CLK_DISP_PIXEL_ROOT,
+	       imx_clk_gate2_shared2(dev, "disp_pixel_clk", "disp_pixel", base + 0x45d0, 0,
+				     &share_count_disp));
 	clk_dm(IMX8MN_CLK_ENET_REF,
 	       imx8m_clk_composite(dev, "enet_ref", imx8mn_enet_ref_sels,
 	       base + 0xa980));
Signature · 1 line
2.43.0
#8 lore raw

PATCH v2 6/25 power: domain: add i.MX8MM/i.MX8MN display block control driver

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Add a driver for the display block control (DISPLAY_BLK_CTRL) of the i.MX8MM and i.MX8MN, which provides the power domains of the LCDIF, the MIPI DSI/CSI and the CSI bridge/ISI, as the Linux imx8m-blk-ctrl driver does. The i.MX8MP media block control is already handled by the imx8mp-mediamix driver.

The block control domains sit on top of the GPC DISPMIX and MIPI domains, so add them, together with the GPUMIX, VPUMIX and related domains, to the i.MX8MM/i.MX8MN PGC domain tables.

---

Changes in v2:
- Fix build error
- Drop i.MX8MP support, already provided by the imx8mp-mediamix driver
- Let the power domain uclass count the domain references
- Check the domains allocation
- Reword subject and commit message

 drivers/power/domain/Kconfig              |   7 +
 drivers/power/domain/Makefile             |   1 +
 drivers/power/domain/imx8m-blk-ctrl.c     | 355 ++++++++++++++++++++++
 drivers/power/domain/imx8m-power-domain.c | 166 +++++++++-
 4 files changed, 528 insertions(+), 1 deletion(-)
 create mode 100644 drivers/power/domain/imx8m-blk-ctrl.c
drivers/power/domain/Kconfig +7 -0
index 13a661ce04f8..9d883d4eaaee 100644
@@ -48,6 +48,13 @@ config IMX8M_POWER_DOMAIN
 	  Enable support for manipulating NXP i.MX8M on-SoC power domains via
 	  requests to the ATF.
 
+config IMX8M_BLK_CTRL
+	bool "Enable i.MX8MM/i.MX8MN display block control driver"
+	depends on POWER_DOMAIN && (IMX8MM || IMX8MN)
+	help
+	  Enable support for the power domains of the display block control
+	  (DISPLAY_BLK_CTRL) on i.MX8MM and i.MX8MN.
+
 config IMX8MP_HSIOMIX_BLKCTRL
 	bool "Enable i.MX8MP HSIOMIX domain driver"
 	depends on POWER_DOMAIN && IMX8MP
drivers/power/domain/Makefile +1 -0
index 3b816ed3bed7..8cd298c924f2 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_AGILEX5_PMGR_POWER_DOMAIN) += altr-pmgr-agilex5.o
 obj-$(CONFIG_APPLE_PMGR_POWER_DOMAIN) += apple-pmgr.o
 obj-$(CONFIG_BCM6328_POWER_DOMAIN) += bcm6328-power-domain.o
 obj-$(CONFIG_IMX8_POWER_DOMAIN) += imx8-power-domain-legacy.o imx8-power-domain.o
+obj-$(CONFIG_IMX8M_BLK_CTRL) += imx8m-blk-ctrl.o
 obj-$(CONFIG_IMX8M_POWER_DOMAIN) += imx8m-power-domain.o
 obj-$(CONFIG_IMX8MP_HSIOMIX_BLKCTRL) += imx8mp-hsiomix.o
 obj-$(CONFIG_IMX8MP_MEDIAMIX_BLKCTRL) += imx8mp-mediamix.o
drivers/power/domain/imx8m-blk-ctrl.c new file +355 -0

355 lines not on this page · raw message

drivers/power/domain/imx8m-power-domain.c +165 -1

222 lines not on this page · raw message

Signature · 1 line
2.43.0
#9 lore raw

PATCH v2 7/25 video: Add video link framework

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

The video link framework uses the port-endpoint graph of the device tree to connect the video components (video, display, bridge and panel uclasses).

Several video links can be described this way, and the user can select one of them for the splash screen.

---

Changes in v2:
- Look up a device as a bridge before looking it up as a DSI host
- Reword commit message

 common/stdio.c             |   4 +
 drivers/video/Kconfig      |   6 +
 drivers/video/Makefile     |   1 +
 drivers/video/video_link.c | 448 +++++++++++++++++++++++++++++++++++++
 include/video_link.h       |  19 ++
 5 files changed, 478 insertions(+)
 create mode 100644 drivers/video/video_link.c
 create mode 100644 include/video_link.h
common/stdio.c +4 -0
index 271a37e959ca..b441710388c3 100644
@@ -17,6 +17,7 @@
 #include <stdio_dev.h>
 #include <serial.h>
 #include <splash.h>
+#include <video_link.h>
 #include <i2c.h>
 #include <dm/device-internal.h>
 
@@ -321,6 +322,9 @@ int stdio_add_devices(void)
 		struct udevice *vdev;
 		int ret;
 
+		if (IS_ENABLED(CONFIG_VIDEO_LINK))
+			video_link_init();
+
 		if (!IS_ENABLED(CONFIG_SYS_CONSOLE_IS_IN_ENV)) {
 			for (ret = uclass_first_device_check(UCLASS_VIDEO,
 							     &vdev);
drivers/video/Kconfig +6 -0
index de0197b21cdb..cc21afbe8ff5 100644
@@ -973,6 +973,12 @@ config VIDEO_SEPS525
 source "drivers/video/zynqmp/Kconfig"
 source "drivers/video/nexell/Kconfig"
 
+config VIDEO_LINK
+	bool "Enable video link framework support"
+	help
+	   This option enables a video link framework basing on port-endpoint graph
+	   to connect video components.
+
 config CONSOLE_SCROLL_LINES
 	int "Number of lines to scroll the console by"
 	default 1
drivers/video/Makefile +1 -0
index 7a7b54e6b53b..6e6d1ba29cdb 100644
@@ -29,6 +29,7 @@ obj-$(CONFIG_$(PHASE_)SIMPLE_PANEL) += simple_panel.o
 obj-$(CONFIG_VIDEO_LOGO) += u_boot_logo.bmp.o
 obj-$(CONFIG_$(PHASE_)BMP) += bmp.o
 
+obj-$(CONFIG_VIDEO_LINK) += video_link.o
 endif
 
 obj-$(CONFIG_BACKLIGHT_AAT2870) += aat2870_backlight.o
drivers/video/video_link.c new file +448 -0

448 lines not on this page · raw message

include/video_link.h new file +19 -0
new file mode 100644
index 000000000000..5350bfa9e9d1
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2020 NXP
+ */
+
+#ifndef __VIDEO_LINK
+#define __VIDEO_LINK
+
+int video_link_init(void);
+
+int video_link_shut_down(void);
+
+struct udevice *video_link_get_next_device(struct udevice *curr_dev);
+
+struct udevice *video_link_get_video_device(void);
+
+int video_link_get_display_timings(struct display_timing *timings);
+
+#endif
Signature · 1 line
2.43.0
#10 lore raw

PATCH v2 8/25 video: bridge: Add check_timing interface

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Add new interface check_timing to video bridge uclass. For bridge device who may update timing needs to implement the callback. So host device can sync the timing with the bridge.

---

(no changes since v1)

 drivers/video/bridge/video-bridge-uclass.c | 10 ++++++++++
 include/video_bridge.h                     | 20 ++++++++++++++++++++
 2 files changed, 30 insertions(+)
drivers/video/bridge/video-bridge-uclass.c +10 -0
index 1b8aa12b9e88..599090141e4d 100644
@@ -59,6 +59,16 @@ int video_bridge_check_attached(struct udevice *dev)
 	return ops->check_attached(dev);
 }
 
+int video_bridge_check_timing(struct udevice *dev, struct display_timing *timing)
+{
+	struct video_bridge_ops *ops = video_bridge_get_ops(dev);
+
+	if (ops->check_timing)
+		return ops->check_timing(dev, timing);
+
+	return 0;
+}
+
 int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size)
 {
 	struct video_bridge_ops *ops = video_bridge_get_ops(dev);
include/video_bridge.h +20 -0
index 00e9804565c2..132de740706c 100644
@@ -44,6 +44,17 @@ struct video_bridge_ops {
 	 */
 	int (*check_attached)(struct udevice *dev);
 
+	/**
+	 * check_timing() - check if the timing need update after the bridge device attached
+	 *
+	 * This method is optional - if not provided then return 0
+	 *
+	 * @dev:	Device to check
+	 * @active:	The timing to be checked and updated
+	 * Return: 0 if OK, -ve on error
+	 */
+	int (*check_timing)(struct udevice *dev, struct display_timing *timing);
+
 	/**
 	 * set_backlight() - Set the backlight brightness
 	 *
@@ -112,6 +123,15 @@ int video_bridge_set_active(struct udevice *dev, bool active);
  */
 int video_bridge_check_attached(struct udevice *dev);
 
+/**
+ * check_timing() - check if the timing need update after the bridge device attached
+ *
+ * @dev:	Device to check
+ * @active:	The timing to be checked and updated
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_check_timing(struct udevice *dev, struct display_timing *timing);
+
 /**
  * video_bridge_get_display_timing() - Get display timings from bridge.
  *
Signature · 1 line
2.43.0
#11 lore raw

PATCH v2 9/25 video: dsi_host: add disable host interface

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Current operations structure has provided disable callback, but there is no API from dsi_host uclass to use it.

Add this disable host interface, so that dsi bridge can call it to disable host

---

(no changes since v1)

 drivers/video/dsi-host-uclass.c | 10 ++++++++++
 include/dsi_host.h              |  8 ++++++++
 2 files changed, 18 insertions(+)
drivers/video/dsi-host-uclass.c +10 -0
index fde275ad7e2e..745991f8dd94 100644
@@ -34,6 +34,16 @@ int dsi_host_enable(struct udevice *dev)
 	return ops->enable(dev);
 }
 
+int dsi_host_disable(struct udevice *dev)
+{
+	struct dsi_host_ops *ops = dsi_host_get_ops(dev);
+
+	if (!ops->disable)
+		return -ENOSYS;
+
+	return ops->disable(dev);
+}
+
 UCLASS_DRIVER(dsi_host) = {
 	.id		= UCLASS_DSI_HOST,
 	.name		= "dsi_host",
include/dsi_host.h +8 -0
index 83f8839db68d..5873ab698d9e 100644
@@ -70,4 +70,12 @@ int dsi_host_init(struct udevice *dev,
  */
 int dsi_host_enable(struct udevice *dev);
 
+/**
+ * dsi_host_disable
+ *
+ * @dev:	dsi host device
+ * @return 0 if OK, -ve on error
+ */
+int dsi_host_disable(struct udevice *dev);
+
 #endif
Signature · 1 line
2.43.0
#12 lore raw

PATCH v2 10/25 video: mxsfb: add missing space after if

In reply to Dario Binacchi

Fix the checkpatch "space required before the open parenthesis '('" errors in mxs_lcd_init().

---

Changes in v2:
- Add patch, split from "video: Update mxsfb video drivers for iMX8MM/iMX8MN display"

 drivers/video/mxsfb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/video/mxsfb.c +3 -3
index 71429a43e064..d7a6214e5a6f 100644
@@ -155,13 +155,13 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
 		  LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH_UNIT |
 		  timings->vsync_len.typ;
 
-	if(flags & DISPLAY_FLAGS_HSYNC_HIGH)
+	if (flags & DISPLAY_FLAGS_HSYNC_HIGH)
 		vdctrl0 |= LCDIF_VDCTRL0_HSYNC_POL;
-	if(flags & DISPLAY_FLAGS_VSYNC_HIGH)
+	if (flags & DISPLAY_FLAGS_VSYNC_HIGH)
 		vdctrl0 |= LCDIF_VDCTRL0_VSYNC_POL;
 	if (flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
 		vdctrl0 |= LCDIF_VDCTRL0_DOTCLK_POL;
-	if(flags & DISPLAY_FLAGS_DE_HIGH)
+	if (flags & DISPLAY_FLAGS_DE_HIGH)
 		vdctrl0 |= LCDIF_VDCTRL0_ENABLE_POL;
 
 	writel(vdctrl0, &regs->hw_lcdif_vdctrl0);
Signature · 1 line
2.43.0
#13 lore raw

PATCH v2 11/25 video: mxsfb: set the DE polarity from the display timings

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

LCDIF_VDCTRL0_ENABLE_POL is always set, so the data enable signal is active high even if the display timings don't ask for it, and the DISPLAY_FLAGS_DE_HIGH check is pointless.

Set it only for DISPLAY_FLAGS_DE_HIGH, as Linux does for DRM_BUS_FLAG_DE_HIGH. The in-tree boards using the LCDIF with display timings all specify "de-active", so they are not affected.

---

Changes in v2:
- Add patch, split from "video: Update mxsfb video drivers for iMX8MM/iMX8MN display"

 drivers/video/mxsfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/mxsfb.c +1 -1
index d7a6214e5a6f..bc082c334577 100644
@@ -150,7 +150,7 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
 	writel((timings->vactive.typ << LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET) |
 		timings->hactive.typ, &regs->hw_lcdif_transfer_count);
 
-	vdctrl0 = LCDIF_VDCTRL0_ENABLE_PRESENT | LCDIF_VDCTRL0_ENABLE_POL |
+	vdctrl0 = LCDIF_VDCTRL0_ENABLE_PRESENT |
 		  LCDIF_VDCTRL0_VSYNC_PERIOD_UNIT |
 		  LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH_UNIT |
 		  timings->vsync_len.typ;
Signature · 1 line
2.43.0
#14 lore raw

PATCH v2 12/25 video: Update mxsfb video drivers for iMX8MM/iMX8MN display

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Update mxsfb for LCD video driver

---

Changes in v2:
- Move the coding style fix and the DE polarity change to separate patches

 drivers/video/mxsfb.c | 129 ++++++++++++++++++++++++++++--------------
 1 file changed, 88 insertions(+), 41 deletions(-)
drivers/video/mxsfb.c +88 -41
index bc082c334577..55ac99bbbf70 100644
@@ -21,8 +21,13 @@
 #include <asm/global_data.h>
 #include <asm/mach-imx/dma.h>
 #include <asm/io.h>
+#include <reset.h>
+#include <panel.h>
+#include <video_bridge.h>
+#include <video_link.h>
 
 #include "videomodes.h"
+#include <dm/device-internal.h>
 
 #define	PS2KHZ(ps)	(1000000000UL / (ps))
 #define HZ2PS(hz)	(1000000000UL / ((hz) / 1000))
@@ -30,6 +35,11 @@
 #define BITS_PP		18
 #define BYTES_PP	4
 
+struct mxsfb_priv {
+	fdt_addr_t reg_base;
+	struct udevice *disp_dev;
+};
+
 struct mxs_dma_desc desc;
 
 /**
@@ -56,9 +66,10 @@ __weak void mxsfb_system_setup(void)
  */
 
 static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
-			 struct display_timing *timings, int bpp)
+			 struct display_timing *timings, int bpp, bool bridge)
 {
-	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE;
+	struct mxsfb_priv *priv = dev_get_priv(dev);
+	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)priv->reg_base;
 	const enum display_flags flags = timings->flags;
 	uint32_t word_len = 0, bus_width = 0;
 	uint8_t valid_data = 0;
@@ -109,7 +120,7 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
 	}
 #else
 	/* Kick in the LCDIF clock */
-	mxs_set_lcdclk(MXS_LCDIF_BASE, timings->pixelclock.typ / 1000);
+	mxs_set_lcdclk(priv->reg_base, timings->pixelclock.typ / 1000);
 #endif
 
 	/* Restart the LCDIF block */
@@ -142,9 +153,13 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
 		LCDIF_CTRL_BYPASS_COUNT | LCDIF_CTRL_LCDIF_MASTER,
 		&regs->hw_lcdif_ctrl);
 
-	writel(valid_data << LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET,
+	writel((valid_data << LCDIF_CTRL1_BYTE_PACKING_FORMAT_OFFSET) |
+		LCDIF_CTRL1_RECOVER_ON_UNDERFLOW,
 		&regs->hw_lcdif_ctrl1);
 
+	if (bridge)
+		writel(LCDIF_CTRL2_OUTSTANDING_REQS_REQ_16, &regs->hw_lcdif_ctrl2);
+
 	mxsfb_system_setup();
 
 	writel((timings->vactive.typ << LCDIF_TRANSFER_COUNT_V_COUNT_OFFSET) |
@@ -198,10 +213,10 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
 }
 
 static int mxs_probe_common(struct udevice *dev, struct display_timing *timings,
-			    int bpp, u32 fb)
+			    int bpp, u32 fb, bool bridge)
 {
 	/* Start framebuffer */
-	mxs_lcd_init(dev, fb, timings, bpp);
+	mxs_lcd_init(dev, fb, timings, bpp, bridge);
 
 #ifdef CONFIG_VIDEO_MXS_MODE_SYSTEM
 	/*
@@ -212,7 +227,8 @@ static int mxs_probe_common(struct udevice *dev, struct display_timing *timings,
 	 * sets the RUN bit, then waits until it gets cleared and repeats this
 	 * infinitelly. This way, we get smooth continuous updates of the LCD.
 	 */
-	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE;
+	struct mxsfb_priv *priv = dev_get_priv(dev);
+	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)priv->reg_base;
 
 	memset(&desc, 0, sizeof(struct mxs_dma_desc));
 	desc.address = (dma_addr_t)&desc;
@@ -229,9 +245,9 @@ static int mxs_probe_common(struct udevice *dev, struct display_timing *timings,
 	return 0;
 }
 
-static int mxs_remove_common(u32 fb)
+static int mxs_remove_common(phys_addr_t reg_base, u32 fb)
 {
-	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE;
+	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)(reg_base);
 	int timeout = 1000000;
 
 	if (!fb)
@@ -258,6 +274,7 @@ static int mxs_of_get_timings(struct udevice *dev,
 	int ret = 0;
 	u32 display_phandle;
 	ofnode display_node;
+	struct mxsfb_priv *priv = dev_get_priv(dev);
 
 	ret = ofnode_read_u32(dev_ofnode(dev), "display", &display_phandle);
 	if (ret) {
@@ -278,10 +295,19 @@ static int mxs_of_get_timings(struct udevice *dev,
 		return -EINVAL;
 	}
 
-	ret = ofnode_decode_display_timing(display_node, 0, timings);
-	if (ret) {
-		dev_err(dev, "failed to get any display timings\n");
-		return -EINVAL;
+	priv->disp_dev = video_link_get_next_device(dev);
+	if (priv->disp_dev) {
+		ret = video_link_get_display_timings(timings);
+		if (ret) {
+			dev_err(dev, "failed to get any video link display timings\n");
+			return -EINVAL;
+		}
+	} else {
+		ret = ofnode_decode_display_timing(display_node, 0, timings);
+		if (ret) {
+			dev_err(dev, "failed to get any display timings\n");
+			return -EINVAL;
+		}
 	}
 
 	return ret;
@@ -291,20 +317,58 @@ static int mxs_video_probe(struct udevice *dev)
 {
 	struct video_uc_plat *plat = dev_get_uclass_plat(dev);
 	struct video_priv *uc_priv = dev_get_uclass_priv(dev);
+	struct mxsfb_priv *priv = dev_get_priv(dev);
 
 	struct display_timing timings;
 	u32 bpp = 0;
 	u32 fb_start, fb_end;
 	int ret;
+	bool enable_bridge = false;
 
 	debug("%s() plat: base 0x%lx, size 0x%x\n",
 	       __func__, plat->base, plat->size);
 
+	priv->reg_base = dev_read_addr(dev);
+	if (priv->reg_base == FDT_ADDR_T_NONE) {
+		dev_err(dev, "lcdif base address is not found\n");
+		return -EINVAL;
+	}
+
 	ret = mxs_of_get_timings(dev, &timings, &bpp);
 	if (ret)
 		return ret;
 
-	ret = mxs_probe_common(dev, &timings, bpp, plat->base);
+	if (priv->disp_dev) {
+		if (IS_ENABLED(CONFIG_VIDEO_BRIDGE)) {
+			if (device_get_uclass_id(priv->disp_dev) == UCLASS_VIDEO_BRIDGE) {
+				ret = video_bridge_attach(priv->disp_dev);
+				if (ret) {
+					dev_err(dev, "fail to attach bridge\n");
+					return ret;
+				}
+
+				ret = video_bridge_set_backlight(priv->disp_dev, 80);
+				if (ret) {
+					dev_err(dev, "fail to set backlight\n");
+					return ret;
+				}
+
+				enable_bridge = true;
+				video_bridge_check_timing(priv->disp_dev, &timings);
+			}
+		}
+
+		if (device_get_uclass_id(priv->disp_dev) == UCLASS_PANEL) {
+			ret = panel_enable_backlight(priv->disp_dev);
+			if (ret) {
+				dev_err(dev, "panel %s enable backlight error %d\n",
+					priv->disp_dev->name, ret);
+				return ret;
+			}
+		}
+	}
+
+	ret = mxs_probe_common(dev, &timings, bpp, plat->base, enable_bridge);
 	if (ret)
 		return ret;
 
@@ -342,33 +406,9 @@ static int mxs_video_probe(struct udevice *dev)
 static int mxs_video_bind(struct udevice *dev)
 {
 	struct video_uc_plat *plat = dev_get_uclass_plat(dev);
-	struct display_timing timings;
-	u32 bpp = 0;
-	u32 bytes_pp = 0;
-	int ret;
 
-	ret = mxs_of_get_timings(dev, &timings, &bpp);
-	if (ret)
-		return ret;
-
-	switch (bpp) {
-	case 32:
-	case 24:
-	case 18:
-		bytes_pp = 4;
-		break;
-	case 16:
-		bytes_pp = 2;
-		break;
-	case 8:
-		bytes_pp = 1;
-		break;
-	default:
-		dev_err(dev, "invalid bpp specified (bpp = %i)\n", bpp);
-		return -EINVAL;
-	}
-
-	plat->size = timings.hactive.typ * timings.vactive.typ * bytes_pp;
+	/* Max size supported by LCDIF, because in bind, we can't probe panel */
+	plat->size = 1920 * 1080 * 4 * 2;
 
 	return 0;
 }
@@ -376,8 +416,12 @@ static int mxs_video_bind(struct udevice *dev)
 static int mxs_video_remove(struct udevice *dev)
 {
 	struct video_uc_plat *plat = dev_get_uclass_plat(dev);
+	struct mxsfb_priv *priv = dev_get_priv(dev);
+
+	if (priv->disp_dev)
+		device_remove(priv->disp_dev, DM_REMOVE_NORMAL);
 
-	mxs_remove_common(plat->base);
+	mxs_remove_common(priv->reg_base, plat->base);
 
 	return 0;
 }
@@ -388,6 +432,8 @@ static const struct udevice_id mxs_video_ids[] = {
 	{ .compatible = "fsl,imx6sx-lcdif" },
 	{ .compatible = "fsl,imx7ulp-lcdif" },
 	{ .compatible = "fsl,imxrt-lcdif" },
+	{ .compatible = "fsl,imx8mm-lcdif" },
+	{ .compatible = "fsl,imx8mn-lcdif" },
 	{ /* sentinel */ }
 };
 
@@ -399,4 +445,5 @@ U_BOOT_DRIVER(mxs_video) = {
 	.probe	= mxs_video_probe,
 	.remove = mxs_video_remove,
 	.flags	= DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE,
+	.priv_auto   = sizeof(struct mxsfb_priv),
 };
Signature · 1 line
2.43.0
#15 lore raw

PATCH v2 13/25 video: Enable DM_UC_FLAG_SEQ_ALIAS for display and bridge

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

To support multiple display or bridge devices, enable the flag, so we can assign the req seq via DTB alias

---

(no changes since v1)

 drivers/video/bridge/video-bridge-uclass.c | 1 +
 drivers/video/display-uclass.c             | 1 +
 2 files changed, 2 insertions(+)
drivers/video/bridge/video-bridge-uclass.c +1 -0
index 599090141e4d..ec2b43002a74 100644
@@ -156,6 +156,7 @@ int video_bridge_set_active(struct udevice *dev, bool active)
 UCLASS_DRIVER(video_bridge) = {
 	.id		= UCLASS_VIDEO_BRIDGE,
 	.name		= "video_bridge",
+	.flags		= DM_UC_FLAG_SEQ_ALIAS,
 	.per_device_auto	= sizeof(struct video_bridge_priv),
 	.pre_probe	= video_bridge_pre_probe,
 };
drivers/video/display-uclass.c +1 -0
index 85dac12a197e..1bf45a8e5d29 100644
@@ -78,5 +78,6 @@ bool display_in_use(struct udevice *dev)
 UCLASS_DRIVER(display) = {
 	.id		= UCLASS_DISPLAY,
 	.name		= "display",
+	.flags          = DM_UC_FLAG_SEQ_ALIAS,
 	.per_device_plat_auto	= sizeof(struct display_plat),
 };
Signature · 1 line
2.43.0
#16 lore raw

PATCH v2 14/25 phy: dphy: add support to calculate the timing based on hs_clk_rate

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Upstream Linux commit 22168675bae7.

For MIPI-CSI sender use-case it is common to specify the allowed link-frequencies which should be used for the MIPI link and is half the hs-clock rate.

This commit adds a helper to calculate the D-PHY timing based on the hs-clock rate so we don't need to calculate the timings within the driver.

---

(no changes since v1)

 drivers/phy/phy-core-mipi-dphy.c | 30 +++++++++++++++++++++++++-----
 include/phy-mipi-dphy.h          |  3 +++
 2 files changed, 28 insertions(+), 5 deletions(-)
drivers/phy/phy-core-mipi-dphy.c +25 -5
index 8fb985a1e682..727c2b040520 100644
@@ -13,21 +13,23 @@
 /*
  * Minimum D-PHY timings based on MIPI D-PHY specification. Derived
  * from the valid ranges specified in Section 6.9, Table 14, Page 41
- * of the D-PHY specification (v2.1).
+ * of the D-PHY specification (v1.2).
  */
-int phy_mipi_dphy_get_default_config(unsigned long pixel_clock,
+static int phy_mipi_dphy_calc_config(unsigned long pixel_clock,
 				     unsigned int bpp,
 				     unsigned int lanes,
+				     unsigned long long hs_clk_rate,
 				     struct phy_configure_opts_mipi_dphy *cfg)
 {
-	unsigned long long hs_clk_rate;
 	unsigned long long ui;
 
 	if (!cfg)
 		return -EINVAL;
 
-	hs_clk_rate = pixel_clock * bpp;
-	do_div(hs_clk_rate, lanes);
+	if (!hs_clk_rate) {
+		hs_clk_rate = pixel_clock * bpp;
+		do_div(hs_clk_rate, lanes);
+	}
 
 	ui = ALIGN(PSEC_PER_SEC, hs_clk_rate);
 	do_div(ui, hs_clk_rate);
@@ -74,6 +76,24 @@ int phy_mipi_dphy_get_default_config(unsigned long pixel_clock,
 	return 0;
 }
 
+int phy_mipi_dphy_get_default_config(unsigned long pixel_clock,
+				     unsigned int bpp,
+				     unsigned int lanes,
+				     struct phy_configure_opts_mipi_dphy *cfg)
+{
+	return phy_mipi_dphy_calc_config(pixel_clock, bpp, lanes, 0, cfg);
+}
+
+int phy_mipi_dphy_get_default_config_for_hsclk(unsigned long long hs_clk_rate,
+					       unsigned int lanes,
+					       struct phy_configure_opts_mipi_dphy *cfg)
+{
+	if (!hs_clk_rate)
+		return -EINVAL;
+
+	return phy_mipi_dphy_calc_config(0, 0, lanes, hs_clk_rate, cfg);
+}
+
 /*
  * Validate D-PHY configuration according to MIPI D-PHY specification
  * (v1.2, Section Section 6.9 "Global Operation Timing Parameters").
include/phy-mipi-dphy.h +3 -0
index a877ffee845d..1ac128d78dfe 100644
@@ -279,6 +279,9 @@ int phy_mipi_dphy_get_default_config(unsigned long pixel_clock,
 				     unsigned int bpp,
 				     unsigned int lanes,
 				     struct phy_configure_opts_mipi_dphy *cfg);
+int phy_mipi_dphy_get_default_config_for_hsclk(unsigned long long hs_clk_rate,
+					       unsigned int lanes,
+					       struct phy_configure_opts_mipi_dphy *cfg);
 int phy_mipi_dphy_config_validate(struct phy_configure_opts_mipi_dphy *cfg);
 
 #endif /* __PHY_MIPI_DPHY_H_ */
Signature · 1 line
2.43.0
#17 lore raw

PATCH v2 15/25 phy: dphy: Correct lpx parameter and its derivatives(ta_{get, go, sure})

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Upstream linux commit 3153fa38e38af5.

According to the comment of the function phy_mipi_dphy_get_default_config(), it uses minimum D-PHY timings based on MIPI D-PHY specification. They are derived from the valid ranges specified in Section 6.9, Table 14, Page 41 of the D-PHY specification (v1.2). The table 14 explicitly mentions that the minimum T-LPX parameter is 50 nanoseconds and the minimum TA-SURE parameter is T-LPX nanoseconds. Likewise, the kernel doc of the 'lpx' and 'ta_sure' members of struct phy_configure_opts_mipi_dphy mentions that the minimum values are 50000 picoseconds and @lpx picoseconds respectively. Also, the function phy_mipi_dphy_config_validate() checks if cfg->lpx is less than 50000 picoseconds and if cfg->ta_sure is less than cfg->lpx, which hints the same minimum values.

Without this patch, the function phy_mipi_dphy_get_default_config() wrongly sets cfg->lpx to 60000 picoseconds and cfg->ta_sure to 2 * cfg->lpx. So, let's correct them to 50000 picoseconds and cfg->lpx respectively.

Note that I've only tested the patch with RM67191 DSI panel on i.MX8mq EVK. Help is needed to test with other i.MX8mq, Meson and Rockchip platforms, as I don't have the hardwares.

---

(no changes since v1)

 drivers/phy/phy-core-mipi-dphy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/phy/phy-core-mipi-dphy.c +2 -2
index 727c2b040520..79cab9125002 100644
@@ -64,10 +64,10 @@ static int phy_mipi_dphy_calc_config(unsigned long pixel_clock,
 	cfg->hs_trail = max(4 * 8 * ui, 60000 + 4 * 4 * ui);
 
 	cfg->init = 100;
-	cfg->lpx = 60000;
+	cfg->lpx = 50000;
 	cfg->ta_get = 5 * cfg->lpx;
 	cfg->ta_go = 4 * cfg->lpx;
-	cfg->ta_sure = 2 * cfg->lpx;
+	cfg->ta_sure = cfg->lpx;
 	cfg->wakeup = 1000;
 
 	cfg->hs_clk_rate = hs_clk_rate;
Signature · 1 line
2.43.0
#18 lore raw

PATCH v2 16/25 phy: dphy: Correct clk_pre parameter

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Upstream linux commit 9a8406ba1a9a29.

The D-PHY specification (v1.2) explicitly mentions that the T-CLK-PRE parameter's unit is Unit Interval(UI) and the minimum value is 8. Also, kernel doc of the 'clk_pre' member of struct phy_configure_opts_mipi_dphy mentions that it should be in UI. However, the dphy core driver wrongly sets 'clk_pre' to 8000, which seems to hint that it's in picoseconds.

So, let's fix the dphy core driver to correctly reflect the T-CLK-PRE parameter's minimum value according to the D-PHY specification.

I'm assuming that all impacted custom drivers shall program values in TxByteClkHS cycles into hardware for the T-CLK-PRE parameter. The D-PHY specification mentions that the frequency of TxByteClkHS is exactly 1/8 the High-Speed(HS) bit rate(each HS bit consumes one UI). So, relevant custom driver code is changed to program those values as DIV_ROUND_UP(cfg->clk_pre, BITS_PER_BYTE), then.

Note that I've only tested the patch with RM67191 DSI panel on i.MX8mq EVK. Help is needed to test with other i.MX8mq, Meson and Rockchip platforms, as I don't have the hardwares.

---

(no changes since v1)

 drivers/phy/meson-axg-mipi-dphy.c | 2 +-
 drivers/phy/phy-core-mipi-dphy.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/phy/meson-axg-mipi-dphy.c +1 -1
index 3f89de19970b..fb10ccca6ac1 100644
@@ -237,7 +237,7 @@ static int phy_meson_axg_mipi_dphy_power_on(struct phy *phy)
 		     (DIV_ROUND_UP(priv->config.clk_zero, temp) << 16) |
 		     (DIV_ROUND_UP(priv->config.clk_prepare, temp) << 24));
 	regmap_write(priv->regmap, MIPI_DSI_CLK_TIM1,
-		     DIV_ROUND_UP(priv->config.clk_pre, temp));
+		     DIV_ROUND_UP(priv->config.clk_pre, BITS_PER_BYTE));
 
 	regmap_write(priv->regmap, MIPI_DSI_HS_TIM,
 		     DIV_ROUND_UP(priv->config.hs_exit, temp) |
drivers/phy/phy-core-mipi-dphy.c +1 -1
index 79cab9125002..27cff85709d9 100644
@@ -36,7 +36,7 @@ static int phy_mipi_dphy_calc_config(unsigned long pixel_clock,
 
 	cfg->clk_miss = 0;
 	cfg->clk_post = 60000 + 52 * ui;
-	cfg->clk_pre = 8000;
+	cfg->clk_pre = 8;
 	cfg->clk_prepare = 38000;
 	cfg->clk_settle = 95000;
 	cfg->clk_term_en = 0;
Signature · 1 line
2.43.0
#19 lore raw

PATCH v2 17/25 video: bridge: Add Samsung DSIM bridge

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano.

In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the as a bridge that can support all different platform.

---

Changes in v2:
- Bind the DSI host to the DSIM node and drop the
"samsung,sec-mipi-dsi" compatible
- Fix typo in a comment

 drivers/video/bridge/Kconfig            |   13 +
 drivers/video/bridge/Makefile           |    1 +
 drivers/video/bridge/samsung-dsi-host.c | 1561 +++++++++++++++++++++++
 drivers/video/bridge/samsung-dsim.c     |  162 +++
 drivers/video/bridge/samsung-dsim.h     |   20 +
 5 files changed, 1757 insertions(+)
 create mode 100644 drivers/video/bridge/samsung-dsi-host.c
 create mode 100644 drivers/video/bridge/samsung-dsim.c
 create mode 100644 drivers/video/bridge/samsung-dsim.h
drivers/video/bridge/Kconfig +13 -0
index 81261c610059..c5a4901587d4 100644
@@ -44,6 +44,19 @@ config VIDEO_BRIDGE_ANALOGIX_ANX6345
 	  The Analogix ANX6345 is RGB-to-DP converter. It enables an eDP LCD
 	  panel to be connected to an parallel LCD interface.
 
+config VIDEO_BRIDGE_SAMSUNG_DSIM
+	bool "Enable IMX SEC DSI video support"
+	select MIPI_DPHY_HELPERS
+	select VIDEO_BRIDGE
+	select VIDEO_LINK
+	select VIDEO_MIPI_DSI
+	help
+	  Enables the common driver code for the Samsung
+	  MIPI DSI block found in SoCs from various vendors.
+	  As this does not provide any functionality by itself (but
+	  rather requires a SoC-specific glue driver to call it), it
+	  can not be enabled from the configuration menu.
+
 config VIDEO_BRIDGE_SOLOMON_SSD2825
 	bool "Solomon SSD2825 bridge driver"
 	depends on VIDEO_BRIDGE && PANEL && DM_GPIO
drivers/video/bridge/Makefile +1 -0
index 520f36a7a6f4..a46594c561b2 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_VIDEO_BRIDGE_PARADE_DP501) += dp501.o
 obj-$(CONFIG_VIDEO_BRIDGE_PARADE_PS862X) += ps862x.o
 obj-$(CONFIG_VIDEO_BRIDGE_NXP_PTN3460) += ptn3460.o
 obj-$(CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345) += anx6345.o
+obj-$(CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM) += samsung-dsim.o samsung-dsi-host.o
 obj-$(CONFIG_VIDEO_BRIDGE_SOLOMON_SSD2825) += ssd2825.o
 obj-$(CONFIG_VIDEO_BRIDGE_TOSHIBA_TC358768) += tc358768.o
 obj-$(CONFIG_VIDEO_BRIDGE_LVDS_CODEC) += lvds-codec.o
drivers/video/bridge/samsung-dsi-host.c new file +1561 -0

1,561 lines not on this page · raw message

drivers/video/bridge/samsung-dsim.c new file +162 -0

162 lines not on this page · raw message

drivers/video/bridge/samsung-dsim.h new file +20 -0
new file mode 100644
index 000000000000..9bb2a379589b
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2024 Amarula Solutions
+ */
+
+#ifndef SAMSUNG_DSIM_H
+#define SAMSUNG_DSIM_H
+
+enum samsung_dsim_type {
+	DSIM_TYPE_EXYNOS3250,
+	DSIM_TYPE_EXYNOS4210,
+	DSIM_TYPE_EXYNOS5410,
+	DSIM_TYPE_EXYNOS5422,
+	DSIM_TYPE_EXYNOS5433,
+	DSIM_TYPE_IMX8MM,
+	DSIM_TYPE_IMX8MP,
+	DSIM_TYPE_COUNT,
+};
+
+#endif
Signature · 1 line
2.43.0
#20 lore raw

PATCH v2 18/25 video: Add Synaptics R63353 panel driver

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

The LS068B3SX02 panel is based on the Synaptics R63353 Controller. Add a driver for it.

---

(no changes since v1)

 drivers/video/Kconfig            |   8 ++
 drivers/video/Makefile           |   1 +
 drivers/video/synaptics-r63353.c | 228 +++++++++++++++++++++++++++++++
 3 files changed, 237 insertions(+)
 create mode 100644 drivers/video/synaptics-r63353.c
drivers/video/Kconfig +8 -0
index cc21afbe8ff5..ed0abb23d751 100644
@@ -708,6 +708,14 @@ config VIDEO_LCD_SSD2828_RESET
 	  The reset pin of SSD2828 chip. This takes a string in the format
 	  understood by 'sunxi_name_to_gpio' function, e.g. PH1 for pin 1 of port H.
 
+config VIDEO_LCD_SYNAPTICS_R63353
+	tristate "Synaptics R63353-based DSI LCD panels support"
+	select VIDEO_MIPI_DSI
+	default n
+	help
+	  Say Y if you want to enable support for panels based on the
+	  Synaptics R63353 controller.
+
 config VIDEO_LCD_TDO_TL070WSH30
 	bool "TDO TL070WSH30 DSI LCD panel support"
 	select VIDEO_MIPI_DSI
drivers/video/Makefile +1 -0
index 6e6d1ba29cdb..2955e76bb02e 100644
@@ -77,6 +77,7 @@ obj-$(CONFIG_VIDEO_LCD_SAMSUNG_LTL106HL02) += samsung-ltl106hl02.o
 obj-$(CONFIG_VIDEO_LCD_SHARP_LQ079L1SX01) += sharp-lq079l1sx01.o
 obj-$(CONFIG_VIDEO_LCD_SHARP_LQ101R1SX01) += sharp-lq101r1sx01.o
 obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o
+obj-$(CONFIG_VIDEO_LCD_SYNAPTICS_R63353) += synaptics-r63353.o
 obj-$(CONFIG_VIDEO_LCD_TDO_TL070WSH30) += tdo-tl070wsh30.o
 obj-$(CONFIG_VIDEO_LCD_SONY_L4F00430T01) += sony-l4f00430t01.o
 obj-$(CONFIG_VIDEO_LCD_SAMSUNG_S6E63M0) += samsung-s6e63m0.o
drivers/video/synaptics-r63353.c new file +228 -0

228 lines not on this page · raw message

Signature · 1 line
2.43.0
#21 lore raw

PATCH v2 19/25 imx8mn_bsh_smm_s2/pro: Enable display on reference design

In reply to Dario Binacchi

From: Michael Trimarchi <[email protected]>

Enable the drivers and add the U-Boot device tree properties required by the display of the BSH SMM S2 and S2 PRO boards.

---

Changes in v2:
- Drop the dsi-host node
- Add commit message

 .../arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi | 16 ++++++++++++++++
 configs/imx8mn_bsh_smm_s2_defconfig              | 15 +++++++++++++++
 configs/imx8mn_bsh_smm_s2pro_defconfig           | 15 +++++++++++++++
 3 files changed, 46 insertions(+)
arch/arm/dts/imx8mn-bsh-smm-s2-u-boot-common.dtsi +16 -0
index 19b0d8977539..724db21f11f8 100644
@@ -6,6 +6,12 @@
 
 #include "imx8mn-u-boot.dtsi"
 
+/ {
+	aliases {
+		display0 = &lcdif;
+	};
+};
+
 &{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} {
 	bootph-pre-ram;
 };
@@ -30,6 +36,16 @@
 	bootph-pre-ram;
 };
 
+&lcdif {
+	display = <&display0>;
+
+	/* panel is r8g8b8 */
+	display0: display@0 {
+		bits-per-pixel = <24>;
+		bits-per-color = <8>;
+	};
+};
+
 &pinctrl_i2c1 {
 	bootph-pre-ram;
 };
configs/imx8mn_bsh_smm_s2_defconfig +15 -0
index 3c585e8b0541..f63948806ed0 100644
@@ -55,6 +55,7 @@ CONFIG_SYS_PROMPT="> "
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_BMP=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
 CONFIG_MTDPARTS_DEFAULT="gpmi-nand:64m(nandboot),16m(nandfit),32m(nandkernel),1m(nanddtb),8m(nandtee),-(nandrootfs)"
@@ -72,6 +73,8 @@ CONFIG_FASTBOOT_BUF_ADDR=0x40480000
 CONFIG_FASTBOOT_BUF_SIZE=0x20000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_DM_GPIO_LOOKUP_LABEL=y
+CONFIG_SPL_DM_GPIO_LOOKUP_LABEL=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
 # CONFIG_MMC is not set
@@ -92,12 +95,17 @@ CONFIG_PHY_NXP_TJA11XX=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_IMX8M_POWER_DOMAIN=y
+CONFIG_IMX8M_BLK_CTRL=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_PMIC_BD71837=y
 CONFIG_SPL_DM_PMIC_BD71837=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_IMX=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
@@ -110,5 +118,12 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
+CONFIG_VIDEO=y
+CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y
+CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y
+CONFIG_VIDEO_MXS=y
+CONFIG_BMP_16BPP=y
+CONFIG_BMP_24BPP=y
+CONFIG_BMP_32BPP=y
 CONFIG_IMX_WATCHDOG=y
 # CONFIG_FAT_WRITE is not set
configs/imx8mn_bsh_smm_s2pro_defconfig +15 -0
index b924f6fefaa4..713121eda886 100644
@@ -52,6 +52,7 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_BMP=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
@@ -66,6 +67,8 @@ CONFIG_FASTBOOT_BUF_SIZE=0x20000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_UUU_SUPPORT=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
+CONFIG_DM_GPIO_LOOKUP_LABEL=y
+CONFIG_SPL_DM_GPIO_LOOKUP_LABEL=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SUPPORT_EMMC_BOOT=y
@@ -81,12 +84,17 @@ CONFIG_PHY_NXP_TJA11XX=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_IMX8M_POWER_DOMAIN=y
+CONFIG_IMX8M_BLK_CTRL=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_PMIC_BD71837=y
 CONFIG_SPL_DM_PMIC_BD71837=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_IMX=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_SYSRESET=y
@@ -99,5 +107,12 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
+CONFIG_VIDEO=y
+CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y
+CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y
+CONFIG_VIDEO_MXS=y
+CONFIG_BMP_16BPP=y
+CONFIG_BMP_24BPP=y
+CONFIG_BMP_32BPP=y
 CONFIG_IMX_WATCHDOG=y
 # CONFIG_FAT_WRITE is not set
Signature · 1 line
2.43.0
#22 lore raw

PATCH v2 20/25 boot: fdt_simplefb: add a debug message

In reply to Dario Binacchi

The printed information is useful when adding support for the simple frame buffer to a board.

---

(no changes since v1)

 boot/fdt_simplefb.c | 2 ++
 1 file changed, 2 insertions(+)
boot/fdt_simplefb.c +2 -0
index 69c7c2e24c03..73ab29e29e9e 100644
@@ -58,6 +58,8 @@ static int fdt_simplefb_configure_node(void *blob, int off)
 		return -EINVAL;
 	}
 
+	debug("Simple frame buffer at 0x%lx, pixels %dx%d, format %s\n",
+	      fb_base, xsize, ysize, name);
 	return fdt_setup_simplefb_node(blob, off, fb_base, xsize, ysize,
 				       xsize * (1 << bpix) / 8, name);
 }
Signature · 1 line
2.43.0
#23 lore raw

PATCH v2 21/25 video: mxsfb: support simple frame-buffer

In reply to Dario Binacchi

If you want to pass the frame-buffer to the kernel, the video output is initialized by U-Boot, and kept by the kernel. The patch does not turn off the power domains or reset the peripheral if you want to support such feature.

---

(no changes since v1)

 drivers/video/mxsfb.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/video/mxsfb.c +6 -1
index 55ac99bbbf70..f7e8947c5509 100644
@@ -421,7 +421,8 @@ static int mxs_video_remove(struct udevice *dev)
 	if (priv->disp_dev)
 		device_remove(priv->disp_dev, DM_REMOVE_NORMAL);
 
-	mxs_remove_common(priv->reg_base, plat->base);
+	if (!IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB))
+		mxs_remove_common(priv->reg_base, plat->base);
 
 	return 0;
 }
@@ -444,6 +445,10 @@ U_BOOT_DRIVER(mxs_video) = {
 	.bind	= mxs_video_bind,
 	.probe	= mxs_video_probe,
 	.remove = mxs_video_remove,
+#if !IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB)
 	.flags	= DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE,
+#else
+	.flags	= DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE | DM_FLAG_LEAVE_PD_ON,
+#endif
 	.priv_auto   = sizeof(struct mxsfb_priv),
 };
Signature · 1 line
2.43.0
#24 lore raw

PATCH v2 22/25 video: bridge: samsung: support simple frame-buffer

In reply to Dario Binacchi

If you want to pass the frame-buffer to the kernel, the video output is initialized by U-Boot, and kept by the kernel. The patch does not turn off the power domains or disable the peripheral if you want to support such feature.

---

(no changes since v1)

 drivers/video/bridge/samsung-dsi-host.c | 9 +++++++++
 drivers/video/bridge/samsung-dsim.c     | 3 +++
 2 files changed, 12 insertions(+)
drivers/video/bridge/samsung-dsi-host.c +9 -0
index 32257cfcca4c..5d01a0540be1 100644
@@ -1281,6 +1281,7 @@ static void samsung_dsi_set_standby(struct samsung_dsi *dsim, bool standby)
 	samsung_dsim_write(dsim, DSIM_MDRESOL_REG, mdresol);
 }
 
+#if (!IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB))
 static void samsung_dsi_disable_clock(struct samsung_dsi *dsim)
 {
 	u32 reg;
@@ -1294,6 +1295,7 @@ static void samsung_dsi_disable_clock(struct samsung_dsi *dsim)
 	reg &= ~DSIM_PLL_EN;
 	samsung_dsim_write(dsim, DSIM_PLLCTRL_REG, reg);
 }
+#endif
 
 static inline struct samsung_dsi *host_to_dsi(struct mipi_dsi_host *host)
 {
@@ -1515,6 +1517,12 @@ static int samsung_dsi_enable(struct udevice *dev)
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB)
+static int samsung_dsi_disable(struct udevice *dev)
+{
+	return 0;
+}
+#else
 static int samsung_dsi_disable(struct udevice *dev)
 {
 	u32 intsrc;
@@ -1532,6 +1540,7 @@ static int samsung_dsi_disable(struct udevice *dev)
 
 	return 0;
 }
+#endif
 
 struct dsi_host_ops samsung_dsi_ops = {
 	.init = samsung_dsi_init,
drivers/video/bridge/samsung-dsim.c +3 -0
index 5a366fa976c5..531303617989 100644
@@ -158,5 +158,8 @@ U_BOOT_DRIVER(samsung_dsim) = {
 	.remove				= samsung_dsim_remove,
 	.probe				= samsung_dsim_probe,
 	.ops				= &samsung_dsim_ops,
+#if IS_ENABLED(CONFIG_VIDEO_DT_SIMPLEFB)
+	.flags				= DM_FLAG_LEAVE_PD_ON,
+#endif
 	.priv_auto		= sizeof(struct samsung_dsim_priv),
 };
Signature · 1 line
2.43.0
#25 lore raw

PATCH v2 23/25 imx8mn_bsh_smm_s2/pro: support simple frame-buffer

In reply to Dario Binacchi

If you want to pass the frame-buffer to the kernel, the video output is initialized by U-Boot, and kept by the kernel. The commit modifies the device tree to be passed to the kernel just before launching it, to prevent the kernel from reinitializing hardware that has already been configured by the bootloader.

---

Changes in v2:
- Drop the custom boot-on properties added to the Linux device tree
- Drop the #if guard around smm_s2_setup_simplefb()
- Fix the style of a comment

 board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c | 72 +++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
board/bsh/imx8mn_smm_s2/imx8mn_smm_s2.c +72 -0
index c4a85c4aa440..902d5304249a 100644
@@ -5,6 +5,8 @@
 
 #include <asm/arch/sys_proto.h>
 #include <env.h>
+#include <fdt_simplefb.h>
+#include <fdt_support.h>
 
 int board_late_init(void)
 {
@@ -15,3 +17,73 @@ int board_late_init(void)
 
 	return 0;
 }
+
+static void smm_s2_setup_simplefb(void *blob)
+{
+#define DT_BLK_CTRL_NODE_PATH "/soc@0/bus@32c00000/blk-ctrl@32e28000"
+#define DT_GPC_NODE_PATH "/soc@0/bus@30000000/gpc@303a0000"
+#define DT_LCDIF_NODE_PATH "/soc@0/bus@32c00000/lcdif@32e00000"
+
+	struct dt_addprop {
+		const char *node;
+		const char *prop;
+		const u32 *val;
+		int len;
+	} dt_addprops[] = {
+		{"/regulator-3v3-O2", "regulator-boot-on", NULL, 0},
+		{"/regulator-3v3-O3", "regulator-boot-on", NULL, 0},
+	};
+	const char *dt_delprops[][2] = {
+		{DT_BLK_CTRL_NODE_PATH, "assigned-clock-rates"},
+		/* pgc_dispmix */
+		{DT_GPC_NODE_PATH "/pgc/power-domain@3", "assigned-clock-rates"},
+		{DT_LCDIF_NODE_PATH, "assigned-clock-rates"},
+	};
+	int i, ret, offset;
+
+	ret = fdt_simplefb_enable_and_mem_rsv(blob);
+	if (ret) {
+		printf("Failed to enable framebuffer DTS node\n");
+		return;
+	}
+
+	for (i = 0; i < ARRAY_SIZE(dt_addprops); i++) {
+		const char *node = dt_addprops[i].node;
+		const char *prop = dt_addprops[i].prop;
+		const void *val = dt_addprops[i].val;
+		const int len = dt_addprops[i].len;
+
+		ret = fdt_find_and_setprop(blob, node, prop, val, len, 1);
+		if (ret < 0)
+			printf("Failed to add property %s:%s, err=%s\n", node, prop,
+			       fdt_strerror(ret));
+		else
+			debug("Add property %s:%s\n", node, prop);
+	}
+
+	for (i = 0; i < ARRAY_SIZE(dt_delprops); i++) {
+		const char *node = dt_delprops[i][0];
+		const char *prop = dt_delprops[i][1];
+
+		offset = fdt_path_offset(blob, node);
+		if (offset < 0) {
+			printf("Missing node %s\n", node);
+			continue;
+		}
+
+		ret = fdt_delprop(blob, offset, prop);
+		if (ret < 0)
+			printf("Failed to delete property %s:%s\n", node, prop);
+		else
+			debug("Delete property %s:%s\n", node, prop);
+	}
+}
+
+int ft_board_setup(void *blob, struct bd_info *bd)
+{
+	if (IS_ENABLED(CONFIG_OF_LIBFDT) && IS_ENABLED(CONFIG_FDT_SIMPLEFB) &&
+	    IS_ENABLED(CONFIG_VIDEO))
+		smm_s2_setup_simplefb(blob);
+
+	return 0;
+}
Signature · 1 line
2.43.0
#26 lore raw

PATCH v2 24/25 imx8mn_bsh_smm_s2/pro: enable simple frame-buffer

In reply to Dario Binacchi

---

(no changes since v1)

 configs/imx8mn_bsh_smm_s2_defconfig    | 3 +++
 configs/imx8mn_bsh_smm_s2pro_defconfig | 3 +++
 2 files changed, 6 insertions(+)
configs/imx8mn_bsh_smm_s2_defconfig +3 -0
index f63948806ed0..fd463981d91f 100644
@@ -28,7 +28,9 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_FDT_SIMPLEFB=y
 CONFIG_DEFAULT_FDT_FILE="freescale/imx8mn-bsh-smm-s2.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2067
@@ -122,6 +124,7 @@ CONFIG_VIDEO=y
 CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y
 CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y
 CONFIG_VIDEO_MXS=y
+CONFIG_VIDEO_DT_SIMPLEFB=y
 CONFIG_BMP_16BPP=y
 CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
configs/imx8mn_bsh_smm_s2pro_defconfig +3 -0
index 713121eda886..304e8dd0266b 100644
@@ -29,7 +29,9 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_FDT_SIMPLEFB=y
 CONFIG_DEFAULT_FDT_FILE="freescale/imx8mn-bsh-smm-s2pro.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2067
@@ -111,6 +113,7 @@ CONFIG_VIDEO=y
 CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y
 CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y
 CONFIG_VIDEO_MXS=y
+CONFIG_VIDEO_DT_SIMPLEFB=y
 CONFIG_BMP_16BPP=y
 CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
Signature · 1 line
2.43.0
#27 lore raw

PATCH v2 25/25 imx8mn_bsh_smm_s2/pro: add splash screen with BSH logo

In reply to Dario Binacchi

Display the BSH logo with features VIDEO_LOGO and SPLASH_SCREEN on imx8mn_bsh_smm_s2/pro boards.

With CONFIG_SYS_VENDOR = "bsh", the logo bsh.bmp is selected, loaded at the address indicated by splashimage and centered with "splashpos=m,m".

---

(no changes since v1)

 configs/imx8mn_bsh_smm_s2_defconfig        |   3 +++
 configs/imx8mn_bsh_smm_s2pro_defconfig     |   3 +++
 include/configs/imx8mn_bsh_smm_s2.h        |   1 +
 include/configs/imx8mn_bsh_smm_s2_common.h |   4 ++++
 include/configs/imx8mn_bsh_smm_s2pro.h     |   1 +
 tools/logos/bsh.bmp                        | Bin 0 -> 10644 bytes
 6 files changed, 12 insertions(+)
 create mode 100644 tools/logos/bsh.bmp
configs/imx8mn_bsh_smm_s2_defconfig +3 -0
index fd463981d91f..ac61617814a7 100644
@@ -121,10 +121,13 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y
 CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y
 CONFIG_VIDEO_MXS=y
 CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
 CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
configs/imx8mn_bsh_smm_s2pro_defconfig +3 -0
index 304e8dd0266b..6e42f5451608 100644
@@ -110,10 +110,13 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_VIDEO=y
+CONFIG_VIDEO_LOGO=y
 CONFIG_VIDEO_LCD_SYNAPTICS_R63353=y
 CONFIG_VIDEO_BRIDGE_SAMSUNG_DSIM=y
 CONFIG_VIDEO_MXS=y
 CONFIG_VIDEO_DT_SIMPLEFB=y
+CONFIG_SPLASH_SCREEN=y
+CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
 CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
include/configs/imx8mn_bsh_smm_s2.h +1 -0
index deeed9c2f582..c8bd55fd3744 100644
@@ -38,6 +38,7 @@
 #define CFG_EXTRA_ENV_SETTINGS \
 	MEM_LAYOUT_ENV_SETTINGS \
 	NANDARGS \
+	SPLASH_ENV_SETTINGS \
 	BOOTENV
 
 #define PHYS_SDRAM_SIZE			SZ_256M
include/configs/imx8mn_bsh_smm_s2_common.h +4 -0
index 204fc4b31647..5d6b22e04139 100644
@@ -21,6 +21,10 @@
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"bootcmd_mfg=echo Running fastboot mode; fastboot usb 0\0" \
 
+#define SPLASH_ENV_SETTINGS \
+	"splashimage=0x5bb00000\0" \
+	"splashpos=m,m\0" \
+
 /* Link Definitions */
 
 #define CFG_SYS_INIT_RAM_ADDR	0x40000000
include/configs/imx8mn_bsh_smm_s2pro.h +1 -0
index 8619fdde7fdb..dd26e0b885d2 100644
@@ -25,6 +25,7 @@
 #define CFG_EXTRA_ENV_SETTINGS \
 	MEM_LAYOUT_ENV_SETTINGS \
 	EMMCARGS \
+	SPLASH_ENV_SETTINGS \
 	BOOTENV
 
 #define PHYS_SDRAM_SIZE			SZ_512M
tools/logos/bsh.bmp new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..5b6fb1ebd50d70c7f5ce4a51042271e9634d8d81
GIT binary patch
Signature · 1 line
2.43.0