public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x
@ 2026-04-16 12:14 Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 2/9] m68k: dts: stmark2: enable esdhc Angelo Dureghello
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

Add mmc support for the mcf5441x family. There is only one esdhc
controller for this cpu family.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 arch/m68k/dts/mcf5441x.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/m68k/dts/mcf5441x.dtsi b/arch/m68k/dts/mcf5441x.dtsi
index dcca36312f5..7cd6072d4a5 100644
--- a/arch/m68k/dts/mcf5441x.dtsi
+++ b/arch/m68k/dts/mcf5441x.dtsi
@@ -163,5 +163,13 @@
 			clock-frequency = <100000>;
 			status = "disabled";
 		};
+
+		esdhc: mmc@0xfc0cc000 {
+			compatible = "fsl,esdhc";
+			reg = <0xfc0cc000 0x8000>;
+			non-removable;
+			bus-width = <4>;
+			status = "disabled";
+		};
 	};
 };
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/9] m68k: dts: stmark2: enable esdhc
  2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
@ 2026-04-16 12:14 ` Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 3/9] board: stmark2: add sd boot command Angelo Dureghello
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

Enable esdhc device.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 arch/m68k/dts/stmark2.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/m68k/dts/stmark2.dts b/arch/m68k/dts/stmark2.dts
index 3ba68b77d64..8e196fa65ff 100644
--- a/arch/m68k/dts/stmark2.dts
+++ b/arch/m68k/dts/stmark2.dts
@@ -45,3 +45,7 @@
 &i2c0 {
 	status = "okay";
 };
+
+&esdhc {
+	status = "okay";
+};
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/9] board: stmark2: add sd boot command
  2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 2/9] m68k: dts: stmark2: enable esdhc Angelo Dureghello
@ 2026-04-16 12:14 ` Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 4/9] board: stmark2: remove old garbage Angelo Dureghello
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

Add command to boot from sd.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 include/configs/stmark2.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/configs/stmark2.h b/include/configs/stmark2.h
index c8a39e191a2..a7afbb3be1f 100644
--- a/include/configs/stmark2.h
+++ b/include/configs/stmark2.h
@@ -14,9 +14,12 @@
 	board/sysam/stmark2/sbf_dram_init.o (.text*)
 
 #define CFG_EXTRA_ENV_SETTINGS				\
+	"boot_sd=load mmc 0:1 ${loadaddr} uImage; "		\
+		"load mmc 0:1 ${loadaddr_ramfs} uRamfs\0"	\
 	"kern_size=0x700000\0"					\
-	"loadaddr=0x40001000\0"					\
+	"loadaddr=0x42000000\0"					\
 		"-(rootfs)\0"					\
+	"loadaddr_ramfs=0x43000000\0"				\
 	"update_uboot=loady ${loadaddr}; "			\
 		"sf probe 0:1 50000000; "			\
 		"sf erase 0 0x80000; "				\
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/9] board: stmark2: remove old garbage
  2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 2/9] m68k: dts: stmark2: enable esdhc Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 3/9] board: stmark2: add sd boot command Angelo Dureghello
@ 2026-04-16 12:14 ` Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 5/9] configs: stmark2: add support for mmc Angelo Dureghello
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

Remove old erroneous garbage.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 include/configs/stmark2.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/stmark2.h b/include/configs/stmark2.h
index a7afbb3be1f..c1096398359 100644
--- a/include/configs/stmark2.h
+++ b/include/configs/stmark2.h
@@ -18,7 +18,6 @@
 		"load mmc 0:1 ${loadaddr_ramfs} uRamfs\0"	\
 	"kern_size=0x700000\0"					\
 	"loadaddr=0x42000000\0"					\
-		"-(rootfs)\0"					\
 	"loadaddr_ramfs=0x43000000\0"				\
 	"update_uboot=loady ${loadaddr}; "			\
 		"sf probe 0:1 50000000; "			\
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/9] configs: stmark2: add support for mmc
  2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
                   ` (2 preceding siblings ...)
  2026-04-16 12:14 ` [PATCH 4/9] board: stmark2: remove old garbage Angelo Dureghello
@ 2026-04-16 12:14 ` Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 6/9] configs: stmark2: add bdinfo command Angelo Dureghello
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

Add support for mmc.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 configs/stmark2_defconfig | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/configs/stmark2_defconfig b/configs/stmark2_defconfig
index ae1fa34df2a..763cbac158d 100644
--- a/configs/stmark2_defconfig
+++ b/configs/stmark2_defconfig
@@ -3,19 +3,19 @@ CONFIG_TEXT_BASE=0x47E00000
 CONFIG_SYS_MALLOC_LEN=0x40000
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_ENV_SIZE=0x2000
-CONFIG_ENV_OFFSET=0x40000
+CONFIG_ENV_OFFSET=0x80000
 CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_DEFAULT_DEVICE_TREE="stmark2"
-CONFIG_SYS_MONITOR_LEN=262144
-CONFIG_SYS_LOAD_ADDR=0x40010000
+CONFIG_SYS_MONITOR_LEN=327680
+CONFIG_SYS_LOAD_ADDR=0x42000000
 CONFIG_TARGET_STMARK2=y
 CONFIG_SYS_BARGSIZE=256
 CONFIG_SYS_MONITOR_BASE=0x47E00400
 CONFIG_TIMESTAMP=y
 CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 rw rootfstype=ramfs rdinit=/bin/init devtmpfs.mount=1"
+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 rw rootfstype=ramfs rdinit=/sbin/init devtmpfs.mount=1"
 CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="sf probe 0:1 50000000; sf read ${loadaddr} 0x100000 ${kern_size}; bootm ${loadaddr}"
+CONFIG_BOOTCOMMAND="run boot_sd; bootm ${loadaddr} ${loadaddr_ramfs}"
 CONFIG_SYS_PBSIZE=283
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_MALLOC_BOOTPARAMS=y
@@ -34,6 +34,12 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nor0=spi-flash.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-flash.0:1m(u-boot),7m(kernel),-(rootfs)"
+CONFIG_CMD_MMC=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_DOS_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_SPI_CS=1
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
@@ -43,6 +49,8 @@ CONFIG_NO_NET=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_FSL=y
 CONFIG_MTD=y
+CONFIG_MMC=y
+CONFIG_FSL_ESDHC_IMX=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_ISSI=y
 CONFIG_SPI_FLASH_MTD=y
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/9] configs: stmark2: add bdinfo command
  2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
                   ` (3 preceding siblings ...)
  2026-04-16 12:14 ` [PATCH 5/9] configs: stmark2: add support for mmc Angelo Dureghello
@ 2026-04-16 12:14 ` Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 7/9] mmc: Kconfig: allows m68k to use esdhc imx driver Angelo Dureghello
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

Enable bdinfo command.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 configs/stmark2_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/stmark2_defconfig b/configs/stmark2_defconfig
index 763cbac158d..0646197f3cb 100644
--- a/configs/stmark2_defconfig
+++ b/configs/stmark2_defconfig
@@ -22,7 +22,6 @@ CONFIG_SYS_MALLOC_BOOTPARAMS=y
 CONFIG_HUSH_PARSER=y
 # CONFIG_CMDLINE_EDITING is not set
 CONFIG_SYS_PROMPT="stmark2 $ "
-# CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_EXPORTENV is not set
 # CONFIG_CMD_IMPORTENV is not set
@@ -39,6 +38,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_BDI=y
 CONFIG_DOS_PARTITION=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_ENV_SPI_CS=1
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/9] mmc: Kconfig: allows m68k to use esdhc imx driver
  2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
                   ` (4 preceding siblings ...)
  2026-04-16 12:14 ` [PATCH 6/9] configs: stmark2: add bdinfo command Angelo Dureghello
@ 2026-04-16 12:14 ` Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 8/9] m68k: mcf5441x: create stub to use imx drivers Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 9/9] m68k: set proper u-boot image size for initial boot Angelo Dureghello
  7 siblings, 0 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

Allow cpu families as mcf5441x (m68k) to use the fsl_esdhc_imx driver
since the hardware ip module is the same.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 drivers/mmc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 22bd3a972bd..24bd16ad5f3 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -924,7 +924,7 @@ config ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE
 
 config FSL_ESDHC_IMX
 	bool "Freescale/NXP i.MX eSDHC controller support"
-	depends on MACH_IMX
+	depends on MACH_IMX || M68K
 	help
 	  This selects support for the i.MX eSDHC (Enhanced Secure Digital Host
 	  Controller) found on numerous Freescale/NXP SoCs.
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 8/9] m68k: mcf5441x: create stub to use imx drivers
  2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
                   ` (5 preceding siblings ...)
  2026-04-16 12:14 ` [PATCH 7/9] mmc: Kconfig: allows m68k to use esdhc imx driver Angelo Dureghello
@ 2026-04-16 12:14 ` Angelo Dureghello
  2026-04-16 12:14 ` [PATCH 9/9] m68k: set proper u-boot image size for initial boot Angelo Dureghello
  7 siblings, 0 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

Some NXP imx hardware ip module as the esdhc controller are exactly the
same in some new ColdFire cpus. For the specific case, mcf5441x needs to
use the existing fsl_esdhc_imx.c driver for the esdhc device.

Create a stub to be able to use NXP "imx" serie drivers as the
fsl_esdhc_imx in the ColdFire architecture.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 arch/m68k/Kconfig                           |  1 +
 arch/m68k/include/asm/arch-mcf5445x/clock.h | 19 +++++++++++++++++
 arch/m68k/lib/Makefile                      |  1 +
 arch/m68k/lib/clock.c                       | 23 +++++++++++++++++++++
 4 files changed, 44 insertions(+)
 create mode 100644 arch/m68k/include/asm/arch-mcf5445x/clock.h
 create mode 100644 arch/m68k/lib/clock.c

diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 6ce8f577e3a..00e89bd0a62 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -62,6 +62,7 @@ config MCF5441x
 	select DM
         select DM_SERIAL
 	select ARCH_COLDFIRE
+	select CREATE_ARCH_SYMLINK
 	bool
 
 config M680x0
diff --git a/arch/m68k/include/asm/arch-mcf5445x/clock.h b/arch/m68k/include/asm/arch-mcf5445x/clock.h
new file mode 100644
index 00000000000..10ceecafcea
--- /dev/null
+++ b/arch/m68k/include/asm/arch-mcf5445x/clock.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * ColdFire clock support
+ *
+ * Copyright 2026 Kernelspace.
+ * Angelo Dureghello <angelo@kernel-space.org>
+ */
+
+#ifndef __CLOCK_H
+#define __CLOCK_H
+
+/* Stub to use fsl/nxp drivers. */
+enum mxc_clock {
+	MXC_ESDHC_CLK,
+};
+
+int mxc_get_clock(enum mxc_clock clk);
+
+#endif /* __CLOCK_H */
diff --git a/arch/m68k/lib/Makefile b/arch/m68k/lib/Makefile
index cf93715637a..9ad67c4272c 100644
--- a/arch/m68k/lib/Makefile
+++ b/arch/m68k/lib/Makefile
@@ -9,3 +9,4 @@ lib-$(CONFIG_USE_PRIVATE_LIBGCC) += lshrdi3.o muldi3.o ashldi3.o ashrdi3.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-$(CONFIG_ARCH_COLDFIRE) += cache.o interrupts.o time.o traps.o bdinfo.o fec.o
+obj-$(CONFIG_MCF5441x) += clock.o
diff --git a/arch/m68k/lib/clock.c b/arch/m68k/lib/clock.c
new file mode 100644
index 00000000000..5d9aeed96c3
--- /dev/null
+++ b/arch/m68k/lib/clock.c
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2026 Kernelspace
+ * Angelo Dureghello <angelo@kernel-space.org>
+ */
+
+#include <config.h>
+#include <asm/arch/clock.h>
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+/*
+ * Stub to use existing nxp/fsl drivers.
+ */
+int mxc_get_clock(enum mxc_clock clk)
+{
+	if (clk == MXC_ESDHC_CLK)
+		return gd->arch.sdhc_clk;
+
+	printf("Unsupported MXC CLK: %d\n", clk);
+
+	return 0;
+}
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 9/9] m68k: set proper u-boot image size for initial boot
  2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
                   ` (6 preceding siblings ...)
  2026-04-16 12:14 ` [PATCH 8/9] m68k: mcf5441x: create stub to use imx drivers Angelo Dureghello
@ 2026-04-16 12:14 ` Angelo Dureghello
  7 siblings, 0 replies; 9+ messages in thread
From: Angelo Dureghello @ 2026-04-16 12:14 UTC (permalink / raw)
  To: trini; +Cc: visitorckw, u-boot, sjg, Angelo Dureghello

There is a value of 256K hardcoded as u-boot image size. This
produce bank tty as soon as the image size grows over the limit.
Fix it by using value preset by CONFIG_SYS_MONITOR_LEN.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 arch/m68k/cpu/mcf5445x/start.S | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/m68k/cpu/mcf5445x/start.S b/arch/m68k/cpu/mcf5445x/start.S
index f0264671d38..ae0e7c35d87 100644
--- a/arch/m68k/cpu/mcf5445x/start.S
+++ b/arch/m68k/cpu/mcf5445x/start.S
@@ -114,7 +114,7 @@ vector192_255:
 	/* Image header: chksum 4 bytes, len 4 bytes, img dest 4 bytes */
 asm_sbf_img_hdr:
 	.long	0x00000000		/* checksum, not yet implemented */
-	.long	0x00040000		/* image length */
+	.long	CONFIG_SYS_MONITOR_LEN	/* image length */
 	.long	CONFIG_TEXT_BASE	/* image to be relocated at */
 
 asm_dram_init:
@@ -292,7 +292,6 @@ asm_dspi_rd_status:
 	move.b	(%a3), %d1
 	rts
 #endif /* CONFIG_CF_SBF */
-
 #ifdef CONFIG_SYS_NAND_BOOT
 	/* copy 4 boot pages to dram as soon as possible */
 	/* each page is 996 bytes (1056 total with 60 ECC bytes */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-04-16 12:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 12:14 [PATCH 1/9] m68k: dts: mcf5441x: add mmc device for mcf5441x Angelo Dureghello
2026-04-16 12:14 ` [PATCH 2/9] m68k: dts: stmark2: enable esdhc Angelo Dureghello
2026-04-16 12:14 ` [PATCH 3/9] board: stmark2: add sd boot command Angelo Dureghello
2026-04-16 12:14 ` [PATCH 4/9] board: stmark2: remove old garbage Angelo Dureghello
2026-04-16 12:14 ` [PATCH 5/9] configs: stmark2: add support for mmc Angelo Dureghello
2026-04-16 12:14 ` [PATCH 6/9] configs: stmark2: add bdinfo command Angelo Dureghello
2026-04-16 12:14 ` [PATCH 7/9] mmc: Kconfig: allows m68k to use esdhc imx driver Angelo Dureghello
2026-04-16 12:14 ` [PATCH 8/9] m68k: mcf5441x: create stub to use imx drivers Angelo Dureghello
2026-04-16 12:14 ` [PATCH 9/9] m68k: set proper u-boot image size for initial boot Angelo Dureghello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox