[PATCH] arm: apple: Switch to board based text env
Janne Grunau
j at jannau.net
Fri May 1 00:31:16 CEST 2026
The main use case for u-boot on Apple silicon based devices is to
provide an EFI based bootloader for operating systems. This uses a
generic u-boot image with DTBs passed from an earlier boot loader
(m1n1). Use the generic board name "mac" for this purpose.
Signed-off-by: Janne Grunau <j at jannau.net>
---
While investigating env related changes I did convert the env for Apple
M1 devices to board based text file. It turned out that no changes to
the env were necessary but the text based env is much nicer than the
C preprocessor SYS_CONFIG header. Since u-boot is used in generic way a
single generic board "mac" is enough.
---
MAINTAINERS | 1 +
arch/arm/mach-apple/Kconfig | 16 +++++++++++++---
arch/arm/mach-apple/rtkit_helper.c | 1 +
board/apple/mac/mac.env | 4 ++++
configs/apple_m1_defconfig | 2 ++
drivers/iommu/apple_dart.c | 1 +
drivers/nvme/nvme_apple.c | 1 +
include/configs/apple.h | 18 ------------------
8 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index d4b527560aa..ca1aae896d7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -131,6 +131,7 @@ M: Mark Kettenis <kettenis at openbsd.org>
S: Maintained
F: arch/arm/include/asm/arch-apple/
F: arch/arm/mach-apple/
+F: board/apple/
F: configs/apple_m1_defconfig
F: drivers/iommu/apple_dart.c
F: drivers/nvme/nvme_apple.c
diff --git a/arch/arm/mach-apple/Kconfig b/arch/arm/mach-apple/Kconfig
index 294690ec0e8..fdc8c32152f 100644
--- a/arch/arm/mach-apple/Kconfig
+++ b/arch/arm/mach-apple/Kconfig
@@ -3,12 +3,22 @@ if ARCH_APPLE
config TEXT_BASE
default 0x00000000
-config SYS_CONFIG_NAME
- default "apple"
-
config SYS_SOC
default "apple"
+config SYS_VENDOR
+ default "apple"
+
+config SYS_BOARD
+ string "Board name"
+ default "mac"
+ help
+ This option contains information about board name.
+ Based on this option board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD> will
+ be used.
+ Apple silicon based devices are expected to use the generic board name
+ "mac".
+
config SYS_MALLOC_LEN
default 0x4000000
diff --git a/arch/arm/mach-apple/rtkit_helper.c b/arch/arm/mach-apple/rtkit_helper.c
index b7d60e15700..cbdc204f141 100644
--- a/arch/arm/mach-apple/rtkit_helper.c
+++ b/arch/arm/mach-apple/rtkit_helper.c
@@ -11,6 +11,7 @@
#include <asm/io.h>
#include <asm/arch/rtkit.h>
#include <linux/iopoll.h>
+#include <linux/sizes.h>
/* ASC registers */
#define REG_CPU_CTRL 0x0044
diff --git a/board/apple/mac/mac.env b/board/apple/mac/mac.env
new file mode 100644
index 00000000000..109379c8c67
--- /dev/null
+++ b/board/apple/mac/mac.env
@@ -0,0 +1,4 @@
+stdin=serial,usbkbd,spikbd
+stdout=vidconsole,serial
+stderr=vidconsole,serial
+boot_targets=nvme usb
diff --git a/configs/apple_m1_defconfig b/configs/apple_m1_defconfig
index 1ce69f2882a..6020cd3f215 100644
--- a/configs/apple_m1_defconfig
+++ b/configs/apple_m1_defconfig
@@ -29,3 +29,5 @@ CONFIG_SYS_WHITE_ON_BLACK=y
CONFIG_NO_FB_CLEAR=y
CONFIG_VIDEO_SIMPLE=y
CONFIG_GENERATE_SMBIOS_TABLE_VERBOSE=y
+CONFIG_SYS_VENDOR=apple
+CONFIG_SYS_BOARD=mac
diff --git a/drivers/iommu/apple_dart.c b/drivers/iommu/apple_dart.c
index bfd4ad20105..ebef28d0b9d 100644
--- a/drivers/iommu/apple_dart.c
+++ b/drivers/iommu/apple_dart.c
@@ -6,6 +6,7 @@
#include <cpu_func.h>
#include <dm.h>
#include <iommu.h>
+#include <linux/sizes.h>
#include <lmb.h>
#include <memalign.h>
#include <asm/io.h>
diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
index 7e7538553e3..94c1cf6e761 100644
--- a/drivers/nvme/nvme_apple.c
+++ b/drivers/nvme/nvme_apple.c
@@ -13,6 +13,7 @@
#include <asm/arch/rtkit.h>
#include <asm/arch/sart.h>
#include <linux/iopoll.h>
+#include <linux/sizes.h>
/* ASC registers */
#define REG_CPU_CTRL 0x0044
diff --git a/include/configs/apple.h b/include/configs/apple.h
deleted file mode 100644
index 1e08b114480..00000000000
--- a/include/configs/apple.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#include <linux/sizes.h>
-
-/* Environment */
-#define ENV_DEVICE_SETTINGS \
- "stdin=serial,usbkbd,spikbd\0" \
- "stdout=vidconsole,serial\0" \
- "stderr=vidconsole,serial\0"
-
-#define BOOT_TARGETS "nvme usb"
-
-#define CFG_EXTRA_ENV_SETTINGS \
- ENV_DEVICE_SETTINGS \
- "boot_targets=" BOOT_TARGETS "\0"
-
-#endif
---
base-commit: 88dc2788777babfd6322fa655df549a019aa1e69
change-id: 20260501-apple-board-env-text-8e6054a2d388
Best regards,
--
Janne Grunau <j at jannau.net>
More information about the U-Boot
mailing list