[PATCH 2/3] board: stmark2: add mmc support

Angelo Dureghello angelo.dureghello at timesys.com
Fri Feb 24 01:52:09 CET 2023


From: Angelo Durgehello <angelo at kernel-space.org>

Enable mmc boot.

Signed-off-by: Angelo Durgehello <angelo at kernel-space.org>
---
 arch/m68k/dts/stmark2.dts |  4 ++++
 configs/stmark2_defconfig | 12 ++++++++++--
 include/configs/stmark2.h |  6 ++++--
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/dts/stmark2.dts b/arch/m68k/dts/stmark2.dts
index 3688651e59..9532a01b2f 100644
--- a/arch/m68k/dts/stmark2.dts
+++ b/arch/m68k/dts/stmark2.dts
@@ -41,3 +41,7 @@
 	status = "okay";
 	mii-base = <0>;
 };
+
+&esdhc1 {
+	status = "okay";
+};
diff --git a/configs/stmark2_defconfig b/configs/stmark2_defconfig
index ae7a9cf6da..ab95baa148 100644
--- a/configs/stmark2_defconfig
+++ b/configs/stmark2_defconfig
@@ -14,9 +14,9 @@ CONFIG_SYS_MONITOR_LEN=262144
 CONFIG_TIMESTAMP=y
 CONFIG_SYS_MONITOR_BASE=0x47E00400
 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_DISPLAY_BOARDINFO is not set
 CONFIG_SYS_MALLOC_BOOTPARAMS=y
 CONFIG_HUSH_PARSER=y
@@ -32,6 +32,12 @@ CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_MTDPARTS=y
+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_MTDIDS_DEFAULT="nor0=spi-flash.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-flash.0:1m(u-boot),7m(kernel),-(rootfs)"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
@@ -41,6 +47,8 @@ CONFIG_USE_HOSTNAME=y
 CONFIG_HOSTNAME="stmark2"
 # CONFIG_NET is not set
 CONFIG_MTD=y
+CONFIG_MMC=y
+CONFIG_FSL_ESDHC_IMX=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_SPI_FLASH_ISSI=y
diff --git a/include/configs/stmark2.h b/include/configs/stmark2.h
index 19589be270..ddb85cc7d1 100644
--- a/include/configs/stmark2.h
+++ b/include/configs/stmark2.h
@@ -13,10 +13,12 @@
 #define LDS_BOARD_TEXT						\
 	board/sysam/stmark2/sbf_dram_init.o (.text*)
 
-#define CFG_EXTRA_ENV_SETTINGS				\
+#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"					\
-		"-(rootfs)\0"					\
+	"loadaddr_ramfs=0x41001000\0"				\
 	"update_uboot=loady ${loadaddr}; "			\
 		"sf probe 0:1 50000000; "			\
 		"sf erase 0 0x80000; "				\
-- 
2.39.1



More information about the U-Boot mailing list