0

I need to modify the default configuration of pinmuxing on the BBB. To do so i'm trying to modify the am335x-boneblack.dts before recompiling the kernel. But that file is very awkward. I've only found information about overlay, but i need this to be default not overlay.

This is for example the pinmuxing I use to define TOR I/O with an overlay DT:

    pinctrl_test: pinctrl_test_0_pins {
    pinctrl-single,pins = <
        0x078 0x07 /* P9_12 OUTPUT | MODE7 | PULLDOWN */
        0x048 0x07 /* P9_14 OUTPUT | MODE7 | PULLDOWN */
        0x040 0x07 /* P9_15 OUTPUT | MODE7 | PULLDOWN */
        0x04c 0x07 /* P9_16 OUTPUT | MODE7 | PULLDOWN */
        0x15c 0x07 /* P9_17 OUTPUT | MODE7 | PULLDOWN */
        0x158 0x07 /* P9_18 OUTPUT | MODE7 | PULLDOWN */
        0x044 0x07 /* P9_23 OUTPUT | MODE7 | PULLDOWN */
        0x1ac 0x07 /* P9_25 OUTPUT | MODE7 | PULLDOWN */


        0x030 0x27 /* P8_12 INPUT | MODE7 | PULLDOWN */
        0x024 0x27 /* P8_13 INPUT | MODE7 | PULLDOWN */
        0x028 0x27 /* P8_14 INPUT | MODE7 | PULLDOWN */
        0x03c 0x27 /* P8_15 INPUT | MODE7 | PULLDOWN */
        0x038 0x27 /* P8_16 INPUT | MODE7 | PULLDOWN */
        0x02c 0x27 /* P8_17 INPUT | MODE7 | PULLDOWN */
        0x08c 0x27 /* P8_18 INPUT | MODE7 | PULLDOWN */
        0x020 0x27 /* P8_19 INPUT | MODE7 | PULLDOWN */
    >;
};

What's the correct syntax to edit the main DT and register pin for TOR I/O, ANA... The aim after that, is to develop driver to be able to read/write at high speed (using register) on the different input/output.

Thanks.

Eklypse
  • 1
  • 3
  • Why do you need to edit this for the driver? AFAIU you just request GPIO line in your driver and exclusively use it. – 0andriy Aug 17 '15 at 17:20
  • Thanks, for your answer, what do you mean by "request the GPIO", can you give me a syntax example ? `#include gpio_request(gpioLED, "LED");` But for example if the pin is already in use by the HDMI i can't request it in my driver isn't it ? I need to remap most of the pins. – Eklypse Aug 18 '15 at 06:12
  • After 2hours reading the docs and schematic pages, so no trouble for HDMI this doesn't launch at boot if the HDMI is not plugged in, the only pin that can cause trouble is the GPIO3_21 (clock for the HDMI) I need to disable the oscillator in order to use the pin (mcasp0) – Eklypse Aug 18 '15 at 08:09

1 Answers1

0

I've tried to write my one am335x-boneblack.dts, deleted every things related to HDMI, modified the include to am335x-bone-common-no-capemgr.dtsi :

/*
 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
/dts-v1/;

#include "am33xx.dtsi"
#include "am335x-bone-common-no-capemgr.dtsi"

/ {
    model = "TI AM335x BeagleBone Black";
    compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
};

&ldo3_reg {
    regulator-min-microvolt = <1800000>;
    regulator-max-microvolt = <1800000>;
    regulator-always-on;
};

&mmc1 {
    vmmc-supply = <&vmmcsd_fixed>;
};

&mmc2 {
    vmmc-supply = <&vmmcsd_fixed>;
    pinctrl-names = "default";
    pinctrl-0 = <&emmc_pins>;
    bus-width = <8>;
    status = "okay";
};

&am33xx_pinmux {

    tor_output_pins: tor_output_pins {
        pinctrl-single,pins = <
            0x078 0x07 /* P9_12 OUTPUT | MODE7 | PULLDOWN */
            0x048 0x07 /* P9_14 OUTPUT | MODE7 | PULLDOWN */
            0x040 0x07 /* P9_15 OUTPUT | MODE7 | PULLDOWN */
            0x04c 0x07 /* P9_16 OUTPUT | MODE7 | PULLDOWN */
            0x15c 0x07 /* P9_17 OUTPUT | MODE7 | PULLDOWN */
            0x158 0x07 /* P9_18 OUTPUT | MODE7 | PULLDOWN */
            0x044 0x07 /* P9_23 OUTPUT | MODE7 | PULLDOWN */
            0x1ac 0x07 /* P9_25 OUTPUT | MODE7 | PULLDOWN */
        >;
    };

    tor_input: tor_input {
        pinctrl-single,pins = <
            0x030 0x27 /* P8_12 INPUT | MODE7 | PULLDOWN */
            0x024 0x27 /* P8_13 INPUT | MODE7 | PULLDOWN */
            0x028 0x27 /* P8_14 INPUT | MODE7 | PULLDOWN */
            0x03c 0x27 /* P8_15 INPUT | MODE7 | PULLDOWN */
            0x038 0x27 /* P8_16 INPUT | MODE7 | PULLDOWN */
            0x02c 0x27 /* P8_17 INPUT | MODE7 | PULLDOWN */
            0x08c 0x27 /* P8_18 INPUT | MODE7 | PULLDOWN */
            0x020 0x27 /* P8_19 INPUT | MODE7 | PULLDOWN */
        >;
    }; 

};

&ocp{
    torout: torout  {
        pinctrl-names = "default";
        pinctrl-0 = <&tor_output_pins>;
        status = "okay";
    };

    torin: torin    {
        pinctrl-names = "default";
        pinctrl-0 = <&tor_input_pins>;
        status = "okay";
    };
};

Booting from uboot using TFTP :

tftpboot 0x80F80000 am335x-bone-custom.dtb
tftpboot 0x80007FC0 uImage-BBB

Then looking at pins configuration :

root@arm:~# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins|grep 95c
pin 87 (44e1095c.0) 00000062 pinctrl-single

Should output :

pin 87 (44e1095c.0) 00000007 pinctrl-single

Why changes didn't take effect ? Did i missed something ?

Eklypse
  • 1
  • 3
  • Replacing &ocp{..} part with : `&gpio3 { torout0 { gpio-hog; gpios = <107 0>; output-low; line-name = "TOR input"; }; };` Still not working ... no change in pinctrl default config... i2c2 is disabled but the MODE7 OUTPUT/INPUT is not correctly set in pinmux ... – Eklypse Aug 18 '15 at 14:36