summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/uart
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2012-05-16 17:20:35 +0200
committerGedare Bloom <gedare@rtems.org>2012-05-16 13:29:13 -0400
commit226d48d8262ff040aeca439c22e7398179eb01cd (patch)
tree931d2a37d49440bd95902f9b367f72f02ea5db2c /c/src/lib/libbsp/sparc/shared/uart
parentnfsclient: Fix symbolic link evaluation (diff)
downloadrtems-226d48d8262ff040aeca439c22e7398179eb01cd.tar.bz2
LEON: moved register definitions into grlib header file
Some register layout definitions for LEON3 reside in ambapp.h which does not really has anything to do with device registers. The register structures has been incorrectly named LEON3_*, the cores are not only used on LEON3 but on LEON4 and perhaps on LEON5 when that day comes. Some structures has been renamed according to the GRLIB core name instead, which CPU that actually use it is not relevant. Drivers has been updated with the new names. Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Diffstat (limited to 'c/src/lib/libbsp/sparc/shared/uart')
-rw-r--r--c/src/lib/libbsp/sparc/shared/uart/apbuart.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart.c
index d442e80a46..25d0373088 100644
--- a/c/src/lib/libbsp/sparc/shared/uart/apbuart.c
+++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart.c
@@ -22,6 +22,7 @@
#include <string.h>
#include <ambapp.h>
+#include <grlib.h>
#include <apbuart.h>
#ifndef DEFAULT_TXBUF_SIZE
@@ -79,7 +80,7 @@ static rtems_device_driver apbuart_write(rtems_device_major_number major, rtems_
static rtems_device_driver apbuart_control(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
typedef struct {
- ambapp_apb_uart *regs;
+ struct apbuart_regs *regs;
int irq;
int minor;
int scaler;
@@ -153,7 +154,7 @@ static void apbuart_hw_open(apbuart_priv *uart);
#endif
#if 0
-static int apbuart_outbyte_try(ambapp_apb_uart *regs, unsigned char ch)
+static int apbuart_outbyte_try(struct apbuart_regs *regs, unsigned char ch)
{
if ( (READ_REG(&regs->status) & LEON_REG_UART_STATUS_THE) == 0 )
return -1; /* Failed */
@@ -164,7 +165,7 @@ static int apbuart_outbyte_try(ambapp_apb_uart *regs, unsigned char ch)
}
-static int apbuart_inbyte_try(ambapp_apb_uart *regs)
+static int apbuart_inbyte_try(struct apbuart_regs *regs)
{
unsigned int status;
/* Clear errors if any */
@@ -386,11 +387,11 @@ static rtems_device_driver apbuart_initialize(rtems_device_major_number major,
/* LEON3: find timer address via AMBA Plug&Play info */
{
struct ambapp_apb_info gptimer;
- LEON3_Timer_Regs_Map *tregs;
+ struct gptimer_regs *tregs;
if ( ambapp_find_apbslv(&ambapp_plb, VENDOR_GAISLER,
GAISLER_GPTIMER, &gptimer) == 1 ){
- tregs = (LEON3_Timer_Regs_Map *)gptimer.start;
+ tregs = (struct gptimer_regs *)gptimer.start;
sys_freq_hz = (tregs->scaler_reload+1)*1000*1000;
DBG("APBUART: detected %dHZ system frequency\n\r",sys_freq_hz);
}else{
@@ -419,7 +420,7 @@ static rtems_device_driver apbuart_initialize(rtems_device_major_number major,
printk("APBUART[%d]: at 0x%x irq %d (0x%x)\n\r",i,dev.start,dev.irq,(unsigned int)&apbuarts[i]);
- apbuarts[i].regs = (ambapp_apb_uart *)dev.start;
+ apbuarts[i].regs = (struct apbuart_regs *)dev.start;
apbuarts[i].irq = dev.irq;
apbuarts[i].minor = i;