[rtems commit] Revert "bsp/leon3: New BSP variant leon3_qemu"

Sebastian Huber sebh at rtems.org
Fri Feb 7 08:26:42 UTC 2014


Module:    rtems
Branch:    master
Commit:    847fc79da16058bfde4c46f7ab535dbc94f592d3
Changeset: http://git.rtems.org/rtems/commit/?id=847fc79da16058bfde4c46f7ab535dbc94f592d3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Feb  7 09:32:31 2014 +0100

Revert "bsp/leon3: New BSP variant leon3_qemu"

This reverts commit 7579e255127ee0cf04901bbab6c1538559053508.

Improve QEMU to support AMBA plug and play instead.

---

 c/src/lib/libbsp/sparc/leon3/Makefile.am           |    1 -
 c/src/lib/libbsp/sparc/leon3/amba/amba.c           |    4 ---
 c/src/lib/libbsp/sparc/leon3/clock/ckinit.c        |   25 -------------------
 c/src/lib/libbsp/sparc/leon3/configure.ac          |    5 ----
 c/src/lib/libbsp/sparc/leon3/console/console.c     |   13 ----------
 .../libbsp/sparc/leon3/console/printk_support.c    |   26 --------------------
 .../libbsp/sparc/leon3/make/custom/leon3_qemu.cfg  |    9 -------
 c/src/lib/libbsp/sparc/leon3/preinstall.am         |    4 ---
 .../libbsp/sparc/leon3/startup/linkcmds.leon3_qemu |   12 ---------
 9 files changed, 0 insertions(+), 99 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index ac97ecc..1a24cbf 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -26,7 +26,6 @@ project_lib_DATA = start.$(OBJEXT)
 dist_project_lib_DATA += ../shared/startup/linkcmds.base
 dist_project_lib_DATA += startup/linkcmds
 dist_project_lib_DATA += startup/linkcmds.leon3
-dist_project_lib_DATA += startup/linkcmds.leon3_qemu
 dist_project_lib_DATA += startup/linkcmds.ngmp
 
 noinst_LIBRARIES += libbsp.a
diff --git a/c/src/lib/libbsp/sparc/leon3/amba/amba.c b/c/src/lib/libbsp/sparc/leon3/amba/amba.c
index c766c76..eb7b0f2 100644
--- a/c/src/lib/libbsp/sparc/leon3/amba/amba.c
+++ b/c/src/lib/libbsp/sparc/leon3/amba/amba.c
@@ -39,7 +39,6 @@ volatile struct irqmp_regs *LEON3_IrqCtrl_Regs;
 
 void amba_initialize(void)
 {
-#ifndef LEON3_QEMU
   int icsel;
   struct ambapp_dev *adev;
 
@@ -91,7 +90,4 @@ void amba_initialize(void)
     ambapp_freq_init(&ambapp_plb, adev,
                      (LEON3_Timer_Regs->scaler_reload + 1) * 1000000);
   }
-#else /* LEON3_QEMU */
-  LEON3_IrqCtrl_Regs = (volatile struct irqmp_regs *)0x80000200;
-#endif /* LEON3_QEMU */
 }
diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
index 695e78d..e0556ba 100644
--- a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
+++ b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
@@ -55,7 +55,6 @@ static int clkirq;
   #define Adjust_clkirq_for_node() do { clkirq += LEON3_CLOCK_INDEX; } while(0)
 #endif
 
-#ifndef LEON3_QEMU
 #define Clock_driver_support_find_timer() \
   do { \
     struct ambapp_dev *adev; \
@@ -72,21 +71,12 @@ static int clkirq;
       Adjust_clkirq_for_node(); \
     } \
   } while (0)
-#else /* LEON3_QEMU */
-#define Clock_driver_support_find_timer() \
-  do { \
-    LEON3_Timer_Regs = (volatile struct gptimer_regs *) \
-                       0x80000300; \
-    clkirq = 6; \
-  } while (0)
-#endif /* LEON3_QEMU */
 
 #define Clock_driver_support_install_isr( _new, _old ) \
   do { \
     _old = set_vector( _new, CLOCK_VECTOR, 1 ); \
   } while(0)
 
-#ifndef LEON3_QEMU
 #define Clock_driver_support_initialize_hardware() \
   do { \
     LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].reload = \
@@ -96,17 +86,6 @@ static int clkirq;
       LEON3_GPTIMER_EN | LEON3_GPTIMER_RL | \
         LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN; \
   } while (0)
-#else
-#define Clock_driver_support_initialize_hardware() \
-  do { \
-    LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].reload = \
-      40 * (rtems_configuration_get_microseconds_per_tick() - 1); \
-    \
-    LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].ctrl = \
-      LEON3_GPTIMER_EN | LEON3_GPTIMER_RL | \
-        LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN; \
-  } while (0)
-#endif
 
 #define Clock_driver_support_shutdown_hardware() \
   do { \
@@ -122,11 +101,7 @@ static uint32_t bsp_clock_nanoseconds_since_last_tick(void)
   if ( !LEON3_Timer_Regs )
     return 0;
 
-#ifndef LEON3_QEMU
   clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value;
-#else
-  clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value / 40;
-#endif
 
   if ( LEON_Is_interrupt_pending( clkirq ) ) {
     clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value;
diff --git a/c/src/lib/libbsp/sparc/leon3/configure.ac b/c/src/lib/libbsp/sparc/leon3/configure.ac
index e22f69a..dbefd3e 100644
--- a/c/src/lib/libbsp/sparc/leon3/configure.ac
+++ b/c/src/lib/libbsp/sparc/leon3/configure.ac
@@ -26,7 +26,6 @@ RTEMS_BSPOPTS_HELP([CONSOLE_USE_INTERRUPTS],
 Under the simulator (especially when FAST_UART is defined), polled seems to operate
 better.])
 
-RTEMS_BSPOPTS_SET([SIMSPARC_FAST_IDLE],[*qemu],[1])
 RTEMS_BSPOPTS_SET([SIMSPARC_FAST_IDLE],[*],[])
 RTEMS_BSPOPTS_HELP([SIMSPARC_FAST_IDLE],
 [If defined, speed up the clock ticks while the idle task is running so
@@ -38,10 +37,6 @@ RTEMS_BSPOPTS_HELP([BSP_LEON3_SMP],
 [Always defined when on a LEON3 to enable the LEON3 support for
  determining the CPU core number in an SMP configuration.])
 
-RTEMS_BSPOPTS_SET([LEON3_QEMU],[*qemu],[1])
-RTEMS_BSPOPTS_HELP([LEON3_QEMU],
-[If defined, then use settings for QEMU simulator.])
-
 RTEMS_BSP_CLEANUP_OPTIONS(0, 1)
 RTEMS_BSP_LINKCMDS
 
diff --git a/c/src/lib/libbsp/sparc/leon3/console/console.c b/c/src/lib/libbsp/sparc/leon3/console/console.c
index 4174a71..7e72633 100644
--- a/c/src/lib/libbsp/sparc/leon3/console/console.c
+++ b/c/src/lib/libbsp/sparc/leon3/console/console.c
@@ -217,7 +217,6 @@ static int leon3_console_set_attributes(int minor, const struct termios *t)
   return 0;
 }
 
-#ifndef LEON3_QEMU
 /* AMBA PP find routine. Extract AMBA PnP information into data structure. */
 static int find_matching_apbuart(struct ambapp_dev *dev, int index, void *arg)
 {
@@ -249,18 +248,6 @@ static void leon3_console_scan_uarts(void)
   ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS), VENDOR_GAISLER,
                   GAISLER_APBUART, find_matching_apbuart, NULL);
 }
-#else /* LEON3_QEMU */
-static void leon3_console_scan_uarts(void)
-{
-  uarts = 1;
-
-  apbuarts[0].regs = (struct apbuart_regs *)0x80000100;
-#if CONSOLE_USE_INTERRUPTS
-  apbuarts[0].irq = 3;
-#endif
-  apbuarts[0].freq_hz = 40000000;
-}
-#endif /* LEON3_QEMU */
 
 /*
  *  Console Device Driver Entry Points
diff --git a/c/src/lib/libbsp/sparc/leon3/console/printk_support.c b/c/src/lib/libbsp/sparc/leon3/console/printk_support.c
index 4c65678..286e37d 100644
--- a/c/src/lib/libbsp/sparc/leon3/console/printk_support.c
+++ b/c/src/lib/libbsp/sparc/leon3/console/printk_support.c
@@ -25,7 +25,6 @@
 int debug_uart_index __attribute__((weak)) = 0;
 static struct apbuart_regs *dbg_uart = NULL;
 
-#ifndef LEON3_QEMU
 /* Before UART driver has registered (or when no UART is available), calls to
  * printk that gets to bsp_out_char() will be filling data into the
  * pre_printk_dbgbuf[] buffer, hopefully the buffer can help debugging the
@@ -74,25 +73,6 @@ void bsp_debug_uart_init(void)
     dbg_uart->status = 0;
   }
 }
-#else
-static void bsp_out_char(char c);
-
-static void leon3_qemu_debug_uart_init(char c)
-{
-  bsp_debug_uart_init();
-
-  BSP_output_char = bsp_out_char;
-
-  bsp_out_char(c);
-}
-
-void bsp_debug_uart_init(void)
-{
-  dbg_uart = (struct apbuart_regs *)0x80000100;
-  dbg_uart->ctrl |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
-  dbg_uart->status = 0;
-}
-#endif
 
 /*
  *  apbuart_outbyte_polled
@@ -148,14 +128,12 @@ int apbuart_inbyte_nonblocking(struct apbuart_regs *regs)
 /* putchar/getchar for printk */
 static void bsp_out_char(char c)
 {
-#ifndef LEON3_QEMU
   if (dbg_uart == NULL) {
     /* Local debug buffer when UART driver has not registered */
     pre_printk_dbgbuf[pre_printk_pos++] = c;
     pre_printk_pos = pre_printk_pos & (sizeof(pre_printk_dbgbuf)-1);
     return;
   }
-#endif
 
   apbuart_outbyte_polled(dbg_uart, c, 1, 1);
 }
@@ -166,11 +144,7 @@ static void bsp_out_char(char c)
 
 #include <rtems/bspIo.h>
 
-#ifndef LEON3_QEMU
 BSP_output_char_function_type BSP_output_char = bsp_out_char;
-#else
-BSP_output_char_function_type BSP_output_char = leon3_qemu_debug_uart_init;
-#endif
 
 static int bsp_in_char(void)
 {
diff --git a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3_qemu.cfg b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3_qemu.cfg
deleted file mode 100644
index 62ffebc..0000000
--- a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3_qemu.cfg
+++ /dev/null
@@ -1,9 +0,0 @@
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=sparc
-
-RTEMS_CPU_MODEL=leon3
-
-CPU_CFLAGS = -mcpu=leon3 -msoft-float
-
-CFLAGS_OPTIMIZE_V = -O0 -g
diff --git a/c/src/lib/libbsp/sparc/leon3/preinstall.am b/c/src/lib/libbsp/sparc/leon3/preinstall.am
index c3c8199..0005edd 100644
--- a/c/src/lib/libbsp/sparc/leon3/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon3/preinstall.am
@@ -81,10 +81,6 @@ $(PROJECT_LIB)/linkcmds.leon3: startup/linkcmds.leon3 $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.leon3
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.leon3
 
-$(PROJECT_LIB)/linkcmds.leon3_qemu: startup/linkcmds.leon3_qemu $(PROJECT_LIB)/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.leon3_qemu
-PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.leon3_qemu
-
 $(PROJECT_LIB)/linkcmds.ngmp: startup/linkcmds.ngmp $(PROJECT_LIB)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.ngmp
 PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.ngmp
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.leon3_qemu b/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.leon3_qemu
deleted file mode 100644
index 1a0e3e5..0000000
--- a/c/src/lib/libbsp/sparc/leon3/startup/linkcmds.leon3_qemu
+++ /dev/null
@@ -1,12 +0,0 @@
-MEMORY {
-  rom : ORIGIN = 0x00000000, LENGTH = 8M
-  ram : ORIGIN = 0x40000000, LENGTH = 64M
-}
-
-_PROM_START = ORIGIN (rom);
-_PROM_SIZE = LENGTH (rom);
-
-_RAM_START = ORIGIN (ram);
-_RAM_SIZE = LENGTH (ram);
-
-INCLUDE linkcmds.base




More information about the vc mailing list