PageRenderTime 25ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/tools/u-boot/patches/u-boot-2011.03-rc1-0011-omap4-add-serial-console-support-to-SPL.patch

http://github.com/OpenELEC/OpenELEC.tv
Patch | 110 lines | 103 code | 7 blank | 0 comment | 0 complexity | b22cb122af1178f79ecd35bd852895fa MD5 | raw file
  1From eb26c57b60b026cd827be2470697111418b5ca61 Mon Sep 17 00:00:00 2001
  2From: Aneesh V <aneesh@ti.com>
  3Date: Sun, 27 Feb 2011 19:45:01 +0530
  4Subject: [PATCH 11/22] omap4: add serial console support to SPL
  5
  6Signed-off-by: Aneesh V <aneesh@ti.com>
  7---
  8 arch/arm/cpu/armv7/omap4/board.c   |    3 ++
  9 arch/arm/include/asm/omap_common.h |    1 +
 10 spl/board/ti/sdp4430/Makefile      |   40 ++++++++++++++++++++++++++++++++++++
 11 spl/board/ti/spl-omap.c            |   10 +++++++++
 12 4 files changed, 54 insertions(+), 0 deletions(-)
 13
 14diff --git a/arch/arm/cpu/armv7/omap4/board.c b/arch/arm/cpu/armv7/omap4/board.c
 15index a5d585b..da79669 100644
 16--- a/arch/arm/cpu/armv7/omap4/board.c
 17+++ b/arch/arm/cpu/armv7/omap4/board.c
 18@@ -57,6 +57,9 @@ u32 omap_boot_mode(void)
 19 void s_init(void)
 20 {
 21 	watchdog_init();
 22+#ifdef CONFIG_PRELOADER
 23+	preloader_console_init();
 24+#endif
 25 }
 26 
 27 /*
 28diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
 29index 06c511c..95116f4 100644
 30--- a/arch/arm/include/asm/omap_common.h
 31+++ b/arch/arm/include/asm/omap_common.h
 32@@ -67,5 +67,6 @@
 33 
 34 u32 omap_boot_device(void);
 35 u32 omap_boot_mode(void);
 36+void preloader_console_init(void);
 37 
 38 #endif /* _OMAP_COMMON_H_ */
 39diff --git a/spl/board/ti/sdp4430/Makefile b/spl/board/ti/sdp4430/Makefile
 40index dd56a40..6a6aa42 100644
 41--- a/spl/board/ti/sdp4430/Makefile
 42+++ b/spl/board/ti/sdp4430/Makefile
 43@@ -28,6 +28,46 @@ include $(TOPDIR)/config.mk
 44 SOBJS =
 45 COBJS =
 46 
 47+# serial console
 48+$(obj)eabi_compat.c:
 49+	@rm -f $@
 50+	@ln -s $(TOPDIR)/arch/arm/lib/eabi_compat.c $@
 51+
 52+$(obj)string.c:
 53+	@rm -f $@
 54+	@ln -s $(TOPDIR)/lib/string.c $@
 55+
 56+$(obj)vsprintf.c:
 57+	@rm -f $@
 58+	@ln -s $(TOPDIR)/lib/vsprintf.c $@
 59+
 60+$(obj)console.c:
 61+	@rm -f $@
 62+	@ln -s $(TOPDIR)/common/console.c $@
 63+
 64+$(obj)stdio.c:
 65+	@rm -f $@
 66+	@ln -s $(TOPDIR)/common/stdio.c $@
 67+
 68+$(obj)serial.c:
 69+	@rm -f $@
 70+	@ln -s $(TOPDIR)/drivers/serial/serial.c $@
 71+
 72+$(obj)ns16550.c:
 73+	@rm -f $@
 74+	@ln -s $(TOPDIR)/drivers/serial/ns16550.c $@
 75+
 76+$(obj)div64.c:
 77+	@rm -f $@
 78+	@ln -s $(TOPDIR)/lib/div64.c $@
 79+
 80+$(obj)ctype.c:
 81+	@rm -f $@
 82+	@ln -s $(TOPDIR)/lib/ctype.c $@
 83+
 84+COBJS	+= serial.o ns16550.o string.o vsprintf.o console.o stdio.o
 85+COBJS	+= ctype.o eabi_compat.o div64.o
 86+
 87 # armv7
 88 $(obj)start.S:
 89 	@rm -f $@
 90diff --git a/spl/board/ti/spl-omap.c b/spl/board/ti/spl-omap.c
 91index 0e08f4f..57ddb7d 100644
 92--- a/spl/board/ti/spl-omap.c
 93+++ b/spl/board/ti/spl-omap.c
 94@@ -45,3 +45,13 @@ void board_init_r(gd_t *id, ulong dummy)
 95 	for (;;)
 96 		;
 97 }
 98+
 99+void preloader_console_init(void)
100+{
101+	gd->bd = &bdata;
102+	gd->flags |= GD_FLG_RELOC;
103+	gd->baudrate = CONFIG_BAUDRATE;
104+	serial_init();		/* serial communications setup */
105+	printf("\nU-Boot SPL for Texas Instruments OMAP4 (%s - %s)\n",
106+		U_BOOT_DATE, U_BOOT_TIME);
107+}
108-- 
1091.7.2.3
110