[Letux-kernel] exact meaning of pinctrl-single masks and when and why are submasks invalid?

H. Nikolaus Schaller hns at goldelico.com
Fri Jun 1 14:39:18 CEST 2018


Hi,
I think I have found the issue. It is not the pinctrl-single masks, but a typo in our DT:

With enabling some debugging I got:

[    0.733612] pinctrl-single 48002274.pinmux_mcbsp1: initialized with no interrupts
[    0.733612] pinctrl-single 48002274.pinmux_mcbsp1: 10 pins, size 4
[    0.733673] pinctrl-single 48002274.pinmux_mcbsp1: pinmux_mcbsp1_devconf0_pins index: 0x0 value: 0x8 mask: 0x1c
[    0.733703] pinctrl-single 48002274.pinmux_mcbsp1: enabling (null) function0
[    0.734161] pinctrl-single 480022d8.pinmux_tv_out: initialized with no interrupts
[    0.734771] pinctrl-single 480022d8.pinmux_tv_out: 4 pins, size 4
[    0.734832] pinctrl-single 480022d8.pinmux_tv_out: pinmux_tv_acbias_devconf1_pins index: 0x0 value: 0x40800 mask: 0x40800
[    0.745513] pinctrl-single 48002030.pinmux: pinmux_uart1_pins index: 0x152 value: 0x100
[    0.745544] pinctrl-single 48002030.pinmux: pinmux_uart1_pins index: 0x14c value: 0x0
[    0.745605] pinctrl-single 48002030.pinmux: enabling (null) function1

which tells that the 48002274 and the 48002030 are being enabled but the 480022d8 isn't even tried...

The question was now: why?

>> 
>> 
>> / {
>> 	/* pinmux for devconf0 */
>> 	control_devconf0: pinmux at 48002274 {
>> 		compatible = "pinctrl-single";
>> 		reg = <0x48002274 4>;   /* CONTROL_DEVCONF0 */
>> 		#address-cells = <1>;
>> 		#size-cells = <0>;
>> 		pinctrl-single,bit-per-mux;
>> 		pinctrl-single,register-width = <32>;
>> 		pinctrl-single,function-mask = <0x5f>;	/* MCBSP CLK */
>> 		#pinctrl-cells = <2>;
>> 	};
>> 
>> 	/* pinmux for devconf1 */
>> 	control_devconf1: pinmux at 480022d8 {
>> 		compatible = "pinctrl-single";
>> 		reg = <0x480022d8 4>;	/* CONTROL_DEVCONF1 */
>> 		#address-cells = <1>;
>> 		#size-cells = <0>;
>> 		pinctrl-single,bit-per-mux;
>> 		pinctrl-single,register-width = <32>;
>> 		pinctrl-single,function-mask = <0x81>;	/* TV control */
>> 		#pinctrl-cells = <2>;
>> 	};
>> };
>> 
>> &control_devconf0 {
>> 	pinctrl-names = "default";
>> 	pinctrl-0 = <&mcbsp1_devconf_pins>;
>> 
>> 	mcbsp1_devconf_pins: pinmux_mcbsp1_devconf_pins {
>> 		/*                   offset bits mask */
>> 		pinctrl-single,bits = <0x00 0x08 0x5f>;	/* set MCBSP1_CLKR_MASK */
>> 	};
>> };
>> 
>> &control_devconf1 {
>> 	pinctrl-name = "default";

^^^ here is the bug: this property must also be called "pinctrl-names".

>> 	pinctrl-0 = < &tv_acbias_pins>;
>> 
>> 	tv_acbias_pins: pinmux_tv_acbias_pins {
>> 		pinctrl-single,bits = <
>> 		/*	offset	bits	mask */
>> 		//	0	0x40800	0x40800
>> 			0	0xfffff	0x40800

>> root at letux:~# devmem2 0x48002274
>> /dev/mem opened.
>> Memory mapped at address 0xb6f34000.
>> Value at address 0x48002274 (0xb6f34274): 0x5000008
>> root at letux:~# devmem2 0x480022d8
>> /dev/mem opened.
>> Memory mapped at address 0xb6f1c000.
>> Value at address 0x480022D8 (0xb6f1c2d8): 0x40
>> root at letux:~# 

Now:

root at letux:~# devmem2 0x48002274
/dev/mem opened.
Memory mapped at address 0xb6f79000.
Value at address 0x48002274 (0xb6f79274): 0x5000008
root at letux:~# devmem2 0x480022d8
/dev/mem opened.
Memory mapped at address 0xb6fd5000.
Value at address 0x480022D8 (0xb6fd52d8): 0x40840
root at letux:~# 

And after finally recognizing that the video cable was broken overnight
(was still working yesterday) and adding some "ti,invert-polarity;" the
TVout of the GTA04 works again :)

Quality isn't bad - so switching to a desktop mode (and taking care of
portrait vs. landscape dimensions) is just a matter of easy-to-use
user-space software...

Kernel and DT and hardware now finally support it (again - we did have it in 3.12).



Now I have just to clean up the DT changes a little.

BR,
Nikolaus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180601/1e491e46/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DSC00922.jpeg
Type: image/jpeg
Size: 142775 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180601/1e491e46/attachment-0001.jpeg>


More information about the Letux-kernel mailing list