[PATCH 0/2] configs: JH7110: enable EFI_LOADER_BOUNCE_BUFFER

Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.
As a prerequisite we must allow CONFIG_EFI_LOADER_BOUNCE_BUFFER on RISC-V.
Heinrich Schuchardt (2): efi_loader: allow EFI_LOADER_BOUNCE_BUFFER on all architectures configs: JH7110: enable EFI_LOADER_BOUNCE_BUFFER
configs/starfive_visionfive2_defconfig | 1 + lib/efi_loader/Kconfig | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)

Commit 775f7657ba58 ("Kconfig: clean up the efi configuration status") by mistake revoked commit dcd1b63b7072 ("efi_loader: allow EFI_LOADER_BOUNCE_BUFFER on all architectures").
Fixes: 775f7657ba58 ("Kconfig: clean up the efi configuration status") Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- lib/efi_loader/Kconfig | 1 - 1 file changed, 1 deletion(-)
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 58d49789f12..d93f28b8422 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -481,7 +481,6 @@ endmenu menu "Misc options" config EFI_LOADER_BOUNCE_BUFFER bool "EFI Applications use bounce buffers for DMA operations" - depends on ARM64 help Some hardware does not support DMA to full 64bit addresses. For this hardware we can create a bounce buffer so that payloads don't have to

Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.
Reported-by: E Shattow lucent@gmail.com Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- configs/starfive_visionfive2_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/starfive_visionfive2_defconfig b/configs/starfive_visionfive2_defconfig index 1c70d1d4b70..20f89ae6796 100644 --- a/configs/starfive_visionfive2_defconfig +++ b/configs/starfive_visionfive2_defconfig @@ -32,6 +32,7 @@ CONFIG_CMODEL_MEDANY=y CONFIG_RISCV_SMODE=y # CONFIG_OF_BOARD_FIXUP is not set # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_EFI_LOADER_BOUNCE_BUFFER=y CONFIG_FIT=y CONFIG_BOOTSTD_DEFAULTS=y CONFIG_BOOTSTAGE=y

On Nov 21 2024, Heinrich Schuchardt wrote:
Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.
That doesn't change the situation with the booting problem I have.

On 21.11.24 16:24, Andreas Schwab wrote:
On Nov 21 2024, Heinrich Schuchardt wrote:
Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.
That doesn't change the situation with the booting problem I have.
Do you relate to https://lore.kernel.org/u-boot/mvm8qtnv310.fsf@suse.de/ where you had some problem reading the FAT file system and which was for as system with only 4 GiB of memory?
In E Shattow's case on a board with 8 GiB the file was read without error but then reported as not being an EFI binary.
Best regards
Heinrich

On Thu, Nov 21, 2024 at 8:05 AM Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
On 21.11.24 16:24, Andreas Schwab wrote:
On Nov 21 2024, Heinrich Schuchardt wrote:
Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.
That doesn't change the situation with the booting problem I have.
Do you relate to https://lore.kernel.org/u-boot/mvm8qtnv310.fsf@suse.de/ where you had some problem reading the FAT file system and which was for as system with only 4 GiB of memory?
In E Shattow's case on a board with 8 GiB the file was read without error but then reported as not being an EFI binary.
Best regards
Heinrich
Hi,
Test failed for both boards here with origin/master then applying this series, then starfive_visionfive2_defconfig target and set CONFIG_BOOTSTD=n following with oldconfig target.
Testing failed on 4GB Star64:
Hit any key to stop autoboot: 0 Unknown command 'bootflow' - try 'help' StarFive # bootefi bootmgr Card did not respond to voltage select! : -110 Not a PE-COFF file Loading Boot0000 'mmc 0' failed Booting: nvme 0 error: no such partition. grub rescue>
The grub EFI loader from EFI System Partition on eMMC fails to load. The same EFI System Partition data on NVMe is successful.
Testing failed on 8GB Mars CM Lite:
Hit any key to stop autoboot: 0 Unknown command 'bootflow' - try 'help' StarFive # bootefi bootmgr Card did not respond to voltage select! : -110 Failed to load EFI variables Error reading cluster Loading Boot0000 'mmc 0' failed EFI boot manager: Cannot load any image
We see that the grub EFI loader from this EFI System Partition fails to load from MMC (SD Card).
Procedure that was used to update SPI NOR flash on either board includes sanitizing the environment variable storages: env erase; env default -a -f; sf probe; dhcp; env set serverip <ip address of tftp server> tftpboot $loadaddr u-boot-spl.bin.normal.out; sf update $loadaddr 0 $filesize tftpboot $loadaddr u-boot.itb; sf update $loadaddr 100000 $filesize fatrm mmc 0:1 ubootefi.var
This does not say anything for or against the validity of the patch series as the root cause is a limitation of the dw mmc driver on JH7110 not resolved here.
-E

On Fri, 22 Nov 2024 at 04:12, E Shattow lucent@gmail.com wrote:
On Thu, Nov 21, 2024 at 8:05 AM Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
On 21.11.24 16:24, Andreas Schwab wrote:
On Nov 21 2024, Heinrich Schuchardt wrote:
Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.
That doesn't change the situation with the booting problem I have.
Do you relate to https://lore.kernel.org/u-boot/mvm8qtnv310.fsf@suse.de/ where you had some problem reading the FAT file system and which was for as system with only 4 GiB of memory?
In E Shattow's case on a board with 8 GiB the file was read without error but then reported as not being an EFI binary.
Best regards
Heinrich
Hi,
Test failed for both boards here with origin/master then applying this series, then starfive_visionfive2_defconfig target and set CONFIG_BOOTSTD=n following with oldconfig target.
I think you need to apply another patch [1].
-sughosh
[1] - https://patchwork.ozlabs.org/project/uboot/patch/20241121142522.59059-2-hein...
Testing failed on 4GB Star64:
Hit any key to stop autoboot: 0 Unknown command 'bootflow' - try 'help' StarFive # bootefi bootmgr Card did not respond to voltage select! : -110 Not a PE-COFF file Loading Boot0000 'mmc 0' failed Booting: nvme 0 error: no such partition. grub rescue>
The grub EFI loader from EFI System Partition on eMMC fails to load. The same EFI System Partition data on NVMe is successful.
Testing failed on 8GB Mars CM Lite:
Hit any key to stop autoboot: 0 Unknown command 'bootflow' - try 'help' StarFive # bootefi bootmgr Card did not respond to voltage select! : -110 Failed to load EFI variables Error reading cluster Loading Boot0000 'mmc 0' failed EFI boot manager: Cannot load any image
We see that the grub EFI loader from this EFI System Partition fails to load from MMC (SD Card).
Procedure that was used to update SPI NOR flash on either board includes sanitizing the environment variable storages: env erase; env default -a -f; sf probe; dhcp; env set serverip <ip address of tftp server> tftpboot $loadaddr u-boot-spl.bin.normal.out; sf update $loadaddr 0 $filesize tftpboot $loadaddr u-boot.itb; sf update $loadaddr 100000 $filesize fatrm mmc 0:1 ubootefi.var
This does not say anything for or against the validity of the patch series as the root cause is a limitation of the dw mmc driver on JH7110 not resolved here.
-E

On Thu, Nov 21, 2024 at 10:32 PM Sughosh Ganu sughosh.ganu@linaro.org wrote: ...
Hi,
Test failed for both boards here with origin/master then applying this series, then starfive_visionfive2_defconfig target and set CONFIG_BOOTSTD=n following with oldconfig target.
I think you need to apply another patch [1].
-sughosh
[1] - https://patchwork.ozlabs.org/project/uboot/patch/20241121142522.59059-2-hein...
I did apply the whole series, patches 1 and 2 inclusive. Is there a canary (printf? i.e.) I can add to know if this survives to the compiled output and does what you think it should do?
-E

Hi guys!
I played with latest openSUSE TW image [1] for VisionFive2 and I also had an issue but not exactly the same Andreas had. Booting the OS from an sdcard gave me the grub cli but not the menu. With Heinrich's patch I was able to boot on grub menu as fully boot the OS as well.
Tested-by: Loic Devulder ldevulder@suse.com

On Fri, Nov 22, 2024 at 6:33 AM Loic Devulder ldevulder@suse.com wrote:
Hi guys!
I played with latest openSUSE TW image [1] for VisionFive2 and I also had an issue but not exactly the same Andreas had. Booting the OS from an sdcard gave me the grub cli but not the menu. With Heinrich's patch I was able to boot on grub menu as fully boot the OS as well.
Tested-by: Loic Devulder ldevulder@suse.com
-- Loic Devulder ldevulder@suse.com Senior QA Engineer | SUSE Software Solutions
[1] - https://download.opensuse.org/ports/riscv/tumbleweed/images/openSUSE-Tumblew...
On Thu, 2024-11-21 at 16:24 +0100, Andreas Schwab wrote:
On Nov 21 2024, Heinrich Schuchardt wrote:
Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.
That doesn't change the situation with the booting problem I have.
What was this series supposed to do and how to test for it properly? I did not see any difference, still just failure on 4GB and 8GB DRAM ... is my testing method wrong?
-E

On Mon, Nov 25, 2024 at 10:32 PM E Shattow lucent@gmail.com wrote:
On Fri, Nov 22, 2024 at 6:33 AM Loic Devulder ldevulder@suse.com wrote:
Hi guys!
I played with latest openSUSE TW image [1] for VisionFive2 and I also had an issue but not exactly the same Andreas had. Booting the OS from an sdcard gave me the grub cli but not the menu. With Heinrich's patch I was able to boot on grub menu as fully boot the OS as well.
Tested-by: Loic Devulder ldevulder@suse.com
-- Loic Devulder ldevulder@suse.com Senior QA Engineer | SUSE Software Solutions
[1] - https://download.opensuse.org/ports/riscv/tumbleweed/images/openSUSE-Tumblew...
On Thu, 2024-11-21 at 16:24 +0100, Andreas Schwab wrote:
On Nov 21 2024, Heinrich Schuchardt wrote:
Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.
That doesn't change the situation with the booting problem I have.
What was this series supposed to do and how to test for it properly? I did not see any difference, still just failure on 4GB and 8GB DRAM ... is my testing method wrong?
-E
Postscript: After some discussion with Sughosh we find that yes I am testing this code path but "the logic of addr_aligned() needs to be changed". This series is correct but the commit description is confusing by omission of information: There is a 1GB offset in address space to DRAM, and so any board with more than 3GB DRAM are affected. If reading the commit message without knowing this information it seems like 4GB DRAM board would not be affected but such address space goes to 5GB. I was hoping for some reply from Heinrich to resolve why testing results are not consistent and to offer a clearer commit message before the pull request.
With that, and my thanks to Heinrich for speedy bug fixing,
Tested-by: E Shattow lucent@gmail.com
participants (5)
-
Andreas Schwab
-
E Shattow
-
Heinrich Schuchardt
-
Loic Devulder
-
Sughosh Ganu