2 * (C) Copyright 2002 ELTEC Elektronik AG
3 * Frank Gottschling <fgottschling@eltec.de>
5 * SPDX-License-Identifier: GPL-2.0+
14 DECLARE_GLOBAL_DATA_PTR;
16 /* ------------------------------------------------------------------------- */
20 puts ("Board: ELTEC PowerPC\n");
24 /* ------------------------------------------------------------------------- */
29 printf ("Test not implemented !\n");
33 /* ------------------------------------------------------------------------- */
35 static unsigned int mpc106_read_cfg_dword (unsigned int reg)
37 unsigned int reg_addr = MPC106_REG | (reg & 0xFFFFFFFC);
39 out32r (MPC106_REG_ADDR, reg_addr);
41 return (in32r (MPC106_REG_DATA | (reg & 0x3)));
44 /* ------------------------------------------------------------------------- */
46 long int dram_size (int board_type)
49 * No actual initialisation to do - done when setting up
50 * PICRs MCCRs ME/SARs etc in asm_init.S.
53 register unsigned long i, msar1, mear1, memSize;
55 #if defined(CONFIG_SYS_MEMTEST)
56 register unsigned long reg;
58 printf ("Testing DRAM\n");
60 /* write each mem addr with it's address */
61 for (reg = CONFIG_SYS_MEMTEST_START; reg < CONFIG_SYS_MEMTEST_END; reg += 4)
64 for (reg = CONFIG_SYS_MEMTEST_START; reg < CONFIG_SYS_MEMTEST_END; reg += 4) {
71 * Since MPC107 memory controller chip has already been set to
72 * control all memory, just read and interpret its memory boundery register.
75 msar1 = mpc106_read_cfg_dword (MPC106_MSAR1);
76 mear1 = mpc106_read_cfg_dword (MPC106_MEAR1);
77 i = mpc106_read_cfg_dword (MPC106_MBER) & 0xf;
80 if (i & 0x01) /* is bank enabled ? */
81 memSize += (mear1 & 0xff) - (msar1 & 0xff) + 1;
87 return (memSize * 0x100000);
90 /* ------------------------------------------------------------------------- */
92 phys_size_t initdram (int board_type)
94 return dram_size (board_type);
97 /* ------------------------------------------------------------------------- */
100 * The BAB 911 can be reset by writing bit 0 of the Processor Initialization
101 * Register PI in the MPC 107 (at offset 0x41090 of the Embedded Utilities
104 int do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
106 out8 (MPC107_EUMB_PI, 1);
110 /* ------------------------------------------------------------------------- */
112 #if defined(CONFIG_WATCHDOG)
115 * Since the 7xx CPUs don't have an internal watchdog, this function is
118 void watchdog_reset (void)
121 #endif /* CONFIG_WATCHDOG */
123 /* ------------------------------------------------------------------------- */
125 void after_reloc (ulong dest_addr)
128 * Jump to the main U-Boot board init code
130 board_init_r ((gd_t *)gd, dest_addr);
133 /* ------------------------------------------------------------------------- */
135 #ifdef CONFIG_CONSOLE_EXTRA_INFO
136 extern GraphicDevice smi;
138 void video_get_info_str (int line_number, char *info)
140 /* init video info strings for graphic console */
141 switch (line_number) {
143 sprintf (info, " MPC7xx V%d.%d at %d / %d MHz",
144 (get_pvr () >> 8) & 0xFF, get_pvr () & 0xFF, 400, 100);
147 sprintf (info, " ELTEC ELPPC with %ld MB DRAM and %ld MB FLASH",
148 dram_size (0) / 0x100000, flash_init () / 0x100000);
151 sprintf (info, " %s", smi.modeIdent);
155 /* no more info lines */
161 int board_eth_init(bd_t *bis)
163 return pci_eth_init(bis);