mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] edb93xx: Enable UART1
       [not found] <d5ecf68c69351ddcef35759f76e7e8ce3d7e0571.1265500315.git.matthias@kaehlcke.net>
@ 2010-02-06 23:54 ` Matthias Kaehlcke
  2010-02-06 23:55 ` [PATCH] edb93xx: Avoid stack usage in early_udelay() Matthias Kaehlcke
  1 sibling, 0 replies; 2+ messages in thread
From: Matthias Kaehlcke @ 2010-02-06 23:54 UTC (permalink / raw)
  To: barebox

edb93xx: according to the datasheet UART1 needs to be enabled explicitly

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
---
 board/edb93xx/edb93xx.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/board/edb93xx/edb93xx.c b/board/edb93xx/edb93xx.c
index add88e1..6316988 100644
--- a/board/edb93xx/edb93xx.c
+++ b/board/edb93xx/edb93xx.c
@@ -32,6 +32,8 @@
 #include <mach/ep93xx-regs.h>
 #include "edb93xx.h"
 
+#define DEVCFG_U1EN (1 << 18)
+
 /*
  * Up to 32MiB NOR type flash, connected to
  * CS line 6, data width is 16 bit
@@ -164,6 +166,12 @@ static int edb93xx_console_init(void)
 	value |= SYSCON_PWRCNT_UART_BAUD;
 	writel(value, &syscon->pwrcnt);
 
+	/* Enable UART1 */
+	value = readl(&syscon->devicecfg);
+	value |= DEVCFG_U1EN;
+	writel(0xAA, &syscon->sysswlock);
+	writel(value, &syscon->devicecfg);
+
 	register_device(&edb93xx_serial_device);
 
 	return 0;
-- 
1.6.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] edb93xx: Avoid stack usage in early_udelay()
       [not found] <d5ecf68c69351ddcef35759f76e7e8ce3d7e0571.1265500315.git.matthias@kaehlcke.net>
  2010-02-06 23:54 ` [PATCH] edb93xx: Enable UART1 Matthias Kaehlcke
@ 2010-02-06 23:55 ` Matthias Kaehlcke
  1 sibling, 0 replies; 2+ messages in thread
From: Matthias Kaehlcke @ 2010-02-06 23:55 UTC (permalink / raw)
  To: barebox

edb93xx: The purpose of early_udelay() is to provide delay functionality in the
early board setup, when the stack isn't set up yet. With some compiler versions
the current implementation makes use of the stack and ends up crashing. Fix this
by removing an explicit division from early_udelay()

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
---
 board/edb93xx/early_udelay.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/edb93xx/early_udelay.h b/board/edb93xx/early_udelay.h
index 3b26b3f..185283d 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"
-- 
1.6.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-06 23:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <d5ecf68c69351ddcef35759f76e7e8ce3d7e0571.1265500315.git.matthias@kaehlcke.net>
2010-02-06 23:54 ` [PATCH] edb93xx: Enable UART1 Matthias Kaehlcke
2010-02-06 23:55 ` [PATCH] edb93xx: Avoid stack usage in early_udelay() Matthias Kaehlcke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox