1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

[pi] Do not attach bcm2835_pwm if DTB node is not enabled

Switch to standard FDT-base driver behavior and don't attach
if node "status" property value nn DTS is not set to "okay"

On RPi PWM by default is disabled, to enable it pwm.dtbo
from official repo[1] should be copied to overlays directory
on SD card FAT partition and "dtoverlay=pwm" line added to
config.txt. For more details see pwm overlay documentation[2]

sysutils/rpi-firmware port now includes overlays, so they
can be installed as a part of release image build.

[1] https://github.com/raspberrypi/firmware/tree/master/boot
[2] https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README

No objections from:	phk@
This commit is contained in:
Oleksandr Tymoshenko 2018-04-10 20:31:25 +00:00
parent 8ea90e075c
commit 3b1d758fba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332392

View File

@ -276,12 +276,8 @@ static int
bcm_pwm_probe(device_t dev)
{
#if 0
// XXX: default state is disabled in RPI3 DTB, assume for now
// XXX: that people want the PWM to work if the KLD this module.
if (!ofw_bus_status_okay(dev))
return (ENXIO);
#endif
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);