Skip to contentSkip to conversation

edb93xx: Enable UART1

PATCH New Matthias Kaehlcke 1 participant 2 messages Feb 6, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): d5ecf68c69351ddcef35759f76e7e8ce3d7e0571.1265500315.git.matthias@kaehlcke.net

#1 lore raw

PATCH 1/1 edb93xx: Enable UART1

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

---
 board/edb93xx/edb93xx.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
board/edb93xx/edb93xx.c +8 -0
index add88e1..6316988 100644
@@ -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;
Signature · 7 lines
1.6.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 1/1 edb93xx: Avoid stack usage in early_udelay()

In reply to a message not in the archive

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()

---
 board/edb93xx/early_udelay.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
board/edb93xx/early_udelay.h +1 -1
index 3b26b3f..185283d 100644
@@ -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"
Signature · 7 lines
1.6.5


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox