Some email on lkml exposed to me how to fix the AWM002 dts files....

The problem is that FDTs (compiled device trees) were designed to be
handed from the bootloader to the kernel, not to have them appended
onto the end of the kernel. There are being append to the kernel right
now because many bootloaders don't support FDT yet. Doing it that way
gives the bootloader a chance to probe for easy things - like the
amount of RAM on the board, and the installed flash chip.

On PowerPC machines (where device tree started) uboot loads an FDT
with empty RAM/flash fields. There is a uboot FDT command that says
fix this FDT up. It then probes those devices and dynamically fixes up
the FDT. That fixed up FDT is then passed to the kernel. The uboot
command bootm takes a third parameter - the address of that FDT.

Ralink is stuck on a five year old kernel which predates uboot so they
haven't implemented any of this. The unpatched FDT is supposed to live
in it's own flash partition. That way you can update it.

So in this model those AWM002 DTS file simply would not have flash and
RAM values specified. They would get dynamically filled in from uboot
at boot time. So the N flash chips x M ram size combination
disappears.

Maybe OpenWRT can switch to this model after Ralink uboot gets merged.
 I think their uboot source was recent enough to have FDT support, it
just wasn't enabled when it was built.

Another fix would be to remove the specific flash chip names from the
AWM002 dts files and then let the kernel fix them up. But that kind of
defeats the point in having DTS files that describe the hardware.

-- 
Jon Smirl
jonsm...@gmail.com
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to