2 * Copyright (C) 2005 Sandburst Corporation
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,
28 #include "karef_version.h"
29 #include <timestamp.h>
30 #include <asm/processor.h>
32 #include <spd_sdram.h>
34 #include "../common/sb_common.h"
35 #include "../common/ppc440gx_i2c.h"
36 #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) || \
37 defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
41 void fpga_init (void);
43 KAREF_BOARD_ID_ST board_id_as[] =
45 {"Undefined"}, /* Not specified */
46 {"Kamino Reference Design"},
47 {"Reserved"}, /* Reserved for future use */
48 {"Reserved"}, /* Reserved for future use */
51 KAREF_BOARD_ID_ST ofem_board_id_as[] =
59 /*************************************************************************
62 * Setup chip selects, initialize the Opto-FPGA, initialize
63 * interrupt polarity and triggers.
64 ************************************************************************/
65 int board_early_init_f (void)
67 ppc440_gpio_regs_t *gpio_regs;
69 /* Enable GPIO interrupts */
70 mtsdr(sdr_pfc0, 0x00103E00);
72 /* Setup access for LEDs, and system topology info */
73 gpio_regs = (ppc440_gpio_regs_t *)CONFIG_SYS_GPIO_BASE;
74 gpio_regs->open_drain = SBCOMMON_GPIO_SYS_LEDS;
75 gpio_regs->tri_state = SBCOMMON_GPIO_DBGLEDS;
77 /* Turn on all the leds for now */
78 gpio_regs->out = SBCOMMON_GPIO_LEDS;
80 /*--------------------------------------------------------------------+
81 | Initialize EBC CONFIG
82 +-------------------------------------------------------------------*/
84 EBC_CFG_LE_UNLOCK | EBC_CFG_PTD_ENABLE |
85 EBC_CFG_RTC_64PERCLK | EBC_CFG_ATC_PREVIOUS |
86 EBC_CFG_DTC_PREVIOUS | EBC_CFG_CTC_PREVIOUS |
87 EBC_CFG_EMC_DEFAULT | EBC_CFG_PME_DISABLE |
90 /*--------------------------------------------------------------------+
91 | 1/2 MB FLASH. Initialize bank 0 with default values.
92 +-------------------------------------------------------------------*/
94 EBC_BXAP_BME_DISABLED | EBC_BXAP_TWT_ENCODE(8) |
95 EBC_BXAP_BCE_DISABLE | EBC_BXAP_CSN_ENCODE(1) |
96 EBC_BXAP_OEN_ENCODE(1)| EBC_BXAP_WBN_ENCODE(1) |
97 EBC_BXAP_WBF_ENCODE(1)| EBC_BXAP_TH_ENCODE(1) |
98 EBC_BXAP_RE_DISABLED | EBC_BXAP_BEM_WRITEONLY |
99 EBC_BXAP_PEN_DISABLED);
101 mtebc(pb0cr, EBC_BXCR_BAS_ENCODE(CONFIG_SYS_FLASH_BASE) |
102 EBC_BXCR_BS_1MB | EBC_BXCR_BU_RW | EBC_BXCR_BW_8BIT);
103 /*--------------------------------------------------------------------+
104 | 8KB NVRAM/RTC. Initialize bank 1 with default values.
105 +-------------------------------------------------------------------*/
107 EBC_BXAP_BME_DISABLED | EBC_BXAP_TWT_ENCODE(10) |
108 EBC_BXAP_BCE_DISABLE | EBC_BXAP_CSN_ENCODE(1) |
109 EBC_BXAP_OEN_ENCODE(1)| EBC_BXAP_WBN_ENCODE(1) |
110 EBC_BXAP_WBF_ENCODE(1)| EBC_BXAP_TH_ENCODE(1) |
111 EBC_BXAP_RE_DISABLED | EBC_BXAP_BEM_WRITEONLY |
112 EBC_BXAP_PEN_DISABLED);
114 mtebc(pb1cr, EBC_BXCR_BAS_ENCODE(0x48000000) |
115 EBC_BXCR_BS_1MB | EBC_BXCR_BU_RW | EBC_BXCR_BW_8BIT);
117 /*--------------------------------------------------------------------+
118 | Compact Flash, uses 2 Chip Selects (2 & 6)
119 +-------------------------------------------------------------------*/
121 EBC_BXAP_BME_DISABLED | EBC_BXAP_TWT_ENCODE(8) |
122 EBC_BXAP_BCE_DISABLE | EBC_BXAP_CSN_ENCODE(1) |
123 EBC_BXAP_OEN_ENCODE(1)| EBC_BXAP_WBN_ENCODE(1) |
124 EBC_BXAP_WBF_ENCODE(0)| EBC_BXAP_TH_ENCODE(1) |
125 EBC_BXAP_RE_DISABLED | EBC_BXAP_BEM_WRITEONLY |
126 EBC_BXAP_PEN_DISABLED);
128 mtebc(pb2cr, EBC_BXCR_BAS_ENCODE(0xF0000000) |
129 EBC_BXCR_BS_1MB | EBC_BXCR_BU_RW | EBC_BXCR_BW_16BIT);
131 /*--------------------------------------------------------------------+
132 | KaRef Scan FPGA. Initialize bank 3 with default values.
133 +-------------------------------------------------------------------*/
135 EBC_BXAP_RE_ENABLED | EBC_BXAP_SOR_NONDELAYED |
136 EBC_BXAP_BME_DISABLED | EBC_BXAP_TWT_ENCODE(3) |
137 EBC_BXAP_TH_ENCODE(1) | EBC_BXAP_WBF_ENCODE(0) |
138 EBC_BXAP_CSN_ENCODE(1) | EBC_BXAP_PEN_DISABLED |
139 EBC_BXAP_OEN_ENCODE(1) | EBC_BXAP_BEM_RW);
141 mtebc(pb5cr, EBC_BXCR_BAS_ENCODE(0x48200000) |
142 EBC_BXCR_BS_1MB | EBC_BXCR_BU_RW | EBC_BXCR_BW_32BIT);
144 /*--------------------------------------------------------------------+
145 | MAC A & B for Kamino. OFEM FPGA decodes the addresses
146 | Initialize bank 4 with default values.
147 +-------------------------------------------------------------------*/
149 EBC_BXAP_RE_ENABLED | EBC_BXAP_SOR_NONDELAYED |
150 EBC_BXAP_BME_DISABLED | EBC_BXAP_TWT_ENCODE(3) |
151 EBC_BXAP_TH_ENCODE(1) | EBC_BXAP_WBF_ENCODE(0) |
152 EBC_BXAP_CSN_ENCODE(1) | EBC_BXAP_PEN_DISABLED |
153 EBC_BXAP_OEN_ENCODE(1) | EBC_BXAP_BEM_RW);
155 mtebc(pb4cr, EBC_BXCR_BAS_ENCODE(0x48600000) |
156 EBC_BXCR_BS_2MB | EBC_BXCR_BU_RW | EBC_BXCR_BW_32BIT);
158 /*--------------------------------------------------------------------+
159 | OFEM FPGA Initialize bank 5 with default values.
160 +-------------------------------------------------------------------*/
162 EBC_BXAP_RE_ENABLED | EBC_BXAP_SOR_NONDELAYED |
163 EBC_BXAP_BME_DISABLED | EBC_BXAP_TWT_ENCODE(3) |
164 EBC_BXAP_TH_ENCODE(1) | EBC_BXAP_WBF_ENCODE(0) |
165 EBC_BXAP_CSN_ENCODE(1) | EBC_BXAP_PEN_DISABLED |
166 EBC_BXAP_OEN_ENCODE(1) | EBC_BXAP_BEM_RW);
169 mtebc(pb3cr, EBC_BXCR_BAS_ENCODE(0x48400000) |
170 EBC_BXCR_BS_1MB | EBC_BXCR_BU_RW | EBC_BXCR_BW_32BIT);
173 /*--------------------------------------------------------------------+
174 | Compact Flash, uses 2 Chip Selects (2 & 6)
175 +-------------------------------------------------------------------*/
177 EBC_BXAP_BME_DISABLED | EBC_BXAP_TWT_ENCODE(8) |
178 EBC_BXAP_BCE_DISABLE | EBC_BXAP_CSN_ENCODE(1) |
179 EBC_BXAP_OEN_ENCODE(1)| EBC_BXAP_WBN_ENCODE(1) |
180 EBC_BXAP_WBF_ENCODE(0)| EBC_BXAP_TH_ENCODE(1) |
181 EBC_BXAP_RE_DISABLED | EBC_BXAP_BEM_WRITEONLY |
182 EBC_BXAP_PEN_DISABLED);
184 mtebc(pb6cr, EBC_BXCR_BAS_ENCODE(0xF0100000) |
185 EBC_BXCR_BS_1MB | EBC_BXCR_BU_RW | EBC_BXCR_BW_16BIT);
187 /*--------------------------------------------------------------------+
188 | BME-32. Initialize bank 7 with default values.
189 +-------------------------------------------------------------------*/
191 EBC_BXAP_RE_ENABLED | EBC_BXAP_SOR_NONDELAYED |
192 EBC_BXAP_BME_DISABLED | EBC_BXAP_TWT_ENCODE(3) |
193 EBC_BXAP_TH_ENCODE(1) | EBC_BXAP_WBF_ENCODE(0) |
194 EBC_BXAP_CSN_ENCODE(1) | EBC_BXAP_PEN_DISABLED |
195 EBC_BXAP_OEN_ENCODE(1) | EBC_BXAP_BEM_RW);
197 mtebc(pb7cr, EBC_BXCR_BAS_ENCODE(0x48500000) |
198 EBC_BXCR_BS_1MB | EBC_BXCR_BU_RW | EBC_BXCR_BW_32BIT);
200 /*--------------------------------------------------------------------+
201 * Setup the interrupt controller polarities, triggers, etc.
202 +-------------------------------------------------------------------*/
204 * Because of the interrupt handling rework to handle 440GX interrupts
205 * with the common code, we needed to change names of the UIC registers.
206 * Here the new relationship:
208 * U-Boot name 440GX name
209 * -----------------------
215 mtdcr (uic1sr, 0xffffffff); /* clear all */
216 mtdcr (uic1er, 0x00000000); /* disable all */
217 mtdcr (uic1cr, 0x00000000); /* all non- critical */
218 mtdcr (uic1pr, 0xfffffe03); /* polarity */
219 mtdcr (uic1tr, 0x01c00000); /* trigger edge vs level */
220 mtdcr (uic1vr, 0x00000001); /* int31 highest, base=0x000 */
221 mtdcr (uic1sr, 0xffffffff); /* clear all */
223 mtdcr (uic2sr, 0xffffffff); /* clear all */
224 mtdcr (uic2er, 0x00000000); /* disable all */
225 mtdcr (uic2cr, 0x00000000); /* all non-critical */
226 mtdcr (uic2pr, 0xffffc8ff); /* polarity */
227 mtdcr (uic2tr, 0x00ff0000); /* trigger edge vs level */
228 mtdcr (uic2vr, 0x00000001); /* int31 highest, base=0x000 */
229 mtdcr (uic2sr, 0xffffffff); /* clear all */
231 mtdcr (uic3sr, 0xffffffff); /* clear all */
232 mtdcr (uic3er, 0x00000000); /* disable all */
233 mtdcr (uic3cr, 0x00000000); /* all non-critical */
234 mtdcr (uic3pr, 0xffff83ff); /* polarity */
235 mtdcr (uic3tr, 0x00ff8c0f); /* trigger edge vs level */
236 mtdcr (uic3vr, 0x00000001); /* int31 highest, base=0x000 */
237 mtdcr (uic3sr, 0xffffffff); /* clear all */
239 mtdcr (uic0sr, 0xfc000000); /* clear all */
240 mtdcr (uic0er, 0x00000000); /* disable all */
241 mtdcr (uic0cr, 0x00000000); /* all non-critical */
242 mtdcr (uic0pr, 0xfc000000);
243 mtdcr (uic0tr, 0x00000000);
244 mtdcr (uic0vr, 0x00000001);
252 /*************************************************************************
255 * Dump pertinent info to the console
256 ************************************************************************/
257 int checkboard (void)
260 unsigned char brd_rev, brd_id;
261 unsigned short sernum;
262 unsigned char scan_rev, scan_id, ofem_rev=0, ofem_id=0;
263 unsigned char ofem_brd_rev, ofem_brd_id;
264 KAREF_FPGA_REGS_ST *karef_ps;
265 OFEM_FPGA_REGS_ST *ofem_ps;
267 karef_ps = (KAREF_FPGA_REGS_ST *)CONFIG_SYS_KAREF_FPGA_BASE;
268 ofem_ps = (OFEM_FPGA_REGS_ST *)CONFIG_SYS_OFEM_FPGA_BASE;
270 scan_id = (unsigned char)((karef_ps->revision_ul &
271 SAND_HAL_KA_SC_SCAN_REVISION_IDENTIFICATION_MASK)
272 >> SAND_HAL_KA_SC_SCAN_REVISION_IDENTIFICATION_SHIFT);
274 scan_rev = (unsigned char)((karef_ps->revision_ul & SAND_HAL_KA_SC_SCAN_REVISION_REVISION_MASK)
275 >> SAND_HAL_KA_SC_SCAN_REVISION_REVISION_SHIFT);
277 brd_rev = (unsigned char)((karef_ps->boardinfo_ul & SAND_HAL_KA_SC_SCAN_BRD_INFO_BRD_REV_MASK)
278 >> SAND_HAL_KA_SC_SCAN_BRD_INFO_BRD_REV_SHIFT);
280 brd_id = (unsigned char)((karef_ps->boardinfo_ul & SAND_HAL_KA_SC_SCAN_BRD_INFO_BRD_ID_MASK)
281 >> SAND_HAL_KA_SC_SCAN_BRD_INFO_BRD_ID_SHIFT);
283 ofem_brd_id = (unsigned char)((karef_ps->boardinfo_ul & SAND_HAL_KA_SC_SCAN_BRD_INFO_FEM_ID_MASK)
284 >> SAND_HAL_KA_SC_SCAN_BRD_INFO_FEM_ID_SHIFT);
286 ofem_brd_rev = (unsigned char)((karef_ps->boardinfo_ul & SAND_HAL_KA_SC_SCAN_BRD_INFO_FEM_REV_MASK)
287 >> SAND_HAL_KA_SC_SCAN_BRD_INFO_FEM_REV_SHIFT);
289 if (0xF != ofem_brd_id) {
290 ofem_id = (unsigned char)((ofem_ps->revision_ul &
291 SAND_HAL_KA_OF_OFEM_REVISION_IDENTIFICATION_MASK)
292 >> SAND_HAL_KA_OF_OFEM_REVISION_IDENTIFICATION_SHIFT);
294 ofem_rev = (unsigned char)((ofem_ps->revision_ul &
295 SAND_HAL_KA_OF_OFEM_REVISION_REVISION_MASK)
296 >> SAND_HAL_KA_OF_OFEM_REVISION_REVISION_SHIFT);
299 get_sys_info (&sysinfo);
301 sernum = sbcommon_get_serial_number();
303 printf ("Board: Sandburst Corporation Kamino Reference Design "
304 "Serial Number: %d\n", sernum);
305 printf ("%s\n", KAREF_U_BOOT_REL_STR);
307 printf ("Built %s %s by %s\n", U_BOOT_DATE, U_BOOT_TIME, BUILDUSER);
308 if (sbcommon_get_master()) {
309 printf("Slot 0 - Master\nSlave board");
310 if (sbcommon_secondary_present())
311 printf(" present\n");
313 printf(" not detected\n");
315 printf("Slot 1 - Slave\n\n");
318 printf ("ScanFPGA ID:\t0x%02X\tRev: 0x%02X\n", scan_id, scan_rev);
319 printf ("Board Rev:\t0x%02X\tID: 0x%02X\n", brd_rev, brd_id);
320 if(0xF != ofem_brd_id) {
321 printf("OFemFPGA ID:\t0x%02X\tRev: 0x%02X\n", ofem_id, ofem_rev);
322 printf("OFEM Board Rev:\t0x%02X\tID: 0x%02X\n", ofem_brd_id, ofem_brd_rev);
325 /* Fix the ack in the bme 32 */
327 out32(CONFIG_SYS_BME32_BASE + 0x0000000C, 0x00000001);
334 /*************************************************************************
337 * Initialize I2C bus one to gain access to the fans
338 ************************************************************************/
339 int misc_init_f (void)
341 /* Turn on i2c bus 1 */
343 i2c1_init (CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
346 /* Turn on fans 3 & 4 */
352 /*************************************************************************
356 ************************************************************************/
357 int misc_init_r (void)
359 unsigned short sernum;
362 KAREF_FPGA_REGS_ST *karef_ps;
363 OFEM_FPGA_REGS_ST *ofem_ps;
365 if(NULL != getenv("secondserial")) {
366 puts("secondserial is set, switching to second serial port\n");
367 setenv("stderr", "serial1");
368 setenv("stdout", "serial1");
369 setenv("stdin", "serial1");
372 setenv("ubrelver", KAREF_U_BOOT_REL_STR);
374 memset(envstr, 0, 255);
375 sprintf (envstr, "Built %s %s by %s",
376 U_BOOT_DATE, U_BOOT_TIME, BUILDUSER);
377 setenv("bldstr", envstr);
380 if( getenv("autorecover")) {
381 setenv("autorecover", NULL);
383 sernum = sbcommon_get_serial_number();
385 printf("\nSetting up environment for automatic filesystem recovery\n");
387 * Setup default bootargs
389 memset(envstr, 0, 255);
391 sprintf(envstr, "console=ttyS0,9600 root=/dev/ram0 "
392 "rw ip=10.100.70.%d:::255.255.0.0:karef%d:eth0:none idebus=33",
394 setenv("bootargs", envstr);
397 * Setup Default boot command
399 setenv("bootcmd", "fatload ide 0 8000000 uimage.karef;"
400 "fatload ide 0 8100000 pramdisk;"
401 "bootm 8000000 8100000");
403 printf("Done. Please type allow the system to continue to boot\n");
406 if( getenv("fakeled")) {
407 karef_ps = (KAREF_FPGA_REGS_ST *)CONFIG_SYS_KAREF_FPGA_BASE;
408 ofem_ps = (OFEM_FPGA_REGS_ST *)CONFIG_SYS_OFEM_FPGA_BASE;
409 ofem_ps->control_ul &= ~SAND_HAL_KA_SC_SCAN_CNTL_FAULT_LED_MASK;
410 karef_ps->control_ul &= ~SAND_HAL_KA_OF_OFEM_CNTL_FAULT_LED_MASK;
411 setenv("bootdelay", "-1");
413 printf("fakeled is set. use 'setenv fakeled ; setenv bootdelay 5 ; saveenv' to recover\n");
416 #ifdef CONFIG_HAS_ETH0
417 if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
418 board_get_enetaddr(0, enetaddr);
419 eth_setenv_enetaddr("ethaddr", enetaddr);
423 #ifdef CONFIG_HAS_ETH1
424 if (!eth_getenv_enetaddr("eth1addr", enetaddr)) {
425 board_get_enetaddr(1, enetaddr);
426 eth_setenv_enetaddr("eth1addr", enetaddr);
430 #ifdef CONFIG_HAS_ETH2
431 if (!eth_getenv_enetaddr("eth2addr", enetaddr)) {
432 board_get_enetaddr(2, enetaddr);
433 eth_setenv_enetaddr("eth2addr", enetaddr);
437 #ifdef CONFIG_HAS_ETH3
438 if (!eth_getenv_enetaddr("eth3addr", enetaddr)) {
439 board_get_enetaddr(3, enetaddr);
440 eth_setenv_enetaddr("eth3addr", enetaddr);
447 /*************************************************************************
449 ************************************************************************/
450 #ifdef CONFIG_IDE_RESET
451 void ide_set_reset(int on)
453 KAREF_FPGA_REGS_ST *karef_ps;
454 /* TODO: ide reset */
455 karef_ps = (KAREF_FPGA_REGS_ST *)CONFIG_SYS_KAREF_FPGA_BASE;
458 karef_ps->reset_ul &= ~SAND_HAL_KA_SC_SCAN_RESET_CF_RESET_N_MASK;
460 karef_ps->reset_ul |= SAND_HAL_KA_SC_SCAN_RESET_CF_RESET_N_MASK;
463 #endif /* CONFIG_IDE_RESET */
465 /*************************************************************************
467 ************************************************************************/
470 KAREF_FPGA_REGS_ST *karef_ps;
471 OFEM_FPGA_REGS_ST *ofem_ps;
472 unsigned char ofem_id;
475 /* Ensure we have power all around */
478 karef_ps = (KAREF_FPGA_REGS_ST *)CONFIG_SYS_KAREF_FPGA_BASE;
480 SAND_HAL_KA_SC_SCAN_RESET_CF_RESET_N_MASK |
481 SAND_HAL_KA_SC_SCAN_RESET_BME_RESET_N_MASK |
482 SAND_HAL_KA_SC_SCAN_RESET_KA_RESET_N_MASK |
483 SAND_HAL_KA_SC_SCAN_RESET_SLAVE_RESET_N_MASK |
484 SAND_HAL_KA_SC_SCAN_RESET_OFEM_RESET_N_MASK |
485 SAND_HAL_KA_SC_SCAN_RESET_IFE_A_RESET_N_MASK |
486 SAND_HAL_KA_SC_SCAN_RESET_I2C_MUX1_RESET_N_MASK |
487 SAND_HAL_KA_SC_SCAN_RESET_PHY0_RESET_N_MASK |
488 SAND_HAL_KA_SC_SCAN_RESET_PHY1_RESET_N_MASK;
490 karef_ps->reset_ul = tmp;
493 * Wait a bit to allow the ofem fpga to get its brains
498 * Check to see if the ofem is there
500 ofem_id = (unsigned char)((karef_ps->boardinfo_ul & SAND_HAL_KA_SC_SCAN_BRD_INFO_FEM_ID_MASK)
501 >> SAND_HAL_KA_SC_SCAN_BRD_INFO_FEM_ID_SHIFT);
504 SAND_HAL_KA_OF_OFEM_RESET_I2C_MUX0_RESET_N_MASK |
505 SAND_HAL_KA_OF_OFEM_RESET_LOCH0_RESET_N_MASK |
506 SAND_HAL_KA_OF_OFEM_RESET_MAC0_RESET_N_MASK;
508 ofem_ps = (OFEM_FPGA_REGS_ST *)CONFIG_SYS_OFEM_FPGA_BASE;
509 ofem_ps->reset_ul = tmp;
511 ofem_ps->control_ul |= 1 < SAND_HAL_KA_OF_OFEM_CNTL_FAULT_LED_SHIFT;
514 karef_ps->control_ul |= 1 << SAND_HAL_KA_SC_SCAN_CNTL_FAULT_LED_SHIFT;
521 int karefSetupVars(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
523 unsigned short sernum;
526 sernum = sbcommon_get_serial_number();
528 memset(envstr, 0, 255);
530 * Setup our ip address
532 sprintf(envstr, "10.100.70.%d", sernum);
534 setenv("ipaddr", envstr);
536 * Setup the host ip address
538 setenv("serverip", "10.100.17.10");
541 * Setup default bootargs
543 memset(envstr, 0, 255);
545 sprintf(envstr, "console=ttyS0,9600 root=/dev/nfs "
546 "rw nfsroot=10.100.17.10:/home/metrobox/mbc70.%d "
547 "nfsaddrs=10.100.70.%d:10.100.17.10:10.100.1.1:"
548 "255.255.0.0:karef%d.sandburst.com:eth0:none idebus=33",
549 sernum, sernum, sernum);
551 setenv("bootargs_nfs", envstr);
552 setenv("bootargs", envstr);
557 memset(envstr, 0, 255);
559 sprintf(envstr, "console=ttyS0,9600 root=/dev/hda2 "
560 "rw ip=10.100.70.%d:::255.255.0.0:karef%d:eth0:none idebus=33",
563 setenv("bootargs_cf", envstr);
566 * Setup Default boot command
568 setenv("bootcmd_tftp", "tftp 8000000 uImage.karef;bootm 8000000");
569 setenv("bootcmd", "tftp 8000000 uImage.karef;bootm 8000000");
572 * Setup compact flash boot command
574 setenv("bootcmd_cf", "fatload ide 0 8000000 uimage.karef;bootm 8000000");
581 int karefRecover(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
583 unsigned short sernum;
586 sernum = sbcommon_get_serial_number();
588 printf("\nSetting up environment for filesystem recovery\n");
590 * Setup default bootargs
592 memset(envstr, 0, 255);
594 sprintf(envstr, "console=ttyS0,9600 root=/dev/ram0 "
595 "rw ip=10.100.70.%d:::255.255.0.0:karef%d:eth0:none",
597 setenv("bootargs", envstr);
600 * Setup Default boot command
603 setenv("bootcmd", "fatload ide 0 8000000 uimage.karef;"
604 "fatload ide 0 8100000 pramdisk;"
605 "bootm 8000000 8100000");
607 printf("Done. Please type boot<cr>.\nWhen the kernel has booted"
608 " please type fsrecover.sh<cr>\n");
613 U_BOOT_CMD(kasetup, 1, 1, karefSetupVars,
614 "Set environment to factory defaults", "");
616 U_BOOT_CMD(karecover, 1, 1, karefRecover,
617 "Set environment to allow for fs recovery", "");