]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/eltec/elppc/elppc.c
2 * (C) Copyright 2002 ELTEC Elektronik AG
3 * Frank Gottschling <fgottschling@eltec.de>
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 DECLARE_GLOBAL_DATA_PTR
;
32 /* ------------------------------------------------------------------------- */
36 puts ("Board: ELTEC PowerPC\n");
40 /* ------------------------------------------------------------------------- */
45 printf ("Test not implemented !\n");
49 /* ------------------------------------------------------------------------- */
51 static unsigned int mpc106_read_cfg_dword (unsigned int reg
)
53 unsigned int reg_addr
= MPC106_REG
| (reg
& 0xFFFFFFFC);
55 out32r (MPC106_REG_ADDR
, reg_addr
);
57 return (in32r (MPC106_REG_DATA
| (reg
& 0x3)));
60 /* ------------------------------------------------------------------------- */
62 long int dram_size (int board_type
)
65 * No actual initialisation to do - done when setting up
66 * PICRs MCCRs ME/SARs etc in asm_init.S.
69 register unsigned long i
, msar1
, mear1
, memSize
;
71 #if defined(CONFIG_SYS_MEMTEST)
72 register unsigned long reg
;
74 printf ("Testing DRAM\n");
76 /* write each mem addr with it's address */
77 for (reg
= CONFIG_SYS_MEMTEST_START
; reg
< CONFIG_SYS_MEMTEST_END
; reg
+= 4)
80 for (reg
= CONFIG_SYS_MEMTEST_START
; reg
< CONFIG_SYS_MEMTEST_END
; reg
+= 4) {
87 * Since MPC107 memory controller chip has already been set to
88 * control all memory, just read and interpret its memory boundery register.
91 msar1
= mpc106_read_cfg_dword (MPC106_MSAR1
);
92 mear1
= mpc106_read_cfg_dword (MPC106_MEAR1
);
93 i
= mpc106_read_cfg_dword (MPC106_MBER
) & 0xf;
96 if (i
& 0x01) /* is bank enabled ? */
97 memSize
+= (mear1
& 0xff) - (msar1
& 0xff) + 1;
103 return (memSize
* 0x100000);
106 /* ------------------------------------------------------------------------- */
108 phys_size_t
initdram (int board_type
)
110 return dram_size (board_type
);
113 /* ------------------------------------------------------------------------- */
116 * The BAB 911 can be reset by writing bit 0 of the Processor Initialization
117 * Register PI in the MPC 107 (at offset 0x41090 of the Embedded Utilities
120 int do_reset (cmd_tbl_t
* cmdtp
, int flag
, int argc
, char *argv
[])
122 out8 (MPC107_EUMB_PI
, 1);
126 /* ------------------------------------------------------------------------- */
128 #if defined(CONFIG_WATCHDOG)
131 * Since the 7xx CPUs don't have an internal watchdog, this function is
134 void watchdog_reset (void)
137 #endif /* CONFIG_WATCHDOG */
139 /* ------------------------------------------------------------------------- */
141 void after_reloc (ulong dest_addr
)
144 * Jump to the main U-Boot board init code
146 board_init_r ((gd_t
*)gd
, dest_addr
);
149 /* ------------------------------------------------------------------------- */
151 #ifdef CONFIG_CONSOLE_EXTRA_INFO
152 extern GraphicDevice smi
;
154 void video_get_info_str (int line_number
, char *info
)
156 /* init video info strings for graphic console */
157 switch (line_number
) {
159 sprintf (info
, " MPC7xx V%d.%d at %d / %d MHz",
160 (get_pvr () >> 8) & 0xFF, get_pvr () & 0xFF, 400, 100);
163 sprintf (info
, " ELTEC ELPPC with %ld MB DRAM and %ld MB FLASH",
164 dram_size (0) / 0x100000, flash_init () / 0x100000);
167 sprintf (info
, " %s", smi
.modeIdent
);
171 /* no more info lines */
177 int board_eth_init(bd_t
*bis
)
179 return pci_eth_init(bis
);