From 58ec39c31cb97938564411fd07907315eba3ce70 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Thu, 5 Oct 2023 12:27:38 -0400 Subject: [PATCH 1/6] sphinx: Bump urllib3 version While not a direct issue for us, urllib3 before 1.26.17 is vulnerable to CVE-2023-43804 to bump our version up. Reported-by: GitHub dependabot Signed-off-by: Tom Rini Reviewed-by: Simon Glass Use urllib3 2.0.6 Signed-off-by: Heinrich Schuchardt --- doc/sphinx/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sphinx/requirements.txt b/doc/sphinx/requirements.txt index 6ccbe527ee7..6d45a3fefff 100644 --- a/doc/sphinx/requirements.txt +++ b/doc/sphinx/requirements.txt @@ -23,4 +23,4 @@ sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 -urllib3==1.26.9 +urllib3==2.0.6 From 9e5116433ddb8145f62be448bd1389fd94e2b51c Mon Sep 17 00:00:00 2001 From: Weizhao Ouyang Date: Sat, 7 Oct 2023 10:52:36 +0000 Subject: [PATCH 2/6] cyclic: doc: Update documentation for CONFIG_CYCLIC_MAX_CPU_TIME_US Cyclic now just print a warning once instead of disabling the cyclic function when the cyclic function upon exceeding CPU time usage. Fixes: ddc8d36a7455 ("cyclic: Don't disable cylic function upon exceeding CPU time") Signed-off-by: Weizhao Ouyang Rephrase the paragraph. Signed-off-by: Heinrich Schuchardt --- doc/develop/cyclic.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/develop/cyclic.rst b/doc/develop/cyclic.rst index 43bedacb9f8..67831496a70 100644 --- a/doc/develop/cyclic.rst +++ b/doc/develop/cyclic.rst @@ -8,11 +8,11 @@ execute code, e.g. every 100ms. Examples for such functions might be LED blinking etc. The functions that are hooked into this cyclic list should be small timewise as otherwise the execution of the other code that relies on a high frequent polling (e.g. UART rx char ready check) might be -delayed too much. To detect cyclic functions with a too long execution -time, the Kconfig option `CONFIG_CYCLIC_MAX_CPU_TIME_US` is introduced, -which configures the max allowed time for such a cyclic function. If it's -execution time exceeds this time, this cyclic function will get removed -from the cyclic list. +delayed too much. To detect cyclic functions with an excessive execution +time, the Kconfig option `CONFIG_CYCLIC_MAX_CPU_TIME_US` was introduced. +It defines the maximum allowable execution time for such a cyclic function. The +first time the execution of a cyclic function exceeds this interval, a warning +will be displayed indicating the problem to the user. Registering a cyclic function ----------------------------- From 9990873aa1fd7836000b310debb925c6d8365691 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 8 Oct 2023 15:35:56 -0600 Subject: [PATCH 3/6] doc: Add a short intro video This video covers the basics in a short time, so add a link to it. Signed-off-by: Simon Glass Reviewed-by: Paul Barker Signed-off-by: Heinrich Schuchardt --- doc/learn/talks.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/learn/talks.rst b/doc/learn/talks.rst index 0bb44aeabe5..d65e3b92be1 100644 --- a/doc/learn/talks.rst +++ b/doc/learn/talks.rst @@ -15,6 +15,9 @@ learn a bit about U-Boot: `__ from Embedded Linux Conference 2023. +* `Introduction to U-Boot for beginners + `__ + See elinux_talks_ for a more comprehensive list. .. _elinux_talks: https://elinux.org/Boot_Loaders#U-Boot From df5227e5e385546194d1b842caffd9015e6e21e5 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 9 Oct 2023 12:11:36 +0100 Subject: [PATCH 4/6] doc: Migrate Renesas board docs to rst Some of the information in README.rmobile is obsolete, references defconfigs which no longer exist in u-boot or has broken links. The information which is still relevant is moved into the reStructuredText documentation under `doc/board/renesas`, and `doc/README.rmobile` is dropped. The list of boards in `doc/board/renesas` is converted into a table so it's easier to see which defconfig to use. The list is expanded based on reviewing the current u-boot code and the contents of the eLinux wiki [1] [2]. [1]: https://elinux.org/R-Car [2]: https://elinux.org/RZ-G Signed-off-by: Paul Barker Signed-off-by: Heinrich Schuchardt --- doc/README.rmobile | 99 ------------- doc/board/renesas/renesas.rst | 253 ++++++++++++++++++++++++++++++---- 2 files changed, 223 insertions(+), 129 deletions(-) delete mode 100644 doc/README.rmobile diff --git a/doc/README.rmobile b/doc/README.rmobile deleted file mode 100644 index 524d839558b..00000000000 --- a/doc/README.rmobile +++ /dev/null @@ -1,99 +0,0 @@ -Summary -======= - -This README is about U-Boot support for Renesas's ARM Cortex-A9 based RMOBILE[1] -and Cortex-A9/A53/A57 based R-Car[2] family of SoCs. Renesas's RMOBILE/R-Car SoC -family contains an ARM Cortex-A9/A53/A57. - -Currently the following boards are supported: - -| SoC | Board | defconfig -|===============+========================================+=================== -| R8A73A0 | KMC KZM-A9-GT [3] | kzm9g_config -| R8A7734 | Atmark-Techno Armadillo-800-EVA [4] | armadillo-800eva_config -|===============+========================================+=================== -| R8A7790 H2 | Renesas Electronics Lager | lager_defconfig -| | Renesas Electronics Stout | stout_defconfig -|---------------+----------------------------------------+------------------- -| R8A7791 M2-W | Renesas Electronics Koelsch | koelsch_defconfig -| | Renesas Electronics Porter | porter_defconfig -|---------------+----------------------------------------+------------------- -| R8A7792 V2H | Renesas Electronics Blanche | blanche_defconfig -|---------------+----------------------------------------+------------------- -| R8A7793 M2-N | Renesas Electronics Gose | gose_defconfig -|---------------+----------------------------------------+------------------- -| R8A7794 E2 | Renesas Electronics Alt | alt_defconfig -| | Renesas Electronics Silk | silk_defconfig -|===============+========================================+=================== -| R8A7795 H3 | Renesas Electronics Salvator-XS ES2.0+ | r8a7795_salvator-x_defconfig -| R8A7795 H3 | Renesas Electronics ULCB ES2.0+ | r8a7795_ulcb -|---------------+----------------------------------------+------------------- -| R8A7796 M3-W | Renesas Electronics Salvator-X | r8a7796_salvator-x_defconfig -| R8A7796 M3-W | Renesas Electronics ULCB | r8a7796_ulcb -|---------------+----------------------------------------+------------------- -| R8A77965 M3-N | Renesas Electronics Salvator-XS | r8a77965_salvator-x_defconfig -| R8A77965 M3-N | Renesas Electronics ULCB | r8a77965_ulcb -|---------------+----------------------------------------+------------------- -| R8A77970 V3M | Renesas Electronics Eagle | r8a77970_eagle_defconfig -| R8A77970 V3M | Renesas Electronics V3MSK | r8a77970_v3msk_defconfig -|---------------+----------------------------------------+------------------- -| R8A77995 D3 | Renesas Electronics Draak | r8a77995_draak_defconfig -'===============+========================================+=================== - -Toolchain -========= - -Either ARMv7 toolchain for 32bit Cortex-A9 systems or ARMv8 (aarch64) -toolchain for 64bit Cortex-A53/A57 systems. Currently we compile the -32bit systems with -march=armv5 to allow more compilers to work. (For -U-Boot code this has no performance impact.) - -Currently, ELDK[5], Linaro[6], CodeSourcery[7] and Emdebian[8] supports -ARMv7. Modern distributions also contain ARMv7 and ARMv8 crosstoolchains -in their package feeds. - -Build -===== - -Locate defconfig in the table above. Then apply standard build procedure: - - make _defconfig - make - - Note: Armadillo-800-EVA's U-Boot supports booting from SDcard only. - Please see "B.2 Appendix B Boot Specifications" in hardware manual. - -Links -===== - -[1] Renesas RMOBILE: - -http://am.renesas.com/products/soc/assp/mobile/r_mobile/index.jsp - -[2] Renesas R-Car: - -http://am.renesas.com/products/soc/assp/automotive/index.jsp - -[3] KZM-A9-GT - -http://www.kmckk.co.jp/kzma9-gt/index.html - -[4] Armadillo-800-EVA - -http://armadillo.atmark-techno.com/armadillo-800-EVA - -[5] ELDK - -http://www.denx.de/wiki/view/ELDK-5/WebHome#Section_1.6. - -[6] Linaro - -http://www.linaro.org/downloads/ - -[7] CodeSourcey - -http://www.mentor.com/embedded-software/codesourcery - -[8] Emdebian - -http://www.emdebian.org/crosstools.html diff --git a/doc/board/renesas/renesas.rst b/doc/board/renesas/renesas.rst index 04dee8da245..7d961e862e4 100644 --- a/doc/board/renesas/renesas.rst +++ b/doc/board/renesas/renesas.rst @@ -9,37 +9,230 @@ About this This document describes the information about Renesas supported boards and their usage steps. -Renesas boards --------------- +Renesas SoC based boards +------------------------ Renesas is a SoC solutions provider for automotive and industrial applications. -U-Boot supports several Renesas SoC families: +.. list-table:: Supported Renesas SoC based boards + :widths: 10, 25, 15, 10, 25 + :header-rows: 1 -* R-Car Gen2 (32-bit) - - Blanche board - - Gose board - - Koelsch board - - Lager board - - Silk board - - Porter board - - Stout board -* R-Car Gen3 (64-bit) - - Condor board - - Draak board - - Eagle board - - Ebisu board - - Salvator-X and Salvator-XS boards - - ULCB board -* R-Car Gen4 (64-bit) - - Falcon board - - Spider board - - Whitehawk board -* RZ/A1 (32-bit) - - GR-PEACH board -* RZ/G - - Beacon-rzg2 board - - Hihope-rzg2 board - - ek874 board -* RZ/N1 (32-bit) - - Schneider rzn1-snarc board + * - Family + - Board + - SoC + - Arch + - defconfig + + * - R2D + - R2D-PLUS + - SH7751 + - sh + - r2dplus_defconfig + + * - RZ/A1 + - GR-PEACH + - R7S72100 (RZ/A1H) + - arm + - grpeach_defconfig + + * - R-Car Gen2 + - Lager + - R8A7790 (H2) + - arm + - lager_defconfig + + * - + - Stout + - R8A7790 (H2) + - arm + - stout_defconfig + + * - + - Koelsch + - R8A7791 (M2-W) + - arm + - koelsch_defconfig + + * - + - Porter + - R8A7791 (M2-W) + - arm + - porter_defconfig + + * - + - Blanche + - R8A7792 (V2H) + - arm + - blanche_defconfig + + * - + - Gose + - R8A7793 (M2-N) + - arm + - gose_defconfig + + * - + - Alt + - R8A7794 (E2) + - arm + - alt_defconfig + + * - + - Silk + - R8A7794 (E2) + - arm + - silk_defconfig + + * - R-Car Gen3 + - Salvator-X(S) + - R8A77951 (H3) + - arm64 + - rcar3_salvator-x_defconfig + + * - + - ULCB + - R8A77951 (H3) + - arm64 + - rcar3_ulcb_defconfig + + * - + - Salvator-X(S) + - R8A77960 (M3-W) + - arm64 + - rcar3_salvator-x_defconfig + + * - + - ULCB + - R8A77960 (M3-W) + - arm64 + - rcar3_ulcb_defconfig + + * - + - Salvator-X(S) + - R8A77965 (M3-N) + - arm64 + - rcar3_salvator-x_defconfig + + * - + - ULCB + - R8A77965 (M3-N) + - arm64 + - rcar3_ulcb_defconfig + + * - + - Eagle + - R8A77970 (V3M) + - arm64 + - r8a77970_eagle_defconfig + + * - + - V3MSK + - R8A77970 (V3M) + - arm64 + - r8a77970_v3msk_defconfig + + * - + - Condor + - R8A77980 (V3H) + - arm64 + - r8a77980_condor_defconfig + + * - + - V3HSK + - R8A77980 (V3H) + - arm64 + - r8a77980_v3hsk_defconfig + + * - + - Ebisu + - R8A77990 (E3) + - arm64 + - r8a77990_ebisu_defconfig + + * - + - Draak + - R8A77995 (D3) + - arm64 + - r8a77995_draak_defconfig + + * - R-Car Gen4 + - Falcon + - R8A779A0 (V3U) + - arm64 + - r8a779a0_falcon_defconfig + + * - + - Spider + - R8A779F0 (S4) + - arm64 + - r8a779f0_spider_defconfig + + * - + - White Hawk + - R8A779G0 (V4H) + - arm64 + - r8a779g0_whitehawk_defconfig + + * - RZ/G2 Family + - Beacon EmbeddedWorks RZ/G2M SoM + - R8A774A1 (RZ/G2M) + - arm64 + - rzg2_beacon_defconfig + + * - + - HopeRun HiHope RZ/G2M + - R8A774A1 (RZ/G2M) + - arm64 + - hihope_rzg2_defconfig + + * - + - Beacon EmbeddedWorks RZ/G2N SoM + - R8A774B1 (RZ/G2N) + - arm64 + - rzg2_beacon_defconfig + + * - + - HopeRun HiHope RZ/G2N + - R8A774B1 (RZ/G2N) + - arm64 + - hihope_rzg2_defconfig + + * - + - Silicon Linux RZ/G2E evaluation kit (EK874) + - R8A774C0 (RZ/G2E) + - arm64 + - silinux_ek874_defconfig + + * - + - Beacon EmbeddedWorks RZ/G2H SoM + - R8A774E1 (RZ/G2H) + - arm64 + - rzg2_beacon_defconfig + + * - + - HopeRun HiHope RZ/G2H + - R8A774E1 (RZ/G2H) + - arm64 + - hihope_rzg2_defconfig + + * - :doc:`RZ/N1 Family ` + - Schneider RZ/N1D board + - R9A06G032 (RZ/N1D) + - arm64 + - rzn1_snarc_defconfig + + * - + - Schneider RZ/N1S board + - R9A06G033 (RZ/N1S) + - arm64 + - rzn1_snarc_defconfig + +Build +----- + +Locate the appropriate defconfig in the table above. Then apply standard build +procedure:: + + make + make From c4054c1c67c0293b13d0a46b081eb6158427c20e Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 24 Sep 2023 22:30:59 +0200 Subject: [PATCH 5/6] efi_selftest: BitBlt test The BitBlt test leaves the serial console output in disarray. * Call ClearScreen() where needed. * Test CheckEvent() for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey via adding navigation keys * Correct timer comment For testing on the sandbox: CONFIG_CMD_BOOTEFI_SELFTEST=y CONFIG_CONSOLE_TRUETYPE=n $ ./u-boot -T -l => setenv efi_selftest block image transfer => bootefi selftest Signed-off-by: Heinrich Schuchardt Acked-by: Ilias Apalodimas --- lib/efi_selftest/efi_selftest_bitblt.c | 83 +++++++++++++++++++------- 1 file changed, 63 insertions(+), 20 deletions(-) diff --git a/lib/efi_selftest/efi_selftest_bitblt.c b/lib/efi_selftest/efi_selftest_bitblt.c index 1def8435054..605078b722d 100644 --- a/lib/efi_selftest/efi_selftest_bitblt.c +++ b/lib/efi_selftest/efi_selftest_bitblt.c @@ -14,6 +14,12 @@ #define HEIGHT 120 #define DEPTH 60 +struct pos { + efi_uintn_t x; + efi_uintn_t y; + int redrawn; +}; + static const struct efi_gop_pixel BLACK = { 0, 0, 0, 0}; static const struct efi_gop_pixel RED = { 0, 0, 255, 0}; static const struct efi_gop_pixel ORANGE = { 0, 128, 255, 0}; @@ -27,7 +33,7 @@ static efi_guid_t efi_gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; static struct efi_gop *gop; static struct efi_gop_pixel *bitmap; static struct efi_event *event; -static efi_uintn_t xpos; +static struct pos pos; static void ellipse(efi_uintn_t x, efi_uintn_t y, efi_uintn_t x0, efi_uintn_t y0, @@ -62,31 +68,33 @@ static void rectangle(efi_uintn_t x, efi_uintn_t y, */ static void EFIAPI notify(struct efi_event *event, void *context) { - efi_uintn_t *pos = context; + struct pos *pos = context; efi_uintn_t dx, sx, width; if (!pos) return; /* Increment position */ - *pos += 5; - if (*pos >= WIDTH + gop->mode->info->width) - *pos = 0; + pos->x += 5; + if (pos->x >= WIDTH + gop->mode->info->width) + pos->x = 0; width = WIDTH; - dx = *pos - WIDTH; + dx = pos->x - WIDTH; sx = 0; - if (*pos >= gop->mode->info->width) { - width = WIDTH + gop->mode->info->width - *pos; - } else if (*pos < WIDTH) { + if (pos->x >= gop->mode->info->width) { + width = WIDTH + gop->mode->info->width - pos->x; + } else if (pos->x < WIDTH) { dx = 0; - sx = WIDTH - *pos; - width = *pos; + sx = WIDTH - pos->x; + width = pos->x; } /* Copy image to video */ - gop->blt(gop, bitmap, EFI_BLT_BUFFER_TO_VIDEO, sx, 0, dx, DEPTH, + gop->blt(gop, bitmap, EFI_BLT_BUFFER_TO_VIDEO, sx, 0, dx, pos->y, width, HEIGHT, WIDTH * sizeof(struct efi_gop_pixel)); + + pos->redrawn = 1; } /* @@ -107,7 +115,7 @@ static int setup(const efi_handle_t handle, /* Create event */ ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, notify, (void *)&xpos, + TPL_CALLBACK, notify, (void *)&pos, &event); if (ret != EFI_SUCCESS) { efi_st_error("could not create event\n"); @@ -247,6 +255,9 @@ static int execute(void) return EFI_ST_FAILURE; } + con_out->set_attribute(con_out, EFI_WHITE | EFI_BACKGROUND_BLUE); + con_out->clear_screen(con_out); + /* Fill background */ ret = gop->blt(gop, bitmap, EFI_BLT_VIDEO_FILL, 0, 0, 0, 0, info->width, info->height, 0); @@ -281,21 +292,53 @@ static int execute(void) return EFI_ST_FAILURE; } - /* Set 250ms timer */ - xpos = WIDTH; + /* Set 25ms timer */ + pos.x = WIDTH; + pos.y = DEPTH; ret = boottime->set_timer(event, EFI_TIMER_PERIODIC, 250000); if (ret != EFI_SUCCESS) { efi_st_error("Could not set timer\n"); return EFI_ST_FAILURE; } - con_out->set_cursor_position(con_out, 0, 0); - con_out->set_attribute(con_out, EFI_WHITE | EFI_BACKGROUND_BLUE); efi_st_printf("The submarine should have three yellow port holes.\n"); - efi_st_printf("Press any key to continue"); - efi_st_get_key(); + efi_st_printf("UP, DOWN to navigate, any other key to quit"); + for (;;) { + struct efi_input_key input_key; + + ret = boottime->check_event(con_in->wait_for_key); + if (ret == EFI_NOT_READY) + continue; + if (ret != EFI_SUCCESS) { + efi_st_error("CheckEvent failed %x\n", + (unsigned int)ret); + return EFI_ST_FAILURE; + } + ret = con_in->read_key_stroke(con_in, &input_key); + if (ret != EFI_SUCCESS) { + efi_st_error("Key not available %x\n", + (unsigned int)ret); + return EFI_ST_FAILURE; + } + switch (input_key.scan_code) { + case 0x01: /* UP */ + if (pos.redrawn && pos.y >= 5) { + pos.y -= 5; + pos.redrawn = 0; + } + continue; + case 0x02: /* DOWN */ + if (pos.redrawn && + pos.y + HEIGHT + 5 < gop->mode->info->height) { + pos.y += 5; + pos.redrawn = 0; + } + continue; + } + break; + } con_out->set_attribute(con_out, EFI_LIGHTGRAY); - efi_st_printf("\n"); + con_out->clear_screen(con_out); return EFI_ST_SUCCESS; } From c1ab04626d6b05c6e82dfe4d97d3f62f7310d612 Mon Sep 17 00:00:00 2001 From: Masahisa Kojima Date: Thu, 12 Oct 2023 14:31:59 +0900 Subject: [PATCH 6/6] efi_loader: use well-known guid for auto-created boot option The boot option automatically created by efibootmgr is identified by the special guid appended in the optional data of boot option. The same mechanism is implemented in the EDK II reference implementation, it uses the different guid from the one currently U-Boot uses. The guid indicating auto-created boot option is not defined in the UEFI specification, but some userspace tools such as 'efivar' package are aware of the guid used in EDK II as auto-created boot option. So let's use the same guid as EDK II reference implementation. Signed-off-by: Masahisa Kojima Reviewed-by: Heinrich Schuchardt --- include/efi_loader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/efi_loader.h b/include/efi_loader.h index 4a29ddaef42..e24410505f4 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -149,8 +149,8 @@ static inline efi_status_t efi_launch_capsules(void) /* GUID for the auto generated boot menu entry */ #define EFICONFIG_AUTO_GENERATED_ENTRY_GUID \ - EFI_GUID(0x38c1acc1, 0x9fc0, 0x41f0, \ - 0xb9, 0x01, 0xfa, 0x74, 0xd6, 0xd6, 0xe4, 0xde) + EFI_GUID(0x8108ac4e, 0x9f11, 0x4d59, \ + 0x85, 0x0e, 0xe2, 0x1a, 0x52, 0x2c, 0x59, 0xb2) /* Use internal device tree when starting UEFI application */ #define EFI_FDT_USE_INTERNAL NULL