From bb9d864b950b711a3d6b983d96c0f2b151f48bc2 Mon Sep 17 00:00:00 2001 From: Alessandro Rubini Date: Sat, 6 Feb 2010 20:53:43 +0100 Subject: [PATCH 1/3] EP93xx: fix syscon_regs definition The structure was missing a reserved entry (not listed in the manual, actually), so the last registers had a wrong offset. This prevented all swlocked registers to be modified as swlock is last in the structure. Signed-off-by: Alessandro Rubini --- include/asm-arm/arch-ep93xx/ep93xx.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/asm-arm/arch-ep93xx/ep93xx.h b/include/asm-arm/arch-ep93xx/ep93xx.h index 6cafe54fbe..806557a50e 100644 --- a/include/asm-arm/arch-ep93xx/ep93xx.h +++ b/include/asm-arm/arch-ep93xx/ep93xx.h @@ -558,8 +558,9 @@ struct syscon_regs { uint32_t i2sclkdiv; uint32_t keytchclkdiv; uint32_t chipid; + uint32_t reserved4; uint32_t syscfg; - uint32_t reserved4[8]; + uint32_t reserved5[8]; uint32_t sysswlock; }; #else From ce262f98386add06254bb96322d087502f0cbe9d Mon Sep 17 00:00:00 2001 From: Alessandro Rubini Date: Sat, 6 Feb 2010 20:53:54 +0100 Subject: [PATCH 2/3] edb93xx: change calculation un early_udelay.h Previous code compiled with gcc-4.2.2 makes a call to __aeabi_uidiv to divide by 20. As a side effect it was not inline any more, and so sdram_cfg used the stack as well, but this is early code that has no stack yet. The patch explicitly removes the division, so no stack is used. The calculation of the counter calls a division by 20 Signed-off-by: Alessandro Rubini --- board/edb93xx/early_udelay.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/edb93xx/early_udelay.h b/board/edb93xx/early_udelay.h index 3b26b3f16c..185283d98d 100644 --- a/board/edb93xx/early_udelay.h +++ b/board/edb93xx/early_udelay.h @@ -26,7 +26,7 @@ static inline void early_udelay(uint32_t usecs) { /* loop takes 4 cycles at 5.0ns (fastest case, running at 200MHz) */ - register uint32_t loops = (usecs * 1000) / 20; + register uint32_t loops = usecs * (1000 / 20); __asm__ volatile ("1:\n" "subs %0, %1, #1\n" From fba8bfd7a8ac1f16dbc603177115d37dbc9549a6 Mon Sep 17 00:00:00 2001 From: Alessandro Rubini Date: Sat, 6 Feb 2010 20:54:05 +0100 Subject: [PATCH 3/3] edb93xx: enable the uart in devicecfg register printf goes to uart1, but it will block forever waiting for busy to go off unless the uart is enabled first. Signed-off-by: Alessandro Rubini --- board/edb93xx/edb93xx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/board/edb93xx/edb93xx.c b/board/edb93xx/edb93xx.c index 4df2246bd7..dde30ffdc2 100644 --- a/board/edb93xx/edb93xx.c +++ b/board/edb93xx/edb93xx.c @@ -64,6 +64,12 @@ int board_init(void) value |= SYSCON_PWRCNT_UART_BAUD; writel(value, &syscon->pwrcnt); + /* Enable the uart in devicecfg */ + value = readl(&syscon->devicecfg); + value |= 1<<18 /* U1EN */; + writel(0xAA, &syscon->sysswlock); + writel(value, &syscon->devicecfg); + /* Machine number, as defined in linux/arch/arm/tools/mach-types */ gd->bd->bi_arch_number = CONFIG_MACH_TYPE;