[rtems commit] bsps/powerpc: Remove bsp_timer_internal_clock
Sebastian Huber
sebh at rtems.org
Thu Mar 22 06:02:38 UTC 2018
Module: rtems
Branch: master
Commit: f3a51d62e9de411d40a798144d07ad5a155f4ed3
Changeset: http://git.rtems.org/rtems/commit/?id=f3a51d62e9de411d40a798144d07ad5a155f4ed3
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Mar 21 08:11:33 2018 +0100
bsps/powerpc: Remove bsp_timer_internal_clock
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 | 7 ++-----
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, 4 insertions(+), 33 deletions(-)
diff --git a/bsps/powerpc/virtex/include/bsp.h b/bsps/powerpc/virtex/include/bsp.h
index 2f61ee2..faea72e 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 db613cf..33ea704 100644
--- a/bsps/powerpc/virtex4/include/bsp.h
+++ b/bsps/powerpc/virtex4/include/bsp.h
@@ -63,11 +63,6 @@
extern "C" {
#endif
-/* miscellaneous stuff assumed to exist */
-extern bool bsp_timer_internal_clock; /* TRUE, when timer runs with CPU clk */
-
-#endif /* ASM */
-
void BSP_ask_for_reset(void);
/*
@@ -79,4 +74,6 @@ void zero_bss(void);
}
#endif
+#endif /* ASM */
+
#endif
diff --git a/bsps/powerpc/virtex5/include/bsp.h b/bsps/powerpc/virtex5/include/bsp.h
index ee9f200..c1be0a1 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 098145b..f3788b1 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 7e3a070..8375435 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 7e7999c..90753f4 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 29651eb..bdea6bb 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 473b846..fa7c113 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 ec69d84..c865abe 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 6ae72a2..64e6f29 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 */
/*
More information about the vc
mailing list