Skip to content

Commit

Permalink
Blackfin arch: add platform device bfin_mii-bus and KSZ8893M switch d…
Browse files Browse the repository at this point in the history
…river platform resources to board files

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Graf Yang authored and Bryan Wu committed Feb 4, 2009
1 parent 583947c commit 6531962
Showing 10 changed files with 105 additions and 0 deletions.
51 changes: 51 additions & 0 deletions arch/blackfin/mach-bf518/boards/ezbrd.c
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@
#include <asm/dpmc.h>
#include <asm/bfin_sdh.h>
#include <linux/spi/ad7877.h>
#include <net/dsa.h>

/*
* Name the Board for the /proc/cpuinfo
@@ -104,8 +105,31 @@ static struct platform_device rtc_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
static struct dsa_platform_data ksz8893m_switch_data = {
.mii_bus = &bfin_mii_bus.dev,
.netdev = &bfin_mac_device.dev,
.port_names[0] = NULL,
.port_names[1] = "eth%d",
.port_names[2] = "eth%d",
.port_names[3] = "cpu",
};

static struct platform_device ksz8893m_switch_device = {
.name = "dsa",
.id = 0,
.num_resources = 0,
.dev.platform_data = &ksz8893m_switch_data,
};
#endif

@@ -147,6 +171,15 @@ static struct bfin5xx_spi_chip spi_adc_chip_info = {
};
#endif

#if defined(CONFIG_NET_DSA_KSZ8893M) \
|| defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
/* SPI SWITCH CHIP */
static struct bfin5xx_spi_chip spi_switch_info = {
.enable_dma = 0,
.bits_per_word = 8,
};
#endif

#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
static struct bfin5xx_spi_chip spi_mmc_chip_info = {
.enable_dma = 1,
@@ -226,6 +259,19 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
},
#endif

#if defined(CONFIG_NET_DSA_KSZ8893M) \
|| defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
{
.modalias = "ksz8893m",
.max_speed_hz = 5000000,
.bus_num = 0,
.chip_select = 1,
.platform_data = NULL,
.controller_data = &spi_switch_info,
.mode = SPI_MODE_3,
},
#endif

#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
{
.modalias = "spi_mmc_dummy",
@@ -582,9 +628,14 @@ static struct platform_device *stamp_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
&ksz8893m_switch_device,
#endif

#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
&bfin_spi0_device,
&bfin_spi1_device,
6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf527/boards/cm_bf527.c
Original file line number Diff line number Diff line change
@@ -403,8 +403,13 @@ static struct platform_device isp1362_hcd_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -918,6 +923,7 @@ static struct platform_device *stamp_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf527/boards/ezbrd.c
Original file line number Diff line number Diff line change
@@ -208,8 +208,13 @@ static struct platform_device rtc_device = {


#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -718,6 +723,7 @@ static struct platform_device *stamp_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf527/boards/ezkit.c
Original file line number Diff line number Diff line change
@@ -425,8 +425,13 @@ static struct platform_device isp1362_hcd_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -986,6 +991,7 @@ static struct platform_device *stamp_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf537/boards/cm_bf537.c
Original file line number Diff line number Diff line change
@@ -479,8 +479,13 @@ static struct platform_device bfin_sport1_uart_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -591,6 +596,7 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf537/boards/generic_board.c
Original file line number Diff line number Diff line change
@@ -262,8 +262,13 @@ static struct platform_device isp1362_hcd_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -662,6 +667,7 @@ static struct platform_device *stamp_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf537/boards/minotaur.c
Original file line number Diff line number Diff line change
@@ -61,8 +61,13 @@ static struct platform_device rtc_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -324,6 +329,7 @@ static struct platform_device *minotaur_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf537/boards/pnav10.c
Original file line number Diff line number Diff line change
@@ -198,8 +198,13 @@ static struct platform_device isp1362_hcd_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -529,6 +534,7 @@ static struct platform_device *stamp_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf537/boards/stamp.c
Original file line number Diff line number Diff line change
@@ -321,8 +321,13 @@ static struct platform_device isp1362_hcd_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -1215,6 +1220,7 @@ static struct platform_device *stamp_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

6 changes: 6 additions & 0 deletions arch/blackfin/mach-bf537/boards/tcm_bf537.c
Original file line number Diff line number Diff line change
@@ -481,8 +481,13 @@ static struct platform_device bfin_sport1_uart_device = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
static struct platform_device bfin_mii_bus = {
.name = "bfin_mii_bus",
};

static struct platform_device bfin_mac_device = {
.name = "bfin_mac",
.dev.platform_data = &bfin_mii_bus,
};
#endif

@@ -593,6 +598,7 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
#endif

#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
&bfin_mii_bus,
&bfin_mac_device,
#endif

0 comments on commit 6531962

Please sign in to comment.