diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2010-01-21 16:09:37 +0100 |
---|---|---|
committer | Francois Retief <fgretief@spaceteq.co.za> | 2015-11-13 10:23:33 +0200 |
commit | f2879f5952b35009c76de92ca57d67ab628bac0c (patch) | |
tree | cd79e349a44c8ed6dfc3cead9cf69b7e37fafb52 /arch/sparc | |
parent | cff009ed6ff7da2e87f8213d34ed869be4373604 (diff) | |
download | u-boot-f2879f5952b35009c76de92ca57d67ab628bac0c.tar.gz u-boot-f2879f5952b35009c76de92ca57d67ab628bac0c.tar.bz2 u-boot-f2879f5952b35009c76de92ca57d67ab628bac0c.zip |
sparc: leon3: Moved GRLIB core header files to common include/grlib directory
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/cpu/leon3/cpu_init.c | 10 | ||||
-rw-r--r-- | arch/sparc/cpu/leon3/interrupts.c | 7 | ||||
-rw-r--r-- | arch/sparc/cpu/leon3/prom.c | 7 | ||||
-rw-r--r-- | arch/sparc/cpu/leon3/serial.c | 13 |
4 files changed, 20 insertions, 17 deletions
diff --git a/arch/sparc/cpu/leon3/cpu_init.c b/arch/sparc/cpu/leon3/cpu_init.c index f23ecb89be..40d1751fcb 100644 --- a/arch/sparc/cpu/leon3/cpu_init.c +++ b/arch/sparc/cpu/leon3/cpu_init.c @@ -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; } diff --git a/arch/sparc/cpu/leon3/interrupts.c b/arch/sparc/cpu/leon3/interrupts.c index a834aa024b..2312b58d29 100644 --- a/arch/sparc/cpu/leon3/interrupts.c +++ b/arch/sparc/cpu/leon3/interrupts.c @@ -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; } diff --git a/arch/sparc/cpu/leon3/prom.c b/arch/sparc/cpu/leon3/prom.c index d0f18603a1..c391be7420 100644 --- a/arch/sparc/cpu/leon3/prom.c +++ b/arch/sparc/cpu/leon3/prom.c @@ -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; } diff --git a/arch/sparc/cpu/leon3/serial.c b/arch/sparc/cpu/leon3/serial.c index c4a49ed369..cefb9d2c36 100644 --- a/arch/sparc/cpu/leon3/serial.c +++ b/arch/sparc/cpu/leon3/serial.c @@ -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 */ |