summaryrefslogtreecommitdiff
path: root/board/ep8260/ep8260.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-02-12 00:47:09 +0000
committerwdenk <wdenk>2004-02-12 00:47:09 +0000
commitbf9e3b38f77c2eac620263dd60437c6ec47a27bf (patch)
treed03891090553d167f3eb08d7f9c3f2532e43fcc2 /board/ep8260/ep8260.c
parenta2d18bb7d31e7b971386fef505ff0218f3b6e893 (diff)
downloadu-boot-bf9e3b38f77c2eac620263dd60437c6ec47a27bf.tar.gz
* Some code cleanup
* Patch by Josef Baumgartner, 10 Feb 2004: Fixes for Coldfire port * Patch by Brad Kemp, 11 Feb 2004: Fix CFI flash driver problems
Diffstat (limited to 'board/ep8260/ep8260.c')
-rw-r--r--board/ep8260/ep8260.c55
1 files changed, 31 insertions, 24 deletions
diff --git a/board/ep8260/ep8260.c b/board/ep8260/ep8260.c
index 7a2c23f9f7..fb4d325b4e 100644
--- a/board/ep8260/ep8260.c
+++ b/board/ep8260/ep8260.c
@@ -190,21 +190,22 @@ const iop_conf_t iop_conf_tab[4][32] = {
*/
int board_early_init_f (void)
{
- volatile t_ep_regs *regs = (t_ep_regs*)CFG_REGS_BASE;
- volatile immap_t *immap = (immap_t *)CFG_IMMR;
- volatile memctl8260_t *memctl = &immap->im_memctl;
- memctl->memc_br4 = CFG_BR4_PRELIM;
- memctl->memc_or4 = CFG_OR4_PRELIM;
- regs->bcsr1 = 0x62; /* to enable terminal on SMC1 */
- regs->bcsr2 = 0x30; /* enable NVRAM and writing FLASH */
- return 0;
+ volatile t_ep_regs *regs = (t_ep_regs *) CFG_REGS_BASE;
+ volatile immap_t *immap = (immap_t *) CFG_IMMR;
+ volatile memctl8260_t *memctl = &immap->im_memctl;
+
+ memctl->memc_br4 = CFG_BR4_PRELIM;
+ memctl->memc_or4 = CFG_OR4_PRELIM;
+ regs->bcsr1 = 0x62; /* to enable terminal on SMC1 */
+ regs->bcsr2 = 0x30; /* enable NVRAM and writing FLASH */
+ return 0;
}
-void
-reset_phy(void)
+void reset_phy (void)
{
- volatile t_ep_regs *regs = (t_ep_regs*)CFG_REGS_BASE;
- regs->bcsr4 = 0xC0;
+ volatile t_ep_regs *regs = (t_ep_regs *) CFG_REGS_BASE;
+
+ regs->bcsr4 = 0xC0;
}
/*
@@ -213,15 +214,21 @@ reset_phy(void)
* Thats why its a static interpretation ...
*/
-int
-checkboard(void)
+int checkboard (void)
{
- volatile t_ep_regs *regs = (t_ep_regs*)CFG_REGS_BASE;
- uint major=0, minor=0;
+ volatile t_ep_regs *regs = (t_ep_regs *) CFG_REGS_BASE;
+ uint major = 0, minor = 0;
+
switch (regs->bcsr0) {
- case 0x02: major = 1; break;
- case 0x03: major = 1; minor = 1; break;
- default: break;
+ case 0x02:
+ major = 1;
+ break;
+ case 0x03:
+ major = 1;
+ minor = 1;
+ break;
+ default:
+ break;
}
printf ("Board: Embedded Planet EP8260, Revision %d.%d\n",
major, minor);
@@ -232,13 +239,13 @@ checkboard(void)
/* ------------------------------------------------------------------------- */
-long int
-initdram(int board_type)
+long int initdram (int board_type)
{
- volatile immap_t *immap = (immap_t *)CFG_IMMR;
+ volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8260_t *memctl = &immap->im_memctl;
volatile uchar c = 0;
- volatile uchar *ramaddr = (uchar *)(CFG_SDRAM_BASE) + 0x110;
+ volatile uchar *ramaddr = (uchar *) (CFG_SDRAM_BASE) + 0x110;
+
/*
ulong psdmr = CFG_PSDMR;
#ifdef CFG_LSDRAM
@@ -288,7 +295,7 @@ initdram(int board_type)
#ifndef CFG_RAMBOOT
#ifdef CFG_LSDRAM
size += CFG_SDRAM1_SIZE;
- ramaddr = (uchar *)(CFG_SDRAM1_BASE) + 0x8c;
+ ramaddr = (uchar *) (CFG_SDRAM1_BASE) + 0x8c;
memctl->memc_lsrt = CFG_LSRT;
memctl->memc_lsdmr = (ulong) CFG_LSDMR | PSDMR_OP_PREA;