- 论坛徽章:
- 0
|
modify 9263 board's reg define and improve the Emac9161's driver
修改了at91sam9263reg.h文件,使得选择9263时,g-bios可以编译通过。
如果使用Emac9161网卡驱动,g-bios下半部启动时,会一直等待网线连接状态ok,如果此时不插网线,g-bios会一直等待,因此在Emac9161驱动中添加了timeout机制。
signed-off-by: voidjackjiang <voidjack@163.com>
-------------------------------------------------------------------------------------------------------
From afd8719d92155fac959e49f8642f4fe9cf124904 Mon Sep 17 00:00:00 2001
From: Jack Jiang <voidjack@163.com>
Date: Tue, 13 Oct 2009 16:47:07 +0800
Subject: [PATCH] fix at91sam9263reg.h eth_at91.c
---
device/net/eth_at91.c | 8 +++++++-
include/arch/at91sam9263reg.h | 14 ++++++++++++++
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/device/net/eth_at91.c b/device/net/eth_at91.c
index c7388c0..8194def 100644
--- a/device/net/eth_at91.c
+++ b/device/net/eth_at91.c
@@ -269,7 +269,7 @@ static int __INIT__ EmacProbe(void)
UINT16 hSpeed, hMode;
struct NetDevice *pNetDev;
struct At91Emac *pEmac;
-
+ int nTimeOut = 100;
pNetDev = GkNetDevNew(sizeof(*pEmac));
pEmac = pNetDev->pChip;
@@ -285,6 +285,12 @@ static int __INIT__ EmacProbe(void)
hMode = EmacMdioRead(MII_REG_BMS);
if (hMode & 0x24)
break;
+ if (nTimeOut == 0)
+ {
+ break;
+ }
+ nTimeOut--;
+ udelay(10);
}
if(hMode & 0x20)
diff --git a/include/arch/at91sam9263reg.h b/include/arch/at91sam9263reg.h
index 40409d7..0f60d0f 100644
--- a/include/arch/at91sam9263reg.h
+++ b/include/arch/at91sam9263reg.h
@@ -3,6 +3,12 @@
#define SDRAM_BASE 0x20000000
#define SDRAM_SIZE 0x04000000
+#define MULA 31
+#define DIVA 3
+#define MAIN_CLOCK 18432000
+#define PLLA_CLOCK (MAIN_CLOCK * ((MULA) + 1) / (DIVA))
+#define MASTER_CLOCK ((PLLA_CLOCK) / 2)
+
#define AT91SAM926X_PA_NAND 0x40000000
#define NAND_DATA 0x000000
#define NAND_ADDR 0x200000
@@ -81,6 +87,14 @@
#define SDRAMC_ISR 0x20
#define SDRAMC_MDR 0x24
+#define SDR_CAS(n) ((n) << 5)
+#define SDR_tWR(n) ((n) << 
+#define SDR_tRC(n) ((n) << 12)
+#define SDR_tRP(n) ((n) << 16)
+#define SDR_tRCD(n) ((n) << 20)
+#define SDR_tRAS(n) ((n) << 24)
+#define SDR_tXSR(n) ((n) << 2
+
#define AT91SAM926X_PA_MATRIX 0xFFFFEC00
#define MATRIX_SCFG4 0x050
#define MATRIX_EBI0CSA 0x120
--
1.6.0.4
[ 本帖最后由 voidjackjiang 于 2009-10-15 18:21 编辑 ] |
|