bb_spi0_pins: pinmux_bb_spi0_pins {
pinctrl-single,pins = <
0x150 0x30 /* spi0_sclk.spi0_sclk, INPUT_PULLUP | MODE0 */
0x154 0x30 /* spi0_d0.spi0_d0, INPUT_PULLUP | MODE0 */
0x158 0x10 /* spi0_d1.spi0_d1, OUTPUT_PULLUP | MODE0 */
0x15c 0x10 /* spi0_cs0.spi0_cs0, OUTPUT_PULLUP | MODE0 */
>;
};
Any one know why only first pin has effect?
In the case above, pin 0x150 used.
the rest 3 pins are un-used.
if I switched pin 0x154 to top then 0x154 used,
the rest 3 pins are un-used.
Hi @caccac268 order, should not matter…
Un-related, there is a bug in the AM335x spi block, all pins must be input… See for example:
&am33xx_pinmux {
bb_spi0_pins: pinmux_bb_spi0_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT, MUX_MODE0) /* P9_22 (A17) spi0_sclk.spi0_sclk */
AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_INPUT, MUX_MODE0) /* P9_21 (B17) spi0_d0.spi0_d0 */
AM33XX_PADCONF(AM335X_PIN_SPI0_D1, PIN_INPUT, MUX_MODE0) /* P9_18 (B16) spi0_d1.spi0_d1 */
AM33XX_PADCONF(AM335X_PIN_SPI0_CS0, PIN_INPUT, MUX_MODE0) /* P9_17 (A16) spi0_cs0.spi0_cs0 */
>;
};
};
Regards
1 Like
Look to me, the device tree overlay source need to include some header because my file doesn’t understand AM33XX_PADCONF …
but when I included header
#include <…>
give me “syntax error”.
Any idea?
And, from define header:
AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT, MUX_MODE0)
also return similar values:
0x150 0x30…
Got building sucessful but still same issue, only first pin effected.
Thanks Robert!
As I try to get a Microchip ATWILC3000 to run off SPI1, this tweak is also going to get tried…
I could make SPI work by spliting BB-SPIDEV0-00A0.dts into two parts:
First part is below, I added this one as aaa.dtsi and added to am335x-boneblack.dts
&am33xx_pinmux {
bb_spi0_pins: pinmux_bb_spi0_pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT, MUX_MODE0) /* P9_22 (A17) spi0_sclk.spi0_sclk */
AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_INPUT, MUX_MODE0) /* P9_21 (B17) spi0_d0.spi0_d0 */
AM33XX_PADCONF(AM335X_PIN_SPI0_D1, PIN_INPUT, MUX_MODE0) /* P9_18 (B16) spi0_d1.spi0_d1 */
AM33XX_PADCONF(AM335X_PIN_SPI0_CS0, PIN_INPUT, MUX_MODE0) /* P9_17 (A16) spi0_cs0.spi0_cs0 */
>;
};
};
Second part is
...
&spi0 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bb_spi0_pins>;
/*
* Select the D0 pin as output and D1 as
* input. The default is D0 as input and
* D1 as output.
*/
//ti,pindir-d0-out-d1-in;
channel@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "spidev";
reg = <0>;
spi-max-frequency = <16000000>;
spi-cpha;
};
channel@1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "spidev";
reg = <1>;
spi-max-frequency = <16000000>;
};
};
This part is overlay and got spi work fine.
Looks to me pinctrl-0 = <&bb_spi0_pins>; doesn’t work correctly if bb_spi0_pins declared as overlay. Only first pin used, three pin left still unused if overlay run time.