summaryrefslogtreecommitdiff
path: root/board/keymile
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2010-02-18 08:08:25 +0100
committerWolfgang Denk <wd@denx.de>2011-04-30 00:44:29 +0200
commit62ddcf05e7d7d84498e1387b9b3b9597fe904070 (patch)
treec252a75c8d942dd7ad6e6b3a4e4a7761f2054845 /board/keymile
parentde3ad13de53fa678e5408d899dcfedec44780994 (diff)
downloadu-boot-imx-62ddcf05e7d7d84498e1387b9b3b9597fe904070.zip
u-boot-imx-62ddcf05e7d7d84498e1387b9b3b9597fe904070.tar.gz
u-boot-imx-62ddcf05e7d7d84498e1387b9b3b9597fe904070.tar.bz2
mpc832x: add support for the mpc8321 based suvd3 board
- serial console on UART1 - Ethernet RMII over UCC4 - PHY SMSC LAN8700 - 64MB Flash - 128 MB DDR2 RAM - I2C - bootcount This board is similiar to the kmeter1 (8360) board, so common config options are extracted into the include/configs/km83xx-common.h file. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Kim Phillips <kim.phillips@freescale.com> cc: Kim Phillips <kim.phillips@freescale.com> cc: Holger Brunck <holger.brunck@keymile.com> cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Diffstat (limited to 'board/keymile')
-rw-r--r--board/keymile/common/common.c10
-rw-r--r--board/keymile/km83xx/Makefile (renamed from board/keymile/kmeter1/Makefile)0
-rw-r--r--board/keymile/km83xx/km83xx.c (renamed from board/keymile/kmeter1/kmeter1.c)94
3 files changed, 82 insertions, 22 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index ea32028..85538d0 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -29,6 +29,7 @@
#include <malloc.h>
#include <hush.h>
#include <net.h>
+#include <netdev.h>
#include <asm/io.h>
#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
@@ -402,7 +403,7 @@ static void setports(int gpio)
#endif
#endif
-#if !defined(CONFIG_KMETER1)
+#if !defined(CONFIG_MPC83xx)
static void writeStartSeq(void)
{
set_sda(1);
@@ -461,7 +462,7 @@ static int i2c_make_abort(void)
*/
void i2c_init_board(void)
{
-#if defined(CONFIG_KMETER1)
+#if defined(CONFIG_MPC83xx)
struct fsl_i2c *dev;
dev = (struct fsl_i2c *) (CONFIG_SYS_IMMR + CONFIG_SYS_I2C_OFFSET);
uchar dummy;
@@ -573,6 +574,7 @@ int board_eth_init(bd_t *bis)
(void)keymile_hdlc_enet_initialize(bis);
#endif
if (ethernet_present())
- return -1;
- return 0;
+ return cpu_eth_init(bis);
+
+ return -1;
}
diff --git a/board/keymile/kmeter1/Makefile b/board/keymile/km83xx/Makefile
index 2fa84f3..2fa84f3 100644
--- a/board/keymile/kmeter1/Makefile
+++ b/board/keymile/km83xx/Makefile
diff --git a/board/keymile/kmeter1/kmeter1.c b/board/keymile/km83xx/km83xx.c
index 9c18168..98aceef 100644
--- a/board/keymile/kmeter1/kmeter1.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -8,7 +8,7 @@
* Copyright (C) 2007 MontaVista Software, Inc.
* Anton Vorontsov <avorontsov@ru.mvista.com>
*
- * (C) Copyright 2008
+ * (C) Copyright 2008 - 2010
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
*
* This program is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@
const qe_iop_conf_t qe_iop_conf_tab[] = {
/* port pin dir open_drain assign */
-
+#if defined(CONFIG_KMETER1)
/* MDIO */
{0, 1, 3, 0, 2}, /* MDIO */
{0, 2, 1, 0, 1}, /* MDC */
@@ -55,6 +55,40 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
{5, 2, 1, 0, 1}, /* UART2_RTS */
{5, 3, 2, 0, 2}, /* UART2_SIN */
{5, 1, 2, 0, 3}, /* UART2_CTS */
+#else
+ /* Local Bus */
+ {0, 16, 1, 0, 3}, /* LA00 */
+ {0, 17, 1, 0, 3}, /* LA01 */
+ {0, 18, 1, 0, 3}, /* LA02 */
+ {0, 19, 1, 0, 3}, /* LA03 */
+ {0, 20, 1, 0, 3}, /* LA04 */
+ {0, 21, 1, 0, 3}, /* LA05 */
+ {0, 22, 1, 0, 3}, /* LA06 */
+ {0, 23, 1, 0, 3}, /* LA07 */
+ {0, 24, 1, 0, 3}, /* LA08 */
+ {0, 25, 1, 0, 3}, /* LA09 */
+ {0, 26, 1, 0, 3}, /* LA10 */
+ {0, 27, 1, 0, 3}, /* LA11 */
+ {0, 28, 1, 0, 3}, /* LA12 */
+ {0, 29, 1, 0, 3}, /* LA13 */
+ {0, 30, 1, 0, 3}, /* LA14 */
+ {0, 31, 1, 0, 3}, /* LA15 */
+
+ /* MDIO */
+ {3, 4, 3, 0, 2}, /* MDIO */
+ {3, 5, 1, 0, 2}, /* MDC */
+
+ /* UCC4 - UEC */
+ {1, 18, 1, 0, 1}, /* TxD0 */
+ {1, 19, 1, 0, 1}, /* TxD1 */
+ {1, 22, 2, 0, 1}, /* RxD0 */
+ {1, 23, 2, 0, 1}, /* RxD1 */
+ {1, 26, 2, 0, 1}, /* RxER */
+ {1, 28, 2, 0, 1}, /* Rx_DV */
+ {1, 30, 1, 0, 1}, /* TxEN */
+ {1, 31, 2, 0, 1}, /* CRS */
+ {3, 10, 2, 0, 3}, /* TxCLK->CLK17 */
+#endif
/* END of table */
{0, 0, 0, 0, QE_IOP_TAB_END},
@@ -77,11 +111,38 @@ static int board_init_i2c_busses(void)
return 0;
}
+#if defined(CONFIG_SUVD3)
+const uint upma_table[] = {
+ 0x1ffedc00, 0x0ffcdc80, 0x0ffcdc80, 0x0ffcdc04, /* Words 0 to 3 */
+ 0x0ffcdc00, 0xffffcc00, 0xffffcc01, 0xfffffc01, /* Words 4 to 7 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 8 to 11 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 12 to 15 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 16 to 19 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 20 to 23 */
+ 0x9cfffc00, 0x00fffc80, 0x00fffc80, 0x00fffc00, /* Words 24 to 27 */
+ 0xffffec04, 0xffffec01, 0xfffffc01, 0xfffffc01, /* Words 28 to 31 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 32 to 35 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 36 to 39 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 40 to 43 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 44 to 47 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 48 to 51 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 52 to 55 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01, /* Words 56 to 59 */
+ 0xfffffc01, 0xfffffc01, 0xfffffc01, 0xfffffc01 /* Words 60 to 63 */
+};
+#endif
+
int board_early_init_r(void)
{
struct km_bec_fpga *base = (struct km_bec_fpga *)CONFIG_SYS_PIGGY_BASE;
- unsigned short svid;
+#if defined(CONFIG_SUVD3)
+ immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
+ fsl_lbc_t *lbc = &immap->im_lbc;
+ u32 *mxmr = &lbc->mamr;
+#endif
+#if defined(CONFIG_MPC8360)
+ unsigned short svid;
/*
* Because of errata in the UCCs, we have to write to the reserved
* registers to slow the clocks down.
@@ -105,13 +166,19 @@ int board_early_init_r(void)
0x00000050, 0x000000a0);
break;
}
+#endif
+
/* enable the PHY on the PIGGY */
setbits_8(&base->pgy_eth, 0x01);
/* enable the Unit LED (green) */
setbits_8(&base->oprth, WRL_BOOT);
- /* take FE/GbE PHYs out of reset */
- setbits_8(&base->prst, 0x1c);
+#if defined(CONFIG_SUVD3)
+ /* configure UPMA for APP1 */
+ upmconfig(UPMA, (uint *) upma_table,
+ sizeof(upma_table) / sizeof(uint));
+ out_be32(mxmr, CONFIG_SYS_MAMR);
+#endif
return 0;
}
@@ -185,12 +252,13 @@ phys_size_t initdram(int board_type)
#endif
/* return total bus SDRAM size(bytes) -- DDR */
- return (msize * 1024 * 1024);
+ return msize * 1024 * 1024;
}
int checkboard(void)
{
- puts("Board: Keymile kmeter1");
+ puts("Board: Keymile " CONFIG_KM_BOARD_NAME);
+
if (ethernet_present())
puts(" with PIGGY.");
puts("\n");
@@ -198,19 +266,9 @@ int checkboard(void)
}
#if defined(CONFIG_OF_BOARD_SETUP)
-/*
- * update property in the blob
- */
-void ft_blob_update(void *blob, bd_t *bd)
-{
- /* no board specific update */
-}
-
-
void ft_board_setup(void *blob, bd_t *bd)
{
- ft_cpu_setup (blob, bd);
- ft_blob_update (blob, bd);
+ ft_cpu_setup(blob, bd);
}
#endif