[ELDK] Adding an SPI slave to the MPC5200

Chris Alfred c.alfred at internode.on.net
Fri Jun 11 09:44:50 CEST 2010


We have a Micrel KS8995M connected via SPI to the MPC5200 dedicated 
SPI bus. I found the spi_ks8995m.c driver by Gabor Juhos and have 
successfully added the Kconfig and build stuff.

In our board .dts I added:

  spi at f00 {
   #address-cells = <1>;
   #size-cells = <0>;
   compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi";
   reg = <0xf00 0x20>;
   interrupts = <2 13 0 2 14 0>;
   interrupt-parent = <&mpc5200_pic>;

   ethernet-switch at 0 {
    compatible = "micrel,ks8995m";
    spi-max-frequency = <1000000>;
    reg = <0>;
   };
  };

In the kernel xconfig we set the following to 'Y':
    SPI
    SPI_MPC52xx
    SPI_SPIDEV
    SPI_KS8995M        <- we added this for the spi_ks8995m.c driver

The spi_ks8995m.c driver init seems to be successfully called during 
boot:

[    0.958464] spi_master spi32766: registered MPC5200 SPI bus
[    0.965725] Micrel/Kendin KS8995 Ethernet switch SPI driver version 
0.1.1
[    0.973191] Micrel/Kendin KS8995 Ethernet switch SPI driver init 
returning:0

How do I bind the ks8995m driver to the SPI bus on the MPC5200?

Thanks,
Chris



More information about the eldk mailing list