Tool/software: Linux
I'm trying to setup pins on an AM5708 using the Linux device tree. Specifically, I'm trying to set pin A18 ( GPIO 5-10) as a PWM output from timer5. Here are the related snippets in the device tree:
in dra7.dtsi
timer5: timer@48820000
{
compatible = "ti,omap5430-timer";
reg = <0x48820000 0x80>;
interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
ti,hwmods = "timer5";
ti,timer-pwm;
};
in our custom tree (solix-dev.dts)
aliases {
display0 = &lcd0;
buzzer = &timer5;
};
/*...*/
// Buzzer output
&timer5
{
pinctrl-names = "default";
pinctrl-0 = <&timer5_pins_default>;
status = "okay";
timer5_pins_default: timer5_pins_default
{
pinctrl-single,pins =
<
DRA7XX_CORE_IOPAD(0x36D4, PIN_OUTPUT_PULLUP | MUX_MODE10) /* TIMER5 -> timer5 -> A18 */
>;
};
};
Here's the problem: When I check the configuration register the value does not match the setup in the device tree.
root@solix:~/> devmem2 0x4a0036d4 w
/dev/mem opened.
Memory mapped at address 0xb6f97000.
Read at address 0x4A0036D4 (0xb6f976d4): 0x0001000A
root@solix:~/>
The mode is correct as 0xa or 10. This selects timer 5 to control the output. However the pull up configuration is wrong. I asked for an output pull up.
PIN_OUTPUT_PULLUP
from dra.h:
#define PULL_UP (1 << 17)
#define PIN_OUTPUT_PULLUP (PULL_UP)
If this had actually been used, the value of the configuration register would have been 0x0002000A not 0x0001000A. I want a pull-up enabled; I got pull resistors disabled.
I checked some other pin configuration values against the settings in the device tree and found similar errors.
What's going on? The associated driver is loaded so that's not the problem. What do I have to do to correct this - globally?