11 #include <linux/types.h>
14 #include <linux/device.h>
17 #include <linux/pci.h>
19 #define PEGASOS2_MARVELL_REGBASE (0xf1000000)
20 #define PEGASOS2_MARVELL_REGSIZE (0x00004000)
21 #define PEGASOS2_SRAM_BASE (0xf2000000)
22 #define PEGASOS2_SRAM_SIZE (256*1024)
24 #define PEGASOS2_SRAM_BASE_ETH_PORT0 (PEGASOS2_SRAM_BASE)
25 #define PEGASOS2_SRAM_BASE_ETH_PORT1 (PEGASOS2_SRAM_BASE_ETH_PORT0 + (PEGASOS2_SRAM_SIZE / 2) )
28 #define PEGASOS2_SRAM_RXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
29 #define PEGASOS2_SRAM_TXRING_SIZE (PEGASOS2_SRAM_SIZE/4)
33 static struct resource mv643xx_eth_shared_resources[] = {
35 .name =
"ethernet shared base",
46 .num_resources =
ARRAY_SIZE(mv643xx_eth_shared_resources),
47 .resource = mv643xx_eth_shared_resources,
50 static struct resource mv643xx_eth_port1_resources[] = {
52 .name =
"eth port1 irq",
60 .shared = &mv643xx_eth_shared_device,
76 .num_resources =
ARRAY_SIZE(mv643xx_eth_port1_resources),
77 .resource = mv643xx_eth_port1_resources,
79 .platform_data = ð_port1_pd,
84 &mv643xx_eth_shared_device,
90 #define MV_READ(offset,val) { val = readl(mv643xx_reg_base + offset); }
91 #define MV_WRITE(offset,data) writel(data, mv643xx_reg_base + offset)
93 static void __iomem *mv643xx_reg_base;
95 static int Enable_SRAM(
void)
99 if (mv643xx_reg_base ==
NULL)
103 if (mv643xx_reg_base ==
NULL)
107 printk(
"Pegasos II/Marvell MV64361: register remapped from %p to %p\n",
130 printk(
"Pegasos II/Marvell MV64361: register unmapped\n");
135 mv643xx_reg_base =
NULL;
143 static int __init mv643xx_eth_add_pds(
void)
152 printk(
"Pegasos II/Marvell MV64361: init\n");
159 if ( Enable_SRAM() < 0)
167 printk(
"Pegasos II/Marvell MV64361: Can't enable the "
174 printk(
"Pegasos II/Marvell MV64361: init is over\n");