[PATCH 5/7] board: stemmy: Add basic Fastboot support

Stephan Gerhold stephan at gerhold.net
Sat Aug 7 15:07:22 CEST 2021


Make use of the new drivers for ARM U8500 introduced in the U-Boot
2021.10 merge window by adding basic support for USB Fastboot with
the "stemmy" board. As a first step this will always boot directly
into USB Fastboot for now with the console displayed on the screen
to make that obvious.

Samsung uses quite strange GPT partition labels on these boards,
so also add a bunch of fastboot_partition_alias_* to make this more
easy to use.

Signed-off-by: Stephan Gerhold <stephan at gerhold.net>
---

 arch/arm/dts/ste-ux500-samsung-stemmy.dts | 16 ++++++++++++++
 configs/stemmy_defconfig                  | 14 ++++++++++++
 include/configs/stemmy.h                  | 27 +++++++++++++++++++++++
 3 files changed, 57 insertions(+)

diff --git a/arch/arm/dts/ste-ux500-samsung-stemmy.dts b/arch/arm/dts/ste-ux500-samsung-stemmy.dts
index 7e7f4c823a..14be86086b 100644
--- a/arch/arm/dts/ste-ux500-samsung-stemmy.dts
+++ b/arch/arm/dts/ste-ux500-samsung-stemmy.dts
@@ -12,9 +12,25 @@
 	};
 
 	soc {
+		/* eMMC */
+		mmc at 80005000 {
+			status = "okay";
+
+			arm,primecell-periphid = <0x10480180>;
+			max-frequency = <100000000>;
+			bus-width = <8>;
+
+			non-removable;
+			cap-mmc-highspeed;
+		};
+
 		/* Debugging console UART */
 		uart at 80007000 {
 			status = "okay";
 		};
+
+		mcde at a0350000 {
+			status = "okay";
+		};
 	};
 };
diff --git a/configs/stemmy_defconfig b/configs/stemmy_defconfig
index f31960b814..1dbec70f36 100644
--- a/configs/stemmy_defconfig
+++ b/configs/stemmy_defconfig
@@ -3,6 +3,8 @@ CONFIG_ARCH_U8500=y
 CONFIG_SYS_TEXT_BASE=0x100000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_DEFAULT_DEVICE_TREE="ste-ux500-samsung-stemmy"
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="run fastbootcmd"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CONFIG=y
@@ -14,5 +16,17 @@ CONFIG_CMD_PART=y
 CONFIG_CMD_GETTIME=y
 CONFIG_EFI_PARTITION=y
 # CONFIG_NET is not set
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x18100000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 # CONFIG_MMC_HW_PARTITIONING is not set
+CONFIG_USB=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_VENDOR_NUM=0x04e8
+CONFIG_USB_GADGET_PRODUCT_NUM=0x685d
+CONFIG_DM_VIDEO=y
+CONFIG_SYS_WHITE_ON_BLACK=y
+CONFIG_VIDEO_MCDE_SIMPLE=y
 # CONFIG_EFI_LOADER is not set
diff --git a/include/configs/stemmy.h b/include/configs/stemmy.h
index b94ef91c2b..9721c21d61 100644
--- a/include/configs/stemmy.h
+++ b/include/configs/stemmy.h
@@ -26,4 +26,31 @@
 /* Generate initrd atag for downstream kernel (others are copied in stemmy.c) */
 #define CONFIG_INITRD_TAG
 
+/* Linux does not boot if FDT / initrd is loaded to end of RAM */
+#define BOOT_ENV \
+	"fdt_high=0x6000000\0" \
+	"initrd_high=0x6000000\0"
+
+#define CONSOLE_ENV \
+	"stdin=serial\0" \
+	"stdout=serial,vidconsole\0" \
+	"stderr=serial,vidconsole\0"
+
+#define FASTBOOT_ENV \
+	"fastboot_partition_alias_boot=Kernel\0" \
+	"fastboot_partition_alias_recovery=Kernel2\0" \
+	"fastboot_partition_alias_system=SYSTEM\0" \
+	"fastboot_partition_alias_cache=CACHEFS\0" \
+	"fastboot_partition_alias_hidden=HIDDEN\0" \
+	"fastboot_partition_alias_userdata=DATAFS\0"
+
+#define BOOTCMD_ENV \
+	"fastbootcmd=echo '*** FASTBOOT MODE ***'; fastboot usb 0\0"
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	BOOT_ENV \
+	CONSOLE_ENV \
+	FASTBOOT_ENV \
+	BOOTCMD_ENV
+
 #endif
-- 
2.32.0



More information about the U-Boot mailing list