Patchwork [U-Boot] DaVinci EMAC: Fix davinci_eth_gigabit_enable

login
register
mail settings
Submitter Sandeep Paulraj
Date Dec. 28, 2010, 7:38 p.m.
Message ID <1293565082-27468-1-git-send-email-s-paulraj@ti.com>
Download mbox | patch
Permalink /patch/76858/
State Accepted
Commit 4b9b9e7c665bfcff43bc720b579b6b03a5078736
Delegated to: Sandeep Paulraj
Headers show

Comments

Sandeep Paulraj - Dec. 28, 2010, 7:38 p.m.
From: Sandeep Paulraj <s-paulraj@ti.com>

Enabling the gigabit was overwriting the
previous configuration by setting up only GIGAFORCE and
GIG bits of MAC control register.
Modified to retain previous configuration while
gigabit enabling.

Signed-off-by: Prakash PM <prakash.pm@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
 drivers/net/davinci_emac.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 43a3d79..9371d96 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -322,9 +322,10 @@  static void  __attribute__((unused)) davinci_eth_gigabit_enable(void)
 			 * Check if link detected is giga-bit
 			 * If Gigabit mode detected, enable gigbit in MAC
 			 */
-			writel(EMAC_MACCONTROL_GIGFORCE |
-			       EMAC_MACCONTROL_GIGABIT_ENABLE,
-			       &adap_emac->MACCONTROL);
+			writel(readl(&adap_emac->MACCONTROL) |
+				EMAC_MACCONTROL_GIGFORCE |
+				EMAC_MACCONTROL_GIGABIT_ENABLE,
+				&adap_emac->MACCONTROL);
 		}
 	}
 }