Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add Linux loader #187

wants to merge 3 commits into from

Conversation

shenki
Copy link
Contributor

@shenki shenki commented Jun 2, 2020

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

  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 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]

@ozbenh
Copy link
Contributor

ozbenh commented Jun 4, 2020

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..

@paulusmack
Copy link
Collaborator

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.

@shenki
Copy link
Contributor Author

shenki commented Jun 15, 2020

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?

@ozbenh
Copy link
Contributor

ozbenh commented Jun 15, 2020 via email

shenki added 3 commits June 22, 2020 14:39
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants