Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 376095
b: refs/heads/master
c: 581df9e
h: refs/heads/master
i:
  376093: 0cf3b86
  376091: 08f22e5
  376087: 89f267d
  376079: 9319a1f
  376063: d9a6e3b
v: v3
  • Loading branch information
Nicolas Ferre authored and David S. Miller committed May 14, 2013
1 parent 7324231 commit 87e1bd5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 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: faff57a92ba1d7247c5e86ecea2886d2c9d54507
refs/heads/master: 581df9e1944194bfcabc57e1efae79b0fe171d6f
18 changes: 16 additions & 2 deletions trunk/drivers/net/ethernet/cadence/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ static void macb_tx_interrupt(struct macb *bp)
status = macb_readl(bp, TSR);
macb_writel(bp, TSR, status);

macb_writel(bp, ISR, MACB_BIT(TCOMP));
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
macb_writel(bp, ISR, MACB_BIT(TCOMP));

netdev_vdbg(bp->dev, "macb_tx_interrupt status = 0x%03lx\n",
(unsigned long)status);
Expand Down Expand Up @@ -738,7 +739,8 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
* now.
*/
macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
macb_writel(bp, ISR, MACB_BIT(RCOMP));
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
macb_writel(bp, ISR, MACB_BIT(RCOMP));

if (napi_schedule_prep(&bp->napi)) {
netdev_vdbg(bp->dev, "scheduling RX softirq\n");
Expand Down Expand Up @@ -1062,6 +1064,17 @@ static void macb_configure_dma(struct macb *bp)
}
}

/*
* Configure peripheral capacities according to integration options used
*/
static void macb_configure_caps(struct macb *bp)
{
if (macb_is_gem(bp)) {
if (GEM_BF(IRQCOR, gem_readl(bp, DCFG1)) == 0)
bp->caps |= MACB_CAPS_ISR_CLEAR_ON_WRITE;
}
}

static void macb_init_hw(struct macb *bp)
{
u32 config;
Expand All @@ -1084,6 +1097,7 @@ static void macb_init_hw(struct macb *bp)
bp->duplex = DUPLEX_HALF;

macb_configure_dma(bp);
macb_configure_caps(bp);

/* Initialize TX and RX buffers */
macb_writel(bp, RBQP, bp->rx_ring_dma);
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/net/ethernet/cadence/macb.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@
#define MACB_REV_SIZE 16

/* Bitfields in DCFG1. */
#define GEM_IRQCOR_OFFSET 23
#define GEM_IRQCOR_SIZE 1
#define GEM_DBWDEF_OFFSET 25
#define GEM_DBWDEF_SIZE 3

Expand All @@ -323,6 +325,9 @@
#define MACB_MAN_READ 2
#define MACB_MAN_CODE 2

/* Capability mask bits */
#define MACB_CAPS_ISR_CLEAR_ON_WRITE 0x1

/* Bit manipulation macros */
#define MACB_BIT(name) \
(1 << MACB_##name##_OFFSET)
Expand Down Expand Up @@ -574,6 +579,8 @@ struct macb {
unsigned int speed;
unsigned int duplex;

u32 caps;

phy_interface_t phy_interface;

/* AT91RM9200 transmit */
Expand Down

0 comments on commit 87e1bd5

Please sign in to comment.