From accef43145a63535fa38714af469f22d912d6c64 Mon Sep 17 00:00:00 2001 From: Reinhard Meyer Date: Wed, 1 Dec 2010 05:49:53 +0100 Subject: AT91: fix EMAC gpio init in at91sam9260_devices.c The AT91SAM9G20 BOOT ROM apparently initializes PA23 and PA24 to multi drive (open drain). Revert this, if those pins are going to be used for MII. Signed-off-by: Reinhard Meyer --- arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch') diff --git a/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c b/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c index f699f4d..c1822b7 100644 --- a/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c +++ b/arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c @@ -204,6 +204,11 @@ void at91_macb_hw_init(void) #else at91_set_b_periph(AT91_PIO_PORTA, 23, 0); /* ETX2 */ at91_set_b_periph(AT91_PIO_PORTA, 24, 0); /* ETX3 */ +#if defined(CONFIG_AT91SAM9G20) + /* 9G20 BOOT ROM initializes those pins to multi-drive, undo that */ + at91_set_pio_multi_drive(AT91_PIO_PORTA, 23, 0); + at91_set_pio_multi_drive(AT91_PIO_PORTA, 24, 0); +#endif #endif at91_set_b_periph(AT91_PIO_PORTA, 22, 0); /* ETXER */ #endif -- cgit v1.1 From 305bf489d1e7dd70f45720720ae0066fcce3acb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= Date: Tue, 30 Nov 2010 09:45:05 +0000 Subject: arm920t/at91/reset: board_reset: define weak symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Bießmann --- arch/arm/cpu/arm920t/at91/reset.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'arch') diff --git a/arch/arm/cpu/arm920t/at91/reset.c b/arch/arm/cpu/arm920t/at91/reset.c index ce9c156..51043ec 100644 --- a/arch/arm/cpu/arm920t/at91/reset.c +++ b/arch/arm/cpu/arm920t/at91/reset.c @@ -35,7 +35,10 @@ #include #include -void board_reset(void) __attribute__((__weak__)); +void __attribute__((weak)) board_reset(void) +{ + /* true empty function for defining weak symbol */ +} void reset_cpu(ulong ignored) { @@ -45,8 +48,7 @@ void reset_cpu(ulong ignored) serial_exit(); #endif - if (board_reset) - board_reset(); + board_reset(); /* Reset the cpu by setting up the watchdog timer */ writel(AT91_ST_WDMR_RSTEN | AT91_ST_WDMR_EXTEN | AT91_ST_WDMR_WDV(2), -- cgit v1.1 From a429db7e3ce6136f80f22584588247926ba60b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= Date: Tue, 30 Nov 2010 09:45:06 +0000 Subject: arm920t/at91/timer: replace bss variables by gd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reuse the gd->tbl value for timestamp and add gd->lastinc for lastinc bss values in arm920t/at91/timer driver. The usage of bss values in driver before initialisation of bss is forbidden. In that special case some data in .rel.dyn gets corrupted by the arm920t/at91/timer driver. Signed-off-by: Andreas Bießmann --- arch/arm/cpu/arm920t/at91/timer.c | 29 ++++++++++++++--------------- arch/arm/include/asm/global_data.h | 1 + 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'arch') diff --git a/arch/arm/cpu/arm920t/at91/timer.c b/arch/arm/cpu/arm920t/at91/timer.c index 91377d4..d9a024f 100644 --- a/arch/arm/cpu/arm920t/at91/timer.c +++ b/arch/arm/cpu/arm920t/at91/timer.c @@ -32,17 +32,16 @@ #include -#include -#include +#include +#include #include #include +DECLARE_GLOBAL_DATA_PTR; + /* the number of clocks per CONFIG_SYS_HZ */ #define TIMER_LOAD_VAL (CONFIG_SYS_HZ_CLOCK/CONFIG_SYS_HZ) -static u32 timestamp; -static u32 lastinc; - int timer_init(void) { at91_tc_t *tc = (at91_tc_t *) AT91_TC_BASE; @@ -64,8 +63,8 @@ int timer_init(void) writel(TIMER_LOAD_VAL, &tc->tc[0].rc); writel(AT91_TC_CCR_SWTRG | AT91_TC_CCR_CLKEN, &tc->tc[0].ccr); - lastinc = 0; - timestamp = 0; + gd->lastinc = 0; + gd->tbl = 0; return 0; } @@ -86,7 +85,7 @@ ulong get_timer(ulong base) void set_timer(ulong t) { - timestamp = t; + gd->tbl = t; } void __udelay(unsigned long usec) @@ -98,8 +97,8 @@ void reset_timer_masked(void) { /* reset time */ at91_tc_t *tc = (at91_tc_t *) AT91_TC_BASE; - lastinc = readl(&tc->tc[0].cv) & 0x0000ffff; - timestamp = 0; + gd->lastinc = readl(&tc->tc[0].cv) & 0x0000ffff; + gd->tbl = 0; } ulong get_timer_raw(void) @@ -109,16 +108,16 @@ ulong get_timer_raw(void) now = readl(&tc->tc[0].cv) & 0x0000ffff; - if (now >= lastinc) { + if (now >= gd->lastinc) { /* normal mode */ - timestamp += now - lastinc; + gd->tbl += now - gd->lastinc; } else { /* we have an overflow ... */ - timestamp += now + TIMER_LOAD_VAL - lastinc; + gd->tbl += now + TIMER_LOAD_VAL - gd->lastinc; } - lastinc = now; + gd->lastinc = now; - return timestamp; + return gd->tbl; } ulong get_timer_masked(void) diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index ada3fbb..e459a5d 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -60,6 +60,7 @@ typedef struct global_data { unsigned long tbl; unsigned long tbu; unsigned long long timer_reset_value; + unsigned long lastinc; #endif unsigned long relocaddr; /* Start address of U-Boot in RAM */ phys_size_t ram_size; /* RAM size */ -- cgit v1.1