Microsemi expansion board support/issue


(Wesley W. Terpstra) #9

This seems like an issue we should solve, so that these sorts of hacks are not required. I am going to work on preparing an updated Unleashed firmware image and blessed gateware images for vc707+microsemi (built from freedom) that work together. I’ll post again here when the matching versions are up on our website.

FYI, This solution will require reprogramming the FPGA, which I hope everyone here is comfortable doing.


(ATISH KUMAR PATRA) #10

@dullfire: That’s a really cool approach.

I made it to work by adding microsemi dt entry in bbl dynamically.
I have verified with a display attached via RADEON 650 GPU.

In case anybody wants to try the dynamic approach
Here are the patches:


Note: You still the Linux config changes & microsemi driver in Linux.


#11

@atish Thanks.
After taking a quick look at your repo, patching in the dt entry does seem like a better approach as far as usability by others. It’s also much less error prone (no need for board specific changes)


(ATISH KUMAR PATRA) #12

@terpstra
That would be great. We need DT changes in future as well to support different kernel features (to name a few . timer interrupt or cpu topology). How difficult is to update the firmware image everytime?

Otherwise we have to make the necessary changes in bbl either with libfdt support (my patch) or static linking approach as suggested by @dullfire.


(ATISH KUMAR PATRA) #13

Yeah but it links entire libfdt into bbl. So it increases bbl size as well.
Thus, I am not sure if that is going to be accepted.


(Wesley W. Terpstra) #14

@atish I think those sort of DTS changes will be best done by modifying the open-source version of the FSBL as soon as it’s ready. The reason I am working on a patch for this is because you need a matching hardware change to be able to distinguish between the FPGA boards attached via ChipLink. Software alone can’t solve this problem, unless you are willing to program a HiFive Unleashed to only work with one expansion board (the current situation).


(Andrew Back) #15

Curious what the latest is on this?


#16

@AndrewBack Since I haven’t seen anything from @terpstra about an updated firmware release, it looks like we are waiting on SiFive to release the FSBL code and/or an updated firnware image.

If you do not want to wait for the official release, you have two choices. If you are comfortable tinkering with the device tree, you can use my patches posted above to make the Microsemi expansion board work. I have test it on a PLX USB2232 (a usb gadget device) and was able to get it to communicate with another system.

However if you want something simpler, @atish posted a link to a git fork that he has that will patch in just the needed device tree nodes for you. I have not personally tested it, but to me it looks like the only down sides would be pulling in libfdt and the corresponding size increase.


(Wesley W. Terpstra) #17

Sorry, believe it or not I’ve been working on this issue pretty much the entire time since I posted. I am still trying to prepare an image that is suitable for release.


(Nikita) #18

Hi! Did somebody try to update a firmware in the FPGA? I tried to do that through JTAG interface but it failed with “Signal Integrity Failure” and I do not know what to do :frowning: I was never work with JTAG before. Could somebody help me with that?


(Andrew Back) #19

@terpstra just thought I’d check in and see what the status on this was?


#20

I’m also interested in hearing the status on this @terpstra


(Jim Wilson) #21

The best source of info I know of is Atish Patra’s instructions, which can be found here:


#22

Hello,

Has anyone made any progress with their expansion board?

I’ve been playing with the HiFive Unleashed board for a while and I’ve been trying to get the expansion board to work.

I have the drivers for the microsemi board enabled in the Linux Kernel

Here is a section of the boot messages:

[ 0.670000] microsemi_pcie_probe In
[ 0.670000] microsemi-pcie 2030000000.pci: interrupt disabled
[ 0.680000] microsemi-pcie 2030000000.pci: Intc node foundi interrupt-controller
[ 0.690000] microsemi-pcie 2030000000.pci: host bridge /soc/pci@2030000000 ranges:
[ 0.690000] microsemi-pcie 2030000000.pci: Parsing ranges property…
[ 0.700000] microsemi-pcie 2030000000.pci: MEM 0x40000000…0x5fffffff -> 0x40000000
[ 0.710000] microsemi-pcie 2030000000.pci: PCI host bridge to bus 0000:00

And here is what I get when listing PCI devices:

lspci -v

00:00.0 Class 1506: Device 2901:1506 (rev 01) (prog-if 29)
Flags: fast devsel
I/O ports at [disabled]
I/O ports at [disabled]
I/O ports at [disabled]
Expansion ROM at [disabled by cmd]

Does anyone know what I’m missing?

I am new to modifying Linux Kernels. Please forgive me if I am asking a super simple, newbie question.


(Jim Wilson) #23

You need the microsemi pci driver and you need a way to modify the in rom DTS to add the missing entry for the microsemi card.

The best reference is here
https://github.com/westerndigitalcorporation/RISC-V-Linux
This adds code to bbl to dynamically modify the DTS to add the missing entry for the microsemi card. Plus it has the microsemi driver, and a 4.19 kernel with patches. You might need to use the v1_0 branch of freedom-u-sdk to make this work though as it refers to freedom-u-sdk which was recently modified.

The SiFive freedom-u-sdk was recently modified to support the card. This is a little rough but can be found here
https://github.com/sifive/freedom-u-sdk
This adds u-boot support, and then u-boot provides the DTS instead of using the one from the ROM. it also includes the microsemi pcie driver.

Another option is to try this
https://github.com/tmagik/freedom-u-sdk/releases/tag/hifiveu-2.0-alpha.1
which is similar to the above, and is also a little rough but should work.


#24

Thank you for responding,

I did pull the freedom-u-sdk on sifive’s github in order to get u-boot, and that’s how I got the above result.
If the card is in standalone mode, it doesn’t see any pci devices, which is why I assumed I already had the drivers.


(Jim Wilson) #25

If you are having trouble with freedom-u-sdk, then I would suggest filing a github issue. The forums have low participation, and aren’t the best place to get help.

I’m not a hardware guy or low level system programmer, so all I can do is point you at useful sources of info.

I would ask if you have any devices plugged into the board though. I don’t know if lspci will do anything useful if nothing is plugged in.


#26

I do have devices connected; my gpu, and a hard drive.

Alrighty, thanks for the advice!


(Jim Wilson) #27

I guess one more thing I can ask is if you have programmed the FPGA. It must be programmed at least once, but once programmed should not need to be programmed a second time.


(Troy Benjegerdes) #28

If ‘lspci’ shows nothing you need to program the FPGA. See https://github.com/sifive/freedom-u-sdk/releases/download/hifiveu-2.0-alpha-2/IOFPGAChip.job for most recent ‘known good’ fpga bitstream build.

root@hifiveu:~# lspci
00:00.0 PCI bridge: Actel Device 1556
01:00.0 PCI bridge: PMC-Sierra Inc. Device 8561
02:00.0 PCI bridge: PMC-Sierra Inc. Device 8561
02:01.0 PCI bridge: PMC-Sierra Inc. Device 8561
02:02.0 PCI bridge: PMC-Sierra Inc. Device 8561
02:03.0 PCI bridge: PMC-Sierra Inc. Device 8561
03:00.0 USB controller: Renesas Technology Corp. uPD720202 USB 3.0 Host Controller (rev 02)
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Caicos [Radeon HD ]
04:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Caicos HDMI Audio [Radeon HD 64]
05:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM9611
06:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9125 PCIe SATA 6.0 Gb/s controlle)