uboot: split the patches apart and disable the verbose logging

logging still has *some* verbosity. i may turn it down further.
This commit is contained in:
Colin 2022-05-17 09:10:26 +00:00
parent 09cb37dee2
commit 61ff0eae4b
5 changed files with 56 additions and 47 deletions

View File

@ -14,8 +14,10 @@
# NixOS defaults to grub: we don't want that.
boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
# raspberryPi boot loader creates extlinux.conf.
# otherwise, enable the generic-extlinux-compatible loader below.
# note: THESE ARE MUTUALLY EXCLUSIVE. generic-extlinux-compatible causes uboot to not be built
# boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.raspberryPiColin.enable = true;
boot.loader.raspberryPiColin.uboot.enable = true;
boot.loader.raspberryPiColin.version = 4;

View File

@ -0,0 +1,32 @@
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 829ccb6bd1..5f3f0ae042 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -133,12 +133,12 @@ static int validate_gpt_header(gpt_header *gpt_h, lbaint_t lba,
* Check that the first_usable_lba and that the last_usable_lba are
* within the disk.
*/
- if (le64_to_cpu(gpt_h->first_usable_lba) > lastlba) {
+ if (le64_to_cpu(gpt_h->first_usable_lba) > lastlba && lastlba != 0) {
printf("GPT: first_usable_lba incorrect: %llX > " LBAF "\n",
le64_to_cpu(gpt_h->first_usable_lba), lastlba);
return -1;
}
- if (le64_to_cpu(gpt_h->last_usable_lba) > lastlba) {
+ if (le64_to_cpu(gpt_h->last_usable_lba) > lastlba && lastlba != 0) {
printf("GPT: last_usable_lba incorrect: %llX > " LBAF "\n",
le64_to_cpu(gpt_h->last_usable_lba), lastlba);
return -1;
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index 7a5f0851b5..01545f7480 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -15,6 +15,8 @@
/* Architecture, CPU, etc.*/
+#define CONFIG_SYS_64BIT_LBA
+
/* Use SoC timer for AArch32, but architected timer for AArch64 */
#ifndef CONFIG_ARM64
#define CONFIG_SYS_TIMER_RATE 1000000

View File

@ -0,0 +1,16 @@
diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
index eae03bf023..2ded4123ce 100644
--- a/configs/rpi_4_defconfig
+++ b/configs/rpi_4_defconfig
@@ -63,3 +63,11 @@ CONFIG_VIDEO_BCM2835=y
CONFIG_CONSOLE_SCROLL_LINES=10
CONFIG_PHYS_TO_BUS=y
CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CMD_CONFIG=y
+CONFIG_CMD_EFIDEBUG=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_LOG=y
+CONFIG_CMD_READ=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_LOG_MAX_LEVEL=8
+CONFIG_CMD_LSBLK=y

View File

@ -1,19 +1,3 @@
diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
index eae03bf023..2ded4123ce 100644
--- a/configs/rpi_4_defconfig
+++ b/configs/rpi_4_defconfig
@@ -63,3 +63,11 @@ CONFIG_VIDEO_BCM2835=y
CONFIG_CONSOLE_SCROLL_LINES=10
CONFIG_PHYS_TO_BUS=y
CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_CMD_CONFIG=y
+CONFIG_CMD_EFIDEBUG=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_LOG=y
+CONFIG_CMD_READ=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_LOG_MAX_LEVEL=8
+CONFIG_CMD_LSBLK=y
diff --git a/disk/part.c b/disk/part.c
index 79955c7fb0..c1d469cebb 100644
--- a/disk/part.c
@ -32,21 +16,6 @@ diff --git a/disk/part_efi.c b/disk/part_efi.c
index 829ccb6bd1..5f3f0ae042 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -133,12 +133,12 @@ static int validate_gpt_header(gpt_header *gpt_h, lbaint_t lba,
* Check that the first_usable_lba and that the last_usable_lba are
* within the disk.
*/
- if (le64_to_cpu(gpt_h->first_usable_lba) > lastlba) {
+ if (le64_to_cpu(gpt_h->first_usable_lba) > lastlba && lastlba != 0) {
printf("GPT: first_usable_lba incorrect: %llX > " LBAF "\n",
le64_to_cpu(gpt_h->first_usable_lba), lastlba);
return -1;
}
- if (le64_to_cpu(gpt_h->last_usable_lba) > lastlba) {
+ if (le64_to_cpu(gpt_h->last_usable_lba) > lastlba && lastlba != 0) {
printf("GPT: last_usable_lba incorrect: %llX > " LBAF "\n",
le64_to_cpu(gpt_h->last_usable_lba), lastlba);
return -1;
@@ -1044,6 +1044,8 @@ static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
return 2;
}
@ -78,19 +47,6 @@ index 21c5209bb6..6ce03d8d09 100644
if (!ops->read)
return -ENOSYS;
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index 7a5f0851b5..01545f7480 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -15,6 +15,8 @@
/* Architecture, CPU, etc.*/
+#define CONFIG_SYS_64BIT_LBA
+
/* Use SoC timer for AArch32, but architected timer for AArch64 */
#ifndef CONFIG_ARM64
#define CONFIG_SYS_TIMER_RATE 1000000
diff --git a/include/log.h b/include/log.h
index 8f35c10abb..afd2d704f4 100644
--- a/include/log.h

View File

@ -3,7 +3,10 @@
(pkgs.ubootRaspberryPi4_64bit.overrideAttrs (upstream: {
patches = (upstream.patches or []) ++ [
# enable booting from > 2 TiB drives
./01-enable-large-gpt.patch
./01-skip-lba-check.patch
# enable some builtin commands to aid in debugging, while we're here
./02-extra-cmds.patch
# ./03-verbose-log.patch
];
}))