Esempio n. 1
0
static void do_command(char *c)
{
	char *token;

	token = get_token(&c);

	if(strcmp(token, "flush") == 0) flush_bridge_cache();

	else if(strcmp(token, "mr") == 0) mr(get_token(&c), get_token(&c));
	else if(strcmp(token, "mw") == 0) mw(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "mc") == 0) mc(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "crc") == 0) crc(get_token(&c), get_token(&c));
	
	else if(strcmp(token, "ls") == 0) ls();
	else if(strcmp(token, "load") == 0) load(get_token(&c), get_token(&c));
	
	else if(strcmp(token, "serialboot") == 0) serialboot();
	else if(strcmp(token, "netboot") == 0) netboot();
	else if(strcmp(token, "cardboot") == 0) cardboot(0);

	else if(strcmp(token, "mdior") == 0) mdior(get_token(&c));
	else if(strcmp(token, "mdiow") == 0) mdiow(get_token(&c), get_token(&c));

	else if(strcmp(token, "reboot") == 0) reboot();
	
	else if(strcmp(token, "help") == 0) help();
	
	else if(strcmp(token, "") != 0)
		printf("Command not found\n");
}
Esempio n. 2
0
static int test_user_abort(void)
{
    char c;

    printf("Automatic boot in 2 seconds...\n");
    printf("Q/ESC: abort boot\n");
    printf("F7:    boot from serial\n");
#ifdef MINIMAC_BASE
    printf("F8:    boot from network\n");
#endif
    timer0_en_write(0);
    timer0_reload_write(0);
    timer0_load_write(identifier_frequency_read()*2);
    timer0_en_write(1);
    timer0_update_value_write(1);
    while(timer0_value_read()) {
        if(readchar_nonblock()) {
            c = readchar();
            if((c == 'Q')||(c == '\e')) {
                puts("Aborted");
                return 0;
            }
            if(c == 0x06) {
                serialboot();
                return 0;
            }
#ifdef MINIMAC_BASE
            if(c == 0x07) {
                netboot();
                return 0;
            }
#endif
        }
        timer0_update_value_write(1);
    }
Esempio n. 3
0
File: main.c Progetto: cyrozap/misoc
static void do_command(char *c)
{
	char *token;

	token = get_token(&c);

	if(strcmp(token, "mr") == 0) mr(get_token(&c), get_token(&c));
	else if(strcmp(token, "mw") == 0) mw(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "mc") == 0) mc(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "crc") == 0) crc(get_token(&c), get_token(&c));
	else if(strcmp(token, "ident") == 0) ident();

#ifdef CONFIG_L2_SIZE
	else if(strcmp(token, "flushl2") == 0) flush_l2_cache();
#endif

#ifdef FLASH_BOOT_ADDRESS
	else if(strcmp(token, "flashboot") == 0) flashboot();
#endif
#ifdef ROM_BOOT_ADDRESS
	else if(strcmp(token, "romboot") == 0) romboot();
#endif
	else if(strcmp(token, "serialboot") == 0) serialboot();
#ifdef CSR_ETHMAC_BASE
	else if(strcmp(token, "netboot") == 0) netboot();
#endif

	else if(strcmp(token, "help") == 0) help();

#ifdef __lm32__
	else if(strcmp(token, "rcsr") == 0) rcsr(get_token(&c));
	else if(strcmp(token, "wcsr") == 0) wcsr(get_token(&c), get_token(&c));
#endif

#ifdef CSR_DFII_BASE
	else if(strcmp(token, "sdrrow") == 0) sdrrow(get_token(&c));
	else if(strcmp(token, "sdrsw") == 0) sdrsw();
	else if(strcmp(token, "sdrhw") == 0) sdrhw();
	else if(strcmp(token, "sdrrdbuf") == 0) sdrrdbuf(-1);
	else if(strcmp(token, "sdrrd") == 0) sdrrd(get_token(&c), get_token(&c));
	else if(strcmp(token, "sdrrderr") == 0) sdrrderr(get_token(&c));
	else if(strcmp(token, "sdrwr") == 0) sdrwr(get_token(&c));
#ifdef CSR_DDRPHY_BASE
	else if(strcmp(token, "sdrwlon") == 0) sdrwlon();
	else if(strcmp(token, "sdrwloff") == 0) sdrwloff();
	else if(strcmp(token, "sdrlevel") == 0) sdrlevel();
#endif
	else if(strcmp(token, "memtest") == 0) memtest();
	else if(strcmp(token, "sdrinit") == 0) sdrinit();
#endif

	else if(strcmp(token, "") != 0)
		printf("Command not found\n");
}
Esempio n. 4
0
static void boot_sequence()
{
	splash_display();
	if(test_user_abort()) {
		serialboot(1);
		netboot();
		if(brd_desc->memory_card != MEMCARD_NONE) {
			if(CSR_GPIO_IN & GPIO_DIP1)
				cardboot(1);
			else
				cardboot(0);
		}
		printf("E: No boot medium found\n");
	}
}
Esempio n. 5
0
File: main.c Progetto: cyrozap/misoc
static void boot_sequence(void)
{
	if(serialboot()) {
#ifdef FLASH_BOOT_ADDRESS
		flashboot();
#endif
#ifdef CSR_ETHMAC_BASE
#ifdef CSR_ETHPHY_MODE_DETECTION_MODE_ADDR
		eth_mode();
#endif
		netboot();
#endif
#ifdef ROM_BOOT_ADDRESS
		romboot();
#endif
		printf("No boot medium found\n");
	}
}
Esempio n. 6
0
static void do_command(char *c)
{
    char *token;

    token = get_token(&c);

    if(strcmp(token, "mr") == 0) mr(get_token(&c), get_token(&c));
    else if(strcmp(token, "mw") == 0) mw(get_token(&c), get_token(&c), get_token(&c));
    else if(strcmp(token, "mc") == 0) mc(get_token(&c), get_token(&c), get_token(&c));
    else if(strcmp(token, "crc") == 0) crc(get_token(&c), get_token(&c));
    else if(strcmp(token, "flushl2") == 0) flush_l2_cache();

#ifdef FLASH_BOOT_ADDRESS
    else if(strcmp(token, "flashboot") == 0) flashboot();
#endif
    else if(strcmp(token, "serialboot") == 0) serialboot();
#ifdef MINIMAC_BASE
    else if(strcmp(token, "netboot") == 0) netboot();
#endif

    else if(strcmp(token, "revision") == 0) printf("%08x\n", MSC_GIT_ID);

    else if(strcmp(token, "help") == 0) help();

    else if(strcmp(token, "rcsr") == 0) rcsr(get_token(&c));
    else if(strcmp(token, "wcsr") == 0) wcsr(get_token(&c), get_token(&c));

#ifdef DFII_BASE
    else if(strcmp(token, "ddrrow") == 0) ddrrow(get_token(&c));
    else if(strcmp(token, "ddrsw") == 0) ddrsw();
    else if(strcmp(token, "ddrhw") == 0) ddrhw();
    else if(strcmp(token, "ddrrd") == 0) ddrrd(get_token(&c));
    else if(strcmp(token, "ddrwr") == 0) ddrwr(get_token(&c));
    else if(strcmp(token, "memtest") == 0) memtest();
    else if(strcmp(token, "ddrinit") == 0) ddrinit();
#endif

    else if(strcmp(token, "dfs") == 0) dfs(get_token(&c));

    else if(strcmp(token, "") != 0)
        printf("Command not found\n");
}
Esempio n. 7
0
/*
 * This is the boot code entry point.
 * Note that we do not bother to set r31, and use the default value supplied
 * by the PROM, which is the top of memory, minus the PROM data area (usually
 * 128KB).
 */
void
start(const char *args, int dev, int unit, int part)
{
	extern int edata, end;

	/* 
	 * This code enables the SFU1 and is used for single stage 
	 * bootstraps or the first stage of a two stage bootstrap.
	 * Do not use any low register to enable the SFU1. This wipes out
	 * the args.  Not cool at all... r25 seems free. 
	 */
	asm("|	enable SFU1");
	asm("	ldcr	r25,cr1" ::: "r25");
	asm("	clr	r25,r25,1<3>"); /* bit 3 is SFU1D */
	asm("	stcr	r25,cr1");

	memset(&edata, 0, ((int)&end - (int)&edata));

	netboot(args, dev, unit, part);
	_rtt();
	/* NOTREACHED */
}
Esempio n. 8
0
static int test_user_abort()
{
	char c;

	puts("I: Press Q or ESC to abort boot");
	CSR_TIMER0_COUNTER = 0;
	CSR_TIMER0_COMPARE = 2*brd_desc->clk_frequency;
	CSR_TIMER0_CONTROL = TIMER_ENABLE;
	while(CSR_TIMER0_CONTROL & TIMER_ENABLE) {
		if(readchar_nonblock()) {
			c = readchar();
			if((c == 'Q')||(c == '\e')) {
				puts("I: Aborted boot on user request");
				vga_set_console(1);
				return 0;
			}
			if(c == 0x07) {
				vga_set_console(1);
				netboot();
				return 0;
			}
		}
	}
Esempio n. 9
0
static void do_command(char *c)
{
	char *token;

	token = get_token(&c);

	if(strcmp(token, "cons") == 0) vga_set_console(!vga_get_console());
	else if(strcmp(token, "flush") == 0) flush_bridge_cache();
	else if(strcmp(token, "mr") == 0) mr(get_token(&c), get_token(&c));
	else if(strcmp(token, "mw") == 0) mw(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "mc") == 0) mc(get_token(&c), get_token(&c), get_token(&c));
	else if(strcmp(token, "crc") == 0) crc(get_token(&c), get_token(&c));

	else if(strcmp(token, "ls") == 0) ls(get_token(&c));
	else if(strcmp(token, "load") == 0) load(get_token(&c), get_token(&c), get_token(&c));

	else if(strcmp(token, "netboot") == 0) netboot();
	else if(strcmp(token, "serialboot") == 0) serialboot();
	else if(strcmp(token, "fsboot") == 0) fsboot(BLOCKDEV_MEMORY_CARD);
	else if(strcmp(token, "flashboot") == 0) flashboot();

	else if(strcmp(token, "mdior") == 0) mdior(get_token(&c));
	else if(strcmp(token, "mdiow") == 0) mdiow(get_token(&c), get_token(&c));

	else if(strcmp(token, "version") == 0) puts(VERSION);
	else if(strcmp(token, "reboot") == 0) reboot();
	else if(strcmp(token, "reconf") == 0) reconf();

	else if(strcmp(token, "help") == 0) help();

	else if(strcmp(token, "rcsr") == 0) rcsr(get_token(&c));
	else if(strcmp(token, "wcsr") == 0) wcsr(get_token(&c), get_token(&c));

	else if(strcmp(token, "") != 0)
		printf("Command not found\n");
}