int misc_init_r(void) { char *str; int mach_type; str = getenv("mach_type"); if (str != NULL) { mach_type = simple_strtoul(str, NULL, 10); printf("Overwriting MACH_TYPE with %d!!!\n", mach_type); gd->bd->bi_arch_number = mach_type; } #if defined(CONFIG_KM_MGCOGE3UN) char *wait_for_ne; wait_for_ne = getenv("waitforne"); if (wait_for_ne != NULL) { if (strcmp(wait_for_ne, "true") == 0) { int cnt = 0; int abort = 0; puts("NE go: "); while (startup_allowed() == 0) { if (tstc()) { (void) getc(); /* consume input */ abort = 1; break; } udelay(200000); cnt++; if (cnt == 5) puts("wait\b\b\b\b"); if (cnt == 10) { cnt = 0; puts(" \b\b\b\b"); } } if (abort == 1) printf("\nAbort waiting for ne\n"); else puts("OK\n"); } } #endif initialize_unit_leds(); set_km_env(); #if defined(CONFIG_BOOTCOUNT_LIMIT) set_bootcount_addr(); #endif return 0; }
int last_stage_init(void) { #if defined(CONFIG_KMVECT1) struct km_bec_fpga __iomem *base = (struct km_bec_fpga __iomem *)CONFIG_SYS_KMBEC_FPGA_BASE; u8 tmp_reg; /* Release mv88e6122 from reset */ tmp_reg = in_8(&base->res1[0]) | 0x10; /* DIRECT3 register */ out_8(&base->res1[0], tmp_reg); /* GP28 as output */ tmp_reg = in_8(&base->gprt3) | 0x10; /* GP28 to high */ out_8(&base->gprt3, tmp_reg); /* configure MV88E6122 switch */ char *name = "UEC2"; if (miiphy_set_current_dev(name)) return 0; mv88e_sw_program(name, CONFIG_KM_MVEXTSW_ADDR, extsw_conf, ARRAY_SIZE(extsw_conf)); mv88e_sw_reset(name, CONFIG_KM_MVEXTSW_ADDR); if (piggy_present()) { setenv("ethact", "UEC2"); setenv("netdev", "eth1"); puts("using PIGGY for network boot\n"); } else { setenv("netdev", "eth0"); puts("using frontport for network boot\n"); } #endif #if defined(CONFIG_KMCOGE5NE) struct bfticu_iomap *base = (struct bfticu_iomap *)CONFIG_SYS_BFTIC3_BASE; u8 dip_switch = in_8((u8 *)&(base->mswitch)) & BFTICU_DIPSWITCH_MASK; if (dip_switch != 0) { /* start bootloader */ puts("DIP: Enabled\n"); setenv("actual_bank", "0"); } #endif set_km_env(); return 0; }
int last_stage_init(void) { #if defined(CONFIG_KMCOGE5NE) struct bfticu_iomap *base = (struct bfticu_iomap *)CONFIG_SYS_BFTIC3_BASE; u8 dip_switch = in_8((u8 *)&(base->mswitch)) & BFTICU_DIPSWITCH_MASK; if (dip_switch != 0) { /* start bootloader */ puts("DIP: Enabled\n"); setenv("actual_bank", "0"); } #endif set_km_env(); return 0; }
int last_stage_init(void) { struct bfticu_iomap *base = (struct bfticu_iomap *)CONFIG_SYS_FPGA_BASE; u8 dip_switch; dip_switch = in_8(&base->mswitch); dip_switch &= BFTICU_DIPSWITCH_MASK; /* dip switch 'full reset' or 'db erase' or 'Local mgmt IP' or any */ if (dip_switch != 0) { /* start bootloader */ puts("DIP: Enabled\n"); setenv("actual_bank", "0"); } set_km_env(); return 0; }
int last_stage_init(void) { #if defined(CONFIG_KMCOGE4) /* on KMCOGE4, the BFTIC4 is on the LBAPP2 */ struct bfticu_iomap *bftic4 = (struct bfticu_iomap *)CONFIG_SYS_LBAPP2_BASE; u8 dip_switch = in_8((u8 *)&(bftic4->mswitch)) & BFTICU_DIPSWITCH_MASK; if (dip_switch != 0) { /* start bootloader */ puts("DIP: Enabled\n"); env_set("actual_bank", "0"); } #endif set_km_env(); return 0; }
int misc_init_r(void) { #if defined(CONFIG_KM_MGCOGE3UN) char *wait_for_ne; u8 dip_switch = kw_gpio_get_value(KM_FLASH_ERASE_ENABLE); wait_for_ne = env_get("waitforne"); if ((wait_for_ne != NULL) && (dip_switch == 0)) { if (strcmp(wait_for_ne, "true") == 0) { int cnt = 0; int abort = 0; puts("NE go: "); while (startup_allowed() == 0) { if (tstc()) { (void) getc(); /* consume input */ abort = 1; break; } udelay(200000); cnt++; if (cnt == 5) puts("wait\b\b\b\b"); if (cnt == 10) { cnt = 0; puts(" \b\b\b\b"); } } if (abort == 1) printf("\nAbort waiting for ne\n"); else puts("OK\n"); } } #endif ivm_read_eeprom(ivm_content, CONFIG_SYS_IVM_EEPROM_MAX_LEN); initialize_unit_leds(); set_km_env(); set_bootcount_addr(); return 0; }
int misc_init_r(void) { #if defined(CONFIG_KM_MGCOGE3UN) char *wait_for_ne; wait_for_ne = getenv("waitforne"); if (wait_for_ne != NULL) { if (strcmp(wait_for_ne, "true") == 0) { int cnt = 0; int abort = 0; puts("NE go: "); while (startup_allowed() == 0) { if (tstc()) { (void) getc(); /* consume input */ abort = 1; break; } udelay(200000); cnt++; if (cnt == 5) puts("wait\b\b\b\b"); if (cnt == 10) { cnt = 0; puts(" \b\b\b\b"); } } if (abort == 1) printf("\nAbort waiting for ne\n"); else puts("OK\n"); } } #endif initialize_unit_leds(); set_km_env(); #if defined(CONFIG_BOOTCOUNT_LIMIT) set_bootcount_addr(); #endif return 0; }
int last_stage_init(void) { set_km_env(); return 0; }