summaryrefslogtreecommitdiffstats
path: root/bsps/arm/raspberrypi/include/bsp
diff options
context:
space:
mode:
authorG S Niteesh <gsnb.gn@gmail.com>2020-01-05 01:20:46 +0530
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2020-01-07 18:21:16 +0100
commit362cf319d44e7e64987f12aa36ea030e6298c586 (patch)
tree6313963fea4b89859adf6219a3860fe245e44afa /bsps/arm/raspberrypi/include/bsp
parentbsp/raspberrypi: Enable FDT support. (diff)
downloadrtems-362cf319d44e7e64987f12aa36ea030e6298c586.tar.bz2
bsp/raspberrypi: Updated the console API.
Replaces the legacy termios API with new termios API (#3034) Replaces the custom PL011 serial driver with RTEMS arm-pl011. Update #3034
Diffstat (limited to 'bsps/arm/raspberrypi/include/bsp')
-rw-r--r--bsps/arm/raspberrypi/include/bsp/fbcons.h18
-rw-r--r--bsps/arm/raspberrypi/include/bsp/raspberrypi.h54
-rw-r--r--bsps/arm/raspberrypi/include/bsp/usart.h5
3 files changed, 33 insertions, 44 deletions
diff --git a/bsps/arm/raspberrypi/include/bsp/fbcons.h b/bsps/arm/raspberrypi/include/bsp/fbcons.h
index d0e126699a..ea3eee4f32 100644
--- a/bsps/arm/raspberrypi/include/bsp/fbcons.h
+++ b/bsps/arm/raspberrypi/include/bsp/fbcons.h
@@ -20,6 +20,7 @@
#define _FBCONS_H_
#include <libchip/serial.h>
+#include <rtems/termiostypes.h>
#ifdef __cplusplus
extern "C" {
@@ -33,12 +34,25 @@ extern "C" {
#define FB_CONSOLE 0x50492835
-bool fbcons_probe( int minor );
+bool fbcons_probe(
+ rtems_termios_device_context *base
+ );
+
+void fbcons_write_polled(
+ rtems_termios_device_context *base,
+ char c
+);
+
+void output_char_fb(char c);
+
+typedef struct {
+ rtems_termios_device_context base;
+} rpi_fb_context ;
/*
* Driver function table
*/
-extern const console_fns fbcons_fns;
+extern const rtems_termios_device_handler fbcons_fns;
#ifdef __cplusplus
}
diff --git a/bsps/arm/raspberrypi/include/bsp/raspberrypi.h b/bsps/arm/raspberrypi/include/bsp/raspberrypi.h
index 40c80cf408..eeb48c42f1 100644
--- a/bsps/arm/raspberrypi/include/bsp/raspberrypi.h
+++ b/bsps/arm/raspberrypi/include/bsp/raspberrypi.h
@@ -53,12 +53,24 @@
*/
#if (BSP_IS_RPI2 == 1)
- #define RPI_PERIPHERAL_BASE 0x3F000000
+ #define RPI_PERIPHERAL_BASE 0x3F000000
+ #define BASE_OFFSET 0X3F000000
#else
- #define RPI_PERIPHERAL_BASE 0x20000000
+ #define RPI_PERIPHERAL_BASE 0x20000000
+ #define BASE_OFFSET 0X5E000000
#endif
-#define RPI_PERIPHERAL_SIZE 0x01000000
+#define RPI_PERIPHERAL_SIZE 0x01000000
+
+/**
+ * @name Bus to Physical address translation
+ * Macro.
+ * @{
+ */
+
+#define BUS_TO_PHY(x) ((x) - BASE_OFFSET)
+
+/** @} */
/**
* @name Internal ARM Timer Registers
@@ -184,42 +196,6 @@
/** @} */
-/**
- * @name UART 0 (PL011) Registers
- *
- * @{
- */
-
-#define BCM2835_UART0_BASE (RPI_PERIPHERAL_BASE + 0x201000)
-
-#define BCM2835_UART0_DR (BCM2835_UART0_BASE + 0x00)
-#define BCM2835_UART0_RSRECR (BCM2835_UART0_BASE + 0x04)
-#define BCM2835_UART0_FR (BCM2835_UART0_BASE + 0x18)
-#define BCM2835_UART0_ILPR (BCM2835_UART0_BASE + 0x20)
-#define BCM2835_UART0_IBRD (BCM2835_UART0_BASE + 0x24)
-#define BCM2835_UART0_FBRD (BCM2835_UART0_BASE + 0x28)
-#define BCM2835_UART0_LCRH (BCM2835_UART0_BASE + 0x2C)
-#define BCM2835_UART0_CR (BCM2835_UART0_BASE + 0x30)
-#define BCM2835_UART0_IFLS (BCM2835_UART0_BASE + 0x34)
-#define BCM2835_UART0_IMSC (BCM2835_UART0_BASE + 0x38)
-#define BCM2835_UART0_RIS (BCM2835_UART0_BASE + 0x3C)
-#define BCM2835_UART0_MIS (BCM2835_UART0_BASE + 0x40)
-#define BCM2835_UART0_ICR (BCM2835_UART0_BASE + 0x44)
-#define BCM2835_UART0_DMACR (BCM2835_UART0_BASE + 0x48)
-#define BCM2835_UART0_ITCR (BCM2835_UART0_BASE + 0x80)
-#define BCM2835_UART0_ITIP (BCM2835_UART0_BASE + 0x84)
-#define BCM2835_UART0_ITOP (BCM2835_UART0_BASE + 0x88)
-#define BCM2835_UART0_TDR (BCM2835_UART0_BASE + 0x8C)
-
-#define BCM2835_UART0_MIS_RX 0x10
-#define BCM2835_UART0_MIS_TX 0x20
-#define BCM2835_UART0_IMSC_RX 0x10
-#define BCM2835_UART0_IMSC_TX 0x20
-#define BCM2835_UART0_FR_RXFE 0x10
-#define BCM2835_UART0_FR_TXFF 0x20
-#define BCM2835_UART0_ICR_RX 0x10
-#define BCM2835_UART0_ICR_TX 0x20
-
/** @} */
/**
diff --git a/bsps/arm/raspberrypi/include/bsp/usart.h b/bsps/arm/raspberrypi/include/bsp/usart.h
index d3e710c5e9..abbf53626c 100644
--- a/bsps/arm/raspberrypi/include/bsp/usart.h
+++ b/bsps/arm/raspberrypi/include/bsp/usart.h
@@ -32,9 +32,8 @@
extern "C" {
#endif /* __cplusplus */
-#define USART0_DEFAULT_BAUD 115000
-
-extern const console_fns bcm2835_usart_fns;
+#define PL011_DEFAULT_BAUD 115000
+#define BCM2835_PL011_BASE (RPI_PERIPHERAL_BASE + 0x201000)
#ifdef __cplusplus
}