This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

spidev problem with arago 3.12.10 sdk7.0

Other Parts Discussed in Thread: AM3352, TPS65217, ADS1299, AM3358

Hello everyone.

I'm working with a custom board based on am3352. The hardware design is similar to the beagle bone black. The linux distribution is obtained from the TI-SDK 7 arago kernel 3.12.10

I have a "simple" problem with the device tree to enable spi0 on / dev / spidev

During the phase of kernel settings from menuconfig , I enabled with [y] the following

Device Drivers ---> [*] SPI  ---> <*> McSPI driver for OMAP
Device Drivers ---> [*] SPI  ---> <*> User mode SPI device driver support

Then I modified the device tree as follows. The uart1 (dev/ttyO1)and the leds are working properly. I do not understand where the error might be with the spidev . Could you help me?

Any help is highly appreciated

The dts file modified is

am335x-bone-common.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.
 */

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

    cpus {
        cpu@0 {
            cpu0-supply = <&dcdc2_reg>;
        };
    };

    memory {
        device_type = "memory";
        reg = <0x80000000 0x10000000>; /* 256 MB */
    };

    am33xx_pinmux: pinmux@44e10800 {
        pinctrl-names = "default";
        pinctrl-0 = <&clkout2_pin>;

        user_leds_default: user_leds_default {
            pinctrl-single,pins = <
                0x28 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a5.gpio1_21     gpmc_ad10.gpio_0_26    */
                0x98 (PIN_OUTPUT_PULLUP | MUX_MODE7)        /* gpmc_a6.gpio1_22       gpmc_wen.gpio_2_4        */
                0x20 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a7.gpio1_23       gpmc_ad8.gpio_0_22    */
                0x40 (PIN_OUTPUT_PULLUP | MUX_MODE7)        /* gpmc_a8.gpio1_24      gpmc_a0.gpio_1_16        */
            >;
        };

        user_leds_sleep: user_leds_sleep {
            pinctrl-single,pins = <
                0x28 (PIN_INPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a5.gpio1_21         gpmc_ad10.gpio_0_26    */
                0x98 (PIN_INPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a6.gpio1_22       gpmc_wen.gpio_2_4       */
                0x20 (PIN_INPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a7.gpio1_23        gpmc_ad8.gpio_0_22    */
                0x40 (PIN_INPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a8.gpio1_24      gpmc_a0.gpio_1_16    */
            >;
        };

        i2c0_pins: pinmux_i2c0_pins {
            pinctrl-single,pins = <
                0x188 (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c0_sda.i2c0_sda */
                0x18c (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c0_scl.i2c0_scl */
            >;
        };

        uart0_pins: pinmux_uart0_pins {
            pinctrl-single,pins = <
                0x170 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart0_rxd.uart0_rxd */
                0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart0_txd.uart0_txd */
            >;
        };

        uart1_pins: pinmux_uart1_pins {
            pinctrl-single,pins = <
                0x180 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart1_rxd.uart1_rxd */
                0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart1_txd.uart1_txd */
            >;
        };

        mcspi0_pins: pinmux_mcspi0_pins {
            pinctrl-single,pins = <
                0x150 (PIN_OUTPUT_PULLUP | MUX_MODE0)   /* spi0_sclk.spi0_sclk       pagina 1117 spruh73j.pdf am335x trm*/
                0x154 (PIN_INPUT_PULLUP | MUX_MODE0)    /* spi0_d0.spi0_d0 */
                0x158 (PIN_OUTPUT_PULLUP | MUX_MODE0)    /* spi0_d1.spi0_d1 */
                0x15C (PIN_OUTPUT_PULLUP | MUX_MODE0)    /* spi0_cs0.spi0_cs0 */
            >;
        };

        clkout2_pin: pinmux_clkout2_pin {
            pinctrl-single,pins = <
                0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)    /* xdma_event_intr1.clkout2 */
            >;
        };

        cpsw_default: cpsw_default {
            pinctrl-single,pins = <
                /* Slave 1 */
                0x110 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxerr.mii1_rxerr */
                0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txen.mii1_txen */
                0x118 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxdv.mii1_rxdv */
                0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd3.mii1_txd3 */
                0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd2.mii1_txd2 */
                0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd1.mii1_txd1 */
                0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd0.mii1_txd0 */
                0x12c (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_txclk.mii1_txclk */
                0x130 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxclk.mii1_rxclk */
                0x134 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxd3.mii1_rxd3 */
                0x138 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxd2.mii1_rxd2 */
                0x13c (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxd1.mii1_rxd1 */
                0x140 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxd0.mii1_rxd0 */
            >;
        };

        cpsw_sleep: cpsw_sleep {
            pinctrl-single,pins = <
                /* Slave 1 reset value */
                0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
            >;
        };

        davinci_mdio_default: davinci_mdio_default {
            pinctrl-single,pins = <
                /* MDIO */
                0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)    /* mdio_data.mdio_data */
                0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)            /* mdio_clk.mdio_clk */
            >;
        };

        davinci_mdio_sleep: davinci_mdio_sleep {
            pinctrl-single,pins = <
                /* MDIO reset value */
                0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
            >;
        };

        mmc1_pins_default: pinmux_mmc1_pins {
            pinctrl-single,pins = <
                0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat3.mmc0_dat3 */
                0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat2.mmc0_dat2 */
                0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat1.mmc0_dat1 */
                0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat0.mmc0_dat0 */
                0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_clk.mmc0_clk */
                0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_cmd.mmc0_cmd */
                0x1A0 (PIN_INPUT_PULLUP | MUX_MODE7)    /* mcasp0_aclkr.gpio3_18 */
                0x160 (PIN_INPUT | MUX_MODE7)        /* spi0_cs1.gpio0_6 */
            >;
        };

        mmc1_pins_sleep: pinmux_mmc1_pins_sleep {
            pinctrl-single,pins = <
                0x0F0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x0F4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x0F8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x0FC (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x100 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x104 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x1A0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                0x160 (PIN_INPUT_PULLDOWN | MUX_MODE7)
            >;
        };

        emmc_pins: pinmux_emmc_pins {
            pinctrl-single,pins = <
                0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
                0x84 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
                0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
                0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
                0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
                0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
                0x10 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */
                0x14 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */
                0x18 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */
                0x1c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */
            >;
        };
    };

    ocp {
        uart0: serial@44e09000 {
            pinctrl-names = "default";
            pinctrl-0 = <&uart0_pins>;
            status = "okay";
        };

        uart1: serial@48022000 {
            pinctrl-names = "default";
            pinctrl-0 = <&uart1_pins>;
            status = "okay";
        };

        mcspi0: mcspi@48030000 {
                 compatible = "ti,omap2-mcspi";    
            #address-cells = <1>;
                #size-cells = <0>;
                ti,hwmods = "spi0";
                ti,spi-num-cs = <4>;
            pinctrl-names = "default";
            pinctrl-0 = <&mcspi0_pins>;
            status = "okay";

            /*compatible = "ti,omap2-mcspi";
            pinctrl-names = "default";
            pinctrl-0 = <&spi0_pins>;
            status = "okay";*/

        };

        musb: usb@47400000 {
            status = "okay";

            control@44e10000 {
                status = "okay";
            };

            usb-phy@47401300 {
                status = "okay";
            };

            usb-phy@47401b00 {
                status = "okay";
            };

            usb@47401000 {
                status = "okay";
            };

            usb@47401800 {
                status = "okay";
                dr_mode = "host";
            };

            dma-controller@07402000  {
                status = "okay";
            };
        };

        i2c0: i2c@44e0b000 {
            pinctrl-names = "default";
            pinctrl-0 = <&i2c0_pins>;
            status = "okay";
            clock-frequency = <400000>;

            /* Set OPP50 (0.95V) for VDD core */
            sleep-sequence = /bits/ 8 <
                0x02 0x24 0x0b 0x6d /* Password unlock 1 */
                0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
                0x02 0x24 0x0b 0x6d /* Password unlock 2 */
                0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
                0x02 0x24 0x0b 0x6c /* Password unlock 1 */
                0x02 0x24 0x11 0x86 /* Apply DCDC changes */
                0x02 0x24 0x0b 0x6c /* Password unlock 2 */
                0x02 0x24 0x11 0x86 /* Apply DCDC changes */
            >;

            /* Set OPP100 (1.10V) for VDD core */
            wake-sequence = /bits/ 8 <
                0x02 0x24 0x0b 0x6d /* Password unlock 1 */
                0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
                0x02 0x24 0x0b 0x6d /* Password unlock 2 */
                0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
                0x02 0x24 0x0b 0x6c /* Password unlock 1 */
                0x02 0x24 0x11 0x86 /* Apply DCDC changes */
                0x02 0x24 0x0b 0x6c /* Password unlock 2 */
                0x02 0x24 0x11 0x86 /* Apply DCDC changes */
            >;

            tps: tps@24 {
                reg = <0x24>;
            };

        };
    };

    leds {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&user_leds_default>;
        pinctrl-1 = <&user_leds_sleep>;

        compatible = "gpio-leds";

        led@2 {
            label = "beaglebone:green:heartbeat";
            gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "heartbeat";
            default-state = "off";
        };

        led@3 {
            label = "beaglebone:green:mmc0";
            gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "mmc0";
            default-state = "off";
        };

        led@4 {
            label = "beaglebone:green:usr2";
            gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "cpu0";
            default-state = "off";
        };

        led@5 {
            label = "beaglebone:green:usr3";
            gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "mmc1";
            default-state = "off";
        };
    };

    vmmcsd_fixed: fixedregulator@0 {
        compatible = "regulator-fixed";
        regulator-name = "vmmcsd_fixed";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
    };
};

/include/ "tps65217.dtsi"

&tps {
    regulators {
        dcdc1_reg: regulator@0 {
            regulator-always-on;
        };

        dcdc2_reg: regulator@1 {
            /* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
            regulator-name = "vdd_mpu";
            regulator-min-microvolt = <925000>;
            regulator-max-microvolt = <1378000>;
            regulator-boot-on;
            regulator-always-on;
        };

        dcdc3_reg: regulator@2 {
            /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
            regulator-name = "vdd_core";
            regulator-min-microvolt = <925000>;
            regulator-max-microvolt = <1150000>;
            regulator-boot-on;
            regulator-always-on;
        };

        ldo1_reg: regulator@3 {
            regulator-always-on;
        };

        ldo2_reg: regulator@4 {
            regulator-always-on;
        };

        ldo3_reg: regulator@5 {
            regulator-always-on;
        };

        ldo4_reg: regulator@6 {
            regulator-always-on;
        };
    };
};

&cpsw_emac0 {
    phy_id = <&davinci_mdio>, <0>;
    phy-mode = "mii";
};

&mac {
    slaves = <1>;
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&cpsw_default>;
    pinctrl-1 = <&cpsw_sleep>;
};

&davinci_mdio {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&davinci_mdio_default>;
    pinctrl-1 = <&davinci_mdio_sleep>;
};

&mmc1 {
    status = "okay";
    bus-width = <0x4>;
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&mmc1_pins_default>;
    pinctrl-1 = <&mmc1_pins_sleep>;
    cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
    cd-inverted;
};

find /sys -name "*spi*"

/sys/bus/spi
/sys/bus/spi/drivers/spidev
/sys/bus/platform/devices/mcspi.3
/sys/bus/platform/devices/480ca000.spinlock
/sys/bus/platform/drivers/ti,dra7xxx-qspi
/sys/bus/platform/drivers/omap2_mcspi
/sys/devices/ocp.2/mcspi.3
/sys/devices/ocp.2/480ca000.spinlock
/sys/class/spi_master
/sys/class/spidev
/sys/module/regmap_spi
/sys/module/spidev

Marco

  • Hi Marco,

    There is a document here, explaining how to enable spidev for the BBB.

    Best regards,
    Miroslav

  • Hi Miroslav


    I've already read it . But my problem is a bit different.

    I have a custom board similar to bbb but not equal. I haven't got an I2C memory on board, neither the hdmi chip. 

    In /sys/devices there is'mt the capemanager* folder . So my idea is to change the dts sources of the am335x or evm to enable the spidev. For the heart bit led and other uart devices. Until now it worked. But the spi seems to shows some problem. 

    Marco

  • Hello to all

    Some small progress has been made​​. I modified the DeviceTree as follows, and now I get
    /dev/spidev1.0         
    /dev/spidev2.1
     
    am335x-bone-common.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.
     */

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

        cpus {
            cpu@0 {
                cpu0-supply = <&dcdc2_reg>;
            };
        };

        memory {
            device_type = "memory";
            reg = <0x80000000 0x10000000>; /* 256 MB */
        };

        am33xx_pinmux: pinmux@44e10800 {
            pinctrl-names = "default";
            pinctrl-0 = <&clkout2_pin>;

            user_leds_default: user_leds_default {
                pinctrl-single,pins = <
                    0x28 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a5.gpio1_21     gpmc_ad10.gpio_0_26    */
                    0x98 (PIN_OUTPUT_PULLUP | MUX_MODE7)        /* gpmc_a6.gpio1_22       gpmc_wen.gpio_2_4        */
                    0x20 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a7.gpio1_23       gpmc_ad8.gpio_0_22    */
                    0x40 (PIN_OUTPUT_PULLUP | MUX_MODE7)        /* gpmc_a8.gpio1_24      gpmc_a0.gpio_1_16        */
                >;
            };

            user_leds_sleep: user_leds_sleep {
                pinctrl-single,pins = <
                    0x28 (PIN_INPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a5.gpio1_21         gpmc_ad10.gpio_0_26    */
                    0x98 (PIN_INPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a6.gpio1_22       gpmc_wen.gpio_2_4       */
                    0x20 (PIN_INPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a7.gpio1_23        gpmc_ad8.gpio_0_22    */
                    0x40 (PIN_INPUT_PULLDOWN | MUX_MODE7)    /* gpmc_a8.gpio1_24      gpmc_a0.gpio_1_16    */
                >;
            };

            i2c0_pins: pinmux_i2c0_pins {
                pinctrl-single,pins = <
                    0x188 (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c0_sda.i2c0_sda */
                    0x18c (PIN_INPUT_PULLUP | MUX_MODE0)    /* i2c0_scl.i2c0_scl */
                >;
            };

            uart0_pins: pinmux_uart0_pins {
                pinctrl-single,pins = <
                    0x170 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart0_rxd.uart0_rxd */
                    0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart0_txd.uart0_txd */
                >;
            };

            uart1_pins: pinmux_uart1_pins {
                pinctrl-single,pins = <
                    0x180 (PIN_INPUT_PULLUP | MUX_MODE0)    /* uart1_rxd.uart1_rxd */
                    0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart1_txd.uart1_txd */
                >;
            };

            pinctrl_spi0: pinctrl_spi0_pins {
                pinctrl-single,pins = <
                    0x150 (PIN_OUTPUT_PULLUP | MUX_MODE0)   /* spi0_sclk.spi0_sclk       pagina 1117 spruh73j.pdf am335x trm*/
                    0x154 (PIN_INPUT_PULLUP | MUX_MODE0)    /* spi0_d0.spi0_d0 */
                    0x158 (PIN_OUTPUT_PULLUP | MUX_MODE0)    /* spi0_d1.spi0_d1 */
                    0x15C (PIN_OUTPUT_PULLUP | MUX_MODE0)    /* spi0_cs0.spi0_cs0 */
                >;
            };

            pinctrl_spi1: pinctrl_spi1_pins {
                pinctrl-single,pins = <
                    0x190 (PIN_OUTPUT_PULLUP | MUX_MODE3)   /* spi0_sclk.spi0_sclk       pagina 1117 spruh73j.pdf am335x trm*/
                    0x194 (PIN_INPUT_PULLUP | MUX_MODE3)    /* spi0_d0.spi0_d0 */
                    0x198 (PIN_OUTPUT_PULLUP | MUX_MODE3)    /* spi0_d1.spi0_d1 */
                    0x19c (PIN_OUTPUT_PULLUP | MUX_MODE3)    /* spi0_cs0.spi0_cs0 */
                >;
            };

            clkout2_pin: pinmux_clkout2_pin {
                pinctrl-single,pins = <
                    0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)    /* xdma_event_intr1.clkout2 */
                >;
            };

            cpsw_default: cpsw_default {
                pinctrl-single,pins = <
                    /* Slave 1 */
                    0x110 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxerr.mii1_rxerr */
                    0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txen.mii1_txen */
                    0x118 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxdv.mii1_rxdv */
                    0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd3.mii1_txd3 */
                    0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd2.mii1_txd2 */
                    0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd1.mii1_txd1 */
                    0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mii1_txd0.mii1_txd0 */
                    0x12c (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_txclk.mii1_txclk */
                    0x130 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxclk.mii1_rxclk */
                    0x134 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxd3.mii1_rxd3 */
                    0x138 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxd2.mii1_rxd2 */
                    0x13c (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxd1.mii1_rxd1 */
                    0x140 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mii1_rxd0.mii1_rxd0 */
                >;
            };

            cpsw_sleep: cpsw_sleep {
                pinctrl-single,pins = <
                    /* Slave 1 reset value */
                    0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                >;
            };

            davinci_mdio_default: davinci_mdio_default {
                pinctrl-single,pins = <
                    /* MDIO */
                    0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)    /* mdio_data.mdio_data */
                    0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)            /* mdio_clk.mdio_clk */
                >;
            };

            davinci_mdio_sleep: davinci_mdio_sleep {
                pinctrl-single,pins = <
                    /* MDIO reset value */
                    0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
                >;
            };

            mmc1_pins_default: pinmux_mmc1_pins {
                pinctrl-single,pins = <
                    0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat3.mmc0_dat3 */
                    0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat2.mmc0_dat2 */
                    0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat1.mmc0_dat1 */
                    0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat0.mmc0_dat0 */
                    0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_clk.mmc0_clk */
                    0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_cmd.mmc0_cmd */
                    0x1A0 (PIN_INPUT_PULLUP | MUX_MODE7)    /* mcasp0_aclkr.gpio3_18 */
                    0x160 (PIN_INPUT | MUX_MODE7)        /* spi0_cs1.gpio0_6 */
                >;
            };

            mmc1_pins_sleep: pinmux_mmc1_pins_sleep {
                pinctrl-single,pins = <
                    0x0F0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x0F4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x0F8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x0FC (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x100 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x104 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x1A0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                    0x160 (PIN_INPUT_PULLDOWN | MUX_MODE7)
                >;
            };

            emmc_pins: pinmux_emmc_pins {
                pinctrl-single,pins = <
                    0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
                    0x84 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
                    0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
                    0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
                    0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
                    0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
                    0x10 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */
                    0x14 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */
                    0x18 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */
                    0x1c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */
                >;
            };
        };

        ocp {
            uart0: serial@44e09000 {
                pinctrl-names = "default";
                pinctrl-0 = <&uart0_pins>;
                status = "okay";
            };

            uart1: serial@48022000 {
                pinctrl-names = "default";
                pinctrl-0 = <&uart1_pins>;
                status = "okay";
            };

            spi1: spi@481a0000 {
                compatible = "ti,omap2-mcspi";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_spi1>;
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0x481a0000 0x400>;
                interrupts = <125>;
                ti,spi-num-cs = <2>;
                clocks = <&dpll_per_m2_div4_ck>;
                clock-names = "fck";
                dmas = <&edma 42
                    &edma 43
                    &edma 44
                    &edma 45>;
                dma-names = "tx0", "rx0", "tx1", "rx1";
            
                status = "okay";
                  spi1_1{
                            #address-cells       = <1>;
                            #size-cells       = <0>;
                            compatible           = "spidev";
                            reg               = <1>;
                            spi-max-frequency = <24000000>; /**/
                };
                    /* Mode 0 (CPOL = 0, CPHA = 0)*/                 
            };



            spi0: spi@48030000 {
                compatible = "ti,omap2-mcspi";  /* ti,omap4-mcspi */
                #address-cells = <1>;
                #size-cells = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_spi0>;            
                reg = <0x48030000 0x400>;
                interrupts = <65>;
                ti,spi-num-cs = <2>; /**/
                //ti,hwmods = "spi0";
                clocks = <&dpll_per_m2_div4_ck>;
                clock-names = "fck";
                dmas = <&edma 16
                    &edma 17
                    &edma 18
                    &edma 19>;
                dma-names = "tx0", "rx0", "tx1", "rx1";
                status = "okay";
                  spi0_0{
                            #address-cells       = <2>;
                            #size-cells       = <0>;
                            compatible           = "spidev";
                            reg               = <0>;
                            spi-max-frequency = <24000000>;
                };
            };

            musb: usb@47400000 {
                status = "okay";

                control@44e10000 {
                    status = "okay";
                };

                usb-phy@47401300 {
                    status = "okay";
                };

                usb-phy@47401b00 {
                    status = "okay";
                };

                usb@47401000 {
                    status = "okay";
                };

                usb@47401800 {
                    status = "okay";
                    dr_mode = "host";
                };

                dma-controller@07402000  {
                    status = "okay";
                };
            };

            i2c0: i2c@44e0b000 {
                pinctrl-names = "default";
                pinctrl-0 = <&i2c0_pins>;
                status = "okay";
                clock-frequency = <400000>;

                /* Set OPP50 (0.95V) for VDD core */
                sleep-sequence = /bits/ 8 <
                    0x02 0x24 0x0b 0x6d /* Password unlock 1 */
                    0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
                    0x02 0x24 0x0b 0x6d /* Password unlock 2 */
                    0x02 0x24 0x10 0x02 /* Set DCDC3 to 0.95V */
                    0x02 0x24 0x0b 0x6c /* Password unlock 1 */
                    0x02 0x24 0x11 0x86 /* Apply DCDC changes */
                    0x02 0x24 0x0b 0x6c /* Password unlock 2 */
                    0x02 0x24 0x11 0x86 /* Apply DCDC changes */
                >;

                /* Set OPP100 (1.10V) for VDD core */
                wake-sequence = /bits/ 8 <
                    0x02 0x24 0x0b 0x6d /* Password unlock 1 */
                    0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
                    0x02 0x24 0x0b 0x6d /* Password unlock 2 */
                    0x02 0x24 0x10 0x08 /* Set DCDC3 to 1.1V */
                    0x02 0x24 0x0b 0x6c /* Password unlock 1 */
                    0x02 0x24 0x11 0x86 /* Apply DCDC changes */
                    0x02 0x24 0x0b 0x6c /* Password unlock 2 */
                    0x02 0x24 0x11 0x86 /* Apply DCDC changes */
                >;

                tps: tps@24 {
                    reg = <0x24>;
                };

            };
        };


        leds {
            pinctrl-names = "default", "sleep";
            pinctrl-0 = <&user_leds_default>;
            pinctrl-1 = <&user_leds_sleep>;

            compatible = "gpio-leds";

            led@2 {
                label = "beaglebone:green:heartbeat";
                gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
                linux,default-trigger = "heartbeat";
                default-state = "off";
            };

            led@3 {
                label = "beaglebone:green:mmc0";
                gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;
                linux,default-trigger = "mmc0";
                default-state = "off";
            };

            led@4 {
                label = "beaglebone:green:usr2";
                gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
                linux,default-trigger = "cpu0";
                default-state = "off";
            };

            led@5 {
                label = "beaglebone:green:usr3";
                gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
                linux,default-trigger = "mmc1";
                default-state = "off";
            };
        };

        vmmcsd_fixed: fixedregulator@0 {
            compatible = "regulator-fixed";
            regulator-name = "vmmcsd_fixed";
            regulator-min-microvolt = <3300000>;
            regulator-max-microvolt = <3300000>;
        };
    };

    /include/ "tps65217.dtsi"

    &tps {
        regulators {
            dcdc1_reg: regulator@0 {
                regulator-always-on;
            };

            dcdc2_reg: regulator@1 {
                /* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
                regulator-name = "vdd_mpu";
                regulator-min-microvolt = <925000>;
                regulator-max-microvolt = <1378000>;
                regulator-boot-on;
                regulator-always-on;
            };

            dcdc3_reg: regulator@2 {
                /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
                regulator-name = "vdd_core";
                regulator-min-microvolt = <925000>;
                regulator-max-microvolt = <1150000>;
                regulator-boot-on;
                regulator-always-on;
            };

            ldo1_reg: regulator@3 {
                regulator-always-on;
            };

            ldo2_reg: regulator@4 {
                regulator-always-on;
            };

            ldo3_reg: regulator@5 {
                regulator-always-on;
            };

            ldo4_reg: regulator@6 {
                regulator-always-on;
            };
        };
    };

    &cpsw_emac0 {
        phy_id = <&davinci_mdio>, <0>;
        phy-mode = "mii";
    };

    &mac {
        slaves = <1>;
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&cpsw_default>;
        pinctrl-1 = <&cpsw_sleep>;
    };

    &davinci_mdio {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&davinci_mdio_default>;
        pinctrl-1 = <&davinci_mdio_sleep>;
    };

    &mmc1 {
        status = "okay";
        bus-width = <0x4>;
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&mmc1_pins_default>;
        pinctrl-1 = <&mmc1_pins_sleep>;
        cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
        cd-inverted;
    };
     
     
    root@am335x-evm:~# find /sys -name "spi*"  command give me
    /sys/bus/spi
    /sys/bus/spi/devices/spi1.0
    /sys/bus/spi/devices/spi2.1
    /sys/bus/spi/drivers/spidev
    /sys/bus/spi/drivers/spidev/spi1.0
    /sys/bus/spi/drivers/spidev/spi2.1
    /sys/devices/ocp.2/48030000.spi/spi_master
    /sys/devices/ocp.2/48030000.spi/spi_master/spi1
    /sys/devices/ocp.2/48030000.spi/spi_master/spi1/spi1.0
    /sys/devices/ocp.2/48030000.spi/spi_master/spi1/spi1.0/spidev
    /sys/devices/ocp.2/48030000.spi/spi_master/spi1/spi1.0/spidev/spidev1.0
    /sys/devices/ocp.2/481a0000.spi/spi_master
    /sys/devices/ocp.2/481a0000.spi/spi_master/spi2
    /sys/devices/ocp.2/481a0000.spi/spi_master/spi2/spi2.1
    /sys/devices/ocp.2/481a0000.spi/spi_master/spi2/spi2.1/spidev
    /sys/devices/ocp.2/481a0000.spi/spi_master/spi2/spi2.1/spidev/spidev2.1
    /sys/class/spi_master
    /sys/class/spi_master/spi1
    /sys/class/spi_master/spi2
    /sys/class/spidev
    /sys/class/spidev/spidev1.0
    /sys/class/spidev/spidev2.1
    /sys/module/spidev
     
     
    So it seems to be all good but .... when i test the devices nodes
     
    root@am335x-evm:~# echo "j" > /dev/spidev2.1
    [   75.047951] spidev spi2.1: TXS timed out
    [   76.057953] spidev spi2.1: TXS timed out
    root@am335x-evm:~# echo "j" > /dev/spidev1.0
    [   81.127950] spidev spi1.0: TXS timed out
    [   82.137951] spidev spi1.0: TXS timed out
    root@am335x-evm:~#

    I can't figure out the reason of this behaviour
     
    Any help is higly appreciated
     
    Marco
  • Hi Marco!

    I guess before trying to send something we need at least add some initialisation code (speed cs_number polarity)

    best regards,

    Yuriy

  • Hi yuriy


    Yes, it seems so. The problems are similar.

    I think you're right, some parameters are missed in the configuration of dts in the ocp .
    I'm doing reverse engineer on some link like this

    http://hipstercircuits.com/enable-spi-with-device-tree-on-beaglebone-black-copy-paste/

    http://elinux.org/BeagleBone_Black_Enable_SPIDEV


    It 's strange to me that in the fragment (in the source tree of the device seems not to be admitted, or may be you have the wrong syntax) are instantiated two spi cs on the same port.

    I had already seen the link on dt-bindings :) thanks anyway

    i don't stop to dig around the problem .

    If i have some relevant news , i will alert you

    Marco

  • Marco!

    YUUUHOO! Made it work at last!

    I checked, the CS pin goes down, data is coming through

    Here is mine dts:

    I guess there is much garbage but at least:

     spi0_pins: pinmux_spi0_pins {
    	               pinctrl-single,pins = <
                   			0x150 (PIN_OUTPUT_PULLUP | MUX_MODE0)   /* spi0_sclk.spi0_sclk */
                    		0x154 (PIN_INPUT_PULLUP | MUX_MODE0)    /* spi0_d0.spi0_d0 */
                    		0x158 (PIN_OUTPUT_PULLUP | MUX_MODE0)    /* spi0_d1.spi0_d1 */
                    		0x15C (PIN_OUTPUT_PULLUP | MUX_MODE0)    /* spi0_cs0.spi0_cs0 */
               		>;
            	};
    
    //.............................//
    
    spi0: spi@48030000 {
    			compatible = "ti,omap4-mcspi";
    			#address-cells = <1>;
    			#size-cells = <0>;
    			reg = <0x48030000 0x400>;
    			interrupts = <65>;
    			ti,spi-num-cs = <2>;
    			pinctrl-names = "default";
    			pinctrl-0 = <&spi0_pins>;
    			ti,hwmods = "spi0";
    			clocks = <&dpll_per_m2_div4_ck>;
    			clock-names = "fck";
    			clock-frequency = <1000000>;			
    			dmas = <&edma 16
    				&edma 17
    				&edma 18
    				&edma 19>;
    			dma-names = "tx0", "rx0", "tx1", "rx1";
    			status = "okay";
    			 spidev:spidev@0{
    	                        compatible        = "spidev";
    	                        reg               = <0>;
    	                        spi-max-frequency = <10000000>;
    		            };
    
    

    Again, thank you very much Marco for your help!

  • Oooohh now it works good!!! Very well done Yuriy ! :)


    It follows my dts changes in order to enable even the spi1.
    The spi0 seems to work perfectly , while spi1 shows a strange behaviour on CS pin. It always remains low. Other pins seems to works properly.

    //----------------------------------------------------------------------------------------------------------------------------//

            spi0_pins: pinmux_spi0_pins {
                pinctrl-single,pins = <
                    0x150 (PIN_OUTPUT_PULLUP | MUX_MODE0)   /* spi0_sclk.spi0_sclk    
                    0x154 (PIN_INPUT_PULLUP | MUX_MODE0)    /* spi0_d0.spi0_d0 */
                    0x158 (PIN_OUTPUT_PULLUP | MUX_MODE0)    /* spi0_d1.spi0_d1 */
                    0x15C (PIN_OUTPUT_PULLUP | MUX_MODE0)    /* spi0_cs0.spi0_cs0 */
                >;
            };

            spi1_pins: pinmux_spi1_pins {
                pinctrl-single,pins = <
                    0x190 (PIN_OUTPUT_PULLUP | MUX_MODE3)  
                    0x194 (PIN_INPUT_PULLUP | MUX_MODE3)   
                    0x198 (PIN_OUTPUT_PULLUP | MUX_MODE3)   
                    0x19c (PIN_OUTPUT_PULLUP | MUX_MODE3)   spi1_cs0  
                >;
            };

    //----------------------------------------------------------------------------------------------------------------------//

        spi0: spi@48030000 {
                    compatible = "ti,omap4-mcspi";
                    #address-cells = <1>;
                    #size-cells = <0>;
                    reg = <0x48030000 0x400>;
                    interrupts = <65>;
                    ti,spi-num-cs = <2>;
                    pinctrl-names = "default";
                    pinctrl-0 = <&spi0_pins>;
                    ti,hwmods = "spi0";
                    clocks = <&dpll_per_m2_div4_ck>;
                    clock-names = "fck";
                    clock-frequency = <1000000>;         
                    dmas = <&edma 16
                        &edma 17
                        &edma 18
                        &edma 19>;
                    dma-names = "tx0", "rx0", "tx1", "rx1";
                    status = "okay";
                     spidev:spidev@0{
                                compatible        = "spidev";
                                reg               = <0>;
                                spi-max-frequency = <10000000>;
                        };
        };

        spi1:  spi@481a0000 {
                    compatible = "ti,omap4-mcspi";
                    #address-cells = <1>;
                    #size-cells = <0>;
                    reg = <0x481a0000 0x400>;
                    interrupts = <125>;
                    ti,spi-num-cs = <2>;
                    pinctrl-names = "default";
                    pinctrl-0 = <&spi1_pins>;
                    ti,hwmods = "spi1";
                    clocks = <&dpll_per_m2_div4_ck>;
                    clock-names = "fck";
                    clock-frequency = <1000000>;         
                    dmas = <&edma 42
                        &edma 43
                        &edma 44
                        &edma 45>;
                    dma-names = "tx0", "rx0", "tx1", "rx1";
                    status = "okay";
                     spidev1:spidev@1{
                                compatible        = "spidev";
                                reg               = <1>;
                                spi-max-frequency = <10000000>;
                        };
        };

    Thank you too for your support Yuriy!!! 

    Best Regards

    Marco

  • Hi Marco!

    I 'm having problems with receiving data. I always get zeros.

    Haven't You encountered such problem.

    Best Regards

    Yuriy

  • Hi Yuriy!

    I apologise for the delay. I've been busy for building up a poky distribution with new device trees etc.

    I have not encountered that problem. For the moment, in my case, the two spi only serve to send the data. the MISO pin is not used. It seems to work fine for now.

    Do you have any news?

    At the moment I'm working on the DMA of the uart port. I should be more present to respond.

    Best regards

  • Hi Marco,

    nice to hear from you!

    I have solved the problem!

    So for the future use its better to metion about it!

    There is a mistake in our devicetrees in pinmux.

    THE CLK PINS ARE TO BE SET AS INPUTS!

    That is needed for some internal cpu mechanisms. Otherwise recieve is not working properly.

    Best regards!

  • Hi Yuriy,

    I encountered the received zero value like.

    Could you kindly share your solution?

    Thanks,

    Sam

     

  • Hi

    So if you have managed to receive zeros you have probably know the trick with devicetrees.

    The only thing you have to do is to change in the pinmux section the direction of the clk pin to input. So if to consider spi0 it looks like:

    0x150 (PIN_OUTPUT_PULLUP | MUX_MODE0)  change to

    0x150 (PIN_INPUT_PULLUP | MUX_MODE0)

     

    Regards

     

  • Hi Yuriy,

    It works now!

    Thanks,

    Sam

  • HI Yuriy,

    I have exactly the same issue (only 0) and my SCLK is already setup as INPUT. I am pretty sure of my wire between my board and the ADS1299 and also pretty confident about the piece of code using to read info from ADS1299 (Currently I just want to read device id info to validate all my process). That's why I am thinking about a device tree configuration issue

    By reading all the post, I am not sure about the board using in your test. Could you confirm that you use the Beagleboard ( I am currently using the BB Black) ?

    Moreover I can see that in my dts file that I does not configure some stuff like :

    reg = <0x48030000 0x400>;
                interrupts = <65>;
                ti,spi-num-cs = <2>;
                pinctrl-names = "default";
                pinctrl-0 = <&spi0_pins>;
                ti,hwmods = "spi0";
                clocks = <&dpll_per_m2_div4_ck>;
                clock-names = "fck";
                clock-frequency = <1000000>;          
                dmas = <&edma 16
                    &edma 17
                    &edma 18
                    &edma 19>;
                dma-names = "tx0", "rx0", "tx1", "rx1";

    Do I need to put all theses values in my dtc files ?  Where did you get all these values ? For example if I used your reg value, I get some warning when I build the dtbo file :

    Warning (reg_format): "reg" property in /fragment@1/__overlay__ has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
    Warning (avoid_default_addr_size): Relying on default #address-cells value for /fragment@1/__overlay__
    Warning (avoid_default_addr_size): Relying on default #size-cells value for /fragment@1/__overlay__

    For example if I used your reg value, I get some warning when I build the dtbo file. Where did you get all these values ?

    Thanks & Regards,

    Arthur.

  • Hi Arthur!

    About the board:

    I'm using the starter kit so there might be differencies.

    all the interrupt stuff can be found on ti's website

    http://git.ti.com/ti-linux-kernel/ti-linux-kernel/blobs/ti-linux-3.12.y/Documentation/devicetree/bindings/spi/omap-spi.txt

    Yes I think you have to add those.

    About the warnings: eeehhm I dont know :(

    hope you'll figure it out.

    Regards

  • Hi Yuriy,

    Ok so there are definitely some missing properties in my device tree configuration file. I was trying to use your dtc configuration file but the result is the same. But in fact it's seems legit. As you said we does not have the same board. Your beagleboard is based on OMAP soc, the Beagleboard black is based on AM3358/9 soc.

    Your link with device tree configuration file is great but I does not see my soc name in all the device tree file in bind/spi directory.

    So I guess that I just need to find the same stuff but for my soc.

    Arthur

  • Hi again,

    I have just a last dummy question. I can see that there is plenty of people which has the same issue ( reading only 0). And I can see that most of time people has wrong on the dtc file. Most of time they have to put the SCLK as input instead of output.

    But in fact I find a way to have value on my spi ! I just need to do the reverse, my SLCK my as output, if I setup it as input I am now able to read value ! ( I am not enough able to say if value are godd or not..)

    So finally SLCK must be output or input ?

    Thanks & Regards

    Arthur.

  • Arthur LAMBERT said:
    So finally SLCK must be output or input ?

    I also have the same question.

    in the following dtb file, it's working.

        spi0_pins_default: spi0_pins_default {
            pinctrl-single,pins = <
                0x150 (PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_sclk.spi0_sclk */
                0x154 (PIN_INPUT_PULLUP | MUX_MODE0)  /* spi0_d0.spi0_d0 */
                0x158 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* spi0_d1.spi0_d1 */
                0x15c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* spi0_cs0.spi0_cs0 */
            >;
        };

    but I changed 0x150 (PIN_INPUT_PULLUP | MUX_MODE0)  to 0x150 (PIN_OUTPUT_PULLUP | MUX_MODE0)

    that cannot read/write value from/to slaver(rtc chip, Ricoh rs5c348 driver, actually used R2043K chip).

    Just want to know why is not to set PIN_OUTPUT_PULLUP.

    BTW, I used ti-processor-sdk-linux-am335x-evm-01.00.00.03.

    Thanks,

    Brad.