Giter Club home page Giter Club logo

Comments (13)

jim-wilson avatar jim-wilson commented on August 24, 2024

You can find it in newlib/libc/machine/riscv/sys/string.h. So it appears that it will compile with an embedded elf compiler using newlib, but not a linux compiler. The files in the lib dir all appear remarkably similar to the ones in newlib/libc/machine/riscv, so either they were borrowed from newlib, or they have a common ancestor.

It looks like we could fix this by copying the missing function from newlib into freedom-u540-c000-bootloader, but we might have to rename it to avoid conflicts with a newlib based embedded elf compiler. Or maybe we could fix this by forcing use of newlib headers somehow.

I don't know if anyone is actively maintaining this tree. There are no commits since Sept 2018. Bootloader code probably doesn't need a lot of changes once it is working though.

from freedom-u540-c000-bootloader.

andreas-schwab avatar andreas-schwab commented on August 24, 2024

How else can you fix the DTS? Kernel drivers are failing to work with the embedded device tree.

from freedom-u540-c000-bootloader.

jim-wilson avatar jim-wilson commented on August 24, 2024

I'm not a kernel hacker and don't know anything about kernel driver problems in general.

I do know that we have started using u-boot in house. I think this somehow allows one to specify an alternate DTS, perhaps by replacing the FSBL with u-boot. Using u-boot requires flipping one of the boot select switches to boot from the SDcard. With the red power switch on the left, the second switch from the bottom must be slid to the right. So maybe with u-boot working we don't need updates to the FSBL anymore?

The u-boot tree we are using is at
https://github.com/tmagik/HiFive_U-Boot
I haven't tried building this myself. We also have a freedom-u-sdk update in progress
sifive/freedom-u-sdk#88
but last I tried this it wasn't working because a compiler change meant that u-boot didn't fit in its sdcard partition anymore. This tree has never actually worked on hardware for me. And there is an alpha release at
https://github.com/tmagik/freedom-u-sdk/releases
but when I tried this it didn't work for me on hardware either. uboot ran, but the kernel didn't mount the root filesystem and dropped into busybox.

So unfortunately, we don't have anything in a releasable form at the moment, and I'm not a kernel hacker so I don't know exactly what is going on in this area.

There is one kernel driver problem I know about, and that applies only if you have the Microsemi expansion board for the HiFive Unleashed. The built-in FSBL doesn't have a DTS entry for the Microsemi PCIe support. I use the solution Atish Patra developed which modifies bbl to allow dynamically adding DTS entries. This can be found at
https://github.com/westerndigitalcorporation/RISC-V-Linux
but I think this is obsoleted by the u-boot stuff, which I haven't actually switched to yet.

from freedom-u540-c000-bootloader.

andreas-schwab avatar andreas-schwab commented on August 24, 2024

The upstream U-Boot does not support replacing FSBL, it is started by BBL or openSBI.

from freedom-u540-c000-bootloader.

paul-walmsley-sifive avatar paul-walmsley-sifive commented on August 24, 2024

If the reported issue here is the error message "undefined reference to `__libc_detect_null'", then as Jim wrote, that can be resolved by using the correct compiler. Please try using the compiler built with crosstool-ng with the "riscv64-unknown-elf" sample configuration:

https://github.com/crosstool-ng/crosstool-ng

Certainly, this is not appropriately documented. This is in keeping with the spirit of the rest of this repository ;-)

from freedom-u540-c000-bootloader.

jim-wilson avatar jim-wilson commented on August 24, 2024

We are discussing DTS problems now. Andreas wanted to build FSBL to fix the DTS, but I'm saying that u-boot provides its own DTS and hence a FSBL fix should not be necessary for that, and that we probably don't have any FSBL fixes for the DTS. But I don't know why the DTS is broken, other than for the microsemi expansion board.

from freedom-u540-c000-bootloader.

andreas-schwab avatar andreas-schwab commented on August 24, 2024

U-Boot does not have its own DTS.

from freedom-u540-c000-bootloader.

paul-walmsley-sifive avatar paul-walmsley-sifive commented on August 24, 2024

The comments on this issue are too confusing for me to figure out what the current problem is. If there is another problem with this repository beyond the compilation issue, could you guys open a separate issue?

from freedom-u540-c000-bootloader.

jim-wilson avatar jim-wilson commented on August 24, 2024

The u-boot I pointed at, the one we are using, has its own DTS.
https://github.com/tmagik/HiFive_U-Boot/blob/master/arch/riscv/dts/hifive_u540.dts

I think we are going in circles here. If you want a solution from SiFive, then you have to use our u-boot. If you don't want our u-boot, then you have to get a solution from someone else.

from freedom-u540-c000-bootloader.

paul-walmsley-sifive avatar paul-walmsley-sifive commented on August 24, 2024

Some people at SiFive may be using that U-Boot & DTS file, but as far as I know, it's not a supported SiFive repository. It's probably mostly useful for older kernels. Mainline-oriented DTS files will be different.

from freedom-u540-c000-bootloader.

tmagik avatar tmagik commented on August 24, 2024

That U-boot and DTS file is what is going to get promoted to the next officially supported SiFive release. I would appreciate any pull requests for more mainline-oriented DTS files, along with working and tested kernel configs.

from freedom-u540-c000-bootloader.

tmagik avatar tmagik commented on August 24, 2024

@andreas-schwab https://github.com/tmagik/freedom-u-sdk/blob/dev/buildroot/conf/uEnv.txt allows you to specify an alternate device tree, and use either the one provided by U-boot, or the one in the FIT image, or you can modify the env and options to load a separate bbl, kernel, DTB, and initrd images either from a partition on the SDcard, or tftp/dhcp over the network.

from freedom-u540-c000-bootloader.

andreas-schwab avatar andreas-schwab commented on August 24, 2024

I don't use buildroot, I'm using a real distribution.

from freedom-u540-c000-bootloader.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.