summaryrefslogtreecommitdiffstats
path: root/bsps/arm/raspberrypi
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/arm/raspberrypi')
-rw-r--r--bsps/arm/raspberrypi/clock/clockdrv.c107
-rw-r--r--bsps/arm/raspberrypi/include/bsp/irq.h28
-rw-r--r--bsps/arm/raspberrypi/include/bsp/mmu.h7
-rw-r--r--bsps/arm/raspberrypi/irq/irq.c30
-rw-r--r--bsps/arm/raspberrypi/start/bspsmp.c27
-rw-r--r--bsps/arm/raspberrypi/start/bspsmp_init.c27
-rw-r--r--bsps/arm/raspberrypi/start/bspstarthooks.c7
7 files changed, 71 insertions, 162 deletions
diff --git a/bsps/arm/raspberrypi/clock/clockdrv.c b/bsps/arm/raspberrypi/clock/clockdrv.c
deleted file mode 100644
index 9954d41741..0000000000
--- a/bsps/arm/raspberrypi/clock/clockdrv.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * @file
- *
- * @ingroup bsp_clock
- *
- * @brief Raspberry Pi clock support.
- */
-
-/*
- * BCM2835 Clock driver
- *
- * Copyright (c) 2013 Alan Cudmore
- * Copyright (c) 2016 Pavel Pisa
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- *
- * http://www.rtems.org/license/LICENSE
- *
-*/
-
-#include <rtems.h>
-#include <bsp.h>
-#include <bsp/irq.h>
-#include <bsp/irq-generic.h>
-#include <bsp/raspberrypi.h>
-#include <rtems/timecounter.h>
-
-/* This is defined in ../../../shared/dev/clock/clockimpl.h */
-void Clock_isr(rtems_irq_hdl_param arg);
-
-static struct timecounter raspberrypi_tc;
-
-static uint32_t raspberrypi_clock_get_timecount(struct timecounter *tc)
-{
- return BCM2835_REG(BCM2835_GPU_TIMER_CLO);
-}
-
-static void raspberrypi_clock_at_tick(void)
-{
- uint32_t act_val;
- uint32_t next_cmp = BCM2835_REG(BCM2835_GPU_TIMER_C3);
- next_cmp += rtems_configuration_get_microseconds_per_tick();
- BCM2835_REG(BCM2835_GPU_TIMER_C3) = next_cmp;
- act_val = BCM2835_REG(BCM2835_GPU_TIMER_CLO);
-
- /*
- * Clear interrupt only if there is time left to the next tick.
- * If time of the next tick has already passed then interrupt
- * request stays active and fires immediately after current tick
- * processing is finished.
- */
- if ((int32_t)(next_cmp - act_val) > 0)
- BCM2835_REG(BCM2835_GPU_TIMER_CS) = BCM2835_GPU_TIMER_CS_M3;
-}
-
-static void raspberrypi_clock_handler_install_isr(
- rtems_isr_entry clock_isr
-)
-{
- rtems_status_code sc = RTEMS_SUCCESSFUL;
-
- if (clock_isr != NULL) {
- sc = rtems_interrupt_handler_install(
- BCM2835_IRQ_ID_GPU_TIMER_M3,
- "Clock",
- RTEMS_INTERRUPT_UNIQUE,
- (rtems_interrupt_handler) clock_isr,
- NULL
- );
- } else {
- /* Remove interrupt handler */
- sc = rtems_interrupt_handler_remove(
- BCM2835_IRQ_ID_GPU_TIMER_M3,
- (rtems_interrupt_handler) Clock_isr,
- NULL
- );
- }
- if ( sc != RTEMS_SUCCESSFUL ) {
- rtems_fatal_error_occurred(0xdeadbeef);
- }
-}
-
-static void raspberrypi_clock_initialize_hardware(void)
-{
- uint32_t next_cmp = BCM2835_REG(BCM2835_GPU_TIMER_CLO);
- next_cmp += rtems_configuration_get_microseconds_per_tick();
- BCM2835_REG(BCM2835_GPU_TIMER_C3) = next_cmp;
- BCM2835_REG(BCM2835_GPU_TIMER_CS) = BCM2835_GPU_TIMER_CS_M3;
-
- raspberrypi_tc.tc_get_timecount = raspberrypi_clock_get_timecount;
- raspberrypi_tc.tc_counter_mask = 0xffffffff;
- raspberrypi_tc.tc_frequency = 1000000; /* 1 MHz */
- raspberrypi_tc.tc_quality = RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER;
- rtems_timecounter_install(&raspberrypi_tc);
-}
-
-#define Clock_driver_support_at_tick() raspberrypi_clock_at_tick()
-
-#define Clock_driver_support_initialize_hardware() raspberrypi_clock_initialize_hardware()
-
-#define Clock_driver_support_install_isr(clock_isr) \
- raspberrypi_clock_handler_install_isr(clock_isr)
-
-#define CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR 1
-
-#include "../../../shared/dev/clock/clockimpl.h"
diff --git a/bsps/arm/raspberrypi/include/bsp/irq.h b/bsps/arm/raspberrypi/include/bsp/irq.h
index 6801b01d84..895b268dfe 100644
--- a/bsps/arm/raspberrypi/include/bsp/irq.h
+++ b/bsps/arm/raspberrypi/include/bsp/irq.h
@@ -22,12 +22,6 @@
#ifndef ASM
#include <rtems.h>
-#include <rtems/irq.h>
-#include <rtems/irq-extension.h>
-
-#if defined(RTEMS_SMP)
-#include <rtems/score/processormask.h>
-#endif
/**
* @defgroup raspberrypi_interrupt Interrrupt Support
@@ -78,27 +72,5 @@
#define BSP_IRQ_COUNT (BCM2835_INTC_TOTAL_IRQ)
-#if defined(RTEMS_SMP)
-static inline rtems_status_code bsp_interrupt_set_affinity(
- rtems_vector_number vector,
- const Processor_mask *affinity
-)
-{
- (void) vector;
- (void) affinity;
- return RTEMS_UNSATISFIED;
-}
-
-static inline rtems_status_code bsp_interrupt_get_affinity(
- rtems_vector_number vector,
- Processor_mask *affinity
-)
-{
- (void) vector;
- _Processor_mask_From_index( affinity, 0 );
- return RTEMS_UNSATISFIED;
-}
-#endif
-
#endif /* ASM */
#endif /* LIBBSP_ARM_RASPBERRYPI_IRQ_H */
diff --git a/bsps/arm/raspberrypi/include/bsp/mmu.h b/bsps/arm/raspberrypi/include/bsp/mmu.h
index 1a5b4e6fc1..4ca822d33f 100644
--- a/bsps/arm/raspberrypi/include/bsp/mmu.h
+++ b/bsps/arm/raspberrypi/include/bsp/mmu.h
@@ -9,12 +9,7 @@
/*
* Copyright (c) 2013 Alan Cudmore.
* based on work by:
- * Copyright (c) 2009
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
+ * Copyright (c) 2009 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
diff --git a/bsps/arm/raspberrypi/irq/irq.c b/bsps/arm/raspberrypi/irq/irq.c
index f3a6528a34..7177cd2c05 100644
--- a/bsps/arm/raspberrypi/irq/irq.c
+++ b/bsps/arm/raspberrypi/irq/irq.c
@@ -9,12 +9,7 @@
/*
* Copyright (c) 2014 Andre Marques <andre.lousa.marques at gmail.com>
*
- * Copyright (c) 2009
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
+ * Copyright (c) 2009 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -24,7 +19,6 @@
#include <rtems/score/armv4.h>
#include <bsp.h>
-#include <bsp/irq.h>
#include <bsp/irq-generic.h>
#include <bsp/raspberrypi.h>
#include <bsp/linker-symbols.h>
@@ -212,6 +206,28 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
return RTEMS_SUCCESSFUL;
}
+#if defined(RTEMS_SMP)
+rtems_status_code bsp_interrupt_get_affinity(
+ rtems_vector_number vector,
+ Processor_mask *affinity
+)
+{
+ (void) vector;
+ _Processor_mask_From_index( affinity, 0 );
+ return RTEMS_UNSATISFIED;
+}
+
+rtems_status_code bsp_interrupt_set_affinity(
+ rtems_vector_number vector,
+ const Processor_mask *affinity
+)
+{
+ (void) vector;
+ (void) affinity;
+ return RTEMS_UNSATISFIED;
+}
+#endif
+
void bsp_interrupt_handler_default(rtems_vector_number vector)
{
printk("spurious interrupt: %" PRIdrtems_vector_number "\n", vector);
diff --git a/bsps/arm/raspberrypi/start/bspsmp.c b/bsps/arm/raspberrypi/start/bspsmp.c
index 9dcfb0fb03..fe5a43fea9 100644
--- a/bsps/arm/raspberrypi/start/bspsmp.c
+++ b/bsps/arm/raspberrypi/start/bspsmp.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -16,11 +18,28 @@
*
* Reuses some ideas from Rohini Kulkarni <krohini1593@gmail.com>
* GSoC 2015 project and Altera Cyclone-V SMP code
- * by embedded brains GmbH
+ * by embedded brains GmbH & Co. KG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/score/smpimpl.h>
diff --git a/bsps/arm/raspberrypi/start/bspsmp_init.c b/bsps/arm/raspberrypi/start/bspsmp_init.c
index eed5b44fa9..afd0fa4473 100644
--- a/bsps/arm/raspberrypi/start/bspsmp_init.c
+++ b/bsps/arm/raspberrypi/start/bspsmp_init.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/**
* @file
*
@@ -16,11 +18,28 @@
*
* Reuses some ideas from Rohini Kulkarni <krohini1593@gmail.com>
* GSoC 2015 project and Altera Cyclone-V SMP code
- * by embedded brains GmbH
+ * by embedded brains GmbH & Co. KG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
#include <rtems/score/smpimpl.h>
diff --git a/bsps/arm/raspberrypi/start/bspstarthooks.c b/bsps/arm/raspberrypi/start/bspstarthooks.c
index c6f76f24b8..1b2db85ef5 100644
--- a/bsps/arm/raspberrypi/start/bspstarthooks.c
+++ b/bsps/arm/raspberrypi/start/bspstarthooks.c
@@ -10,12 +10,7 @@
* Copyright (c) 2013. Hesham AL-Matary
* Copyright (c) 2013 by Alan Cudmore
* based on work by:
- * Copyright (c) 2009
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
+ * Copyright (c) 2009 embedded brains GmbH & Co. KG
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at