Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327381
b: refs/heads/master
c: cc72d10
h: refs/heads/master
i:
  327379: 56a4a6e
v: v3
  • Loading branch information
David S. Miller committed Aug 4, 2012
1 parent f0be9dc commit cc0a573
Show file tree
Hide file tree
Showing 54 changed files with 902 additions and 192 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 044b722f36a17bc5f7f472cc3246cb15a430bb0e
refs/heads/master: cc72d100a3f4ba42a9ad02ebe52c0c6c7c496267
104 changes: 104 additions & 0 deletions trunk/Documentation/devicetree/bindings/net/cpsw.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
TI SoC Ethernet Switch Controller Device Tree Bindings
------------------------------------------------------

Required properties:
- compatible : Should be "ti,cpsw"
- reg : physical base address and size of the cpsw
registers map
- interrupts : property with a value describing the interrupt
number
- interrupt-parent : The parent interrupt controller
- cpdma_channels : Specifies number of channels in CPDMA
- host_port_no : Specifies host port shift
- cpdma_reg_ofs : Specifies CPDMA submodule register offset
- ale_reg_ofs : Specifies ALE submodule register offset
- ale_entries : Specifies No of entries ALE can hold
- host_port_reg_ofs : Specifies host port register offset
- hw_stats_reg_ofs : Specifies hardware statistics register offset
- bd_ram_ofs : Specifies internal desciptor RAM offset
- bd_ram_size : Specifies internal descriptor RAM size
- rx_descs : Specifies number of Rx descriptors
- mac_control : Specifies Default MAC control register content
for the specific platform
- slaves : Specifies number for slaves
- slave_reg_ofs : Specifies slave register offset
- sliver_reg_ofs : Specifies slave sliver register offset
- phy_id : Specifies slave phy id
- mac-address : Specifies slave MAC address

Optional properties:
- ti,hwmods : Must be "cpgmac0"
- no_bd_ram : Must be 0 or 1

Note: "ti,hwmods" field is used to fetch the base address and irq
resources from TI, omap hwmod data base during device registration.
Future plan is to migrate hwmod data base contents into device tree
blob so that, all the required data will be used from device tree dts
file.

Examples:

mac: ethernet@4A100000 {
compatible = "ti,cpsw";
reg = <0x4A100000 0x1000>;
interrupts = <55 0x4>;
interrupt-parent = <&intc>;
cpdma_channels = 8;
host_port_no = 0;
cpdma_reg_ofs = 0x800;
ale_reg_ofs = 0xd00;
ale_entries = 1024;
host_port_reg_ofs = 0x108;
hw_stats_reg_ofs = 0x900;
bd_ram_ofs = 0x2000;
bd_ram_size = 0x2000;
no_bd_ram = 0;
rx_descs = 64;
mac_control = 0x20;
slaves = 2;
slave@0 {
slave_reg_ofs = 0x208;
sliver_reg_ofs = 0xd80;
phy_id = "davinci_mdio-0:00"
mac-address = [00 04 9F 01 1B B8];
};
slave@1 {
slave_reg_ofs = 0x208;
sliver_reg_ofs = 0xd80;
phy_id = "davinci_mdio-0:01"
mac-address = [00 04 9F 01 1B B9];
};
};

(or)

mac: ethernet@4A100000 {
compatible = "ti,cpsw";
ti,hwmods = "cpgmac0";
cpdma_channels = 8;
host_port_no = 0;
cpdma_reg_ofs = 0x800;
ale_reg_ofs = 0xd00;
ale_entries = 1024;
host_port_reg_ofs = 0x108;
hw_stats_reg_ofs = 0x900;
bd_ram_ofs = 0x2000;
bd_ram_size = 0x2000;
no_bd_ram = 0;
rx_descs = 64;
mac_control = 0x20;
slaves = 2;
slave@0 {
slave_reg_ofs = 0x208;
sliver_reg_ofs = 0xd80;
phy_id = "davinci_mdio-0:00"
mac-address = [00 04 9F 01 1B B8];
};
slave@1 {
slave_reg_ofs = 0x208;
sliver_reg_ofs = 0xd80;
phy_id = "davinci_mdio-0:01"
mac-address = [00 04 9F 01 1B B9];
};

};
1 change: 1 addition & 0 deletions trunk/drivers/bcma/host_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4353) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
{ 0, },
};
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/bcma/sprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,9 @@ static bool bcma_sprom_onchip_available(struct bcma_bus *bus)
/* for these chips OTP is always available */
present = true;
break;

case BCMA_CHIP_ID_BCM43228:
present = chip_status & BCMA_CC_CHIPST_43228_OTP_PRESENT;
break;
default:
present = false;
break;
Expand Down
12 changes: 0 additions & 12 deletions trunk/drivers/isdn/isdnloop/isdnloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/sched.h>
#include "isdnloop.h"

static char *revision = "$Revision: 1.11.6.7 $";
static char *isdnloop_id = "loop0";

MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card");
Expand Down Expand Up @@ -1494,17 +1493,6 @@ isdnloop_addcard(char *id1)
static int __init
isdnloop_init(void)
{
char *p;
char rev[10];

if ((p = strchr(revision, ':'))) {
strcpy(rev, p + 1);
p = strchr(rev, '$');
*p = 0;
} else
strcpy(rev, " ??? ");
printk(KERN_NOTICE "isdnloop-ISDN-driver Rev%s\n", rev);

if (isdnloop_id)
return (isdnloop_addcard(isdnloop_id));

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/cris/eth_v10.c
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ e100_set_network_leds(int active)
static void
e100_netpoll(struct net_device* netdev)
{
e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev, NULL);
e100rxtx_interrupt(NETWORK_DMA_TX_IRQ_NBR, netdev);
}
#endif

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2485,6 +2485,7 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp,
break;

default:
kfree(new_cmd);
BNX2X_ERR("Unknown command: %d\n", cmd);
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1948,7 +1948,7 @@ static int be_rx_cqs_create(struct be_adapter *adapter)

if (adapter->num_rx_qs != MAX_RX_QS)
dev_info(&adapter->pdev->dev,
"Created only %d receive queues", adapter->num_rx_qs);
"Created only %d receive queues\n", adapter->num_rx_qs);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/mellanox/mlx4/en_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
/* If source MAC is equal to our own MAC and not performing
* the selftest or flb disabled - drop the packet */
if (s_mac == priv->mac &&
(!(dev->features & NETIF_F_LOOPBACK) ||
!priv->validate_loopback))
!((dev->features & NETIF_F_LOOPBACK) ||
priv->validate_loopback))
goto next;

/*
Expand Down
17 changes: 7 additions & 10 deletions trunk/drivers/net/ethernet/mellanox/mlx4/en_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
ring->cons = 0xffffffff;
ring->last_nr_txbb = 1;
ring->poll_cnt = 0;
ring->blocked = 0;
memset(ring->tx_info, 0, ring->size * sizeof(struct mlx4_en_tx_info));
memset(ring->buf, 0, ring->buf_size);

Expand Down Expand Up @@ -365,14 +364,13 @@ static void mlx4_en_process_tx_cq(struct net_device *dev, struct mlx4_en_cq *cq)
ring->cons += txbbs_skipped;
netdev_tx_completed_queue(ring->tx_queue, packets, bytes);

/* Wakeup Tx queue if this ring stopped it */
if (unlikely(ring->blocked)) {
if ((u32) (ring->prod - ring->cons) <=
ring->size - HEADROOM - MAX_DESC_TXBBS) {
ring->blocked = 0;
netif_tx_wake_queue(ring->tx_queue);
priv->port_stats.wake_queue++;
}
/*
* Wakeup Tx queue if this stopped, and at least 1 packet
* was completed
*/
if (netif_tx_queue_stopped(ring->tx_queue) && txbbs_skipped > 0) {
netif_tx_wake_queue(ring->tx_queue);
priv->port_stats.wake_queue++;
}
}

Expand Down Expand Up @@ -592,7 +590,6 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
ring->size - HEADROOM - MAX_DESC_TXBBS)) {
/* every full Tx ring stops queue */
netif_tx_stop_queue(ring->tx_queue);
ring->blocked = 1;
priv->port_stats.queue_stopped++;

return NETDEV_TX_BUSY;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ int mlx4_check_port_params(struct mlx4_dev *dev,
"on this HCA, aborting.\n");
return -EINVAL;
}
if (port_type[i] == MLX4_PORT_TYPE_ETH &&
port_type[i + 1] == MLX4_PORT_TYPE_IB)
return -EINVAL;
}
}

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ struct mlx4_en_tx_ring {
u32 doorbell_qpn;
void *buf;
u16 poll_cnt;
int blocked;
struct mlx4_en_tx_info *tx_info;
u8 *bounce_buf;
u32 last_nr_txbb;
Expand Down
14 changes: 0 additions & 14 deletions trunk/drivers/net/ethernet/mellanox/mlx4/sense.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,6 @@ void mlx4_do_sense_ports(struct mlx4_dev *dev,
stype[i - 1] = defaults[i - 1];
}

/*
* Adjust port configuration:
* If port 1 sensed nothing and port 2 is IB, set both as IB
* If port 2 sensed nothing and port 1 is Eth, set both as Eth
*/
if (stype[0] == MLX4_PORT_TYPE_ETH) {
for (i = 1; i < dev->caps.num_ports; i++)
stype[i] = stype[i] ? stype[i] : MLX4_PORT_TYPE_ETH;
}
if (stype[dev->caps.num_ports - 1] == MLX4_PORT_TYPE_IB) {
for (i = 0; i < dev->caps.num_ports - 1; i++)
stype[i] = stype[i] ? stype[i] : MLX4_PORT_TYPE_IB;
}

/*
* If sensed nothing, remain in current configuration.
*/
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/ethernet/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,11 @@ static int efx_probe_all(struct efx_nic *efx)
goto fail2;
}

BUILD_BUG_ON(EFX_DEFAULT_DMAQ_SIZE < EFX_RXQ_MIN_ENT);
if (WARN_ON(EFX_DEFAULT_DMAQ_SIZE < EFX_TXQ_MIN_ENT(efx))) {
rc = -EINVAL;
goto fail3;
}
efx->rxq_entries = efx->txq_entries = EFX_DEFAULT_DMAQ_SIZE;

rc = efx_probe_filters(efx);
Expand Down Expand Up @@ -2070,6 +2075,7 @@ static int efx_register_netdev(struct efx_nic *efx)
net_dev->irq = efx->pci_dev->irq;
net_dev->netdev_ops = &efx_netdev_ops;
SET_ETHTOOL_OPS(net_dev, &efx_ethtool_ops);
net_dev->gso_max_segs = EFX_TSO_MAX_SEGS;

rtnl_lock();

Expand Down
14 changes: 10 additions & 4 deletions trunk/drivers/net/ethernet/sfc/efx.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ extern netdev_tx_t
efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb);
extern void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index);
extern int efx_setup_tc(struct net_device *net_dev, u8 num_tc);
extern unsigned int efx_tx_max_skb_descs(struct efx_nic *efx);

/* RX */
extern int efx_probe_rx_queue(struct efx_rx_queue *rx_queue);
Expand All @@ -52,10 +53,15 @@ extern void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue);
#define EFX_MAX_EVQ_SIZE 16384UL
#define EFX_MIN_EVQ_SIZE 512UL

/* The smallest [rt]xq_entries that the driver supports. Callers of
* efx_wake_queue() assume that they can subsequently send at least one
* skb. Falcon/A1 may require up to three descriptors per skb_frag. */
#define EFX_MIN_RING_SIZE (roundup_pow_of_two(2 * 3 * MAX_SKB_FRAGS))
/* Maximum number of TCP segments we support for soft-TSO */
#define EFX_TSO_MAX_SEGS 100

/* The smallest [rt]xq_entries that the driver supports. RX minimum
* is a bit arbitrary. For TX, we must have space for at least 2
* TSO skbs.
*/
#define EFX_RXQ_MIN_ENT 128U
#define EFX_TXQ_MIN_ENT(efx) (2 * efx_tx_max_skb_descs(efx))

/* Filters */
extern int efx_probe_filters(struct efx_nic *efx);
Expand Down
16 changes: 11 additions & 5 deletions trunk/drivers/net/ethernet/sfc/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,21 +680,27 @@ static int efx_ethtool_set_ringparam(struct net_device *net_dev,
struct ethtool_ringparam *ring)
{
struct efx_nic *efx = netdev_priv(net_dev);
u32 txq_entries;

if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
ring->rx_pending > EFX_MAX_DMAQ_SIZE ||
ring->tx_pending > EFX_MAX_DMAQ_SIZE)
return -EINVAL;

if (ring->rx_pending < EFX_MIN_RING_SIZE ||
ring->tx_pending < EFX_MIN_RING_SIZE) {
if (ring->rx_pending < EFX_RXQ_MIN_ENT) {
netif_err(efx, drv, efx->net_dev,
"TX and RX queues cannot be smaller than %ld\n",
EFX_MIN_RING_SIZE);
"RX queues cannot be smaller than %u\n",
EFX_RXQ_MIN_ENT);
return -EINVAL;
}

return efx_realloc_channels(efx, ring->rx_pending, ring->tx_pending);
txq_entries = max(ring->tx_pending, EFX_TXQ_MIN_ENT(efx));
if (txq_entries != ring->tx_pending)
netif_warn(efx, drv, efx->net_dev,
"increasing TX queue size to minimum of %u\n",
txq_entries);

return efx_realloc_channels(efx, ring->rx_pending, txq_entries);
}

static int efx_ethtool_set_pauseparam(struct net_device *net_dev,
Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/net/ethernet/sfc/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,25 @@ efx_max_tx_len(struct efx_nic *efx, dma_addr_t dma_addr)
return len;
}

unsigned int efx_tx_max_skb_descs(struct efx_nic *efx)
{
/* Header and payload descriptor for each output segment, plus
* one for every input fragment boundary within a segment
*/
unsigned int max_descs = EFX_TSO_MAX_SEGS * 2 + MAX_SKB_FRAGS;

/* Possibly one more per segment for the alignment workaround */
if (EFX_WORKAROUND_5391(efx))
max_descs += EFX_TSO_MAX_SEGS;

/* Possibly more for PCIe page boundaries within input fragments */
if (PAGE_SIZE > EFX_PAGE_SIZE)
max_descs += max_t(unsigned int, MAX_SKB_FRAGS,
DIV_ROUND_UP(GSO_MAX_SIZE, EFX_PAGE_SIZE));

return max_descs;
}

/*
* Add a socket buffer to a TX queue
*
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/ti/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ config TI_DAVINCI_EMAC

config TI_DAVINCI_MDIO
tristate "TI DaVinci MDIO Support"
depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 )
depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX )
select PHYLIB
---help---
This driver supports TI's DaVinci MDIO module.
Expand All @@ -42,7 +42,7 @@ config TI_DAVINCI_MDIO

config TI_DAVINCI_CPDMA
tristate "TI DaVinci CPDMA Support"
depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 )
depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 || SOC_AM33XX )
---help---
This driver supports TI's DaVinci CPDMA dma engine.

Expand Down
Loading

0 comments on commit cc0a573

Please sign in to comment.