aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx/dev-enet.c
diff options
context:
space:
mode:
authorMaxime Bizon <mbizon@freebox.fr>2013-06-04 17:53:34 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-10 17:28:27 -0400
commit0ae99b5fede6f3a8d252d50bb4aba29544295219 (patch)
tree3be7197f59057e81f9167f81b658a5eba6cb10cc /arch/mips/bcm63xx/dev-enet.c
parent7260aac97447a2b2cb9e8684d1162118c4426354 (diff)
bcm63xx_enet: split DMA channel register accesses
The current bcm63xx_enet driver always uses bcmenet_shared_base whenever it needs to access DMA channel configuration space or access the DMA channel state RAM. Split these register in 3 parts to be more accurate: - global DMA configuration - per DMA channel configuration space - per DMA channel state RAM space This is preliminary to support new chips where the global DMA configuration remains the same, but there is a varying number of DMA channels located at a different memory offset. Signed-off-by: Maxime Bizon <mbizon@freebox.fr> Signed-off-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/mips/bcm63xx/dev-enet.c')
-rw-r--r--arch/mips/bcm63xx/dev-enet.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c
index 39c23366c5c7..df5bf6686942 100644
--- a/arch/mips/bcm63xx/dev-enet.c
+++ b/arch/mips/bcm63xx/dev-enet.c
@@ -19,6 +19,16 @@ static struct resource shared_res[] = {
19 .end = -1, /* filled at runtime */ 19 .end = -1, /* filled at runtime */
20 .flags = IORESOURCE_MEM, 20 .flags = IORESOURCE_MEM,
21 }, 21 },
22 {
23 .start = -1, /* filled at runtime */
24 .end = -1, /* filled at runtime */
25 .flags = IORESOURCE_MEM,
26 },
27 {
28 .start = -1, /* filled at runtime */
29 .end = -1, /* filled at runtime */
30 .flags = IORESOURCE_MEM,
31 },
22}; 32};
23 33
24static struct platform_device bcm63xx_enet_shared_device = { 34static struct platform_device bcm63xx_enet_shared_device = {
@@ -110,10 +120,15 @@ int __init bcm63xx_enet_register(int unit,
110 if (!shared_device_registered) { 120 if (!shared_device_registered) {
111 shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); 121 shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA);
112 shared_res[0].end = shared_res[0].start; 122 shared_res[0].end = shared_res[0].start;
113 if (BCMCPU_IS_6338()) 123 shared_res[0].end += (RSET_ENETDMA_SIZE) - 1;
114 shared_res[0].end += (RSET_ENETDMA_SIZE / 2) - 1; 124
115 else 125 shared_res[1].start = bcm63xx_regset_address(RSET_ENETDMAC);
116 shared_res[0].end += (RSET_ENETDMA_SIZE) - 1; 126 shared_res[1].end = shared_res[1].start;
127 shared_res[1].end += RSET_ENETDMAC_SIZE(16) - 1;
128
129 shared_res[2].start = bcm63xx_regset_address(RSET_ENETDMAS);
130 shared_res[2].end = shared_res[2].start;
131 shared_res[2].end += RSET_ENETDMAS_SIZE(16) - 1;
117 132
118 ret = platform_device_register(&bcm63xx_enet_shared_device); 133 ret = platform_device_register(&bcm63xx_enet_shared_device);
119 if (ret) 134 if (ret)