[lowrisc-dev] boot linux directly from DDR, (no sdcard)

Dr Jonathan Kimmitt jrrk2 at cam.ac.uk
Tue Mar 20 09:10:46 GMT 2018

Yes, it's possible but you need to bear in mind the FPGA bitstream has 
to come from somewhere.

If you use QSPI for the bitstream, you would have to offset the address 
of the kernel when you access

it from the bootloader. The Vivado QSPI IP gives access to flash from 
software but I don't know if it supports

every kind of QSPI that could be installed on the board. If you try to 
access it from your own hardware design

you will have to deal with the problem of the configuration pins being 
shared with user pins.

It's all doable but you need to be persistent and have an enquiring 
attitude to chase down the different issues.

If you have a tool which generates the .bin files that Xilinx require, 
this can be used to piggyback any binary file
using the .incbin function of the assembler. The boot loader would then 
have to be modified to read the ELF header
of the loaded .bin file and find the section which was piggybacked.

On 20/03/18 08:57, Anup Kini wrote:
> Thank You Jonathan for the explanation.
> It looks rather cumbersome to go ahead with this option.
> I looked at the Flash & Jump baremetal examples in v0.5.
> I was wondering if we could use the onboard 1Gbit QSPI Flash in place 
> of the SD Card.
> I tried to load the VMLINUX and BBL file directly using Xilinx 
> Hardware Manager, but the tool expects a bin file.
> Something similar to zImage for ZYNQ.
> is it possible to boot lowRISC using the onboard QSPI Flash?
> Thanks & Regards,
> Anup Kini.
> On Mon, Mar 19, 2018 at 4:09 PM, Dr Jonathan Kimmitt <jrrk2 at cam.ac.uk 
> <mailto:jrrk2 at cam.ac.uk>> wrote:
>     It's possible to change the base address of RAM in Linux from
>     0x80000000 but this
>     has an impact on page tables, Berkeley boot loader, spike
>     simulator and chisel etc.
>     You might find it easier to modify your custom AXI interface
>     address if that is possible.
>     Alternatively if you have dynamic memory on board your card, you
>     could adapt the Xilinx MIG config
>     to use this memory and save the overhead of the custom AXI
>     interface. Most cards come
>     with an example MIG config to reduce the burden of setting all the
>     parameters correctly.
>     If you want to have a go at changing the kernel address, you need
>     to be aware that it is BBL that loads
>     at 0x80000000 and not the kernel itself. Typically the kernel
>     address will be loaded at the next megapage
>     which is typically 0x80200000. And the kernel never accesses this
>     address because it runs in supervisor mode
>     which sets the kernel address to 0xffffffff80000000 using the MMU.
>     If you change the base address you need
>     to make sure any calculations involving BBL address or MMU page
>     tables are corrected. All very simple NOT!
>     On 19/03/18 06:57, Anup Kini wrote:
>         Hi All,
>         I am trying to boot linux on lowRISC using a custom Virtex-7
>         board.
>         Unfortunately, the SD card interface has some issues and I am
>         unable to use
>         it.
>         I was able to bring up the lowRISC design and run hello world
>         and dram test
>         successfully.
>         Since, I do not have the SD Card, I tried to load the BBL
>         directly on to
>         DDR using the custom AXI interface provided by the board vendor.
>         It loads successfully and a few debug prints from the BBL also
>         show up on
>         the UART terminal. I had to modify the boot.c code inorder to
>         get this
>         working.
>         Going forward, I was curious to know if I can load the vmlinux
>         and root.bin
>         also to DDR and boot linux.
>         I understand that the base address for vmlinux is fixed to
>         0x80000000+OFFSET.
>         Will it be possible for me to change this and boot linux
>         directly from DDR ?
>         Thanks & Regards,
>         Anup Kini.

More information about the lowrisc-dev mailing list