cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
srinivasan
Explorer
Explorer
2,907 Views
Registered: ‎02-17-2017

spi_gpio spi-gpio: gpio-sck property not found in xilinx linux BSP's for zynq

 

 

Am trying to convert GPIO to SPI controller by adding the below entires in Device tree am facing the below error

 

"spi-gpio: gpio-sck property not found" , could you pls let me know how to resolve this issue or am I making any mistake in the device tree

    aliases {
        ethernet0 = &ps7_ethernet_0;
        i2c0 = &ps7_i2c_0;
        i2c1 = &ps7_i2c_1;
        serial0 = &ps7_uart_1;
        serial1 = &ps7_uart_0;
        spi0 = &ps7_spi_0;
        /*spi1 = &ps7_qspi_0;*/
        spi1 = &ps7_spi_1;
        spi_gpio = &spi_gpio;
    } ;

 

    spi_gpio: spi-gpio {
            compatible = "spi-gpio";
            #address-cells = <1>;
            #size-cells = <0>;
           /* ranges; */
            gpio-mosi = <&ps7_gpio_0 54 0>;
            gpio-miso = <&ps7_gpio_0 55 0>;
            gpio-sck  = <&ps7_gpio_0 56 0>;
            cs-gpios  = <&ps7_gpio_0 57 1>;

            num-chipselects = <1>;
            status = "ok";

             spidev@2 {
                    compatible = "linux,spidev";
                    reg = <0x0>;
                 /*   #address-cells = <1>; */
                /*    #size-cells = <0>; */
                    spi-max-frequency = <50000000>;
             };
    };


I have configured in kernel (CONFIG_SPI_GPIO=y)

After kernel bootup it throws the below error, is there any dependency on the bitstream because of being gpio's not configured properly??
spi_gpio spi-gpio: gpio-sck property not found

 

Kindly do the needful as early as possible

Awaiting for your replies

0 Kudos
2 Replies
pvenugo
Moderator
Moderator
2,882 Views
Registered: ‎07-31-2012

Hi,

 

There should be clocks in SPI node..something like this

 

    spi_gpio: spi-gpio {
            compatible = "spi-gpio";
            #address-cells = <1>;
            #size-cells = <0>;

            clocks = <&clkc 26>; 
           /* ranges; */
            gpio-mosi = <&ps7_gpio_0 54 0>;
            gpio-miso = <&ps7_gpio_0 55 0>;
            gpio-sck  = <&ps7_gpio_0 56 0>;
            cs-gpios  = <&ps7_gpio_0 57 1>;

 

If not see the may need to add in system-top under spi node and rebuild image.

 

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
srinivasan
Explorer
Explorer
2,844 Views
Registered: ‎02-17-2017

Hi Praveen,

 

Thanks a lot for your replies, am very glad that am getting responses for the queries

 

Am trying to convert GPIO pins to SPI controller using SPI bitbang in linux I have configured 4 GPIo signals GPIO-EMIO 57(SPI_SCK), 56(SPI_CS), 55(SPI_MOSI, 54(MISO)

 

In system top as attached below and xdc I have configured as below

 

set_property PACKAGE_PIN L21 [get_ports {leds_emio[3]}]
set_property PACKAGE_PIN L22 [get_ports {leds_emio[2]}]
set_property PACKAGE_PIN J21 [get_ports {leds_emio[1]}]
#set_property PACKAGE_PIN J22 [get_ports {leds_emio[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports {leds_emio[3]}]
set_property IOSTANDARD LVCMOS33 [get_ports {leds_emio[2]}]
set_property IOSTANDARD LVCMOS33 [get_ports {leds_emio[1]}]
#set_property IOSTANDARD LVCMOS33 [get_ports {leds_emio[0]}]

set_property PACKAGE_PIN J22 [get_ports {sw_emio[0]}];
set_property IOSTANDARD LVCMOS33 [get_ports {sw_emio[0]}];

 

Issue:

 

1. Am unable to find the sysfs entries for the GPIO configured in system top

 

I have configured existing GPIO controller via EMIO , I have attached the configuration files the problem is am unable to find the sysfs entries for GPIO pins 54, 55, 56, 57 configured via EMIO

 

 

 

zync:/# mount -t debugfs none /sys/kernel/debug
zync:/# cat /sys/
block/     bus/       class/     dev/       devices/   firmware/  fs/        kernel/    module/    power/
zync:/# cat /sys/kernel/debug/
bdi/                fault_around_bytes  iio/                mmc0/               regmap/             ubifs/
clk/                gpio                irq_domain_mapping  pinctrl/            sleep_time          usb/
dynamic_debug/      hid/                memblock/           pm_qos/             ubi/                uwb/
zync:/# cat /sys/kernel/debug/gpio
gpiochip1: GPIOs 1008-1015, /amba@0/gpio@41240000:

gpiochip0: GPIOs 1016-1023, /amba@0/gpio@41200000:
zync:/#
zync:/#
zync:/# echo 906 > /sys/class/gpio/export
-sh: write error: Invalid argument
zync:/#

Could you please let me know how to reolve this issue so that I can drive these pins from syfs entries
 
2. Could you please help me I have attached files for your reference what am I missing anything wrong ?
 
0 Kudos