sparc: leon3: Moved GRLIB core header files to common include/grlib directory
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
This commit is contained in:

committed by
Francois Retief

parent
cff009ed6f
commit
f2879f5952
@@ -11,6 +11,8 @@
|
||||
#include <asm/asi.h>
|
||||
#include <asm/leon.h>
|
||||
#include <ambapp.h>
|
||||
#include <grlib/irqmp.h>
|
||||
#include <grlib/gptimer.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -27,11 +29,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
/* reset CPU (jump to 0, without reset) */
|
||||
void start(void);
|
||||
|
||||
/* find & initialize the memory controller */
|
||||
int init_memory_ctrl(void);
|
||||
|
||||
ambapp_dev_irqmp *irqmp = NULL;
|
||||
ambapp_dev_mctrl memctrl;
|
||||
ambapp_dev_gptimer *gptimer = NULL;
|
||||
unsigned int gptimer_irq = 0;
|
||||
int leon3_snooping_avail = 0;
|
||||
@@ -150,8 +148,8 @@ int timer_interrupt_init_cpu(void)
|
||||
gptimer->e[0].val = 0;
|
||||
gptimer->e[0].rld = (TIMER_BASE_CLK / CONFIG_SYS_HZ) - 1;
|
||||
gptimer->e[0].ctrl =
|
||||
(LEON3_GPTIMER_EN |
|
||||
LEON3_GPTIMER_RL | LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN);
|
||||
(GPTIMER_CTRL_EN | GPTIMER_CTRL_RS |
|
||||
GPTIMER_CTRL_LD | GPTIMER_CTRL_IE);
|
||||
|
||||
return gptimer_irq;
|
||||
}
|
||||
|
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <asm/leon.h>
|
||||
#include <ambapp.h>
|
||||
#include <grlib/irqmp.h>
|
||||
#include <grlib/gptimer.h>
|
||||
|
||||
/* 15 normal irqs and a non maskable interrupt */
|
||||
#define NR_IRQS 15
|
||||
@@ -125,9 +127,8 @@ int interrupt_init_cpu(void)
|
||||
/* Handle Timer 0 IRQ */
|
||||
void timer_interrupt_cpu(void *arg)
|
||||
{
|
||||
gptimer->e[0].ctrl = (LEON3_GPTIMER_EN |
|
||||
LEON3_GPTIMER_RL |
|
||||
LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN);
|
||||
gptimer->e[0].ctrl = (GPTIMER_CTRL_EN | GPTIMER_CTRL_RS |
|
||||
GPTIMER_CTRL_LD | GPTIMER_CTRL_IE);
|
||||
/* nothing to do here */
|
||||
return;
|
||||
}
|
||||
|
@@ -15,6 +15,9 @@
|
||||
#include <asm/irq.h>
|
||||
#include <asm/leon.h>
|
||||
#include <ambapp.h>
|
||||
#include <grlib/apbuart.h>
|
||||
#include <grlib/irqmp.h>
|
||||
#include <grlib/gptimer.h>
|
||||
|
||||
#include <config.h>
|
||||
/*
|
||||
@@ -741,14 +744,14 @@ static int PROM_TEXT leon_nbputchar(int c)
|
||||
|
||||
/* Wait for last character to go. */
|
||||
while (!(SPARC_BYPASS_READ(&uart->status)
|
||||
& LEON_REG_UART_STATUS_THE)) ;
|
||||
& APBUART_STATUS_THE));
|
||||
|
||||
/* Send data */
|
||||
SPARC_BYPASS_WRITE(&uart->data, c);
|
||||
|
||||
/* Wait for data to be sent */
|
||||
while (!(SPARC_BYPASS_READ(&uart->status)
|
||||
& LEON_REG_UART_STATUS_TSE)) ;
|
||||
& APBUART_STATUS_TSE));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include <common.h>
|
||||
#include <asm/io.h>
|
||||
#include <ambapp.h>
|
||||
#include <grlib/apbuart.h>
|
||||
#include <serial.h>
|
||||
#include <watchdog.h>
|
||||
|
||||
@@ -38,9 +39,9 @@ static int leon3_serial_init(void)
|
||||
writel(tmp, &uart->scaler);
|
||||
|
||||
/* Let bit 11 be unchanged (debug bit for GRMON) */
|
||||
tmp = readl(&uart->ctrl) & LEON_REG_UART_CTRL_DBG;
|
||||
tmp = readl(&uart->ctrl) & APBUART_CTRL_DBG;
|
||||
/* Receiver & transmitter enable */
|
||||
tmp |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
|
||||
tmp |= APBUART_CTRL_RE | APBUART_CTRL_TE;
|
||||
writel(tmp, &uart->ctrl);
|
||||
|
||||
gd->arch.uart = uart;
|
||||
@@ -61,7 +62,7 @@ static void leon3_serial_putc_raw(const char c)
|
||||
return;
|
||||
|
||||
/* Wait for last character to go. */
|
||||
while (!(readl(&uart->status) & LEON_REG_UART_STATUS_THE))
|
||||
while (!(readl(&uart->status) & APBUART_STATUS_THE))
|
||||
WATCHDOG_RESET();
|
||||
|
||||
/* Send data */
|
||||
@@ -69,7 +70,7 @@ static void leon3_serial_putc_raw(const char c)
|
||||
|
||||
#ifdef LEON_DEBUG
|
||||
/* Wait for data to be sent */
|
||||
while (!(readl(&uart->status) & LEON_REG_UART_STATUS_TSE))
|
||||
while (!(readl(&uart->status) & APBUART_STATUS_TSE))
|
||||
WATCHDOG_RESET();
|
||||
#endif
|
||||
}
|
||||
@@ -90,7 +91,7 @@ static int leon3_serial_getc(void)
|
||||
return 0;
|
||||
|
||||
/* Wait for a character to arrive. */
|
||||
while (!(readl(&uart->status) & LEON_REG_UART_STATUS_DR))
|
||||
while (!(readl(&uart->status) & APBUART_STATUS_DR))
|
||||
WATCHDOG_RESET();
|
||||
|
||||
/* Read character data */
|
||||
@@ -104,7 +105,7 @@ static int leon3_serial_tstc(void)
|
||||
if (!uart)
|
||||
return 0;
|
||||
|
||||
return readl(&uart->status) & LEON_REG_UART_STATUS_DR;
|
||||
return readl(&uart->status) & APBUART_STATUS_DR;
|
||||
}
|
||||
|
||||
/* set baud rate for uart */
|
||||
|
Reference in New Issue
Block a user