mv643xx_eth: get rid of static variables, allow multiple instances
Subsystems (3)
PATCH 1/4 mv643xx_eth: get rid of static variables, allow multiple instances
Move mv643xx_eth's static state (ethernet register block base address and MII management interface spinlock) into a struct hanging off the shared platform device. This is necessary to support chips that contain multiple mv643xx_eth silicon blocks.
Signed-off-by Lennert Buytenhek <[email protected]>
arch/powerpc/platforms/chrp/pegasos_eth.c +4 -0
@@ -58,7 +58,9 @@ static struct resource mv643xx_eth0_resostatic struct mv643xx_eth_platform_data eth0_pd = { + .shared = &mv643xx_eth_shared_device, .port_number =0 , + .tx_sram_addr =PEGASOS2_SRAM_BASE_ETH0 , .tx_sram_size =PEGASOS2_SRAM_TXRING_SIZE , .tx_queue_size =PEGASOS2_SRAM_TXRING_SIZE /16 ,
@@ -88,7 +90,9 @@ static struct resource mv643xx_eth1_reso };static struct mv643xx_eth_platform_data eth1_pd = { + .shared = &mv643xx_eth_shared_device, .port_number =1 , + .tx_sram_addr =PEGASOS2_SRAM_BASE_ETH1 , .tx_sram_size =PEGASOS2_SRAM_TXRING_SIZE , .tx_queue_size =PEGASOS2_SRAM_TXRING_SIZE /16 ,
arch/powerpc/sysdev/mv64x60_dev.c +41 -13
92 lines not on this page · raw message
arch/ppc/syslib/mv64x60.c +3 -0
@@ -341,6 +341,7 @@ static struct resource mv64x60_eth0_reso };static struct mv643xx_eth_platform_data eth0_pd = { + .shared = &mv64x60_eth_shared_device; .port_number =0 , };
@@ -366,6 +367,7 @@ static struct resource mv64x60_eth1_reso };static struct mv643xx_eth_platform_data eth1_pd = { + .shared = &mv64x60_eth_shared_device; .port_number =1 , };
@@ -391,6 +393,7 @@ static struct resource mv64x60_eth2_reso };static struct mv643xx_eth_platform_data eth2_pd = { + .shared = &mv64x60_eth_shared_device; .port_number =2 , };
drivers/net/mv643xx_eth.c +45 -17
138 lines not on this page · raw message
include/linux/mv643xx_eth.h +3 -0
@@ -1,6 +1,7 @@/* * MV-643XX ethernet platform device data definition file. */ +#ifndef __LINUX_MV643XX_ETH_H#define __LINUX_MV643XX_ETH_H
@@ -13,7 +14,9 @@#define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290struct mv643xx_eth_platform_data { +struct platform_device *shared;int port_number; +u16 force_phy_addr;/* force override if phy_addr == 0 */ u16 phy_addr;
----