From 35361d8b4556cc0b6d4b4299412b41f074caa4db Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Thu, 18 Apr 2024 21:00:25 +0200 Subject: [PATCH 1/5] apple_m1_defconfig: Turn on CONFIG_SYS_64BIT_LBA 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. Signed-off-by: Hector Martin Reviewed-by: Mark Kettenis Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- configs/apple_m1_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/apple_m1_defconfig b/configs/apple_m1_defconfig index e00d72e8be..31d966f0ab 100644 --- a/configs/apple_m1_defconfig +++ b/configs/apple_m1_defconfig @@ -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 From 9d189ab3f94080839c014829b8087de028d5c3b4 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 18 Apr 2024 21:00:26 +0200 Subject: [PATCH 2/5] configs: apple: Use "vidconsole,serial" as stdout/stderr 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. Reviewed-by: Mark Kettenis Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- include/configs/apple.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/configs/apple.h b/include/configs/apple.h index 0576bc04c9..a70440b3ad 100644 --- a/include/configs/apple.h +++ b/include/configs/apple.h @@ -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) From 59f5ce836d8ac86d31f0c902d9fc1e1f4425fb53 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 18 Apr 2024 21:00:27 +0200 Subject: [PATCH 3/5] configs: apple: Enable CMD_SELECT_FONT and FONT_16X32 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. Reviewed-by: Mark Kettenis Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- configs/apple_m1_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/apple_m1_defconfig b/configs/apple_m1_defconfig index 31d966f0ab..c30aec7c55 100644 --- a/configs/apple_m1_defconfig +++ b/configs/apple_m1_defconfig @@ -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 From f1972dd73f4dd18d708e5109ffcb492d0687487b Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 18 Apr 2024 21:00:28 +0200 Subject: [PATCH 4/5] arm: apple: Switch to standard boot Use standard boot instead of the distro boot scripts. Use BOOTSTD_FULL instead of BOOTSTD_DEFAULTS for easier interactive use. Signed-off-by: Janne Grunau Reviewed-by: Mark Kettenis Reviewed-by: Neal Gompa --- arch/arm/Kconfig | 2 +- include/configs/apple.h | 20 ++------------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 01d6556c42..9b83b2e6f8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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 diff --git a/include/configs/apple.h b/include/configs/apple.h index a70440b3ad..1e08b11448 100644 --- a/include/configs/apple.h +++ b/include/configs/apple.h @@ -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 +#define BOOT_TARGETS "nvme usb" #define CFG_EXTRA_ENV_SETTINGS \ ENV_DEVICE_SETTINGS \ - BOOTENV + "boot_targets=" BOOT_TARGETS "\0" #endif From 63334ca9b593dcb378c19cc0712174dbe918e027 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 18 Apr 2024 21:00:29 +0200 Subject: [PATCH 5/5] arm: apple: Do not list bootflows on boot The bootflow list is only seen briefly and is probably more confusing than helpful. Signed-off-by: Janne Grunau Reviewed-by: Neal Gompa Reviewed-by: Mark Kettenis --- configs/apple_m1_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/apple_m1_defconfig b/configs/apple_m1_defconfig index c30aec7c55..4eac1a9e2d 100644 --- a/configs/apple_m1_defconfig +++ b/configs/apple_m1_defconfig @@ -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