From cb82a532669f6b02225ec3429ea4d49ff2b97d0a Mon Sep 17 00:00:00 2001 From: Ulf Samuelsson Date: Fri, 27 Mar 2009 23:26:43 +0100 Subject: Add support for the AT91RM9200EK Board. The AT91RM9200-EK Evaluation Board supports the AT91RM9200 ARM9-based 32-bit RISC microcontroller and enables real-time code development and evaluation. Here is the chip page on Atmel website: http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507 with - NOR (cfi driver) - DataFlash - USB OHCI - Net - I2C (hard) Signed-off-by: Ulf Samuelsson Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- cpu/arm920t/start.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cpu/arm920t') diff --git a/cpu/arm920t/start.S b/cpu/arm920t/start.S index fbcfe6dbc3..f610e9f96f 100644 --- a/cpu/arm920t/start.S +++ b/cpu/arm920t/start.S @@ -258,11 +258,9 @@ cpu_init_crit: * find a lowlevel_init.S in your board directory. */ mov ip, lr -#if defined(CONFIG_AT91RM9200EK) -#else bl lowlevel_init -#endif + mov lr, ip mov pc, lr #endif /* CONFIG_SKIP_LOWLEVEL_INIT */ -- cgit From beebd851cdbc9dd070bcdfec1fd8f17e3cc91bc0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 27 Mar 2009 23:26:43 +0100 Subject: at91rm9200: move serial driver to drivers/serial add CONFIG_AT91RM9200_USART to activate the driver Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- cpu/arm920t/at91rm9200/Makefile | 2 +- cpu/arm920t/at91rm9200/serial.c | 113 ---------------------------------------- 2 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 cpu/arm920t/at91rm9200/serial.c (limited to 'cpu/arm920t') diff --git a/cpu/arm920t/at91rm9200/Makefile b/cpu/arm920t/at91rm9200/Makefile index ab4c52c8fb..67f17fadfe 100644 --- a/cpu/arm920t/at91rm9200/Makefile +++ b/cpu/arm920t/at91rm9200/Makefile @@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(SOC).a COBJS = bcm5221.o dm9161.o ether.o i2c.o interrupts.o \ - lxt972.o serial.o usb.o spi.o + lxt972.o usb.o spi.o SOBJS = lowlevel_init.o SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) diff --git a/cpu/arm920t/at91rm9200/serial.c b/cpu/arm920t/at91rm9200/serial.c deleted file mode 100644 index d563445492..0000000000 --- a/cpu/arm920t/at91rm9200/serial.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * (C) Copyright 2002 - * Lineo, Inc - * Bernhard Kuhn - * - * (C) Copyright 2002 - * Sysgo Real-Time Solutions, GmbH - * Marius Groeger - * - * (C) Copyright 2002 - * Sysgo Real-Time Solutions, GmbH - * Alex Zuepke - * - * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -#if !defined(CONFIG_DBGU) && !defined(CONFIG_USART0) && !defined(CONFIG_USART1) -#error must define one of CONFIG_DBGU or CONFIG_USART0 or CONFIG_USART1 -#endif - -/* ggi thunder */ -#ifdef CONFIG_DBGU -AT91PS_USART us = (AT91PS_USART) AT91C_BASE_DBGU; -#endif -#ifdef CONFIG_USART0 -AT91PS_USART us = (AT91PS_USART) AT91C_BASE_US0; -#endif -#ifdef CONFIG_USART1 -AT91PS_USART us = (AT91PS_USART) AT91C_BASE_US1; -#endif - -void serial_setbrg (void) -{ - int baudrate; - - if ((baudrate = gd->baudrate) <= 0) - baudrate = CONFIG_BAUDRATE; - /* MASTER_CLOCK/(16 * baudrate) */ - us->US_BRGR = (AT91C_MASTER_CLOCK >> 4) / (unsigned)baudrate; -} - -int serial_init (void) -{ - /* make any port initializations specific to this port */ -#ifdef CONFIG_DBGU - *AT91C_PIOA_PDR = AT91C_PA31_DTXD | AT91C_PA30_DRXD; /* PA 31 & 30 */ - *AT91C_PMC_PCER = 1 << AT91C_ID_SYS; /* enable clock */ -#endif -#ifdef CONFIG_USART0 - *AT91C_PIOA_PDR = AT91C_PA17_TXD0 | AT91C_PA18_RXD0; - *AT91C_PMC_PCER |= 1 << AT91C_ID_USART0; /* enable clock */ -#endif -#ifdef CONFIG_USART1 - *AT91C_PIOB_PDR = AT91C_PB21_TXD1 | AT91C_PB20_RXD1; - *AT91C_PMC_PCER |= 1 << AT91C_ID_USART1; /* enable clock */ -#endif - serial_setbrg (); - - us->US_CR = AT91C_US_RSTRX | AT91C_US_RSTTX; - us->US_CR = AT91C_US_RXEN | AT91C_US_TXEN; - us->US_MR = - (AT91C_US_CLKS_CLOCK | AT91C_US_CHRL_8_BITS | - AT91C_US_PAR_NONE | AT91C_US_NBSTOP_1_BIT); - us->US_IMR = ~0ul; - return (0); -} - -void serial_putc (const char c) -{ - if (c == '\n') - serial_putc ('\r'); - while ((us->US_CSR & AT91C_US_TXRDY) == 0); - us->US_THR = c; -} - -void serial_puts (const char *s) -{ - while (*s) { - serial_putc (*s++); - } -} - -int serial_getc (void) -{ - while ((us->US_CSR & AT91C_US_RXRDY) == 0); - return us->US_RHR; -} - -int serial_tstc (void) -{ - return ((us->US_CSR & AT91C_US_RXRDY) == AT91C_US_RXRDY); -} -- cgit From 3524049cd053746298e4cfab2449882e75c146fc Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 27 Mar 2009 23:26:43 +0100 Subject: at91rm9200: move serial shutdown code to serial drivers introduce serial_exit for this purpose. Use it only when the rm9200 serial driver is active Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- cpu/arm920t/at91rm9200/interrupts.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'cpu/arm920t') diff --git a/cpu/arm920t/at91rm9200/interrupts.c b/cpu/arm920t/at91rm9200/interrupts.c index 5f0703c2de..15e22bf6cf 100644 --- a/cpu/arm920t/at91rm9200/interrupts.c +++ b/cpu/arm920t/at91rm9200/interrupts.c @@ -166,21 +166,14 @@ ulong get_tbclk (void) void reset_cpu (ulong ignored) { -#ifdef CONFIG_DBGU - AT91PS_USART us = (AT91PS_USART) AT91C_BASE_DBGU; -#endif -#ifdef CONFIG_USART0 - AT91PS_USART us = AT91C_BASE_US0; -#endif -#ifdef CONFIG_USART1 - AT91PS_USART us = AT91C_BASE_US1; -#endif #ifdef CONFIG_AT91RM9200DK AT91PS_PIO pio = AT91C_BASE_PIOA; #endif +#if defined(CONFIG_AT91RM9200_USART) /*shutdown the console to avoid strange chars during reset */ - us->US_CR = (AT91C_US_RSTRX | AT91C_US_RSTTX); + serial_exit(); +#endif #ifdef CONFIG_AT91RM9200DK /* Clear PA19 to trigger the hard reset */ -- cgit From f82518d7f443ebac5f8821103a3c521c963aa6ee Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 27 Mar 2009 23:26:43 +0100 Subject: at91rm9200: Reset update Update the rm9200 reset sequence to try executing a board-specific reset function and move specific board reset to board. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- cpu/arm920t/at91rm9200/interrupts.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'cpu/arm920t') diff --git a/cpu/arm920t/at91rm9200/interrupts.c b/cpu/arm920t/at91rm9200/interrupts.c index 15e22bf6cf..cff4916643 100644 --- a/cpu/arm920t/at91rm9200/interrupts.c +++ b/cpu/arm920t/at91rm9200/interrupts.c @@ -45,6 +45,8 @@ AT91PS_TC tmr; static ulong timestamp; static ulong lastinc; +void board_reset(void) __attribute__((__weak__)); + int interrupt_init (void) { tmr = AT91C_BASE_TC0; @@ -166,21 +168,13 @@ ulong get_tbclk (void) void reset_cpu (ulong ignored) { -#ifdef CONFIG_AT91RM9200DK - AT91PS_PIO pio = AT91C_BASE_PIOA; -#endif - #if defined(CONFIG_AT91RM9200_USART) /*shutdown the console to avoid strange chars during reset */ serial_exit(); #endif -#ifdef CONFIG_AT91RM9200DK - /* Clear PA19 to trigger the hard reset */ - pio->PIO_CODR = 0x00080000; - pio->PIO_OER = 0x00080000; - pio->PIO_PER = 0x00080000; -#endif + if (board_reset) + board_reset(); /* this is the way Linux does it */ -- cgit