Compiling device tree from snickerdoodle-linux-prebuilt sources

Using the devicetree.dts and zynq-7000.dtsi at https://github.com/krtkl/snickerdoodle-linux-prebuilt/tree/master/snickerdoodle/boot_sources, I compiled a device tree with:
dtc -I dts -O dtb -R 8 -o devicetree.dtb devicetree.dts

The skeleton.dtsi that zynq-7000.dtsi includes wasn't in the repo, but I found several references to it that all more or less look like this:

/ {
#address-cells = <1>;
#size-cells = <1>;
chosen { };
aliases { };
memory { device_type = "memory"; reg = <0 0>; };
};

Using these 3 files to compile a DTB, Snickerdoodle won't boot with it. It hangs at the "Starting kernel..." message.
Using the devicetree.dtb from snickerdoodle-linux-prebuilt/snickerdoodle/boot_images works.

Some cursory differences between the DTB I compiled from source and the DTB in snickerdoodle-linux-prebuilt/snickerdoodle/boot_images repo:
1)
The prebuilt devicetree.dtb is 10287 bytes.
My DTB has size 10298 bytes

2)
The prebuilt DTB has bootargs: console=ttyPS0,115200n8 earlyprintk ramdisk_size=0x8F0000
My DTB has bootargs: console=ttyPS0,115200n8 root=/dev/mmcblk0p2 rw rootwait earlyprintk

3)
The prebuilt DTB has a flash@0 section with partitions defined for qspi-fsbl-uboot, qspi-linux, qspi-device-tree, qspi-rootfs, qspi-bootstream
My DTB has no such section/partitions.

4)
My DTB has gpio@41200000 and gpio@41210000 sections (as seen in devicetree.dts).
The prebuilt DTB has no such gpio sections

So it would appear the provided sources are not the ones that generate the provided DTB. Can we get the actual sources?
But regardless of the binary/source discrepancy, can anyone see why the provided DTS/DTSI sources produce a DTB that doesn't work?

Thanks for your help!



On Sunday, July 17, 2016 at 11:14:15 AM UTC-7, Edward Wingate wrote:
Using these 3 files to compile a DTB, Snickerdoodle won't boot with it. It hangs at the "Starting kernel..." message.

Turns out I needed to load the provided system.bit file that apparently contains the axi_gpio devices that are in the DTS.

Should the axi_gpio_x devices in the FPGA show up in /proc/iomem? I don't see them listed:

00000000-3fffffff : System RAM
00008000-00704f3f : Kernel code
00740000-007b4437 : Kernel data
e0000000-e0000fff : xuartps
e0007000-e0007fff : /amba/spi@e0007000
e000a000-e000afff : /amba/gpio@e000a000
e000d000-e000dfff : /amba/spi@e000d000
e0100000-e0100fff : mmc0
e0101000-e0101fff : mmc1
f8003000-f8003fff : /amba/dmac@f8003000
f8003000-f8003fff : /amba/dmac@f8003000
f8005000-f8005fff : /amba/watchdog@f8005000
f8007000-f80070ff : /amba/devcfg@f8007000
f8007100-f800711f : /amba/adc@f8007100
f800c000-f800cfff : /amba/ocmc@f800c000
fffc0000-ffffffff : f800c000.ocmc
Hi Edward.

Did you ever figure this out? Did you end up using this procedure: http://www.wiki.xilinx.com/Build+Device+Tree+Blob? I'm heading down that path myself right now and would like to know if it's the right one. :-)

-Nick

On Sunday, July 17, 2016 at 10:05:01 PM UTC-7, Edward Wingate wrote:
On Sunday, July 17, 2016 at 11:14:15 AM UTC-7, Edward Wingate wrote:
Using these 3 files to compile a DTB, Snickerdoodle won't boot with it. It hangs at the "Starting kernel..." message.

Turns out I needed to load the provided system.bit file that apparently contains the axi_gpio devices that are in the DTS.

Should the axi_gpio_x devices in the FPGA show up in /proc/iomem? I don't see them listed:

00000000-3fffffff : System RAM
00008000-00704f3f : Kernel code
00740000-007b4437 : Kernel data
e0000000-e0000fff : xuartps
e0007000-e0007fff : /amba/spi@e0007000
e000a000-e000afff : /amba/gpio@e000a000
e000d000-e000dfff : /amba/spi@e000d000
e0100000-e0100fff : mmc0
e0101000-e0101fff : mmc1
f8003000-f8003fff : /amba/dmac@f8003000
f8003000-f8003fff : /amba/dmac@f8003000
f8005000-f8005fff : /amba/watchdog@f8005000
f8007000-f80070ff : /amba/devcfg@f8007000
f8007100-f800711f : /amba/adc@f8007100
f800c000-f800cfff : /amba/ocmc@f800c000
fffc0000-ffffffff : f800c000.ocmc
On Tuesday, July 19, 2016 at 1:02:46 PM UTC-7, Nick Burkitt wrote:
Did you ever figure this out? Did you end up using this procedure: http://www.wiki.xilinx.com/Build+Device+Tree+Blob? I'm heading down that path myself right now and would like to know if it's the right one. :-)

What exactly are you referring to? I did figure out why I couldn't boot with my compiled DTB. It was because the DTS had devices defined that were located in the FPGA and I didn't load the FPGA bitstream.

I didn't figure out if the FPGA devices are suppose to appear in /proc/iomem or not.

I did not use that specific procedure, but the dtc commands there look similar to the one I used.


In my previous adventures with talking to PL hardware, I had used the simple expedient of decompiling the DTB provided by krtkl and just adding an entry for my simple IP. Now I have to do it for real, and was curious if that Xilinx document was all I needed. It appears that it is, but I haven't quite gotten to the point of finding out for sure.
Thanks.

On Tuesday, July 19, 2016 at 1:26:54 PM UTC-7, Edward Wingate wrote:
On Tuesday, July 19, 2016 at 1:02:46 PM UTC-7, Nick Burkitt wrote:
Did you ever figure this out? Did you end up using this procedure: http://www.wiki.xilinx.com/Build+Device+Tree+Blob? I'm heading down that path myself right now and would like to know if it's the right one. :-)

What exactly are you referring to? I did figure out why I couldn't boot with my compiled DTB. It was because the DTS had devices defined that were located in the FPGA and I didn't load the FPGA bitstream.

I didn't figure out if the FPGA devices are suppose to appear in /proc/iomem or not.

I did not use that specific procedure, but the dtc commands there look similar to the one I used.