blob: 0cad897349279d1582ed245e840f3849f762cc2c [file] [log] [blame]
Heiko Schocherf5e0d032006-06-19 11:02:41 +02001/*
2 * ppmc7xx.c
3 * ---------
Wolfgang Denkb87dfd22006-07-19 13:50:38 +02004 *
Heiko Schocherf5e0d032006-06-19 11:02:41 +02005 * Main board-specific routines for Wind River PPMC 7xx/74xx board.
Wolfgang Denkb87dfd22006-07-19 13:50:38 +02006 *
Heiko Schocherf5e0d032006-06-19 11:02:41 +02007 * By Richard Danter (richard.danter@windriver.com)
8 * Copyright (C) 2005 Wind River Systems
9 */
10
11#include <common.h>
12#include <command.h>
Ben Warren10efa022008-08-31 20:37:00 -070013#include <netdev.h>
Heiko Schocherf5e0d032006-06-19 11:02:41 +020014
15
16/* Define some MPC107 (memory controller) registers */
17#define MPC107_EUMB_GCR 0xfce41020
18#define MPC107_EUMB_IACKR 0xfce600a0
19
20
21/* Function prototypes */
22extern void unlock_ram_in_cache( void );
23extern void _start_warm(void);
24
25
26/*
27 * initdram()
Wolfgang Denkb87dfd22006-07-19 13:50:38 +020028 *
Heiko Schocherf5e0d032006-06-19 11:02:41 +020029 * This function normally initialises the (S)DRAM of the system. For this board
30 * the SDRAM was already initialised by board_asm_init (see init.S) so we just
31 * return the size of RAM.
32 */
Becky Bruce9973e3c2008-06-09 16:03:40 -050033phys_size_t initdram( int board_type )
Heiko Schocherf5e0d032006-06-19 11:02:41 +020034{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020035 return CONFIG_SYS_SDRAM_SIZE;
Heiko Schocherf5e0d032006-06-19 11:02:41 +020036}
37
38
39/*
40 * after_reloc()
Wolfgang Denkb87dfd22006-07-19 13:50:38 +020041 *
Heiko Schocherf5e0d032006-06-19 11:02:41 +020042 * This is called after U-Boot has been copied from Flash/ROM to RAM. It gives
43 * us an opportunity to do some additional setup before the rest of the system
44 * is initialised. We don't need to do anything, so we just call board_init_r()
45 * which should never return.
Wolfgang Denkb87dfd22006-07-19 13:50:38 +020046 */
Heiko Schocherf5e0d032006-06-19 11:02:41 +020047void after_reloc( ulong dest_addr, gd_t* gd )
48{
49 /* Jump to the main U-Boot board init code */
50 board_init_r( gd, dest_addr );
51}
52
53
54/*
55 * checkboard()
Wolfgang Denkb87dfd22006-07-19 13:50:38 +020056 *
Heiko Schocherf5e0d032006-06-19 11:02:41 +020057 * We could do some board level checks here, such as working out what version
58 * it is, but for this board we simply display it's name (on the console).
59 */
60int checkboard( void )
61{
62 puts( "Board: Wind River PPMC 7xx/74xx\n" );
63 return 0;
64}
65
66
67/*
68 * misc_init_r
Wolfgang Denkb87dfd22006-07-19 13:50:38 +020069 *
Heiko Schocherf5e0d032006-06-19 11:02:41 +020070 * Used for other setup which needs to be done late in the bring-up phase.
71 */
72int misc_init_r( void )
73{
74 /* Reset the EPIC and clear pending interrupts */
75 out32r(MPC107_EUMB_GCR, 0xa0000000);
76 while( in32r( MPC107_EUMB_GCR ) & 0x80000000 );
77 out32r( MPC107_EUMB_GCR, 0x20000000 );
78 while( in32r( MPC107_EUMB_IACKR ) != 0xff );
79
80 /* Enable the I-Cache */
81 icache_enable();
Wolfgang Denkb87dfd22006-07-19 13:50:38 +020082
Heiko Schocherf5e0d032006-06-19 11:02:41 +020083 return 0;
84}
85
86
87/*
88 * do_reset()
Wolfgang Denkb87dfd22006-07-19 13:50:38 +020089 *
Heiko Schocherf5e0d032006-06-19 11:02:41 +020090 * Shell command to reset the board.
91 */
Wolfgang Denk54841ab2010-06-28 22:00:46 +020092void do_reset( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] )
Heiko Schocherf5e0d032006-06-19 11:02:41 +020093{
94 printf( "Resetting...\n" );
Wolfgang Denkb87dfd22006-07-19 13:50:38 +020095
Heiko Schocherf5e0d032006-06-19 11:02:41 +020096 /* Disabe and invalidate cache */
97 icache_disable();
98 dcache_disable();
99
100 /* Jump to warm start (in RAM) */
101 _start_warm();
Wolfgang Denkb87dfd22006-07-19 13:50:38 +0200102
Heiko Schocherf5e0d032006-06-19 11:02:41 +0200103 /* Should never get here */
104 while(1);
105}
Ben Warren10efa022008-08-31 20:37:00 -0700106
107int board_eth_init(bd_t *bis)
108{
109 return pci_eth_init(bis);
110}