Beispiel #1
0
static void set_bootcmd(){
	const int bd_start = 8 * 1024 * 1024;
	const int initrd_start  = 32 * 1024 * 1024, initrd_size = 2 * 1024 * 1024;
	e500_core_t * core = get_boot_core();
	bd_t t;
	memset(&t, '\0', sizeof(t));
        t.bi_immr_base = ppc_word_to_BE(0xe0000000);
        t.bi_busfreq = ppc_word_to_BE(100 * 1024 * 1024);
        t.bi_intfreq = ppc_word_to_BE(500 * 1024 * 1024);
        t.bi_baudrate = ppc_word_to_BE(9600);
        t.bi_memsize = ppc_word_to_BE(64 * 1024 * 1024);
	load_data(&t, sizeof(t), bd_start);

	core->gpr[3] = bd_start;

/*
 *   r4 - Starting address of the init RAM disk
 *   r5 - Ending address of the init RAM disk
 */
	core->gpr[4] = initrd_start;
	core->gpr[5] = initrd_start + initrd_size;


	char * bootcmd = "root=/dev/ram0 console=ttyCPM0 mem=64M";
	const int bootcmd_start= 9 * 1024 * 1024;
	/* load bootcmd string to bootcmd_start address */
	load_data(bootcmd, (strlen(bootcmd) + 1), bootcmd_start);

	core->gpr[6] = bootcmd_start;
	core->gpr[7] = bootcmd_start + strlen(bootcmd) + 1;
}
static void set_bootcmd(){
	const int bd_start = 8 * 1024 * 1024;
	e500_core_t * core = &gCPU.core[0];
	bd_t t;
	memset(&t, '\0', sizeof(t));
        t.bi_immr_base = ppc_word_to_BE(0xe0000000);
        t.bi_busfreq = ppc_word_to_BE(100 * 1024 * 1024);
        t.bi_intfreq = ppc_word_to_BE(500 * 1024 * 1024);
        t.bi_baudrate = ppc_word_to_BE(9600);
        t.bi_memsize = ppc_word_to_BE(64 * 1024 * 1024);
	load_data(&t, sizeof(t), bd_start);

	core->gpr[3] = bd_start;

	char * bootcmd = "root=/dev/ram0 console=ttyCPM0 mem=64M";
	const int bootcmd_start= 9 * 1024 * 1024;
	/* load bootcmd string to bootcmd_start address */
	load_data(bootcmd, (strlen(bootcmd) + 1), bootcmd_start);

	core->gpr[6] = bootcmd_start;
	core->gpr[7] = bootcmd_start + strlen(bootcmd) + 1;
}