change log for rtems (2010-05-24)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon May 24 15:11:24 UTC 2010
*joel*:
2010-05-24 Joel Sherrill <joel.sherrill at oarcorp.com>
* Makefile.am, amba/amba.c, console/console.c, console/debugputs.c,
startup/bspstart.c: Rework initialization order so AMBA bus is
scanned earlier. This lets us look for UARTs earlier and support
printk as early as bsp_start() returning.
M 1.95 c/src/lib/libbsp/sparc/leon3/ChangeLog
M 1.28 c/src/lib/libbsp/sparc/leon3/Makefile.am
M 1.12 c/src/lib/libbsp/sparc/leon3/amba/amba.c
M 1.14 c/src/lib/libbsp/sparc/leon3/console/console.c
M 1.10 c/src/lib/libbsp/sparc/leon3/console/debugputs.c
M 1.18 c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
diff -u rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog:1.94 rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog:1.95
--- rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog:1.94 Tue May 11 02:41:21 2010
+++ rtems/c/src/lib/libbsp/sparc/leon3/ChangeLog Mon May 24 10:05:18 2010
@@ -1,3 +1,10 @@
+2010-05-24 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * Makefile.am, amba/amba.c, console/console.c, console/debugputs.c,
+ startup/bspstart.c: Rework initialization order so AMBA bus is
+ scanned earlier. This lets us look for UARTs earlier and support
+ printk as early as bsp_start() returning.
+
2010-05-11 Sebastian Huber <sebastian.huber at embedded-brains.de>
* startup/linkcmds: Include basic linker command file and define only
diff -u rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am:1.27 rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am:1.28
--- rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am:1.27 Tue May 11 02:41:22 2010
+++ rtems/c/src/lib/libbsp/sparc/leon3/Makefile.am Mon May 24 10:05:19 2010
@@ -39,7 +39,7 @@
# startup
libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
../../shared/bsppost.c ../../shared/bootcard.c startup/bspstart.c \
- ../../sparc/shared/bsppretaskinghook.c \
+ ../../sparc/shared/bsppretaskinghook.c ../../shared/bsppredriverhook.c \
../../sparc/shared/bspgetworkarea.c ../../shared/sbrk.c startup/setvec.c \
startup/spurious.c startup/bspidle.S
# gnatsupp
diff -u rtems/c/src/lib/libbsp/sparc/leon3/amba/amba.c:1.11 rtems/c/src/lib/libbsp/sparc/leon3/amba/amba.c:1.12
--- rtems/c/src/lib/libbsp/sparc/leon3/amba/amba.c:1.11 Sun Nov 29 09:33:27 2009
+++ rtems/c/src/lib/libbsp/sparc/leon3/amba/amba.c Mon May 24 10:05:19 2010
@@ -24,9 +24,9 @@
int LEON3_Cpu_Index = 0;
/*
- * bsp_predriver_hook
+ * amba_initialize
*
- * BSP predriver hook. Called just before drivers are initialized.
+ * Must be called just before drivers are initialized.
* Used to scan system bus. Probes for AHB masters, AHB slaves and
* APB slaves. Addresses to configuration areas of the AHB masters,
* AHB slaves, APB slaves and APB master are storeds in
@@ -43,8 +43,9 @@
extern rtems_configuration_table Configuration;
+extern int scan_uarts(void);
-void bsp_predriver_hook(void)
+void amba_initialize(void)
{
int i;
amba_apb_device dev;
@@ -71,4 +72,6 @@
LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start;
}
+ /* find UARTS */
+ scan_uarts();
}
diff -u rtems/c/src/lib/libbsp/sparc/leon3/console/console.c:1.13 rtems/c/src/lib/libbsp/sparc/leon3/console/console.c:1.14
--- rtems/c/src/lib/libbsp/sparc/leon3/console/console.c:1.13 Thu Dec 10 08:43:52 2009
+++ rtems/c/src/lib/libbsp/sparc/leon3/console/console.c Mon May 24 10:05:19 2010
@@ -76,27 +76,8 @@
*
*/
int uarts = 0;
-static int isinit = 0;
volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
-int scan_uarts(void) {
- int i;
- amba_apb_device apbuarts[LEON3_APBUARTS];
-
- if (isinit == 0) {
- i = 0;
- uarts = 0;
-
- uarts = amba_find_apbslvs(
- &amba_conf, VENDOR_GAISLER, GAISLER_APBUART, apbuarts, LEON3_APBUARTS);
- for(i=0; i<uarts; i++) {
- LEON3_Console_Uart[i] = (volatile LEON3_UART_Regs_Map *)apbuarts[i].start;
- }
- isinit = 1;
- }
- return uarts;
-}
-
rtems_device_driver console_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
@@ -109,10 +90,7 @@
rtems_termios_initialize();
- /* Find UARTs */
- scan_uarts();
-
- /* default to zero and override if multiprocessing */
+ /* default console to zero and override if multiprocessing */
uart0 = 0;
#if defined(RTEMS_MULTIPROCESSING)
if (rtems_configuration_get_user_multiprocessing_table() != NULL)
@@ -120,22 +98,18 @@
#endif
/* Register Device Names */
-
- if (uarts && (uart0 < uarts))
- {
+ if (uarts && (uart0 < uarts)) {
status = rtems_io_register_name( "/dev/console", major, 0 );
if (status != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(status);
strcpy(console_name,"/dev/console_a");
- for (i = uart0+1; i < uarts; i++)
- {
+ for (i = uart0+1; i < uarts; i++) {
console_name[13]++;
status = rtems_io_register_name( console_name, major, i);
}
}
-
/*
* Initialize Hardware if ONLY CPU or first CPU in MP system
*/
diff -u rtems/c/src/lib/libbsp/sparc/leon3/console/debugputs.c:1.9 rtems/c/src/lib/libbsp/sparc/leon3/console/debugputs.c:1.10
--- rtems/c/src/lib/libbsp/sparc/leon3/console/debugputs.c:1.9 Sun Nov 29 09:33:27 2009
+++ rtems/c/src/lib/libbsp/sparc/leon3/console/debugputs.c Mon May 24 10:05:19 2010
@@ -27,6 +27,38 @@
*/
extern int uarts;
+static int isinit = 0;
+
+/*
+ * Scan for UARTS in configuration
+ */
+int scan_uarts(void)
+{
+ int i;
+ amba_apb_device apbuarts[LEON3_APBUARTS];
+
+ if (isinit == 0) {
+ i = 0;
+ uarts = 0;
+
+ uarts = amba_find_apbslvs(
+ &amba_conf, VENDOR_GAISLER, GAISLER_APBUART, apbuarts, LEON3_APBUARTS);
+ for(i=0; i<uarts; i++) {
+ LEON3_Console_Uart[i] = (volatile LEON3_UART_Regs_Map *)apbuarts[i].start;
+ }
+
+ /* initialize uart 0 if present for printk */
+ if ( uarts ) {
+ LEON3_Console_Uart[0]->ctrl |=
+ LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
+ LEON3_Console_Uart[0]->status = 0;
+ }
+ isinit = 1;
+ }
+
+ return uarts;
+}
+
/*
* console_outbyte_polled
*
diff -u rtems/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c:1.17 rtems/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c:1.18
--- rtems/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c:1.17 Sun Nov 29 09:33:27 2009
+++ rtems/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c Mon May 24 10:05:19 2010
@@ -27,6 +27,8 @@
*/
int CPU_SPARC_HAS_SNOOPING;
+extern void amba_initialize(void);
+
/*
* set_snooping
*
@@ -54,4 +56,7 @@
void bsp_start( void )
{
CPU_SPARC_HAS_SNOOPING = set_snooping();
+
+ /* Find UARTs */
+ amba_initialize();
}
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100524/ee8dbda5/attachment-0001.html>
More information about the vc
mailing list