[PATCH 2/3] bsps/powerpc: Remove bsp_timer_internal_clock

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Mar 21 07:16:33 UTC 2018


The only consumer of this variable was the ppc403 clock driver used by
the

* haleakala,
* virtex, and
* virtex4

BSPs which set bsp_timer_internal_clock unconditionally to true.

Update #3285.
---
 bsps/powerpc/virtex/include/bsp.h                      |  3 ---
 bsps/powerpc/virtex4/include/bsp.h                     |  3 ---
 bsps/powerpc/virtex5/include/bsp.h                     |  3 ---
 c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c  |  2 --
 c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c |  1 -
 c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c     |  1 -
 c/src/lib/libbsp/powerpc/virtex/timer/timer-config.c   |  3 ---
 c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c    |  2 --
 c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c    |  2 --
 c/src/lib/libcpu/powerpc/ppc403/clock/clock.c          | 13 ++-----------
 10 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/bsps/powerpc/virtex/include/bsp.h b/bsps/powerpc/virtex/include/bsp.h
index 2f61ee2517..faea72e25e 100644
--- a/bsps/powerpc/virtex/include/bsp.h
+++ b/bsps/powerpc/virtex/include/bsp.h
@@ -61,9 +61,6 @@ extern "C" {
 
 #define BSP_INTERRUPT_STACK_AT_WORK_AREA_BEGIN
 
-/* miscellaneous stuff assumed to exist */
-extern bool bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
-
 /* Network Defines */
 #if 1 /* EB/doe changes */
 #define RTEMS_BSP_NETWORK_DRIVER_NAME     "eth0"
diff --git a/bsps/powerpc/virtex4/include/bsp.h b/bsps/powerpc/virtex4/include/bsp.h
index 91e7ddf4ab..192d794d96 100644
--- a/bsps/powerpc/virtex4/include/bsp.h
+++ b/bsps/powerpc/virtex4/include/bsp.h
@@ -63,9 +63,6 @@
 extern "C" {
 #endif
 
-/* miscellaneous stuff assumed to exist */
-extern bool bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
-
 extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
 #endif /* ASM */
 
diff --git a/bsps/powerpc/virtex5/include/bsp.h b/bsps/powerpc/virtex5/include/bsp.h
index ee9f20058d..c1be0a11d7 100644
--- a/bsps/powerpc/virtex5/include/bsp.h
+++ b/bsps/powerpc/virtex5/include/bsp.h
@@ -63,9 +63,6 @@
 extern "C" {
 #endif
 
-/* miscellaneous stuff assumed to exist */
-extern bool bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
-
 /*
  * Bus Frequency
  */
diff --git a/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c b/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
index 098145bfb2..f3788b1bd2 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/haleakala/startup/bspstart.c
@@ -75,7 +75,6 @@ LINKER_SYMBOL(intrStack_size);
 
 /* Expected by clock.c */
 uint32_t    bsp_clicks_per_usec;
-bool        bsp_timer_internal_clock;   /* true, when timer runs with CPU clk */
 uint32_t    bsp_timer_least_valid;
 uint32_t    bsp_timer_average_overhead;
 
@@ -183,7 +182,6 @@ void bsp_start( void )
   bsp_clicks_per_usec = 400;
   rtems_counter_initialize_converter(bsp_clicks_per_usec * 1000000);
 
-  bsp_timer_internal_clock  = TRUE;
   bsp_timer_average_overhead = 2;
   bsp_timer_least_valid = 3;
 
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
index 7e3a070b62..837543567f 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
@@ -70,7 +70,6 @@ bool       bsp_serial_cts_rts;
 uint32_t   bsp_serial_rate;
 uint32_t   bsp_timer_average_overhead; /* Average overhead of timer in ticks */
 uint32_t   bsp_timer_least_valid;      /* Least valid number from timer      */
-bool       bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
 
 extern char IntrStack_start [];
 extern char intrStack [];
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c
index 7e7999c66f..90753f4982 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c
@@ -49,7 +49,6 @@ uint32_t bsp_clicks_per_usec; /* for PIT driver: OSCCLK */
 /* for timer: */
 uint32_t   bsp_timer_average_overhead; /* Average overhead of timer in ticks */
 uint32_t   bsp_timer_least_valid;      /* Least valid number from timer      */
-bool       bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
 
 static const char *bsp_tqm_get_cib_string( const char *cib_id)
 {
diff --git a/c/src/lib/libbsp/powerpc/virtex/timer/timer-config.c b/c/src/lib/libbsp/powerpc/virtex/timer/timer-config.c
index 29651eb37a..bdea6bb775 100644
--- a/c/src/lib/libbsp/powerpc/virtex/timer/timer-config.c
+++ b/c/src/lib/libbsp/powerpc/virtex/timer/timer-config.c
@@ -56,6 +56,3 @@ uint32_t bsp_timer_average_overhead = 2;
 
 /* Least valid number from timer */
 uint32_t bsp_timer_least_valid = 3;
-
-/* TRUE, when timer runs with CPU clk */
-bool bsp_timer_internal_clock = true;
diff --git a/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
index 473b846cd7..fa7c1137e9 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex4/startup/bspstart.c
@@ -96,7 +96,6 @@ LINKER_SYMBOL(bsp_exc_vector_base);
 
 /* Expected by clock.c */
 uint32_t    bsp_clicks_per_usec;
-bool        bsp_timer_internal_clock;   /* true, when timer runs with CPU clk */
 uint32_t    bsp_timer_least_valid;
 uint32_t    bsp_timer_average_overhead;
 
@@ -168,7 +167,6 @@ void bsp_start(void)
 
   /* Timebase register ticks/microsecond;  The application may override these */
   bsp_clicks_per_usec        = 350;
-  bsp_timer_internal_clock   = true;
   bsp_timer_average_overhead = 2;
   bsp_timer_least_valid      = 3;
   rtems_counter_initialize_converter(bsp_clicks_per_usec * 1000000);
diff --git a/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c b/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
index ec69d84163..c865abe3a1 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/virtex5/startup/bspstart.c
@@ -97,7 +97,6 @@ LINKER_SYMBOL(bsp_exc_vector_base);
 
 /* Expected by clock.c */
 uint32_t    bsp_clicks_per_usec;
-bool        bsp_timer_internal_clock;   /* true, when timer runs with CPU clk */
 uint32_t    bsp_timer_least_valid;
 uint32_t    bsp_timer_average_overhead;
 
@@ -190,7 +189,6 @@ void bsp_start(void)
   rtems_counter_initialize_converter(
     BSP_bus_frequency / (BSP_time_base_divisor / 1000)
   );
-  bsp_timer_internal_clock   = true;
   bsp_timer_average_overhead = 2;
   bsp_timer_least_valid      = 3;
 
diff --git a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
index 6ae72a223f..64e6f29d39 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
@@ -53,7 +53,6 @@
 #include <bsp/irq.h>
 
 extern uint32_t   bsp_clicks_per_usec;
-extern bool       bsp_timer_internal_clock;
 
 volatile uint32_t Clock_driver_ticks;
 static uint32_t   pit_value, tick_time;
@@ -171,11 +170,7 @@ static void ClockOn(const rtems_irq_connect_data* unused)
 
 #ifndef ppc405 /* this is a ppc403 */
   __asm__ volatile ("mfdcr %0, 0xa0" : "=r" (iocr));              /* IOCR */
-  if (bsp_timer_internal_clock) {
-    iocr &= ~4;                         /* timer clocked from system clock */
-  } else {
-    iocr |= 4;                          /* select external timer clock */
-  }
+  iocr &= ~4;                         /* timer clocked from system clock */
   __asm__ volatile ("mtdcr 0xa0, %0" : "=r" (iocr) : "0" (iocr)); /* IOCR */
 
   __asm__ volatile ("mfspr %0, 0x11f" : "=r" ((pvr))); /* PVR */
@@ -194,11 +189,7 @@ static void ClockOn(const rtems_irq_connect_data* unused)
 
 #else /* ppc405 */
   __asm__ volatile ("mfdcr %0, 0x0b2" : "=r" (iocr));              /*405GP CPC0_CR1 */
-  if (bsp_timer_internal_clock) {
-    iocr &=~0x800000;               /* timer clocked from system clock CETE*/
-  } else {
-    iocr |= 0x800000;               /* select external timer clock CETE*/
-  }
+  iocr &=~0x800000;               /* timer clocked from system clock CETE*/
   __asm__ volatile ("mtdcr 0x0b2, %0" : "=r" (iocr) : "0" (iocr)); /* 405GP CPC0_CR1 */
 
   /*
-- 
2.12.3




More information about the devel mailing list