Boot from 64-bit memory address?

Conor Dooley conor at kernel.org
Thu Feb 23 07:56:24 CET 2023



On 23 February 2023 01:21:01 GMT, "Bernard, Philip" <philip.bernard at intel.com> wrote:
>Hi,
>
>Is it possible to boot from a DRAM memory address beyond the 32-bit boundary? I'm trying to configure a new RISC-V board which has 2GB of DRAM starting at offset 0x40_0000_0000. I started from the settings for an existing RISC-V board and made adjustments for my HW, but when I try to boot, I run into an "out of memory" error.
>
>From https://u-boot.readthedocs.io/en/latest/develop/uefi/u-boot_on_efi.html#tables I noticed that U-Boot will only use "conventional" memory which is 4GB and below, so it seems like this may not be possible? Looking through the repo, I also noticed that nearly every device is configuring settings like CONFIG_SYS_LOAD_ADDR with a 32-bit value, so I haven't found any examples to emulate for my use case.
>
>I'm hoping someone knows the mistake I'm making or can confirm that this isn't possible. Appreciate the help.

Whether you get u-boot working or not is one thing,
but there's a load of knock on from not having any
32-bit ddr. 
If you're using the generic CPU, check out its dram.c, there's a check there that forces ram_top
to 32-bit.
Other than that, it's mainly a case of swapping the config options to suitable values.
We've been doing 64-bit only for a while out of tree for icicle kit, and it does just work.
The caveat is if you intend using Linux, the dma code and some pci devices
are not going to appreciate it!
(Apologies for the formatting, mobile makes it hard)

>
>Best,
>Phil
>
>
>Below is the output from U-Boot:
>
>U-Boot SPL 2022.07 (Feb 23 2023 - 00:50:44 +0000)
>Trying to boot from RAM
>
>OpenSBI v1.1
>   ____                    _____ ____ _____
>  / __ \                  / ____|  _ \_   _|
>| |  | |_ __   ___ _ __ | (___ | |_) || |
>| |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
>| |__| | |_) |  __/ | | |____) | |_) || |_
>  \____/| .__/ \___|_| |_|_____/|____/_____|
>        | |
>        |_|
>
>Platform Name             : test,test
>Platform Features         : medeleg
>Platform HART Count       : 1
>Platform IPI Device       : aclint-mswi
>Platform Timer Device     : aclint-mtimer @ 1000000Hz
>Platform Console Device   : uart8250
>Platform HSM Device       : ---
>Platform Reboot Device    : ---
>Platform Shutdown Device  : ---
>Firmware Base             : 0x80000000
>Firmware Size             : 276 KB
>Runtime SBI Version       : 1.0
>
>Domain0 Name              : root
>Domain0 Boot HART         : 0
>Domain0 HARTs             : 0*
>Domain0 Region00          : 0x0000000002000000-0x000000000200ffff (I)
>Domain0 Region01          : 0x0000000080000000-0x000000008007ffff ()
>Domain0 Region02          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
>Domain0 Next Address      : 0x0000004001200000
>Domain0 Next Arg1         : 0x0000004001267830
>Domain0 Next Mode         : S-mode
>Domain0 SysReset          : yes
>
>Boot HART ID              : 0
>Boot HART Domain          : root
>Boot HART Priv Version    : v1.10
>Boot HART Base ISA        : rv64imafdcb
>Boot HART ISA Extensions  : time
>Boot HART PMP Count       : 8
>Boot HART PMP Granularity : 4
>Boot HART PMP Address Bits: 54
>Boot HART MHPM Count      : 0
>Boot HART MIDELEG         : 0x0000000000000222
>Boot HART MEDELEG         : 0x000000000000b109
>
>
>U-Boot 2022.07 (Feb 23 2023 - 00:50:44 +0000)
>
>CPU:   rv64imafdc
>Model: test,test
>DRAM:  2 GiB
>Core:  11 devices, 8 uclasses, devicetree: separate
>ERROR: Out of memory
>Loading Environment from nowhere... OK
>In:    serial at 131400000
>Out:   serial at 131400000
>Err:   serial at 131400000
>Model: test,test
>Net:   No ethernet found.
>Hit any key to stop autoboot:  0
>Moving Image from 0x4006000000 to 0x4000200000, end=4000b01c8c
>## Flattened Device Tree blob at ff76a1d0
>   Booting using the fdt blob at 0xff76a1d0
>ERROR: Failed to allocate 0x1000000 bytes below 0x100000000.
>ramdisk - allocation error


More information about the U-Boot mailing list