-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linux loader #187
base: master
Are you sure you want to change the base?
Add Linux loader #187
Conversation
There's a printf along with the small libc in litedram/gen-src/sdram_init. This is similar to the one I put in simple_random. Let's not add yet another one :) I'm thinking moving a bunch of that stuff to a sw/ directory, we shall see.. |
Joel, were you going to update this? I thought you were going to lose the printf and just use explicit print_string and print_hex calls (to reduce the object code size), and also remove the row of dots being printed. |
We can now load Linux directly from flash on the Arty now that Ben's flash controller is implemented. I can update this so it can be used from the flash if we think that would be useful? |
On Sun, 2020-06-14 at 20:55 -0700, Joel Stanley wrote:
We can now load Linux directly from flash on the Arty now that Ben's
flash controller is implemented.
I can update this so it can be used from the flash if we think that
would be useful?
Ideally we want a loader that can generate the right device-tree for
the board based on the board type and syscon setup bits.
It can then load a secondary payload from flash, ethernet or serial...
In fact, it could also provide a little OPAL blob :-) We'll probably
want that for XICS unless we add native ICS support to Linux.
Cheers,
Ben.
|
Signed-off-by: Joel Stanley <[email protected]>
This is a copy of litedram/gen-src/sdram_init/libc. We should work out how to share the sources. Signed-off-by: Joel Stanley <[email protected]>
This privdes just enough firmware to load Linux. The loader is linked to run from the aliased BRAM address. This means you should configure your SoC with BRAM (ie, don't pass --no_bram). It can load a raw kernel (vmlinux.bin) or a wrapper that embeds the device tree (dtbImage.microwatt). The printf comes from https://github.com/mpredfearn/simple-printf 1. Build Linux for microwatt objcopy -O binary microwatt/vmlinux vmlinux.bin 2. Build a dtb 3. Set MW_DEBUG to point to a copy of mw_debug and type `make load` to load the loader into BRAM. 4. Press 'RESET' 5. Follow the instructions: Microwatt Loader (Jun 22 2020 16:44:59 Load binaries into SDRAM and select option to start: vmlinux.bin and dtb: mw_debug -b jtag stop load vmlinux.bin load microwatt.dtb 0x1000000 start press 'l' to start' dtbImage.microwatt: mw_debug -b jtag stop load dtbImage.microwatt 0x500000 start press 'w' to start' Flash: To boot a binary from flash, write it to 0000000000300000 press 'f' to start' If you want to test other software, such as MicroPython, you can also load it to the start of SDRAM and the loader will jump to it with 'l'. Signed-off-by: Joel Stanley <[email protected]>
This privdes just enough firmware to load Linux. The loader is linked to
run from the aliased BRAM address.
It can load a raw kernel (vmlinux.bin) or a wrapper that embeds the
device tree (dtbImage.microwatt).
The printf comes from https://github.com/mpredfearn/simple-printf
Build Linux for microwatt
objcopy -O binary microwatt/vmlinux vmlinux.bin
Build a dtb
Set MW_DEBUG to point to a copy of mw_debug and type
make load
toload the loader into BRAM.
Press 'RESET'
Follow the instructions:
Microwatt Loader (Jun 2 2020 21:31:16)
Load binaries into SDRAM and select option to start:
vmlinux.bin and dtb:
mw_debug -b jtag stop load vmlinux.bin load microwatt.dtb 1000000 start
press 'l' to start'
dtbImage.microwatt:
mw_debug -b jtag stop load dtbImage.microwatt 500000 start
press 'w' to start'
If you want to test other software, such as MicroPython, you can also
load it to the start of SDRAM and the loader will jump to it with 'l'.
Signed-off-by: Joel Stanley [email protected]