Skip to contentSkip to conversation

net/designware: Add-on: Consecutive writes must have delay

PATCH New Dinh Nguyen 2 participants 3 messages Jun 7, 2012 1 message not in the archive Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/designware: Add-on: Consecutive writes must have delay

This commit is an add-on to f6c4191f. There are a few other registers where consecutive writes must have a delay.

---
 drivers/net/designware.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/designware.c +2 -2
index e8e669b..34952c0 100644
@@ -163,8 +163,8 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 	writel(FIXEDBURST | PRIORXTX_41 | BURST_16,
 			&dma_p->busmode);
 
-	writel(FLUSHTXFIFO | readl(&dma_p->opmode), &dma_p->opmode);
-	writel(STOREFORWARD | TXSECONDFRAME, &dma_p->opmode);
+	writel(readl(&dma_p->opmode) | FLUSHTXFIFO | STOREFORWARD | \
+		TXSECONDFRAME, &dma_p->opmode);
 
 	conf = FRAMEBURSTENABLE | DISABLERXOWN;
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 net/designware: Add-on: Consecutive writes must have delay

Dear Dinh,

Quoted 2 lines · In message <[email protected]> you wrote:

This commit is an add-on to f6c4191f. There are a few other registers where consecutive writes must have a delay.

Sorry, but this commit message is misleading - I was expecting to see something like udelay() in the code, but there wasn't any...

Quoted 10 lines
---
 drivers/net/designware.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/designware.c +0 -0
index e8e669b..34952c0 100644

drivers/net/designware.c static int dw_eth_init(struct eth_device *dev, bd_t *bis) · line 167

Quoted 7 lines
drivers/net/designware.c +2 -2
@@ -163,8 +163,8 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
 	writel(FIXEDBURST | PRIORXTX_41 | BURST_16,
 			&dma_p->busmode);
 
-	writel(FLUSHTXFIFO | readl(&dma_p->opmode), &dma_p->opmode);
-	writel(STOREFORWARD | TXSECONDFRAME, &dma_p->opmode);
+	writel(readl(&dma_p->opmode) | FLUSHTXFIFO | STOREFORWARD | \
+		TXSECONDFRAME, &dma_p->opmode);

There is no need for the continuation line here; please drop the backslash.

Hm... Should we not rather use something like setbits_le32() here?

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You said you  didn't  want  to  use  CGI.pm,  but  methinks  you  are
needlessly reinventing the wheel, one spoke at a time. Either you are
masochistic,  or  you  just haven't seen enough of what CGI.pm can do
for you. -- Randal L. Schwartz in <[email protected]>

A message that is not in the archive (sent off-list or not yet received): 71B37E0559AC6849A68C5BA94C509FB458298D3C24@SJ-ITMSG02.altera.priv.altera.com

#3 lore raw

PATCH 1/1 net/designware: Add-on: Consecutive writes must have delay

Dear Dinh,

Quoted 6 lines · In message <71B37E0559AC6849A68C5BA94C509FB458298D3C24@SJ-ITMSG02.altera.priv.a…
Quoted 3 lines

Sorry, but this commit message is misleading - I was expecting to see something like udelay() in the code, but there wasn't any...

Combining the 2 individual writes into a single write will also work. I'm just keeping in sync with commit # f6c4191f.

I understand this - but the commit message should match the code.

Quoted 1 line

Again, just keeping the code in sync with the previous commit that address this issue. If you like, I can change it to setbits_le32().

I think it would be cleaner, but if the rest of the code looks like that, I will not insist.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"...one of the main causes of the fall of the Roman Empire was  that,
lacking  zero,  they had no way to indicate successful termination of
their C programs."                                     - Robert Firth