Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82926
b: refs/heads/master
c: fa3218d
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Russell King committed Feb 4, 2008
1 parent f037d26 commit a9f4d3f
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e83aff58bf1b7e6b355a0cfa206e9d3aebe5623f
refs/heads/master: fa3218d8594869b38b1a170ea36d176ac455b897
30 changes: 30 additions & 0 deletions trunk/arch/arm/mach-at91/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,36 @@ config AT91_TIMER_HZ
system clock (of at least several MHz), rounding is less of a
problem so it can be safer to use a decimal values like 100.

choice
prompt "Select a UART for early kernel messages"

config AT91_EARLY_DBGU
bool "DBGU"

config AT91_EARLY_USART0
bool "USART0"

config AT91_EARLY_USART1
bool "USART1"

config AT91_EARLY_USART2
bool "USART2"
depends on ! ARCH_AT91X40

config AT91_EARLY_USART3
bool "USART3"
depends on (ARCH_AT91RM9200 || ARCH_AT91SAM9RL || ARCH_AT91SAM9260)

config AT91_EARLY_USART4
bool "USART4"
depends on ARCH_AT91SAM9260

config AT91_EARLY_USART5
bool "USART5"
depends on ARCH_AT91SAM9260

endchoice

endmenu

endif
3 changes: 1 addition & 2 deletions trunk/drivers/serial/atmel_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/tty_flip.h>
#include <linux/platform_device.h>
#include <linux/atmel_pdc.h>
#include <linux/atmel_serial.h>

#include <asm/io.h>

Expand All @@ -45,8 +46,6 @@
#include <asm/arch/gpio.h>
#endif

#include "atmel_serial.h"

#if defined(CONFIG_SERIAL_ATMEL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
#endif
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-arm/arch-at91/at91rm9200.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
#define AT91_RTC (0xfffffe00 - AT91_BASE_SYS) /* Real-Time Clock */
#define AT91_MC (0xffffff00 - AT91_BASE_SYS) /* Memory Controllers */

#define AT91_USART0 AT91RM9200_BASE_US0
#define AT91_USART1 AT91RM9200_BASE_US1
#define AT91_USART2 AT91RM9200_BASE_US2
#define AT91_USART3 AT91RM9200_BASE_US3

#define AT91_MATRIX 0 /* not supported */

/*
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/asm-arm/arch-at91/at91sam9260.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@
#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS)
#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS)

#define AT91_USART0 AT91SAM9260_BASE_US0
#define AT91_USART1 AT91SAM9260_BASE_US1
#define AT91_USART2 AT91SAM9260_BASE_US2
#define AT91_USART3 AT91SAM9260_BASE_US3
#define AT91_USART4 AT91SAM9260_BASE_US4
#define AT91_USART5 AT91SAM9260_BASE_US5


/*
* Internal Memory.
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/asm-arm/arch-at91/at91sam9261.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS)
#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS)

#define AT91_USART0 AT91SAM9261_BASE_US0
#define AT91_USART1 AT91SAM9261_BASE_US1
#define AT91_USART2 AT91SAM9261_BASE_US2


/*
* Internal Memory.
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/asm-arm/arch-at91/at91sam9263.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
#define AT91_RTT1 (0xfffffd50 - AT91_BASE_SYS)
#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS)

#define AT91_USART0 AT91SAM9263_BASE_US0
#define AT91_USART1 AT91SAM9263_BASE_US1
#define AT91_USART2 AT91SAM9263_BASE_US2

#define AT91_SMC AT91_SMC0

/*
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-arm/arch-at91/at91sam9rl.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS)
#define AT91_RTC (0xfffffe00 - AT91_BASE_SYS)

#define AT91_USART0 AT91SAM9RL_BASE_US0
#define AT91_USART1 AT91SAM9RL_BASE_US1
#define AT91_USART2 AT91SAM9RL_BASE_US2
#define AT91_USART3 AT91SAM9RL_BASE_US3


/*
* Internal Memory.
Expand Down
32 changes: 24 additions & 8 deletions trunk/include/asm-arm/arch-at91/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,23 @@
#define __ASM_ARCH_UNCOMPRESS_H

#include <asm/io.h>
#include <asm/arch/at91_dbgu.h>
#include <linux/atmel_serial.h>

#if defined(CONFIG_AT91_EARLY_DBGU)
#define UART_OFFSET (AT91_DBGU + AT91_BASE_SYS)
#elif defined(CONFIG_AT91_EARLY_USART0)
#define UART_OFFSET AT91_USART0
#elif defined(CONFIG_AT91_EARLY_USART1)
#define UART_OFFSET AT91_USART1
#elif defined(CONFIG_AT91_EARLY_USART2)
#define UART_OFFSET AT91_USART2
#elif defined(CONFIG_AT91_EARLY_USART3)
#define UART_OFFSET AT91_USART3
#elif defined(CONFIG_AT91_EARLY_USART4)
#define UART_OFFSET AT91_USART4
#elif defined(CONFIG_AT91_EARLY_USART5)
#define UART_OFFSET AT91_USART5
#endif

/*
* The following code assumes the serial port has already been
Expand All @@ -33,22 +49,22 @@
*/
static void putc(int c)
{
#ifdef AT91_DBGU
void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */
#ifdef UART_OFFSET
void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */

while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY))
while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXRDY))
barrier();
__raw_writel(c, sys + AT91_DBGU_THR);
__raw_writel(c, sys + ATMEL_US_THR);
#endif
}

static inline void flush(void)
{
#ifdef AT91_DBGU
void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */
#ifdef UART_OFFSET
void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */

/* wait for transmission to complete */
while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY))
while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXEMPTY))
barrier();
#endif
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* drivers/serial/atmel_serial.h
* include/linux/atmel_serial.h
*
* Copyright (C) 2005 Ivan Kokshaysky
* Copyright (C) SAN People
Expand Down

0 comments on commit a9f4d3f

Please sign in to comment.