Hi everyone,

as the RaspberryPI kernel is nowadays "configured" by the device tree, there 
are some issues for the current openSUSE images.

By default the dtbs as shipped disable any optional hardware, which is a good 
thing. On the other hand things like SPI are no longer working.

Raspbian tackles this with so called overlays and some help from the binary 
start.elf bootloader:
1. start.elf reads the dtb from the fat boot partition
   a) a file defined in config.txt, "device_tree=foo.dtb"
   b) a hardcoded hardware specific default file, "bcm2708-rpi-<variant>.dtb"
2. if the config.txt specifies "dtoverlay=foo-overlay"
   1. the boot loader reads "overlays/foo-overlay.dtb" from the fat partition
   2. the overlay is patched into the flattened device tree
3. the boot loader puts the device tree at address 0x100 (override with 
"device_tree_address=0xabcd1234"
4. the boot loader loads the specified kernel

As openSUSE does not directly jump into the kernel, but starts u-boot, this 
does not work here.

Issues:
1. u-boot does not have overlay support
2. u-boot loads its own dtb from storage, e.g. bcm2835-rpi-b.dtb
3. The u-boot boot.scr is loaded at address 0, and overwrites the boot loader 
provided dtb.

The 3rd issue can be worked around with a "device_tree_address=0x1000" in 
config.txt. I tried to replace the "loadfdt" function in the boot.scr with
a "fdt move 0x1000 0x2000000". Although the move succeeds, the kernel start 
crashes afterwards:

----
4443840 bytes read in 1041 ms (4.1 MiB/s)
6946368 bytes read in 1403 ms (4.7 MiB/s)
Copying FDT ...
Kernel image @ 0x1000000 [ 0x000000 - 0x43cec0 ]
data abort
pc : [<17f63d68>]          lr : [<17f644e0>]
reloc pc : [<0001dd68>]    lr : [<0001e4e0>]
sp : 17b48a50  ip : 17b521e9     fp : 17f51c54
r10: 17f91354  r9 : 17b49ee8     r8 : 17f922bc
r7 : 17f922b8  r6 : 17b521e0     r5 : 00000003  r4 : 33554432
r3 : 00000000  r2 : 00000010     r1 : 00000000  r0 : 33554432
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...
----
instead of:
----
4443840 bytes read in 1268 ms (3.3 MiB/s)
6946368 bytes read in 1753 ms (3.8 MiB/s)
8127 bytes read in 56 ms (141.6 KiB/s)
Kernel image @ 0x1000000 [ 0x000000 - 0x43cec0 ]
## Flattened Device Tree blob at 02000000
   Booting using the fdt blob at 0x2000000
   Using Device Tree in place at 02000000, end 02004fbe
----

So either this approach needs more work, or a completely different approach is 
needed to get overlays to work.

Any ideas?


Kind regards,

Stefan

-- 
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019

--
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to