Bug 248247 - sysctl for dev.pwm.0.ratio2 is writing to the wrong address
Summary: sysctl for dev.pwm.0.ratio2 is writing to the wrong address
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: 12.0-RELEASE
Hardware: arm64 Any
: --- Affects Some People
Assignee: freebsd-arm (Nobody)
Depends on:
Reported: 2020-07-24 15:53 UTC by egweriksson
Modified: 2020-07-24 15:53 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description egweriksson 2020-07-24 15:53:36 UTC
When the value for dev.pwm.0.ratio2 is changed using sysctl there will not be any ratio update of the physical signal for the second PWM channel. Instead it will update the ratio for the first PWM channel. Because of this it is not possible to change the ratio for the second PWM channel.

Nothing wrong can be seen using sysctl. It is on the physical PWM signals this problem can be seen.

The error is in file sys/arm/broadcom/bcm2835/bcm2835_pwm.c, function bcm_pwm_ratio2_proc, line 329:

	W_DAT(sc, sc->ratio2);

This line should be changed to the following to write to the correct address:

	W_DAT2(sc, sc->ratio2);