Esempio n. 1
0
void restart()
{
    /* Perform some initialization to restart a program */
    memcpy(hwa_to_va(LOADER_START), loader, loader_len);
    tlb_init();

    /* General initialization */
    cpu.eip = LOADER_START;
    cpu.ebp = 0;
    cpu.esp = 0x8000000;
    cpu.eflags = 0x2;
    cpu.eax = 0;
    cpu.ecx = 0;
    cpu.edx = 0;
    cpu.cr0.paging = 0;
    cpu.cr0.protect_enable = 0;
    cpu.INTR = 0;
    FLAG_CHG(IF, 0);

    /* Segment initialization */
    cpu.gdtr.limit = 0;
    cpu.gdtr.base = 0;
    cpu.cr[0] = 0; // Set PE to 0

    load_prog();

   // trigger = TRIGGER_INIT;

    init_dram();

}
Esempio n. 2
0
void mt_set_emi(const struct mt8173_sdram_params *sdram_params)
{
	/* voltage info */
	dram_vcore_adjust();
	dram_vmem_adjust();

	if (sdram_params->type != TYPE_LPDDR3) {
		die("The DRAM type is not supported");
	}

	init_dram(sdram_params);
	do_calib(sdram_params);
}
Esempio n. 3
0
void restart() {
	/* Perform some initialization to restart a program */
	load_prog();
	memcpy(hwa_to_va(LOADER_START), loader, loader_len);

	cpu.eip = LOADER_START;
	cpu.ebp = 0;
	cpu.esp = 0x8000000;
	cpu.eflags = 2;

	init_dram();
	init_cache1();
	init_cache2();
	init_TLB();

	/* initialize limit of cs in gdt */
//	printf("%x\n",cpu.gdtr.base);
//	uint16_t *cs_limit =(void *)(0x90901700 + 64);
//	*cs_limit = 0xffff;
	seg_cache[1].limit = 0xffffffff;//can't modify memory in 0x90901700

//	*cs_limit = 0xffff;//other bits are initialized by 0
}