aboutsummaryrefslogtreecommitdiff
path: root/machine/fdt.c
AgeCommit message (Collapse)AuthorFilesLines
2019-08-12allow additional ns16550a config via device treeMichael Panzlaff1-0/+5
This commit makes bbl read some additional fields from the device tree if it detects an ns16550a: - reg-shift - reg-offset - clock-frequency For explanation of these check out the Linux Kernel doc: https://www.kernel.org/doc/Documentation/devicetree/bindings/serial/8250.txt In particular this allows the Xilinx AXI UART 16550 to act as serial console with bbl and the Linux early boot console. This also fixes a bug in which bbl will ignore any other than the first "compatible" string when iterating over the nodes. Previously this line would not have worked: compatible = "xlnx,xps-uart16550-2.00.a", "ns16550a"; Before bbl would have just checked the first field instead of checking all strings in the list.
2018-07-09Properly license all nontrivial filesAndrew Waterman1-0/+2
2018-06-20Fix problem of casting u64 to void* on 32-bit environment (#111)Zong Li1-2/+2
Can't cast to pointer from 64 bit size integer directly on 32 bit environment.
2018-05-22RISC-V: Support separate firmware and kernel payloadMichael Clark1-0/+57
Support for separate firmware and kernel payload is added by updating BBL to read optional preloaded kernel address attributes from device-tree using a similar mechanism to that used to pass init ramdisk addresses to linux kernel. chosen { riscv,kernel-start = <0x00000000 0x80200000>; riscv,kernel-end = <0x00000000 0x80590634>; }; These attributes are added by QEMU and read by BBL when combining -bios <firmware-image> and -kernel <kernel-image> options. e.g. $ qemu-system-riscv64 -machine virt -bios bbl -kernel vmlinux With this change, bbl can be compiled without --with-payload and the dummy payload alignment is altered to make the memory footprint of the firmware-only bbl smaller. The dummy payload message is updated to indicate the alternative load method. This load method could also be supported by a first stage boot loader that reads seperate firmware and kernel from SPI flash. The main advantage of this new mechanism is that it eases kernel development by avoiding the riscv-pk packaging step after kernel builds, makes building per repository artefacts for CI simpler, and mimics bootloaders on other platforms that can load a kernel image file directly. Ultimately BBL should use an SPI driver to load the kernel image however this mechanism supports use cases such such as QEMU's -bios, -kernel and -initrd options following examples from other platforms that pass kernel entry to firmware via device-tree. Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Alistair Francis <Alistair.Francis@wdc.com> Signed-off-by: Michael Clark <mjc@sifive.com>
2017-11-02Detect harts that can't boot Linux instead of hard-coding themPalmer Dabbelt1-5/+23
This checks to see if a hart can't boot Linux by looking for a compatible "mmu-type" field. If the hart can't boot Linux, then bbl masks it off.
2017-08-03Add the '--enable-print-device-tree' argumentPalmer Dabbelt1-0/+127
I'm trying to debug some device tree problems while booting Linux and figured it would be really nice to have access to the device tree while trying to debug these problems. I think this might be useful for lots of people, so I went ahead and cleaned up the code enough that it should actaully work in most cases.
2017-04-18Use uint64_t, not uintptr_t, to represent FDT addresses/sizesAndrew Waterman1-17/+20
This fixes RV32 pk.
2017-04-05Remove num_harts; use hart_mask exclusivelyAndrew Waterman1-3/+3
2017-04-05fdt: update the status length when masking cpusWesley W. Terpstra1-1/+4
2017-04-05fdt: redact clint, plic, and debug hardwareWesley W. Terpstra1-2/+154
2017-04-05fdt: support redactionWesley W. Terpstra1-7/+11
2017-03-31clint: move hart wakeup till after all FDT parsingWesley W. Terpstra1-4/+6
The clint was wiping out information discovered by the plic. Initialize hart stacks as they are discovered. Then fill in clint+plic info Then wake the harts.
2017-03-30fdt: look for the phandle of a cpu's nested interrupt controllerWesley W. Terpstra1-15/+34
2017-03-28plic: discovered via fdtWesley W. Terpstra1-0/+101
2017-03-27fdt: rewrite parser using a single design patternWesley W. Terpstra1-102/+167
2017-03-23fdt: add a size methodWesley W. Terpstra1-0/+10
2017-03-22machine: add FDT parserWesley W. Terpstra1-0/+236