From 963cdadeaf95624e5911cc0b71950fd701a545ed Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 23 Dec 2025 11:57:51 -0800 Subject: [PATCH] Peer review fixes --- .../e2studio/RZN2L/flash_app/src/Flash_wrappedkey_public.s | 2 +- docs/Targets.md | 5 +++-- hal/armv8m_tz.h | 2 +- hal/hifive1.c | 6 ++---- hal/mpfs250.c | 2 +- hal/mpfs250.h | 2 +- hal/mpfs250.ld | 2 +- hal/nxp_ls1028a.c | 2 +- hal/nxp_ls1028a.h | 2 +- hal/nxp_p1021.c | 2 +- hal/stm32h5.c | 2 +- hal/stm32h5.h | 2 +- hal/va416x0.h | 2 +- include/x86/exceptions.h | 2 +- include/x86/fsp.h | 2 +- include/x86/gdt.h | 2 +- src/stage2_params.c | 4 ++-- src/x86/exceptions.c | 2 +- src/x86/fsp.c | 2 +- src/x86/gdt.c | 4 ++-- test-app/app_nxp_ls1028a.c | 2 +- test-app/app_stm32h5.c | 2 +- test-app/app_x86_fsp_qemu.c | 2 +- 23 files changed, 28 insertions(+), 29 deletions(-) diff --git a/IDE/Renesas/e2studio/RZN2L/flash_app/src/Flash_wrappedkey_public.s b/IDE/Renesas/e2studio/RZN2L/flash_app/src/Flash_wrappedkey_public.s index 415e8816..67b3e678 100644 --- a/IDE/Renesas/e2studio/RZN2L/flash_app/src/Flash_wrappedkey_public.s +++ b/IDE/Renesas/e2studio/RZN2L/flash_app/src/Flash_wrappedkey_public.s @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/docs/Targets.md b/docs/Targets.md index ae190a49..13d80ce9 100644 --- a/docs/Targets.md +++ b/docs/Targets.md @@ -926,11 +926,12 @@ sudo dd if=test-app/image_v1_signed.bin of=/dev/sdc2 bs=512 && sudo cmp test-app 4) Insert SDCARD into PolarFire and let HSS start wolfBoot. You may need to use `boot sdcard` or configure/build HSS to disable MMC / enable SDCARD. -### PolarFire building Yocto-SDK Linux +### PolarFire Building Yocto-SDK Linux See: * https://github.com/linux4microchip/meta-mchp/blob/scarthgap/meta-mchp-common/README.md * https://github.com/linux4microchip/meta-mchp/blob/scarthgap/meta-mchp-polarfire-soc/README.md +* https://github.com/polarfire-soc/polarfire-soc-documentation/blob/master/reference-designs-fpga-and-development-kits/mpfs-video-kit-embedded-software-user-guide.md Building mchp-base-image Yocto Linux: @@ -947,7 +948,7 @@ MACHINE=mpfs-video-kit bitbake mchp-base-image-sdk Build images are output to: `./tmp-glibc/deploy/images/mpfs-video-kit/` -#### Building custom FIT image, signing and coping to SDCard +#### Custom FIT image, signing and coping to SDCard ```sh # Extract GZIP compressed linux kernel to wolfboot root diff --git a/hal/armv8m_tz.h b/hal/armv8m_tz.h index 975cc155..1f5286cd 100644 --- a/hal/armv8m_tz.h +++ b/hal/armv8m_tz.h @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/hal/hifive1.c b/hal/hifive1.c index a7b10666..94c6da48 100644 --- a/hal/hifive1.c +++ b/hal/hifive1.c @@ -269,7 +269,7 @@ void fespi_init(uint32_t cpu_clock, uint32_t flash_freq) static RAMFUNCTION void fespi_swmode(void) { asm volatile("fence"); - + asm volatile("fence.i"); if (FESPI_REG_FCTRL & FESPI_FCTRL_MODE_SEL) FESPI_REG_FCTRL &= ~FESPI_FCTRL_MODE_SEL; } @@ -280,7 +280,7 @@ static RAMFUNCTION void fespi_hwmode(void) if ((FESPI_REG_FCTRL & FESPI_FCTRL_MODE_SEL) == 0) FESPI_REG_FCTRL |= FESPI_FCTRL_MODE_SEL; asm volatile("fence"); - + asm volatile("fence.i"); /* Wait two milliseconds for the eSPI device * to reboot into hw-mapped mode and link to the * instruction cache @@ -575,13 +575,11 @@ int RAMFUNCTION hal_flash_erase(uint32_t address, int len) address -= FLASH_BASE; end = address + len - 1; - FESPI_REG_TXMARK = 1; fespi_wait_txwm(); fespi_swmode(); fespi_wait_flash_busy(); - for (p = address; p <= end; p += FESPI_FLASH_SECTOR_SIZE) { fespi_write_enable(); fespi_csmode_hold(); diff --git a/hal/mpfs250.c b/hal/mpfs250.c index b2350067..f0865f3d 100644 --- a/hal/mpfs250.c +++ b/hal/mpfs250.c @@ -861,7 +861,7 @@ int mmc_init(void) reg |= EMMC_SD_SRS15_DSS_TYPE_B; /* default */ EMMC_SD_SRS15 = reg; - /* eanble high speed */ + /* enable high speed */ EMMC_SD_SRS10 |= EMMC_SD_SRS10_HSE; /* set UHS mode */ diff --git a/hal/mpfs250.h b/hal/mpfs250.h index 2c4c7c2e..0066e24f 100644 --- a/hal/mpfs250.h +++ b/hal/mpfs250.h @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/hal/mpfs250.ld b/hal/mpfs250.ld index 49d1e640..732b8c50 100644 --- a/hal/mpfs250.ld +++ b/hal/mpfs250.ld @@ -57,4 +57,4 @@ SECTIONS } PROVIDE(_start_heap = _end); -PROVIDE(_end_stack = ORIGIN(RAM_L2_SCRATCH) + (LENGTH(RAM_L2_SCRATCH)) ); +PROVIDE(_end_stack = ORIGIN(L2_SCRATCH) + (LENGTH(L2_SCRATCH)) ); diff --git a/hal/nxp_ls1028a.c b/hal/nxp_ls1028a.c index d886a217..fb39f977 100644 --- a/hal/nxp_ls1028a.c +++ b/hal/nxp_ls1028a.c @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/hal/nxp_ls1028a.h b/hal/nxp_ls1028a.h index b383f277..17fbdcb6 100644 --- a/hal/nxp_ls1028a.h +++ b/hal/nxp_ls1028a.h @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/hal/nxp_p1021.c b/hal/nxp_p1021.c index c96b9ef7..7b173e95 100644 --- a/hal/nxp_p1021.c +++ b/hal/nxp_p1021.c @@ -1564,7 +1564,7 @@ static void hal_irq_init(void) set32(PIC_GCR, PIC_GCR_RST); while (get32(PIC_GCR) & PIC_GCR_RST); - set32(PIC_GCR, PIC_GCR_M); /* eanble mixed-mode */ + set32(PIC_GCR, PIC_GCR_M); /* enable mixed-mode */ reg = get32(PIC_GCR); /* read back */ (void)reg; } diff --git a/hal/stm32h5.c b/hal/stm32h5.c index c100f7b0..264f8351 100644 --- a/hal/stm32h5.c +++ b/hal/stm32h5.c @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/hal/stm32h5.h b/hal/stm32h5.h index 26a60266..f62cc08f 100644 --- a/hal/stm32h5.h +++ b/hal/stm32h5.h @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/hal/va416x0.h b/hal/va416x0.h index e86de446..74d4d39b 100644 --- a/hal/va416x0.h +++ b/hal/va416x0.h @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/include/x86/exceptions.h b/include/x86/exceptions.h index 3097ab81..e0452208 100644 --- a/include/x86/exceptions.h +++ b/include/x86/exceptions.h @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/include/x86/fsp.h b/include/x86/fsp.h index cbd42f70..bfd8a3dc 100644 --- a/include/x86/fsp.h +++ b/include/x86/fsp.h @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/include/x86/gdt.h b/include/x86/gdt.h index 3b74d4db..720885c7 100644 --- a/include/x86/gdt.h +++ b/include/x86/gdt.h @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/src/stage2_params.c b/src/stage2_params.c index fd13252f..069b9e9d 100644 --- a/src/stage2_params.c +++ b/src/stage2_params.c @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, @@ -80,7 +80,7 @@ struct idt_descriptor { void stage2_set_parameters(struct stage2_parameter *p, struct stage2_ptr_holder *holder) { struct idt_descriptor idt; - + idt.limit = sizeof(holder->dummy_idt) - 1; idt.base = (uint32_t)&holder->dummy_idt; memset(holder->dummy_idt, 0, sizeof(holder->dummy_idt)); diff --git a/src/x86/exceptions.c b/src/x86/exceptions.c index 761ac9de..c9cdaab9 100644 --- a/src/x86/exceptions.c +++ b/src/x86/exceptions.c @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/src/x86/fsp.c b/src/x86/fsp.c index 28e944d4..e21e499e 100644 --- a/src/x86/fsp.c +++ b/src/x86/fsp.c @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/src/x86/gdt.c b/src/x86/gdt.c index ee2fcbeb..df093066 100644 --- a/src/x86/gdt.c +++ b/src/x86/gdt.c @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, @@ -89,7 +89,7 @@ int gdt_update_segments(void) "retfq\r\n" "seg_cs:\r\n" : - : "i"(GDT_DS), "i" (GDT_CS_64BIT) + : "i"(GDT_DS), "i" (GDT_CS_64BIT) : "rax" ); return 0; diff --git a/test-app/app_nxp_ls1028a.c b/test-app/app_nxp_ls1028a.c index e9002890..3502e941 100644 --- a/test-app/app_nxp_ls1028a.c +++ b/test-app/app_nxp_ls1028a.c @@ -6,7 +6,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/test-app/app_stm32h5.c b/test-app/app_stm32h5.c index ddf199c9..787ea59a 100644 --- a/test-app/app_stm32h5.c +++ b/test-app/app_stm32h5.c @@ -8,7 +8,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful, diff --git a/test-app/app_x86_fsp_qemu.c b/test-app/app_x86_fsp_qemu.c index eb50fdcc..feed83eb 100644 --- a/test-app/app_x86_fsp_qemu.c +++ b/test-app/app_x86_fsp_qemu.c @@ -8,7 +8,7 @@ * * wolfBoot is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * wolfBoot is distributed in the hope that it will be useful,