projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ppc4xx: Big cleanup of PPC4xx defines
[platform/kernel/u-boot.git]
/
post
/
cpu
/
ppc4xx
/
uart.c
diff --git
a/post/cpu/ppc4xx/uart.c
b/post/cpu/ppc4xx/uart.c
index
1a57c3d
..
be217fc
100644
(file)
--- a/
post/cpu/ppc4xx/uart.c
+++ b/
post/cpu/ppc4xx/uart.c
@@
-34,14
+34,14
@@
#include <post.h>
#include <post.h>
-#if CONFIG_POST & C
FG
_POST_UART
+#if CONFIG_POST & C
ONFIG_SYS
_POST_UART
/*
* This table defines the UART's that should be tested and can
* be overridden in the board config file
*/
/*
* This table defines the UART's that should be tested and can
* be overridden in the board config file
*/
-#ifndef C
FG
_POST_UART_TABLE
-#define C
FG_POST_UART_TABLE
{UART0_BASE, UART1_BASE, UART2_BASE, UART3_BASE}
+#ifndef C
ONFIG_SYS
_POST_UART_TABLE
+#define C
ONFIG_SYS_POST_UART_TABLE
{UART0_BASE, UART1_BASE, UART2_BASE, UART3_BASE}
#endif
#include <asm/processor.h>
#endif
#include <asm/processor.h>
@@
-50,17
+50,17
@@
#if defined(CONFIG_440)
#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
#if defined(CONFIG_440)
#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
-#define UART0_BASE C
FG
_PERIPHERAL_BASE + 0x00000300
-#define UART1_BASE C
FG
_PERIPHERAL_BASE + 0x00000400
-#define UART2_BASE C
FG
_PERIPHERAL_BASE + 0x00000500
-#define UART3_BASE C
FG
_PERIPHERAL_BASE + 0x00000600
+#define UART0_BASE C
ONFIG_SYS
_PERIPHERAL_BASE + 0x00000300
+#define UART1_BASE C
ONFIG_SYS
_PERIPHERAL_BASE + 0x00000400
+#define UART2_BASE C
ONFIG_SYS
_PERIPHERAL_BASE + 0x00000500
+#define UART3_BASE C
ONFIG_SYS
_PERIPHERAL_BASE + 0x00000600
#else
#else
-#define UART0_BASE C
FG
_PERIPHERAL_BASE + 0x00000200
-#define UART1_BASE C
FG
_PERIPHERAL_BASE + 0x00000300
+#define UART0_BASE C
ONFIG_SYS
_PERIPHERAL_BASE + 0x00000200
+#define UART1_BASE C
ONFIG_SYS
_PERIPHERAL_BASE + 0x00000300
#endif
#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
#endif
#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
-#define UART2_BASE C
FG
_PERIPHERAL_BASE + 0x00000600
+#define UART2_BASE C
ONFIG_SYS
_PERIPHERAL_BASE + 0x00000600
#endif
#if defined(CONFIG_440GP)
#endif
#if defined(CONFIG_440GP)
@@
-68,7
+68,7
@@
#define CR0_EXTCLK_ENA 0x00600000
#define CR0_UDIV_POS 16
#define UDIV_SUBTRACT 1
#define CR0_EXTCLK_ENA 0x00600000
#define CR0_UDIV_POS 16
#define UDIV_SUBTRACT 1
-#define UART0_SDR
cntrl
0
+#define UART0_SDR
CPC0_CR
0
#define MFREG(a, d) d = mfdcr(a)
#define MTREG(a, d) mtdcr(a, d)
#else /* #if defined(CONFIG_440GP) */
#define MFREG(a, d) d = mfdcr(a)
#define MTREG(a, d) mtdcr(a, d)
#else /* #if defined(CONFIG_440GP) */
@@
-77,16
+77,16
@@
#define CR0_EXTCLK_ENA 0x00800000
#define CR0_UDIV_POS 0
#define UDIV_SUBTRACT 0
#define CR0_EXTCLK_ENA 0x00800000
#define CR0_UDIV_POS 0
#define UDIV_SUBTRACT 0
-#define UART0_SDR
sdr_uart
0
-#define UART1_SDR
sdr_uart
1
+#define UART0_SDR
SDR0_UART
0
+#define UART1_SDR
SDR0_UART
1
#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
defined(CONFIG_440SP) || defined(CONFIG_440SPE)
#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
defined(CONFIG_440SP) || defined(CONFIG_440SPE)
-#define UART2_SDR
sdr_uart
2
+#define UART2_SDR
SDR0_UART
2
#endif
#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
defined(CONFIG_440GR) || defined(CONFIG_440GRX)
#endif
#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
defined(CONFIG_440GR) || defined(CONFIG_440GRX)
-#define UART3_SDR
sdr_uart
3
+#define UART3_SDR
SDR0_UART
3
#endif
#define MFREG(a, d) mfsdr(a, d)
#define MTREG(a, d) mtsdr(a, d)
#endif
#define MFREG(a, d) mfsdr(a, d)
#define MTREG(a, d) mtsdr(a, d)
@@
-106,8
+106,8
@@
#define CR0_EXTCLK_ENA 0x00800000
#define CR0_UDIV_POS 0
#define UDIV_SUBTRACT 0
#define CR0_EXTCLK_ENA 0x00800000
#define CR0_UDIV_POS 0
#define UDIV_SUBTRACT 0
-#define UART0_SDR
sdr_uart
0
-#define UART1_SDR
sdr_uart
1
+#define UART0_SDR
SDR0_UART
0
+#define UART1_SDR
SDR0_UART
1
#define MFREG(a, d) mfsdr(a, d)
#define MTREG(a, d) mtsdr(a, d)
#else /* CONFIG_405GP || CONFIG_405CR */
#define MFREG(a, d) mfsdr(a, d)
#define MTREG(a, d) mtsdr(a, d)
#else /* CONFIG_405GP || CONFIG_405CR */
@@
-147,7
+147,7
@@
DECLARE_GLOBAL_DATA_PTR;
#if defined(CONFIG_440) || defined(CONFIG_405EX)
DECLARE_GLOBAL_DATA_PTR;
#if defined(CONFIG_440) || defined(CONFIG_405EX)
-#if !defined(C
FG
_EXT_SERIAL_CLOCK)
+#if !defined(C
ONFIG_SYS
_EXT_SERIAL_CLOCK)
static void serial_divs (int baudrate, unsigned long *pudiv,
unsigned short *pbdiv)
{
static void serial_divs (int baudrate, unsigned long *pudiv,
unsigned short *pbdiv)
{
@@
-196,7
+196,7
@@
static int uart_post_init (unsigned long dev_base)
unsigned long udiv;
unsigned short bdiv;
volatile char val;
unsigned long udiv;
unsigned short bdiv;
volatile char val;
-#ifdef C
FG
_EXT_SERIAL_CLOCK
+#ifdef C
ONFIG_SYS
_EXT_SERIAL_CLOCK
unsigned long tmp;
#endif
int i;
unsigned long tmp;
#endif
int i;
@@
-209,11
+209,11
@@
static int uart_post_init (unsigned long dev_base)
MFREG(UART0_SDR, reg);
reg &= ~CR0_MASK;
MFREG(UART0_SDR, reg);
reg &= ~CR0_MASK;
-#ifdef C
FG
_EXT_SERIAL_CLOCK
+#ifdef C
ONFIG_SYS
_EXT_SERIAL_CLOCK
reg |= CR0_EXTCLK_ENA;
udiv = 1;
tmp = gd->baudrate * 16;
reg |= CR0_EXTCLK_ENA;
udiv = 1;
tmp = gd->baudrate * 16;
- bdiv = (C
FG
_EXT_SERIAL_CLOCK + tmp / 2) / tmp;
+ bdiv = (C
ONFIG_SYS
_EXT_SERIAL_CLOCK + tmp / 2) / tmp;
#else
/* For 440, the cpu clock is on divider chain A, UART on divider
* chain B ... so cpu clock is irrelevant. Get the "optimized"
#else
/* For 440, the cpu clock is on divider chain A, UART on divider
* chain B ... so cpu clock is irrelevant. Get the "optimized"
@@
-276,34
+276,34
@@
static int uart_post_init (unsigned long dev_base)
clk = tmp = reg = 0;
#else
#ifdef CONFIG_405EP
clk = tmp = reg = 0;
#else
#ifdef CONFIG_405EP
- reg = mfdcr(
cpc0_ucr
) & ~(UCR0_MASK | UCR1_MASK);
+ reg = mfdcr(
CPC0_UCR
) & ~(UCR0_MASK | UCR1_MASK);
clk = gd->cpu_clk;
clk = gd->cpu_clk;
- tmp = C
FG
_BASE_BAUD * 16;
+ tmp = C
ONFIG_SYS
_BASE_BAUD * 16;
udiv = (clk + tmp / 2) / tmp;
if (udiv > UDIV_MAX) /* max. n bits for udiv */
udiv = UDIV_MAX;
reg |= (udiv) << UCR0_UDIV_POS; /* set the UART divisor */
reg |= (udiv) << UCR1_UDIV_POS; /* set the UART divisor */
udiv = (clk + tmp / 2) / tmp;
if (udiv > UDIV_MAX) /* max. n bits for udiv */
udiv = UDIV_MAX;
reg |= (udiv) << UCR0_UDIV_POS; /* set the UART divisor */
reg |= (udiv) << UCR1_UDIV_POS; /* set the UART divisor */
- mtdcr (
cpc0_ucr
, reg);
+ mtdcr (
CPC0_UCR
, reg);
#else /* CONFIG_405EP */
#else /* CONFIG_405EP */
- reg = mfdcr(
cntrl
0) & ~CR0_MASK;
-#ifdef C
FG
_EXT_SERIAL_CLOCK
- clk = C
FG
_EXT_SERIAL_CLOCK;
+ reg = mfdcr(
CPC0_CR
0) & ~CR0_MASK;
+#ifdef C
ONFIG_SYS
_EXT_SERIAL_CLOCK
+ clk = C
ONFIG_SYS
_EXT_SERIAL_CLOCK;
udiv = 1;
reg |= CR0_EXTCLK_ENA;
#else
clk = gd->cpu_clk;
udiv = 1;
reg |= CR0_EXTCLK_ENA;
#else
clk = gd->cpu_clk;
-#ifdef C
FG
_405_UART_ERRATA_59
+#ifdef C
ONFIG_SYS
_405_UART_ERRATA_59
udiv = 31; /* Errata 59: stuck at 31 */
#else
udiv = 31; /* Errata 59: stuck at 31 */
#else
- tmp = C
FG
_BASE_BAUD * 16;
+ tmp = C
ONFIG_SYS
_BASE_BAUD * 16;
udiv = (clk + tmp / 2) / tmp;
if (udiv > UDIV_MAX) /* max. n bits for udiv */
udiv = UDIV_MAX;
#endif
#endif
reg |= (udiv - 1) << CR0_UDIV_POS; /* set the UART divisor */
udiv = (clk + tmp / 2) / tmp;
if (udiv > UDIV_MAX) /* max. n bits for udiv */
udiv = UDIV_MAX;
#endif
#endif
reg |= (udiv - 1) << CR0_UDIV_POS; /* set the UART divisor */
- mtdcr (
cntrl
0, reg);
+ mtdcr (
CPC0_CR
0, reg);
#endif /* CONFIG_405EP */
tmp = gd->baudrate * udiv * 16;
bdiv = (clk + tmp / 2) / tmp;
#endif /* CONFIG_405EP */
tmp = gd->baudrate * udiv * 16;
bdiv = (clk + tmp / 2) / tmp;
@@
-375,7
+375,7
@@
done:
int uart_post_test (int flags)
{
int i, res = 0;
int uart_post_test (int flags)
{
int i, res = 0;
- static unsigned long base[] = C
FG
_POST_UART_TABLE;
+ static unsigned long base[] = C
ONFIG_SYS
_POST_UART_TABLE;
for (i = 0; i < sizeof (base) / sizeof (base[0]); i++) {
if (test_ctlr (base[i], i))
for (i = 0; i < sizeof (base) / sizeof (base[0]); i++) {
if (test_ctlr (base[i], i))
@@
-386,4
+386,4
@@
int uart_post_test (int flags)
return res;
}
return res;
}
-#endif /* CONFIG_POST & C
FG
_POST_UART */
+#endif /* CONFIG_POST & C
ONFIG_SYS
_POST_UART */