Fixing the missing "cpu" devclass on RPi
Peter Jeremy
peter at rulingia.com
Sun Feb 24 03:07:52 UTC 2019
On the RPi, the "cpu" devclass is created by dev/ofw/ofw_cpu.c and depends
on the presence of a "cpus" block in the FDT. This exists in the FreeBSD
trees (eg bcm2835-rpi-b-plus.dtb) but not in the Linux FDT populated by the
latest firmware. This means that (eg) bcm2835_cpufreq never gets probed[1].
Injecting "cpus" via a fdt overlay was suggested but I can't get that to
work. I have rpi-cpus.dtso as follows:
=====
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
};
&{/} {
cpus {
cpu at 0 {
compatible = "arm,1176jzf-s";
device_type = "cpu";
};
};
};
=====
When I compile it and de-compile it, the result looks sane:
====
$ dtc -I dtb -O dts rpi-cpus.dtbo
/dts-v1/;
/ {
compatible = "brcm,bcm2835";
fragment at 0 {
target-path = "/";
__overlay__ {
cpus {
cpu at 0 {
compatible = "arm,1176jzf-s";
device_type = "cpu";
};
};
};
};
__symbols__ {
};
};
====
I've added rpi-cpus.dtbo to fdt_overlays in loader.conf and the boot
messages report that it's being loaded but the "cpus" section is still
missing from hw.fdt
I presume I've got something wrong in my dtso but I'm not sure what -
I haven't found a great deal of documentation on writing overlays and
the above looks correct according to what I've found.
[1] There's a separate bug in bcm2835_cpufreq.c so it'll never attach,
but that's just a matter of fixing the compatible list.
--
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20190224/da6e920a/attachment.sig>
More information about the freebsd-arm
mailing list