aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/pasemi/iommu.c19
-rw-r--r--arch/powerpc/sysdev/mpic.c9
-rw-r--r--drivers/net/pasemi_mac.c35
3 files changed, 46 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c
index 5803f11c77fc..86967bdd8774 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2005-2007, PA Semi, Inc 2 * Copyright (C) 2005-2008, PA Semi, Inc
3 * 3 *
4 * Maintained by: Olof Johansson <olof@lixom.net> 4 * Maintained by: Olof Johansson <olof@lixom.net>
5 * 5 *
@@ -27,7 +27,6 @@
27#include <asm/abs_addr.h> 27#include <asm/abs_addr.h>
28#include <asm/firmware.h> 28#include <asm/firmware.h>
29 29
30
31#define IOBMAP_PAGE_SHIFT 12 30#define IOBMAP_PAGE_SHIFT 12
32#define IOBMAP_PAGE_SIZE (1 << IOBMAP_PAGE_SHIFT) 31#define IOBMAP_PAGE_SIZE (1 << IOBMAP_PAGE_SHIFT)
33#define IOBMAP_PAGE_MASK (IOBMAP_PAGE_SIZE - 1) 32#define IOBMAP_PAGE_MASK (IOBMAP_PAGE_SIZE - 1)
@@ -35,13 +34,13 @@
35#define IOB_BASE 0xe0000000 34#define IOB_BASE 0xe0000000
36#define IOB_SIZE 0x3000 35#define IOB_SIZE 0x3000
37/* Configuration registers */ 36/* Configuration registers */
38#define IOBCAP_REG 0x10 37#define IOBCAP_REG 0x40
39#define IOBCOM_REG 0x40 38#define IOBCOM_REG 0x100
40/* Enable IOB address translation */ 39/* Enable IOB address translation */
41#define IOBCOM_ATEN 0x00000100 40#define IOBCOM_ATEN 0x00000100
42 41
43/* Address decode configuration register */ 42/* Address decode configuration register */
44#define IOB_AD_REG 0x53 43#define IOB_AD_REG 0x14c
45/* IOBCOM_AD_REG fields */ 44/* IOBCOM_AD_REG fields */
46#define IOB_AD_VGPRT 0x00000e00 45#define IOB_AD_VGPRT 0x00000e00
47#define IOB_AD_VGAEN 0x00000100 46#define IOB_AD_VGAEN 0x00000100
@@ -56,13 +55,13 @@
56#define IOB_AD_TRNG_2G 0x00000001 55#define IOB_AD_TRNG_2G 0x00000001
57#define IOB_AD_TRNG_128G 0x00000003 56#define IOB_AD_TRNG_128G 0x00000003
58 57
59#define IOB_TABLEBASE_REG 0x55 58#define IOB_TABLEBASE_REG 0x154
60 59
61/* Base of the 64 4-byte L1 registers */ 60/* Base of the 64 4-byte L1 registers */
62#define IOB_XLT_L1_REGBASE 0xac0 61#define IOB_XLT_L1_REGBASE 0x2b00
63 62
64/* Register to invalidate TLB entries */ 63/* Register to invalidate TLB entries */
65#define IOB_AT_INVAL_TLB_REG 0xb40 64#define IOB_AT_INVAL_TLB_REG 0x2d00
66 65
67/* The top two bits of the level 1 entry contains valid and type flags */ 66/* The top two bits of the level 1 entry contains valid and type flags */
68#define IOBMAP_L1E_V 0x40000000 67#define IOBMAP_L1E_V 0x40000000
@@ -76,7 +75,7 @@
76#define IOBMAP_L2E_V 0x80000000 75#define IOBMAP_L2E_V 0x80000000
77#define IOBMAP_L2E_V_CACHED 0xc0000000 76#define IOBMAP_L2E_V_CACHED 0xc0000000
78 77
79static u32 __iomem *iob; 78static void __iomem *iob;
80static u32 iob_l1_emptyval; 79static u32 iob_l1_emptyval;
81static u32 iob_l2_emptyval; 80static u32 iob_l2_emptyval;
82static u32 *iob_l2_base; 81static u32 *iob_l2_base;
@@ -219,7 +218,7 @@ int __init iob_init(struct device_node *dn)
219 for (i = 0; i < 64; i++) { 218 for (i = 0; i < 64; i++) {
220 /* Each L1 covers 32MB, i.e. 8K entries = 32K of ram */ 219 /* Each L1 covers 32MB, i.e. 8K entries = 32K of ram */
221 regword = IOBMAP_L1E_V | (__pa(iob_l2_base + i*0x2000) >> 12); 220 regword = IOBMAP_L1E_V | (__pa(iob_l2_base + i*0x2000) >> 12);
222 out_le32(iob+IOB_XLT_L1_REGBASE+i, regword); 221 out_le32(iob+IOB_XLT_L1_REGBASE+i*4, regword);
223 } 222 }
224 223
225 /* set 2GB translation window, based at 0 */ 224 /* set 2GB translation window, based at 0 */
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 6131fd2b6619..8619f2a3f1f6 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1410,11 +1410,6 @@ void mpic_cpu_set_priority(int prio)
1410 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), prio); 1410 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), prio);
1411} 1411}
1412 1412
1413/*
1414 * XXX: someone who knows mpic should check this.
1415 * do we need to eoi the ipi including for kexec cpu here (see xics comments)?
1416 * or can we reset the mpic in the new kernel?
1417 */
1418void mpic_teardown_this_cpu(int secondary) 1413void mpic_teardown_this_cpu(int secondary)
1419{ 1414{
1420 struct mpic *mpic = mpic_primary; 1415 struct mpic *mpic = mpic_primary;
@@ -1434,6 +1429,10 @@ void mpic_teardown_this_cpu(int secondary)
1434 1429
1435 /* Set current processor priority to max */ 1430 /* Set current processor priority to max */
1436 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0xf); 1431 mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0xf);
1432 /* We need to EOI the IPI since not all platforms reset the MPIC
1433 * on boot and new interrupts wouldn't get delivered otherwise.
1434 */
1435 mpic_eoi(mpic);
1437 1436
1438 spin_unlock_irqrestore(&mpic_lock, flags); 1437 spin_unlock_irqrestore(&mpic_lock, flags);
1439} 1438}
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index c50f0f4de6d8..965f2e4b3452 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -404,6 +404,7 @@ static void pasemi_mac_free_csring(struct pasemi_mac_csring *csring)
404 pasemi_dma_free_flag(csring->events[1]); 404 pasemi_dma_free_flag(csring->events[1]);
405 pasemi_dma_free_ring(&csring->chan); 405 pasemi_dma_free_ring(&csring->chan);
406 pasemi_dma_free_chan(&csring->chan); 406 pasemi_dma_free_chan(&csring->chan);
407 pasemi_dma_free_fun(csring->fun);
407} 408}
408 409
409static int pasemi_mac_setup_rx_resources(const struct net_device *dev) 410static int pasemi_mac_setup_rx_resources(const struct net_device *dev)
@@ -1150,7 +1151,10 @@ static int pasemi_mac_open(struct net_device *dev)
1150 if (!mac->tx) 1151 if (!mac->tx)
1151 goto out_tx_ring; 1152 goto out_tx_ring;
1152 1153
1153 if (dev->mtu > 1500) { 1154 /* We might already have allocated rings in case mtu was changed
1155 * before interface was brought up.
1156 */
1157 if (dev->mtu > 1500 && !mac->num_cs) {
1154 pasemi_mac_setup_csrings(mac); 1158 pasemi_mac_setup_csrings(mac);
1155 if (!mac->num_cs) 1159 if (!mac->num_cs)
1156 goto out_tx_ring; 1160 goto out_tx_ring;
@@ -1388,8 +1392,12 @@ static int pasemi_mac_close(struct net_device *dev)
1388 free_irq(mac->tx->chan.irq, mac->tx); 1392 free_irq(mac->tx->chan.irq, mac->tx);
1389 free_irq(mac->rx->chan.irq, mac->rx); 1393 free_irq(mac->rx->chan.irq, mac->rx);
1390 1394
1391 for (i = 0; i < mac->num_cs; i++) 1395 for (i = 0; i < mac->num_cs; i++) {
1392 pasemi_mac_free_csring(mac->cs[i]); 1396 pasemi_mac_free_csring(mac->cs[i]);
1397 mac->cs[i] = NULL;
1398 }
1399
1400 mac->num_cs = 0;
1393 1401
1394 /* Free resources */ 1402 /* Free resources */
1395 pasemi_mac_free_rx_resources(mac); 1403 pasemi_mac_free_rx_resources(mac);
@@ -1640,6 +1648,26 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget)
1640 return pkts; 1648 return pkts;
1641} 1649}
1642 1650
1651#ifdef CONFIG_NET_POLL_CONTROLLER
1652/*
1653 * Polling 'interrupt' - used by things like netconsole to send skbs
1654 * without having to re-enable interrupts. It's not called while
1655 * the interrupt routine is executing.
1656 */
1657static void pasemi_mac_netpoll(struct net_device *dev)
1658{
1659 const struct pasemi_mac *mac = netdev_priv(dev);
1660
1661 disable_irq(mac->tx->chan.irq);
1662 pasemi_mac_tx_intr(mac->tx->chan.irq, mac->tx);
1663 enable_irq(mac->tx->chan.irq);
1664
1665 disable_irq(mac->rx->chan.irq);
1666 pasemi_mac_rx_intr(mac->rx->chan.irq, mac->rx);
1667 enable_irq(mac->rx->chan.irq);
1668}
1669#endif
1670
1643static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu) 1671static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu)
1644{ 1672{
1645 struct pasemi_mac *mac = netdev_priv(dev); 1673 struct pasemi_mac *mac = netdev_priv(dev);
@@ -1799,6 +1827,9 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1799 dev->mtu = PE_DEF_MTU; 1827 dev->mtu = PE_DEF_MTU;
1800 /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */ 1828 /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
1801 mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128; 1829 mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128;
1830#ifdef CONFIG_NET_POLL_CONTROLLER
1831 dev->poll_controller = pasemi_mac_netpoll;
1832#endif
1802 1833
1803 dev->change_mtu = pasemi_mac_change_mtu; 1834 dev->change_mtu = pasemi_mac_change_mtu;
1804 dev->ethtool_ops = &pasemi_mac_ethtool_ops; 1835 dev->ethtool_ops = &pasemi_mac_ethtool_ops;