u-boot, dynamic part detection

84 views
Skip to first unread message

Rob Barris

unread,
Jul 13, 2016, 11:46:52 PM7/13/16
to snickerdoodle forum
Is there a way that u-boot could sense whether it is on a snickerdoodle or snickerdoodle black, and select one of two different bit streams to load into FPGA ?

Restated it would be nice if we could unify the BOOT partition contents, to just have two bitstreams on it and let the boot loader pick the right one ?

Or is the FPGA bitstream loading at reset more hardwired in terms of filename?
 

Bush

unread,
Jul 14, 2016, 1:03:43 AM7/14/16
to snickerdoodle forum
You can put bitstream/devicetree combinations in the config directory on the BOOT partition, for either versions. A simple way to set it up would be to create a pair of subdirectories (e.g. sd and sdb) and set the command in config.txt to something like config_dir=/config/sdb/gpio where you would have a .bit and .dtb files. This does not make the SD card interchangable, however, as BOOT.bin is board specific.

The config.txt file is parsed by commands specified in uEnv.txt which specifies the boot command(s). The bitstream loading is determined by the value of config_dir (if it exists) along with the complimentary devicetree. This system is by no means refined, so if you have any thoughts about automation or increasing usability please share.

Rob Barris

unread,
Jul 14, 2016, 1:13:22 AM7/14/16
to snickerdoodle forum
Yeah I need to learn more about what can be sensed about the physical part while in u-boot.  If I can find a way to detect the part in u-boot scripting, then I think I could steer it from there.  Not urgent.

weath...@krtkl.com

unread,
Jul 14, 2016, 2:40:52 AM7/14/16
to snickerdoodle forum
I'm not a U-Boot/Linux guy but here are the registers you need to read to get the data you would need: 













On Wednesday, July 13, 2016 at 8:46:52 PM UTC-7, Rob Barris wrote:
Auto Generated Inline Image 1
Auto Generated Inline Image 2
Auto Generated Inline Image 3
Auto Generated Inline Image 4
Auto Generated Inline Image 5
Auto Generated Inline Image 6
Reply all
Reply to author
Forward
0 new messages