cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ggillett
Contributor
Contributor
948 Views
Registered: ‎08-14-2018

axi-spi-engine, spidev, linux-xlnx and zedboard

Jump to solution

Hi,

I am trying to get ADI's axi_spi_engine working on a zedboard under Linux.  Using Yocto and  rel-2018.3 repos and meta-xilinx-tools layer.  

The device tree entry

        amba_pl {
                #address-cells = <0x1>;
                #size-cells = <0x1>;
                compatible = "simple-bus";
                ranges;

                axi_spi_engine@43c00000 {
                        clock-names = "s_axi_aclk", "spi_clk";
                        clocks = <0x1 0xf 0x1 0xf>;
                        compatible = "adi,axi-spi-engine-1.00.a";
                        reg = <0x43c00000 0x10000>;
                        status = "okay";
                        interrupts = <0x0 0x48 0x4>;
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;

                        spidev@1 {
                                compatible = "spidev";
                                spi-max-frequency = <0xf4240>;
                                reg = <0x1>;
                                status = "okay";
                        };
                };
        };

is generated by dtgen with the  spidev node added by including a user dtsi which also adds the interrupt and #*-cells fields.

The device-tree compiles without complaint but I don't see a spi1 bus under /sys/class/spi_master.

ls /sys/class/spi_master
spi0

and /sys/class/spidev is, perhaps not surprisingly, empty.

The platform device for the axi_spi_engine is there

ls /sys/bus/platform/devices
200.rstc                    amba                        e0002000.phy0               e0100000.mmc                f8006000.memory-controller  f8891000.pmu                fpga-full
43c00000.axi_spi_engine     amba_pl                     e0002000.usb                f8000000.slcr               f8007000.devcfg             f8f00200.timer              reg-dummy
700.pinctrl                 ci_hdrc.0                   e000a000.gpio               f8001000.timer              f8007100.adc                f8f00600.timer              snd-soc-dummy
Fixed MDIO bus.0            cpuidle-zynq.0              e000b000.ethernet           f8002000.timer              f800c000.ocmc               f8f02000.cache-controller
alarmtimer                  e0001000.serial             e000d000.spi                f8005000.watchdog           f800d000.efuse              fixedregulator

and I can use devmem to interact with the registers but I am not sure the driver (spi-axi-spi-engine.c) is getting registered.  The driver code registers a platform driver and a spi_master using spi_register_master().

...

static struct platform_driver spi_engine_driver = {
	.probe = spi_engine_probe,
	.remove = spi_engine_remove,
	.driver = {
		.name = "spi-engine",
		.of_match_table = spi_engine_match_table,
	},
};
module_platform_driver(spi_engine_driver);
...

I am a noob, how can I debug what the problem is? Presumably the platform driver is being registered since there is an entry in /sys/bus/platform/devices but why is there no spi1 in /sys/class/spi_master? Any help or push in the right direction would be appreciated.

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ggillett
Contributor
Contributor
905 Views
Registered: ‎08-14-2018

I Did mention I am a noob.

It does not work unless you config the kernel to build the driver module (CONFIG_SPI_AXI_SPI_ENGINE=y).

Doh!

View solution in original post

0 Kudos
1 Reply
ggillett
Contributor
Contributor
906 Views
Registered: ‎08-14-2018

I Did mention I am a noob.

It does not work unless you config the kernel to build the driver module (CONFIG_SPI_AXI_SPI_ENGINE=y).

Doh!

View solution in original post

0 Kudos