Freedom-u540 board related dts file

Hi folks,

            I am using freedom-U540 Soc .I need information regrading freedom-U540 internel peripherals inside soc information.and where i have to get these peripheral device addresses ,pin descriptions,each device supported interrupts i want to write my own dts file .I didn't get related documents & data sheet ,needed those documents.if any body knows please update me that information.

Thanking you,
Sateesh

You can find a lot of info in the Freedom-U540-C000 manual at
https://www.sifive.com/documentation
This describes the on chip peripherals, and provides a memory map. We don’t have a datasheet, as we don’t sell the chip as a separate part, so we may not have public info for pin descriptions. There is a schematic for the Freedom Unleashed, but I don’t think you can get much pin info from that.

You can find the original built-in dtb in the boot loader source tree, e.g.
https://github.com/sifive/freedom-u540-c000-bootloader/blob/master/fsbl/ux00_fsbl.dts
The simplest approach is to probably start with that and modify it as necessary.

I am also really confused about this. I built the git repo and loaded it up and I didn’t have access to any ports (as far as I know). I didn’t have an spi, i2c, uart, etc… Do I need to manually add these to the dts? I added a debian rootfs on the second part. Idk if this has anything to do with it. Are the ports under different names than i2c0, i2c1?

Which git repo did you build? I’m not a kernel hacker and don’t know how any of this stuff works. There are spi, i2c, etc entries in the dts I pointed at. What do you mean that the devices aren’t there? If the kernel booted, then they must be there, otherwise it wouldn’t have booted. Maybe you are looking for stuff in /dev? Maybe no one has written driver support for that yet? Try looking in /proc/device-tree/soc to see device tree devices.

You might have better luck asking linux kernel questions on a linux kernel mailing list.

So normally (like when edit device tree in ARM), if I enable i2c0, I can go to /dev/ and see the stream there. so /dev/i2cx. But I don’t see that. I’m currently away from the board so I can’t send a screenshot, but when I go to /dev/, all I see are the standard streams. So from what I can tell, there are no sercom streams. Maybe they’re enabled but the streams are just missing?

Also, I built the one from the getting started guide: https://github.com/sifive/freedom-u-sdk.git and followed the instructions there before making the debian filesystem and tacking it on to the second partition.

RISC-V is a new target. Not everything that is supported for ARM and x86_64 works for RISC-V yet. I would guess that more kernel device driver work for RISC-V is required, and that if you want a better answer you need to ask a linux kernel developer. Or alternatively, maybe it is just a linux kernel config issue, but again, you would have to ask a linux kernel developer.

There are many possible issues that could cause this. It could be that your userspace is not using devtmpfs, and so udev or some other userspace program needs to create /dev/i2c0 itself, and is not doing it. You can try using “mknod” to create the device special file by hand. If that works, then it’s likely a userspace issue.

Another possible cause could be that CONFIG_I2C_OCORES wasn’t enabled when you rebuilt your kernel.

Another possible cause could be that the board is not using the DT file that you created.

@jimw @paulw Sorry to bump this thread, but I got it working! I missed a lot during my first attempt at building the kernel from the git repo. Thanks

\o/

For future viewers of this thread: upstream DT data now exists for the FU540 SoC at:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/boot/dts/sifive/fu540-c000.dtsi

and for the HiFive Unleashed board at:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts