From 9d04a0db9cc16bc781d9d62d39a08fc69e26dbc4 Mon Sep 17 00:00:00 2001 From: imp Date: Tue, 10 Jul 2012 02:14:50 +0000 Subject: [PATCH] Eliminate the AT91XXXX_BASE for each SoC. AT91_BASE is the right way to spell this since we only have one AT91_BASE for all Atmel arm9 SoCs. --- sys/arm/at91/at91_reset.S | 7 ++++--- sys/arm/at91/at91rm9200.c | 4 ++-- sys/arm/at91/at91rm92reg.h | 1 - sys/arm/at91/at91sam9g20.c | 4 ++-- sys/arm/at91/at91sam9g20reg.h | 2 -- sys/arm/at91/at91sam9x25.c | 4 ++-- sys/arm/at91/at91sam9x25reg.h | 2 -- sys/arm/at91/uart_cpu_at91rm9200usart.c | 2 +- 8 files changed, 11 insertions(+), 15 deletions(-) diff --git a/sys/arm/at91/at91_reset.S b/sys/arm/at91/at91_reset.S index 6ff7da0c80f7..28703cc0f48d 100644 --- a/sys/arm/at91/at91_reset.S +++ b/sys/arm/at91/at91_reset.S @@ -1,13 +1,14 @@ #include #include +#include #include __FBSDID("$FreeBSD$"); -#define SDRAM_TR (AT91SAM9G20_BASE + \ +#define SDRAM_TR (AT91_BASE + \ AT91SAM9G20_SDRAMC_BASE + AT91SAM9G20_SDRAMC_TR) -#define SDRAM_LPR (AT91SAM9G20_BASE + \ +#define SDRAM_LPR (AT91_BASE + \ AT91SAM9G20_SDRAMC_BASE + AT91SAM9G20_SDRAMC_LPR) -#define RSTC_RCR (AT91SAM9G20_BASE + \ +#define RSTC_RCR (AT91_BASE + \ AT91SAM9G20_RSTC_BASE + RST_CR) /* diff --git a/sys/arm/at91/at91rm9200.c b/sys/arm/at91/at91rm9200.c index ddddb7828667..bb46c35e9a54 100644 --- a/sys/arm/at91/at91rm9200.c +++ b/sys/arm/at91/at91rm9200.c @@ -164,8 +164,8 @@ at91_add_child(device_t dev, int prio, const char *name, int unit, bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91RM92_BASE) - addr += AT91RM92_BASE; + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); } diff --git a/sys/arm/at91/at91rm92reg.h b/sys/arm/at91/at91rm92reg.h index 129c01b91d2a..66fad34b57ef 100644 --- a/sys/arm/at91/at91rm92reg.h +++ b/sys/arm/at91/at91rm92reg.h @@ -70,7 +70,6 @@ * 0xf0000000 - 0xfffffffff : Peripherals */ -#define AT91RM92_BASE 0xd0000000 /* Usart */ #define AT91RM92_USART_SIZE 0x4000 diff --git a/sys/arm/at91/at91sam9g20.c b/sys/arm/at91/at91sam9g20.c index 668b05775a11..8124ceea311a 100644 --- a/sys/arm/at91/at91sam9g20.c +++ b/sys/arm/at91/at91sam9g20.c @@ -157,8 +157,8 @@ at91_add_child(device_t dev, int prio, const char *name, int unit, bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91SAM9G20_BASE) - addr += AT91SAM9G20_BASE; + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); } diff --git a/sys/arm/at91/at91sam9g20reg.h b/sys/arm/at91/at91sam9g20reg.h index 7311adeab5d9..ab686c39824c 100644 --- a/sys/arm/at91/at91sam9g20reg.h +++ b/sys/arm/at91/at91sam9g20reg.h @@ -73,8 +73,6 @@ #define AT91_CHIPSELECT_7 0x80000000 -#define AT91SAM9G20_BASE 0xd0000000 - #define AT91SAM9G20_EMAC_BASE 0xffc4000 #define AT91SAM9G20_EMAC_SIZE 0x4000 diff --git a/sys/arm/at91/at91sam9x25.c b/sys/arm/at91/at91sam9x25.c index fa1930028152..2b83d82bcf95 100644 --- a/sys/arm/at91/at91sam9x25.c +++ b/sys/arm/at91/at91sam9x25.c @@ -160,8 +160,8 @@ at91_add_child(device_t dev, int prio, const char *name, int unit, bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); if (irq2 != 0) bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); - if (addr != 0 && addr < AT91SAM9X25_BASE) - addr += AT91SAM9X25_BASE; + if (addr != 0 && addr < AT91_BASE) + addr += AT91_BASE; if (addr != 0) bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); } diff --git a/sys/arm/at91/at91sam9x25reg.h b/sys/arm/at91/at91sam9x25reg.h index e8bc0e52ec86..d497e2bd7749 100644 --- a/sys/arm/at91/at91sam9x25reg.h +++ b/sys/arm/at91/at91sam9x25reg.h @@ -73,8 +73,6 @@ #define AT91_CHIPSELECT_4 0x50000000 #define AT91_CHIPSELECT_5 0x60000000 -#define AT91SAM9X25_BASE 0xd0000000 - #define AT91SAM9X25_EMAC_SIZE 0x4000 #define AT91SAM9X25_EMAC0_BASE 0x802c000 #define AT91SAM9X25_EMAC0_SIZE AT91SAM9X25_EMAC_SIZE diff --git a/sys/arm/at91/uart_cpu_at91rm9200usart.c b/sys/arm/at91/uart_cpu_at91rm9200usart.c index 098e368d27fd..cb39bf9560a2 100644 --- a/sys/arm/at91/uart_cpu_at91rm9200usart.c +++ b/sys/arm/at91/uart_cpu_at91rm9200usart.c @@ -73,7 +73,7 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) * XXX: Not pretty, but will work because we map the needed addresses * early. */ - di->bas.bsh = AT91RM92_BASE + AT91RM92_DBGU_BASE; + di->bas.bsh = AT91_BASE + AT91RM92_DBGU_BASE; di->baudrate = 115200; di->bas.regshft = 0; di->bas.rclk = 0;