Various minor clean-ups and improvements
Subsystems (6)
cover Various minor clean-ups and improvements
This series includes a collection of things noticed while bringing up verified boot on Coral.
It includes support for relocating the bloblist.
Simon Glass (17):
doc: Correct documentation for uclass_root
spl: Add functions for next and previous phase
bloblist: Support relocating to a larger space
bloblist: Add missing tag names
x86: tsc_timer: Correct overflow in __udelay()
video: Allow syncing the entire framebuffer to the copy
net: Use CONFIG_IS_ENABLED() in eth_dev_get_mac_address()
fdtdec: Update the missing-devicetree message
fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
display_options: Use USE_TINY_PRINTF for SPL check
uuid: Add a comment for UUID_STR_LEN
mmc: pci_mmc: Only generate ACPI code for the SD card
x86: coral: Add a devicetree node for eMMC
mmc: pci_mmc: Set the removable flag
crc32: Exclude crc32 from TPL
binman: Move selection of the binman node into a function
binman: Allow reading entries from a subnode
arch/x86/dts/chromebook_coral.dts | 6 +++ common/Kconfig | 10 +++++ common/bloblist.c | 17 +++++++++ common/board_f.c | 10 +++-- common/spl/spl.c | 2 +- drivers/mmc/pci_mmc.c | 19 +++++++++- drivers/timer/tsc_timer.c | 2 +- drivers/video/video-uclass.c | 10 +++++ include/asm-generic/global_data.h | 4 +- include/binman.h | 14 +++++++ include/bloblist.h | 10 +++++ include/spl.h | 53 +++++++++++++++++++++++++++ include/uuid.h | 1 + include/video.h | 14 +++++++ lib/Makefile | 2 + lib/binman.c | 61 ++++++++++++++++++++++++++----- lib/display_options.c | 9 ++--- lib/fdtdec.c | 5 ++- net/eth-uclass.c | 2 +- test/bloblist.c | 36 ++++++++++++++++++ 20 files changed, 260 insertions(+), 27 deletions(-)
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 1/17 doc: Correct documentation for uclass_root
The comments are swapped at present so this produces an error with 'make htmldocs'. Fix it.
---
include/asm-generic/global_data.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/asm-generic/global_data.h +2 -2
@@ -192,12 +192,12 @@ struct global_data {*/ struct udevice *dm_root_f;/** -* @uclass_root: head of core tree +* @uclass_root_s: head of core tree */ struct list_head uclass_root_s;/** * @uclass_root: pointer to head of core tree, if uclasses are in -* read-only memory and cannot be adjusted to use @uclass_root as a +* read-only memory and cannot be adjusted to use @uclass_root_s as a * list head. */ struct list_head *uclass_root;
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 2/17 spl: Add functions for next and previous phase
In reply to Simon GlassIt is useful to be able to figure out which phase we are loading next and which phase we came from. Add some functions to handle this as well as returning the name of a phase. This allows messages like "Booting to x" where x is the next phase.
At present, TPL says 'Jumping to U-Boot' at the end, when in fact it is jumping to SPL. This is confusing, so use the new functions to correct this.
Tests for this will come with an upcoming minor SPL test refactor.
---
common/spl/spl.c | 2 +- include/spl.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-)
common/spl/spl.c +1 -1
@@ -734,7 +734,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)debug ("Failed to stash bootstage: err=%d\n" , ret);#endif -debug ("loaded - jumping to U-Boot...\n" ); +debug ("loaded - jumping to %s...\n" ,spl_phase_name (spl_next_phase ()));spl_board_prepare_for_boot ();jump_to_image_no_args (&spl_image); }
include/spl.h +53 -0
65 lines not on this page · raw message
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 2/17 spl: Add functions for next and previous phase
Quoted 5 lines · Simon Glass
It is useful to be able to figure out which phase we are loading next and which phase we came from. Add some functions to handle this as well as returning the name of a phase. This allows messages like "Booting to x" where x is the next phase.
Quoted 7 lines
At present, TPL says 'Jumping to U-Boot' at the end, when in fact it is jumping to SPL. This is confusing, so use the new functions to correct this.
Tests for this will come with an upcoming minor SPL test refactor.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/abc07047/attachment.sig>
PATCH 3/17 bloblist: Support relocating to a larger space
In reply to Simon GlassTypically in TPL/SPL the bloblist is quite small. But U-Boot proper may want to add a lot more to it, such as ACPI tables.
Add a way to expand the bloblist by relocating it in U-Boot proper, along with the other relocation activities.
---
common/Kconfig | 10 ++++++++++ common/bloblist.c | 11 +++++++++++ common/board_f.c | 10 ++++++---- include/bloblist.h | 10 ++++++++++ test/bloblist.c | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 4 deletions(-)
common/Kconfig +10 -0
@@ -689,6 +689,16 @@ config BLOBLIST_ADDR Sets the address of the bloblist, set up by the first part of U-Boot which runs. Subsequent U-Boot stages typically use the same address. +config BLOBLIST_SIZE_RELOC + hex "Size of bloblist after relocation" + depends on BLOBLIST + default BLOBLIST_SIZE + help + Sets the size of the bloblist in bytes after relocation. Since U-Boot + has a lot more memory available then, it is possible to use a larger + size than the one set up by SPL. This bloblist is set up during the + relocation process. + endmenu source "common/spl/Kconfig"
common/bloblist.c +11 -0
@@ -317,6 +317,15 @@ void bloblist_show_list(void) } } +void bloblist_reloc (void *to,uint to_size,void *from,uint from_size) +{ +struct bloblist_hdr *hdr; + +memcpy (to, from, from_size); + hdr = to; + hdr->size = to_size; +} +int bloblist_init (void ) {bool expected;
@@ -327,6 +336,8 @@ int bloblist_init(void)* that runs */ expected = !u_boot_first_phase (); +if (spl_prev_phase () ==PHASE_TPL && !IS_ENABLED (CONFIG_TPL_BLOBLIST )) + expected = false;if (expected) ret =bloblist_check (CONFIG_BLOBLIST_ADDR ,CONFIG_BLOBLIST_SIZE );
common/board_f.c +6 -4
@@ -576,9 +576,10 @@ static int reserve_bloblist(void) {#ifdef CONFIG_BLOBLIST /* Align to a 4KB boundary for easier reading of addresses */ - gd->start_addr_sp =ALIGN_DOWN (gd->start_addr_sp -CONFIG_BLOBLIST_SIZE , -0x1000 ); - gd->new_bloblist =map_sysmem (gd->start_addr_sp,CONFIG_BLOBLIST_SIZE ); + gd->start_addr_sp =ALIGN_DOWN (gd->start_addr_sp - +CONFIG_BLOBLIST_SIZE_RELOC ,0x1000 ); + gd->new_bloblist =map_sysmem (gd->start_addr_sp, +CONFIG_BLOBLIST_SIZE_RELOC );#endif return 0 ;
@@ -661,7 +662,8 @@ static int reloc_bloblist(void)debug ("Copying bloblist from %p to %p, size %x\n" , gd->bloblist, gd->new_bloblist, size); -memcpy (gd->new_bloblist, gd->bloblist, size); +bloblist_reloc (gd->new_bloblist,CONFIG_BLOBLIST_SIZE_RELOC , + gd->bloblist, size); gd->bloblist = gd->new_bloblist; }#endif
include/bloblist.h +10 -0
@@ -242,6 +242,16 @@ void bloblist_show_list(void);*/ const char *bloblist_tag_name (enum bloblist_tag_t tag); +/** +* bloblist_reloc() - Relocate the bloblist and optionally resize it +* +* @to: Pointer to new bloblist location (must not overlap old location) +* @to:size: New size for bloblist (must be larger than from_size) +* @from: Pointer to bloblist to relocate +* @from_size: Size of bloblist to relocate +*/ +void bloblist_reloc (void *to,uint to_size,void *from,uint from_size); +/** * bloblist_init() - Init the bloblist system with a single bloblist *
test/bloblist.c +36 -0
@@ -352,6 +352,42 @@ static int bloblist_test_align(struct unit_test_state *uts) }BLOBLIST_TEST (bloblist_test_align,0 ); +/* Test relocation of a bloblist */ +static int bloblist_test_reloc (struct unit_test_state *uts) +{ +const uint large_size =TEST_BLOBLIST_SIZE ; +const uint small_size =0x20 ; +void *old_ptr, *new_ptr; +void *blob1, *blob2; +ulong new_addr; +ulong new_size; + +ut_assertok (bloblist_new (TEST_ADDR ,TEST_BLOBLIST_SIZE ,0 )); + old_ptr =map_sysmem (TEST_ADDR ,TEST_BLOBLIST_SIZE ); + +/* Add one blob and then one that won't fit */ + blob1 =bloblist_add (TEST_TAG , small_size,0 ); +ut_assertnonnull (blob1); + blob2 =bloblist_add (TEST_TAG2 , large_size,0 ); +ut_assertnull (blob2); + +/* Relocate the bloblist somewhere else, a bit larger */ + new_addr =TEST_ADDR +TEST_BLOBLIST_SIZE ; + new_size =TEST_BLOBLIST_SIZE +0x100 ; + new_ptr =map_sysmem (new_addr,TEST_BLOBLIST_SIZE ); +bloblist_reloc (new_ptr, new_size, old_ptr,TEST_BLOBLIST_SIZE ); + gd->bloblist = new_ptr; + +/* Check the old blob is there and that we can now add the bigger one */ +ut_assertnonnull (bloblist_find (TEST_TAG , small_size)); +ut_assertnull (bloblist_find (TEST_TAG2 , small_size)); + blob2 =bloblist_add (TEST_TAG2 , large_size,0 ); +ut_assertnonnull (blob2); + +return 0 ; +} +BLOBLIST_TEST (bloblist_test_reloc,0 ); +int do_ut_bloblist (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 3/17 bloblist: Support relocating to a larger space
Quoted 7 lines · Simon Glass
Typically in TPL/SPL the bloblist is quite small. But U-Boot proper may want to add a lot more to it, such as ACPI tables.
Add a way to expand the bloblist by relocating it in U-Boot proper, along with the other relocation activities.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/1503a787/attachment.sig>
PATCH 4/17 bloblist: Add missing tag names
In reply to Simon GlassAdd tag names for recently added types.
---
common/bloblist.c | 6 ++++++ 1 file changed, 6 insertions(+)
common/bloblist.c +6 -0
@@ -33,6 +33,12 @@ static const char *const tag_name[] = { [BLOBLISTT_SPL_HANDOFF] = "SPL hand-off", [BLOBLISTT_VBOOT_CTX] = "Chrome OS vboot context", [BLOBLISTT_VBOOT_HANDOFF] = "Chrome OS vboot hand-off", + [BLOBLISTT_ACPI_GNVS] = "ACPI GNVS", + [BLOBLISTT_INTEL_VBT] = "Intel Video-BIOS table", + [BLOBLISTT_TPM2_TCG_LOG] = "TPM v2 log space", + [BLOBLISTT_TCPA_LOG] = "TPM log space", + [BLOBLISTT_ACPI_TABLES] = "ACPI tables for x86", + [BLOBLISTT_SMBIOS_TABLES] = "SMBIOS tables for x86", };const char *bloblist_tag_name (enum bloblist_tag_t tag)
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 4/17 bloblist: Add missing tag names
Quoted 4 lines · Simon Glass
Add tag names for recently added types.
Fixes d2cb7a22da0 (x86: Allow putting some tables in the bloblist)Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/8c57f258/attachment.sig>
PATCH 5/17 x86: tsc_timer: Correct overflow in __udelay()
In reply to Simon GlassAt present long delays such as msleep(2000) can cause an overflow in this function. There is no need for this, since it already uses a 64-bit int.
Add a cast to correct this.
---
drivers/timer/tsc_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/timer/tsc_timer.c +1 -1
@@ -372,7 +372,7 @@ void __udelay(unsigned long usec)u64 now =get_ticks ();u64 stop; - stop = now + usec *get_tbclk_mhz (); + stop = now + (u64 )usec *get_tbclk_mhz (); while ((int64_t)(stop - get_ticks()) > 0)#if defined(CONFIG_QEMU ) && defined(CONFIG_SMP )
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 5/17 x86: tsc_timer: Correct overflow in __udelay()
Quoted 4 lines · Simon Glass
At present long delays such as msleep(2000) can cause an overflow in this function. There is no need for this, since it already uses a 64-bit int.
Quoted 8 lines
Add a cast to correct this.
Signed-off-by Simon Glass <[email protected]>---
drivers/timer/tsc_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 5/17 x86: tsc_timer: Correct overflow in __udelay()
Quoted 8 lines · Bin Meng
Quoted 6 lines · Simon Glass
At present long delays such as msleep(2000) can cause an overflow in this function. There is no need for this, since it already uses a 64-bit int.
Add a cast to correct this.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Simon Glass <[email protected]>---
drivers/timer/tsc_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH 6/17 video: Allow syncing the entire framebuffer to the copy
In reply to Simon GlassIn some cases so much of the framebuffer is updated that it is not worth copying the changes piece by piece to the copy framebuffer. Add a function to copy the whole thing.
---
drivers/video/video-uclass.c | 10 ++++++++++ include/video.h | 14 ++++++++++++++ 2 files changed, 24 insertions(+)
drivers/video/video-uclass.c +10 -0
@@ -275,6 +275,16 @@ int video_sync_copy(struct udevice *dev, void *from, void *to) return 0; } + +int video_sync_copy_all (struct udevice *dev) +{ +struct video_priv *priv =dev_get_uclass_priv (dev); + +video_sync_copy (dev, priv->fb, priv->fb + priv->fb_size); + +return 0 ; +} +#endif /* Set up the colour map */
include/video.h +14 -0
@@ -236,11 +236,25 @@ void video_set_default_colors(struct udevice *dev, bool invert);* frame buffer start */ int video_sync_copy (struct udevice *dev,void *from,void *to); + +/** +* video_sync_copy_all() - Sync the entire framebuffer to the copy +* +* @dev: Vidconsole device being updated +* @return 0 (always) +*/ +int video_sync_copy_all (struct udevice *dev);#else static inline int video_sync_copy (struct udevice *dev,void *from,void *to) {return 0 ; } + +static inline int video_sync_copy_all (struct udevice *dev) +{ +return 0 ; +} +#endif #ifndef CONFIG_DM_VIDEO
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 6/17 video: Allow syncing the entire framebuffer to the copy
Quoted 5 lines · Simon Glass
In some cases so much of the framebuffer is updated that it is not worth copying the changes piece by piece to the copy framebuffer. Add a function to copy the whole thing.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/75babb8a/attachment.sig>
PATCH 7/17 net: Use CONFIG_IS_ENABLED() in eth_dev_get_mac_address()
In reply to Simon GlassThis function may be used in SPL where devicetree is not available. Use the correct macro so that the function does not try to read it.
---
net/eth-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/eth-uclass.c +1 -1
@@ -482,7 +482,7 @@ static int eth_pre_unbind(struct udevice *dev)static bool eth_dev_get_mac_address (struct udevice *dev,u8 mac[ARP_HLEN ]) { -#if IS_ENABLED (CONFIG_OF_CONTROL ) +#if CONFIG_IS_ENABLED (OF_CONTROL )const uint8_t *p; p =dev_read_u8_array_ptr (dev,"mac-address" ,ARP_HLEN );
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 7/17 net: Use CONFIG_IS_ENABLED() in eth_dev_get_mac_address()
Quoted 4 lines · Simon Glass
This function may be used in SPL where devicetree is not available. Use the correct macro so that the function does not try to read it.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/00acc2bf/attachment.sig>
PATCH 8/17 fdtdec: Update the missing-devicetree message
In reply to Simon GlassThis includes information about sandbox which is not relevant for most boards. Drop it.
Also add the address to help figure out the problem.
---
lib/fdtdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/fdtdec.c +2 -1
@@ -600,7 +600,8 @@ int fdtdec_prepare_fdt(void) #ifdef CONFIG_SPL_BUILD puts("Missing DTB\n"); #else - puts("No valid device tree binary found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>\n"); + printf("No valid device tree binary found at %p\n", + gd->fdt_blob); # ifdef DEBUG if (gd->fdt_blob) { printf("fdt_blob=%p\n", gd->fdt_blob);
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 8/17 fdtdec: Update the missing-devicetree message
Quoted 6 lines · Simon Glass
This includes information about sandbox which is not relevant for most boards. Drop it.
Also add the address to help figure out the problem.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/0b1729ba/attachment.sig>
PATCH 9/17 fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
In reply to Simon GlassThis setting may be different in SPL and TPL. Update the code to check the correct setting.
---
lib/fdtdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/fdtdec.c +1 -1
@@ -1253,7 +1253,7 @@ __weak void *board_fdt_blob_setup(void)void *fdt_blob =NULL ;#ifdef CONFIG_SPL_BUILD /* FDT is at end of BSS unless it is in a different memory region */ -if (IS_ENABLED (CONFIG_SPL_SEPARATE_BSS )) +if (CONFIG_IS_ENABLED (SEPARATE_BSS )) fdt_blob = (ulong *)&_image_binary_end;else fdt_blob = (ulong *)&__bss_end;
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 9/17 fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
Quoted 4 lines · Simon Glass
This setting may be different in SPL and TPL. Update the code to check the correct setting.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/b6fb348d/attachment.sig>
PATCH 9/17 fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
Hi Simon,
Quoted 9 lines · Tom Rini
Quoted 4 lines · Simon Glass
This setting may be different in SPL and TPL. Update the code to check the correct setting.
Signed-off-by Simon Glass <[email protected]>Applied to u-boot/master, thanks!
This breaks booting on at least rk3399 based devices for me with the following error:
U-Boot TPL 2021.04-rc1 (Feb 01 2021 - 00:00:00)
Missing DTB
### ERROR ### Please RESET the board ###
PATCH 9/17 fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
Quoted 8 lines · Peter Robinson
Hi Simon,
Quoted 5 lines · Tom Rini
Quoted 3 lines · Simon Glass
This setting may be different in SPL and TPL. Update the code to check the correct setting.
Quoted 8 lines
Quoted 2 lines
Quoted 1 line
Signed-off-by Simon Glass <[email protected]>Applied to u-boot/master, thanks!
This breaks booting on at least rk3399 based devices for me with the following error:
U-Boot TPL 2021.04-rc1 (Feb 01 2021 - 00:00:00)
Missing DTB
### ERROR ### Please RESET the board ###
Also see https://lists.denx.de/pipermail/u-boot/2021-February/440263.html
PATCH 9/17 fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
Quoted 11 lines · Jesper Schmitz Mouridsen
Quoted 9 lines · Peter Robinson
Hi Simon,
Quoted 6 lines · Tom Rini
Quoted 4 lines · Simon Glass
This setting may be different in SPL and TPL. Update the code to check the correct setting.
Signed-off-by Simon Glass <[email protected]>
Quoted 8 lines
Quoted 7 lines
Quoted 1 line
Applied to u-boot/master, thanks!
This breaks booting on at least rk3399 based devices for me with the following error:
U-Boot TPL 2021.04-rc1 (Feb 01 2021 - 00:00:00)
Missing DTB
### ERROR ### Please RESET the board ###Also see https://lists.denx.de/pipermail/u-boot/2021-February/440263.html
So we have two forms of bug. sunxi (your link above Jesper) needs SPL_SEPARATE_BSS to be set I think. Peter's problem is that there is no TPL_SEPARATE_BSS which is a harder problem to solve quickly. I'll post a revert with you both Reported-by shortly, thanks.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210214/72d48060/attachment.sig>
PATCH 9/17 fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
Quoted 19 lines · Tom Rini
Quoted 18 lines · Jesper Schmitz Mouridsen
Quoted 16 lines · Peter Robinson
Hi Simon,
Quoted 7 lines · Tom Rini
Quoted 4 lines · Simon Glass
This setting may be different in SPL and TPL. Update the code to check the correct setting.
Signed-off-by Simon Glass <[email protected]>Applied to u-boot/master, thanks!
This breaks booting on at least rk3399 based devices for me with the following error:
U-Boot TPL 2021.04-rc1 (Feb 01 2021 - 00:00:00)
Missing DTB
### ERROR ### Please RESET the board ###
Quoted 6 lines
Quoted 1 line
Also see https://lists.denx.de/pipermail/u-boot/2021-February/440263.html
So we have two forms of bug. sunxi (your link above Jesper) needs
SPL_SEPARATE_BSSto be set I think. Peter's problem is that there is noTPL_SEPARATE_BSSwhich is a harder problem to solve quickly. I'll post a revert with you both Reported-by shortly, thanks.
Er, wait. I'm a bit less clear on the why on sunxi at least. I'm going to post the revert shortly all the same.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210214/d564abb6/attachment.sig>
PATCH 9/17 fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
Quoted 23 lines · Tom Rini
Quoted 21 lines · Tom Rini
Quoted 19 lines · Jesper Schmitz Mouridsen
Quoted 8 lines · Peter Robinson
Hi Simon,
Quoted 5 lines · Tom Rini
Quoted 3 lines · Simon Glass
This setting may be different in SPL and TPL. Update the code to check the correct setting.
Quoted 8 lines
Quoted 2 lines
Quoted 1 line
Signed-off-by Simon Glass <[email protected]>Applied to u-boot/master, thanks!
This breaks booting on at least rk3399 based devices for me with the following error:
U-Boot TPL 2021.04-rc1 (Feb 01 2021 - 00:00:00)
Missing DTB
### ERROR ### Please RESET the board ###Also see https://lists.denx.de/pipermail/u-boot/2021-February/440263.html
Quoted 7 lines
Quoted 4 lines
So we have two forms of bug. sunxi (your link above Jesper) needs
SPL_SEPARATE_BSSto be set I think. Peter's problem is that there is noTPL_SEPARATE_BSSwhich is a harder problem to solve quickly. I'll post a revert with you both Reported-by shortly, thanks.Er, wait. I'm a bit less clear on the why on sunxi at least. I'm going to post the revert shortly all the same.
The sunxi bits seem OK with 2021.04-rc1 from my testing, at least for this problem, to now in my testing it's only been the rockchip stuff that's had issues but I'm still getting through all my devices.
Peter
PATCH 9/17 fdtdec: Use CONFIG_IS_ENABLED in board_fdt_blob_setup()
Quoted 29 lines · Peter Robinson
Quoted 28 lines · Tom Rini
Quoted 25 lines · Tom Rini
Quoted 11 lines · Jesper Schmitz Mouridsen
Quoted 9 lines · Peter Robinson
Hi Simon,
Quoted 6 lines · Tom Rini
Quoted 4 lines · Simon Glass
This setting may be different in SPL and TPL. Update the code to check the correct setting.
Signed-off-by Simon Glass <[email protected]>Quoted 8 lines
Quoted 7 lines
Quoted 1 line
Applied to u-boot/master, thanks!
This breaks booting on at least rk3399 based devices for me with the following error:
U-Boot TPL 2021.04-rc1 (Feb 01 2021 - 00:00:00)
Missing DTB
### ERROR ### Please RESET the board ###Also see https://lists.denx.de/pipermail/u-boot/2021-February/440263.html
So we have two forms of bug. sunxi (your link above Jesper) needs
SPL_SEPARATE_BSSto be set I think. Peter's problem is that there is noTPL_SEPARATE_BSSwhich is a harder problem to solve quickly. I'll post a revert with you both Reported-by shortly, thanks.
Quoted 6 lines
Quoted 2 lines
Er, wait. I'm a bit less clear on the why on sunxi at least. I'm going to post the revert shortly all the same.
The sunxi bits seem OK with 2021.04-rc1 from my testing, at least for this problem, to now in my testing it's only been the rockchip stuff that's had issues but I'm still getting through all my devices.
Yup. I need to fix my mental map of "pine* == sunxi", that was the confusion I had.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210214/1b38275d/attachment.sig>
PATCH 10/17 display_options: Use USE_TINY_PRINTF for SPL check
In reply to Simon GlassAt present this code uses a simple printf() format if running in SPL. But SPL can use the full printf. Use USE_TINY_PRINTF instead.
---
lib/display_options.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
lib/display_options.c +4 -5
@@ -169,11 +169,10 @@ int print_buffer(ulong addr, const void *data, uint width, uint count, x = lb.us[i] = *(volatile uint16_t *)data; else x = lb.uc[i] = *(volatile uint8_t *)data; -#if defined(CONFIG_SPL_BUILD ) -printf (" %x" , (uint )x); -#else -printf (" %0*lx" , width *2 , x); -#endif +if (CONFIG_IS_ENABLED (USE_TINY_PRINTF )) +printf (" %x" , (uint )x); +else +printf (" %0*lx" , width *2 , x); data += width; }
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 10/17 display_options: Use USE_TINY_PRINTF for SPL check
Quoted 4 lines · Simon Glass
At present this code uses a simple
printf()format if running in SPL. But SPL can use the full printf. UseUSE_TINY_PRINTFinstead.Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/346a0db0/attachment.sig>
PATCH 11/17 uuid: Add a comment for UUID_STR_LEN
In reply to Simon GlassThis macro is the length of the string but excludes the terminator. Users must add 1 when declaring a large-enough string. Add a comment to make this clear.
---
include/uuid.h | 1 + 1 file changed, 1 insertion(+)
include/uuid.h +1 -0
@@ -23,6 +23,7 @@ struct uuid {#define UUID_STR_FORMAT_GUID BIT(0)#define UUID_STR_UPPER_CASE BIT(1) +/* Use UUID_STR_LEN + 1 for string space */ #define UUID_STR_LEN 36#define UUID_BIN_LEN sizeof(struct uuid)
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 11/17 uuid: Add a comment for UUID_STR_LEN
Quoted 5 lines · Simon Glass
This macro is the length of the string but excludes the terminator. Users must add 1 when declaring a large-enough string. Add a comment to make this clear.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/600a7a07/attachment.sig>
PATCH 12/17 mmc: pci_mmc: Only generate ACPI code for the SD card
In reply to Simon GlassAt present if an eMMC part is in the system, the ACPI table generated will include information about that, as well as the SD card. We only need to include the SD card, since it has a card-detect GPIO. Use a different compatible string for each option, and add code only for the SD card.
---
drivers/mmc/pci_mmc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/mmc/pci_mmc.c +10 -1
@@ -17,6 +17,12 @@#include <asm-generic/gpio.h> #include <dm/acpi.h> +/* Type of MMC device */ +enum { +TYPE_SD , +TYPE_EMMC , +}; +struct pci_mmc_plat {struct mmc_config cfg;struct mmc mmc;
@@ -77,6 +83,8 @@ static int pci_mmc_acpi_fill_ssdt(const struct udevice *dev,if (!dev_has_ofnode (dev))return 0 ; +if (dev_get_driver_data (dev) ==TYPE_EMMC ) +return 0 ; ret =gpio_get_acpi (&priv->cd_gpio, &gpio);if (ret)
@@ -120,7 +128,8 @@ struct acpi_ops pci_mmc_acpi_ops = { };static const struct udevice_id pci_mmc_match[] = { - { .compatible ="intel,apl-sd" }, + { .compatible ="intel,apl-sd" , .data =TYPE_SD }, + { .compatible ="intel,apl-emmc" , .data =TYPE_EMMC }, { } };
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 12/17 mmc: pci_mmc: Only generate ACPI code for the SD card
Quoted 6 lines · Simon Glass
At present if an eMMC part is in the system, the ACPI table generated will include information about that, as well as the SD card. We only need to include the SD card, since it has a card-detect GPIO. Use a different compatible string for each option, and add code only for the SD card.
Signed-off-by Simon Glass <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 42 lines
---
drivers/mmc/pci_mmc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)drivers/mmc/pci_mmc.c +10
-1@@ -17,6 +17,12 @@#include <asm-generic/gpio.h> #include <dm/acpi.h> +/* Type of MMC device */ +enum { +TYPE_SD , +TYPE_EMMC , +}; +struct pci_mmc_plat {struct mmc_config cfg;struct mmc mmc;@@ -77,6 +83,8 @@ static int pci_mmc_acpi_fill_ssdt(const struct udevice *dev,if (!dev_has_ofnode (dev))return 0 ; +if (dev_get_driver_data (dev) ==TYPE_EMMC ) +return 0 ; ret =gpio_get_acpi (&priv->cd_gpio, &gpio);if (ret)@@ -120,7 +128,8 @@ struct acpi_ops pci_mmc_acpi_ops = { };static const struct udevice_id pci_mmc_match[] = { - { .compatible ="intel,apl-sd" }, + { .compatible ="intel,apl-sd" , .data =TYPE_SD }, + { .compatible ="intel,apl-emmc" , .data =TYPE_EMMC }, { } };
PATCH 12/17 mmc: pci_mmc: Only generate ACPI code for the SD card
In reply to Simon GlassQuoted 7 lines · Simon Glass
At present if an eMMC part is in the system, the ACPI table generated will include information about that, as well as the SD card. We only need to include the SD card, since it has a card-detect GPIO. Use a different compatible string for each option, and add code only for the SD card.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Jaehoon Chung <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/47daf6ab/attachment.sig>
PATCH 13/17 x86: coral: Add a devicetree node for eMMC
In reply to Simon GlassAdd a node for this so we can indicate that it is does not require any ACPI code.
---
arch/x86/dts/chromebook_coral.dts | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/dts/chromebook_coral.dts +6 -0
@@ -569,6 +569,12 @@ acpi,name = "SDCD"; }; + emmc: emmc at 1c,0 { + reg = <0x0000e000 0 0 0 0>; + compatible = "intel,apl-emmc"; + non-removable; + }; + pch: pch at 1f,0 { reg = <0x0000f800 0 0 0 0>; compatible = "intel,apl-pch";
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 13/17 x86: coral: Add a devicetree node for eMMC
Quoted 4 lines · Simon Glass
Add a node for this so we can indicate that it is does not require any ACPI code.
Signed-off-by Simon Glass <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 23 lines
---
arch/x86/dts/chromebook_coral.dts | 6 ++++++ 1 file changed, 6 insertions(+)arch/x86/dts/chromebook_coral.dts +6
-0@@ -569,6 +569,12 @@ acpi,name = "SDCD"; }; + emmc: emmc at 1c,0 { + reg = <0x0000e000 0 0 0 0>; + compatible = "intel,apl-emmc"; + non-removable; + }; + pch: pch at 1f,0 { reg = <0x0000f800 0 0 0 0>; compatible = "intel,apl-pch";
PATCH 13/17 x86: coral: Add a devicetree node for eMMC
In reply to Simon GlassQuoted 10 lines · Simon Glass
Add a node for this so we can indicate that it is does not require any ACPI code.
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_coral.dts | 6 ++++++ 1 file changed, 6 insertions(+)
PATCH 13/17 x86: coral: Add a devicetree node for eMMC
Quoted 6 lines · Bin Meng
Quoted 4 lines · Simon Glass
Add a node for this so we can indicate that it is does not require any ACPI code.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Simon Glass <[email protected]>---
arch/x86/dts/chromebook_coral.dts | 6 ++++++ 1 file changed, 6 insertions(+)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH 14/17 mmc: pci_mmc: Set the removable flag
In reply to Simon GlassSet this flag so that it is available to those looking at the device. For non-removable devices there is no need to check for insertion/removable since the media can never change.
---
drivers/mmc/pci_mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/mmc/pci_mmc.c +8 -0
@@ -10,6 +10,7 @@#include <log.h> #include <malloc.h> #include <mapmem.h> +#include <mmc.h> #include <sdhci.h> #include <acpi/acpigen.h> #include <acpi/acpi_device.h>
@@ -40,8 +41,15 @@ static int pci_mmc_probe(struct udevice *dev)struct pci_mmc_plat *plat =dev_get_plat (dev);struct pci_mmc_priv *priv =dev_get_priv (dev);struct sdhci_host *host = &priv->host; +struct blk_desc *desc;int ret; + ret =mmc_of_parse (dev, &plat->cfg); +if (ret) +return ret; + desc =mmc_get_blk_desc (&plat->mmc); + desc->removable = !(plat->cfg.host_caps &MMC_CAP_NONREMOVABLE ); + host->ioaddr = (void *)dm_pci_map_bar (dev,PCI_BASE_ADDRESS_0 ,PCI_REGION_MEM ); host->name = dev->name;
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 14/17 mmc: pci_mmc: Set the removable flag
Quoted 5 lines · Simon Glass
Set this flag so that it is available to those looking at the device. For non-removable devices there is no need to check for insertion/removable since the media can never change.
Signed-off-by Simon Glass <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 34 lines
---
drivers/mmc/pci_mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/mmc/pci_mmc.c +8
-0@@ -10,6 +10,7 @@#include <log.h> #include <malloc.h> #include <mapmem.h> +#include <mmc.h> #include <sdhci.h> #include <acpi/acpigen.h> #include <acpi/acpi_device.h> @@ -40,8 +41,15 @@ static int pci_mmc_probe(struct udevice *dev)struct pci_mmc_plat *plat =dev_get_plat (dev);struct pci_mmc_priv *priv =dev_get_priv (dev);struct sdhci_host *host = &priv->host; +struct blk_desc *desc;int ret; + ret =mmc_of_parse (dev, &plat->cfg); +if (ret) +return ret; + desc =mmc_get_blk_desc (&plat->mmc); + desc->removable = !(plat->cfg.host_caps &MMC_CAP_NONREMOVABLE ); + host->ioaddr = (void *)dm_pci_map_bar (dev,PCI_BASE_ADDRESS_0 ,PCI_REGION_MEM ); host->name = dev->name;
PATCH 14/17 mmc: pci_mmc: Set the removable flag
In reply to Simon GlassQuoted 6 lines · Simon Glass
Set this flag so that it is available to those looking at the device. For non-removable devices there is no need to check for insertion/removable since the media can never change.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Jaehoon Chung <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/05142e39/attachment.sig>
PATCH 15/17 crc32: Exclude crc32 from TPL
In reply to Simon GlassUnfortunately the toolchain often brings in the crc32 table even if the function is not actually used. For now, exclude it from the TPL build, which is very sensitive to size.
---
lib/Makefile | 2 ++ 1 file changed, 2 insertions(+)
lib/Makefile +2 -0
@@ -92,7 +92,9 @@ obj-y += display_options.o CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"') obj-$(CONFIG_BCH) += bch.o obj-$(CONFIG_MMC_SPI) += crc7.o +#ifndef CONFIG_TPL_BUILD obj-y += crc32.o +#endif obj-$(CONFIG_CRC32C) += crc32c.o obj-y += ctype.o obj-y += div64.o
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 15/17 crc32: Exclude crc32 from TPL
Quoted 5 lines · Simon Glass
Unfortunately the toolchain often brings in the crc32 table even if the function is not actually used. For now, exclude it from the TPL build, which is very sensitive to size.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/03278a56/attachment.sig>
PATCH 16/17 binman: Move selection of the binman node into a function
In reply to Simon GlassMove this logic out of the main init function so it is available for other purpose.
Use a different error when multiple-images is in use but no subnode is available. This makes it easier to determine what is wrong.
---
lib/binman.c | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-)
lib/binman.c +33 -10
@@ -30,6 +30,34 @@ struct binman_info {static struct binman_info *binman; +/** +* find_image_node() - Find the top-level binman node +* +* Finds the binman node which can be used to load entries. The correct node +* depends on whether multiple-images is in use. +* +* @nodep: Returns the node found, on success +* @return 0 if OK, , -EINVAL if there is no /binman node, -ECHILD if multiple +* images are being used but the first image is not available +*/ +static int find_image_node (ofnode *nodep) +{ +ofnode node; + + node =ofnode_path ("/binman" ); +if (!ofnode_valid (node)) +return log_msg_ret ("binman node" , -EINVAL ); +if (ofnode_read_bool (node,"multiple-images" )) { + node =ofnode_first_subnode (node); + +if (!ofnode_valid (node)) +return log_msg_ret ("first image" , -ECHILD ); + } + *nodep = node; + +return 0 ; +} +static int binman_entry_find_internal (ofnode node,const char *name,struct binman_entry *entry) {
@@ -90,19 +118,14 @@ int binman_get_rom_offset(void)int binman_init (void ) { +int ret; + binman =malloc (sizeof (struct binman_info ));if (!binman)return log_msg_ret ("space for binman" , -ENOMEM ); - binman->image =ofnode_path ("/binman" ); -if (!ofnode_valid (binman->image)) -return log_msg_ret ("binman node" , -EINVAL ); -if (ofnode_read_bool (binman->image,"multiple-images" )) { -ofnode node =ofnode_first_subnode (binman->image); - -if (!ofnode_valid (node)) -return log_msg_ret ("first image" , -ENOENT ); - binman->image = node; - } + ret =find_image_node (&binman->image); +if (ret) +return log_msg_ret ("node" , -ENOENT );binman_set_rom_offset (ROM_OFFSET_NONE );return 0 ;
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 16/17 binman: Move selection of the binman node into a function
Quoted 7 lines · Simon Glass
Move this logic out of the main init function so it is available for other purpose.
Use a different error when multiple-images is in use but no subnode is available. This makes it easier to determine what is wrong.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/3039b29a/attachment.sig>
PATCH 17/17 binman: Allow reading entries from a subnode
In reply to Simon GlassSome images may have multiple copies of the same thing, e.g. two versions of the read/write U-Boots. It is necessary to read data from one or other of these under selection of the verified-boot logic. Add a function to select the subnode to use.
---
include/binman.h | 14 ++++++++++++++ lib/binman.c | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+)
include/binman.h +14 -0
@@ -70,6 +70,20 @@ int binman_entry_find(const char *name, struct binman_entry *entry);*/ ofnode binman_section_find_node (const char *name); +/** +* binman_select_subnode() - Select a subnode to use to find entries +* +* Normally binman selects the top-level node for future entry requests, such as +* binman_entry_find(). This function allows a subnode to be chosen instead. +* +* @name: Name of subnode, typically a section. This must be in the top-level +* binman node +* @return 0 if OK, -EINVAL if there is no /binman node, -ECHILD if multiple +* images are being used but the first image is not available, -ENOENT if +* the requested subnode cannot be found +*/ +int binman_select_subnode (const char *name); +/** * binman_init() - Set up the binman symbol information *
lib/binman.c +18 -0
@@ -116,6 +116,24 @@ int binman_get_rom_offset(void)return binman->rom_offset; } +int binman_select_subnode (const char *name) +{ +ofnode node; +int ret; + + ret =find_image_node (&node); +if (ret) +return log_msg_ret ("main" , -ENOENT ); + node =ofnode_find_subnode (node, name); +if (!ofnode_valid (node)) +return log_msg_ret ("node" , -ENOENT ); + binman->image = node; +log_debug ("binman: Selected image subnode '%s'\n" , +ofnode_get_name (binman->image)); + +return 0 ; +} +int binman_init (void ) {int ret;
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog
PATCH 17/17 binman: Allow reading entries from a subnode
Quoted 6 lines · Simon Glass
Some images may have multiple copies of the same thing, e.g. two versions of the read/write U-Boots. It is necessary to read data from one or other of these under selection of the verified-boot logic. Add a function to select the subnode to use.
Signed-off-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210128/7b0515a3/attachment.sig>