Skip to contentSkip to conversation

configs: apple: Switch to standard boot + small adjustments

PATCH In review Janne Grunau 4 participants 11 messages Apr 18, 2024 – Apr 22, 2024 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v2 cover configs: apple: Switch to standard boot + small adjustments

This series contains a few misc config changes for Apple silicon systems:
- switch from the deprecated distro boot scripts to standard boot
- allows EFI console resizing based on the video console size
- enables 16x32 bitmap fonts as Apple devices come with high DPI displays
- enables 64-bit LBA addressing

---
Changes in v2:
- added Reviewed-by: tags
- switched to BOOTSTD_FULL to enable efi_bootmgr and make interactive
use easier
- override BOOTCOMMAND to not list the bootflows
- rebased onto v2024.04
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Hector Martin (1):
apple_m1_defconfig: Turn on CONFIG_SYS_64BIT_LBA

Janne Grunau (4):
configs: apple: Use "vidconsole,serial" as stdout/stderr
configs: apple: Enable CMD_SELECT_FONT and FONT_16X32
arm: apple: Switch to standard boot
arm: apple: Do not list bootflows on boot

 arch/arm/Kconfig           |  2 +-
 configs/apple_m1_defconfig |  4 ++++
 include/configs/apple.h    | 24 ++++--------------------
 3 files changed, 9 insertions(+), 21 deletions(-)

---
base-commit: 25049ad560826f7dc1c4740883b0016014a59789
change-id: 20240317-apple_config-981fcd9028b9

Best regards,

Signature · 1 line
Janne Grunau <[email protected]>
#1 lore raw

PATCH v2 1/5 apple_m1_defconfig: Turn on CONFIG_SYS_64BIT_LBA

From: Hector Martin <[email protected]>

This makes USB HDDs >2TiB work. The only reason this hasn't bitten us for the internal NVMe yet is the 4K sector size, because the largest SSD Apple sells is 8TB and we can handle up to 16TiB with that sector size. Close call.

---
 configs/apple_m1_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/apple_m1_defconfig +1 -0
index e00d72e8be..31d966f0ab 100644
@@ -10,6 +10,7 @@ CONFIG_SYS_PBSIZE=276
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_LATE_INIT=y
 # CONFIG_NET is not set
+CONFIG_SYS_64BIT_LBA=y
 CONFIG_APPLE_SPI_KEYB=y
 # CONFIG_MMC is not set
 CONFIG_NVME_APPLE=y
Signature · 1 line
2.44.0
#2 lore raw

PATCH v2 2/5 configs: apple: Use "vidconsole,serial" as stdout/stderr

In reply to Janne Grunau

From: Janne Grunau <[email protected]>

The display size querying in efi_console relies on this order. The display should be the primary output device and should be used to display more than 80x25 chars.

---
 include/configs/apple.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/configs/apple.h +2 -2
index 0576bc04c9..a70440b3ad 100644
@@ -6,8 +6,8 @@
 /* Environment */
 #define ENV_DEVICE_SETTINGS \
 	"stdin=serial,usbkbd,spikbd\0" \
-	"stdout=serial,vidconsole\0" \
-	"stderr=serial,vidconsole\0"
+	"stdout=vidconsole,serial\0" \
+	"stderr=vidconsole,serial\0"
 
 #if IS_ENABLED(CONFIG_CMD_NVME)
 	#define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
Signature · 1 line
2.44.0
#3 lore raw

PATCH v2 3/5 configs: apple: Enable CMD_SELECT_FONT and FONT_16X32

In reply to Janne Grunau

Apple devices have high DPI displays so the larger fonts are preferable for improved readability. This does not yet change the used font based on the display's pixel density so the standard 8x16 font is still used by default.

---
 configs/apple_m1_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/apple_m1_defconfig +2 -0
index 31d966f0ab..c30aec7c55 100644
@@ -9,6 +9,7 @@ CONFIG_SYS_PBSIZE=276
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_LATE_INIT=y
+CONFIG_CMD_SELECT_FONT=y
 # CONFIG_NET is not set
 CONFIG_SYS_64BIT_LBA=y
 CONFIG_APPLE_SPI_KEYB=y
@@ -19,6 +20,7 @@ CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_PCI=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_KEYBOARD=y
+CONFIG_VIDEO_FONT_16X32=y
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_NO_FB_CLEAR=y
 CONFIG_VIDEO_SIMPLE=y
Signature · 1 line
2.44.0
#4 lore raw

PATCH v2 4/5 arm: apple: Switch to standard boot

In reply to Janne Grunau

Use standard boot instead of the distro boot scripts. Use BOOTSTD_FULL instead of BOOTSTD_DEFAULTS for easier interactive use.

---
 arch/arm/Kconfig        |  2 +-
 include/configs/apple.h | 20 ++------------------
 2 files changed, 3 insertions(+), 19 deletions(-)
arch/arm/Kconfig +1 -1
index 01d6556c42..9b83b2e6f8 100644
@@ -1034,7 +1034,7 @@ config ARCH_APPLE
 	select USB
 	imply CMD_DM
 	imply CMD_GPT
-	imply DISTRO_DEFAULTS
+	imply BOOTSTD_FULL
 	imply OF_HAS_PRIOR_STAGE
 
 config ARCH_OWL
include/configs/apple.h +2 -18
index a70440b3ad..1e08b11448 100644
@@ -9,26 +9,10 @@
 	"stdout=vidconsole,serial\0" \
 	"stderr=vidconsole,serial\0"
 
-#if IS_ENABLED(CONFIG_CMD_NVME)
-	#define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
-#else
-	#define BOOT_TARGET_NVME(func)
-#endif
-
-#if IS_ENABLED(CONFIG_CMD_USB)
-	#define BOOT_TARGET_USB(func) func(USB, usb, 0)
-#else
-	#define BOOT_TARGET_USB(func)
-#endif
-
-#define BOOT_TARGET_DEVICES(func) \
-	BOOT_TARGET_NVME(func) \
-	BOOT_TARGET_USB(func)
-
-#include <config_distro_bootcmd.h>
+#define BOOT_TARGETS	"nvme usb"
 
 #define CFG_EXTRA_ENV_SETTINGS \
 	ENV_DEVICE_SETTINGS \
-	BOOTENV
+	"boot_targets=" BOOT_TARGETS "\0"
 
 #endif
Signature · 1 line
2.44.0
Reviewed-by on v2 4/5
#5 lore raw

Re: [PATCH v2 4/5] arm: apple: Switch to standard boot

Quoted 60 lines · On Thu, Apr 18, 2024 at 3:00 PM Janne Grunau via B4 Relay…

From: Janne Grunau <[email protected]>

Use standard boot instead of the distro boot scripts. Use BOOTSTD_FULL instead of BOOTSTD_DEFAULTS for easier interactive use.

---
 arch/arm/Kconfig        |  2 +-
 include/configs/apple.h | 20 ++------------------
 2 files changed, 3 insertions(+), 19 deletions(-)
arch/arm/Kconfig +1 -1
index 01d6556c42..9b83b2e6f8 100644
@@ -1034,7 +1034,7 @@ config ARCH_APPLE
        select USB
        imply CMD_DM
        imply CMD_GPT
-       imply DISTRO_DEFAULTS
+       imply BOOTSTD_FULL
        imply OF_HAS_PRIOR_STAGE
 
 config ARCH_OWL
include/configs/apple.h +2 -19
index a70440b3ad..1e08b11448 100644
@@ -9,26 +9,10 @@
        "stdout=vidconsole,serial\0" \
        "stderr=vidconsole,serial\0"
 
-#if IS_ENABLED(CONFIG_CMD_NVME)
-       #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
-#else
-       #define BOOT_TARGET_NVME(func)
-#endif
-
-#if IS_ENABLED(CONFIG_CMD_USB)
-       #define BOOT_TARGET_USB(func) func(USB, usb, 0)
-#else
-       #define BOOT_TARGET_USB(func)
-#endif
-
-#define BOOT_TARGET_DEVICES(func) \
-       BOOT_TARGET_NVME(func) \
-       BOOT_TARGET_USB(func)
-
-#include <config_distro_bootcmd.h>
+#define BOOT_TARGETS   "nvme usb"
 
 #define CFG_EXTRA_ENV_SETTINGS \
        ENV_DEVICE_SETTINGS \
-       BOOTENV
+       "boot_targets=" BOOT_TARGETS "\0"
 
 #endif
 
--
Quoted 2 lines

2.44.0

Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
Reviewed-by on v2 4/5
#6 lore raw

Re: [PATCH v2 4/5] arm: apple: Switch to standard boot

In reply to Janne Grunau
Quoted 9 lines

From: Janne Grunau via B4 Relay <[email protected]>
Date: Thu, 18 Apr 2024 21:00:28 +0200

From: Janne Grunau <[email protected]>

Use standard boot instead of the distro boot scripts. Use BOOTSTD_FULL instead of BOOTSTD_DEFAULTS for easier interactive use.

Quoted 58 lines
---
 arch/arm/Kconfig        |  2 +-
 include/configs/apple.h | 20 ++------------------
 2 files changed, 3 insertions(+), 19 deletions(-)
arch/arm/Kconfig +1 -1
index 01d6556c42..9b83b2e6f8 100644
@@ -1034,7 +1034,7 @@ config ARCH_APPLE
 	select USB
 	imply CMD_DM
 	imply CMD_GPT
-	imply DISTRO_DEFAULTS
+	imply BOOTSTD_FULL
 	imply OF_HAS_PRIOR_STAGE
 
 config ARCH_OWL
include/configs/apple.h +2 -18
index a70440b3ad..1e08b11448 100644
@@ -9,26 +9,10 @@
 	"stdout=vidconsole,serial\0" \
 	"stderr=vidconsole,serial\0"
 
-#if IS_ENABLED(CONFIG_CMD_NVME)
-	#define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
-#else
-	#define BOOT_TARGET_NVME(func)
-#endif
-
-#if IS_ENABLED(CONFIG_CMD_USB)
-	#define BOOT_TARGET_USB(func) func(USB, usb, 0)
-#else
-	#define BOOT_TARGET_USB(func)
-#endif
-
-#define BOOT_TARGET_DEVICES(func) \
-	BOOT_TARGET_NVME(func) \
-	BOOT_TARGET_USB(func)
-
-#include <config_distro_bootcmd.h>
+#define BOOT_TARGETS	"nvme usb"
 
 #define CFG_EXTRA_ENV_SETTINGS \
 	ENV_DEVICE_SETTINGS \
-	BOOTENV
+	"boot_targets=" BOOT_TARGETS "\0"
 
 #endif
Signature · 2 lines
-- 
2.44.0
#7 lore raw

PATCH v2 5/5 arm: apple: Do not list bootflows on boot

In reply to Janne Grunau

The bootflow list is only seen briefly and is probably more confusing than helpful.

---
 configs/apple_m1_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/apple_m1_defconfig +1 -0
index c30aec7c55..4eac1a9e2d 100644
@@ -8,6 +8,7 @@ CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=276
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_BOOTCOMMAND="bootflow scan -b"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_CMD_SELECT_FONT=y
 # CONFIG_NET is not set
Signature · 1 line
2.44.0
Reviewed-by on v2 5/5
#8 lore raw

Re: [PATCH v2 5/5] arm: apple: Do not list bootflows on boot

Quoted 25 lines · On Thu, Apr 18, 2024 at 3:00 PM Janne Grunau via B4 Relay…

From: Janne Grunau <[email protected]>

The bootflow list is only seen briefly and is probably more confusing than helpful.

---
 configs/apple_m1_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/apple_m1_defconfig +1 -1
index c30aec7c55..4eac1a9e2d 100644
@@ -8,6 +8,7 @@ CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=276
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_BOOTCOMMAND="bootflow scan -b"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_CMD_SELECT_FONT=y
 # CONFIG_NET is not set
 
--
Quoted 2 lines

2.44.0

Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
Reviewed-by on v2 5/5
#9 lore raw

Re: [PATCH v2 5/5] arm: apple: Do not list bootflows on boot

In reply to Janne Grunau
Quoted 7 lines

From: Janne Grunau via B4 Relay <[email protected]>
Date: Thu, 18 Apr 2024 21:00:29 +0200

From: Janne Grunau <[email protected]>

The bootflow list is only seen briefly and is probably more confusing than helpful.

To be honest, I think that applies to all boards using BOOTSSTD_FILL. Which probably means the -l should be dropped from the default BOOTCOMMAND for BOOTSTD_FULL. But until that happens:

Quoted 25 lines
---
 configs/apple_m1_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/apple_m1_defconfig +1 -0
index c30aec7c55..4eac1a9e2d 100644
@@ -8,6 +8,7 @@ CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=276
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_BOOTCOMMAND="bootflow scan -b"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_CMD_SELECT_FONT=y
 # CONFIG_NET is not set
Signature · 2 lines
-- 
2.44.0
#10 lore raw
In reply to Janne Grunau
Quoted 9 lines · Janne Grunau

This series contains a few misc config changes for Apple silicon systems:
- switch from the deprecated distro boot scripts to standard boot
- allows EFI console resizing based on the video console size
- enables 16x32 bitmap fonts as Apple devices come with high DPI displays
- enables 64-bit LBA addressing

[...]

Applied to u-boot/master, thanks!

Signature · 1 line
Tom