Changeset View
Changeset View
Standalone View
Standalone View
stand/powerpc/ofw/main.c
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | main(int (*openfirm)(void *)) | ||||
*/ | */ | ||||
init_heap(); | init_heap(); | ||||
/* | /* | ||||
* Set up console. | * Set up console. | ||||
*/ | */ | ||||
cons_probe(); | cons_probe(); | ||||
archsw.arch_getdev = ofw_getdev; | |||||
archsw.arch_copyin = ofw_copyin; | |||||
archsw.arch_copyout = ofw_copyout; | |||||
archsw.arch_readin = ofw_readin; | |||||
#ifdef CAS | |||||
setenv("cas", "1", 0); | |||||
archsw.arch_autoload = ppc64_autoload; | |||||
#else | |||||
archsw.arch_autoload = ofw_autoload; | |||||
#endif | |||||
/* Set up currdev variable to have hooks in place. */ | /* Set up currdev variable to have hooks in place. */ | ||||
env_setenv("currdev", EV_VOLATILE, "", ofw_setcurrdev, env_nounset); | env_setenv("currdev", EV_VOLATILE, "", ofw_setcurrdev, env_nounset); | ||||
/* | /* | ||||
* March through the device switch probing for things. | * March through the device switch probing for things. | ||||
*/ | */ | ||||
for (i = 0; devsw[i] != NULL; i++) | for (i = 0; devsw[i] != NULL; i++) | ||||
if (devsw[i]->dv_init != NULL) | if (devsw[i]->dv_init != NULL) | ||||
Show All 29 Lines | #endif | ||||
/* | /* | ||||
* On non-Apple hardware, where it works reliably, pass flattened | * On non-Apple hardware, where it works reliably, pass flattened | ||||
* device trees to the kernel by default instead of OF CI pointers. | * device trees to the kernel by default instead of OF CI pointers. | ||||
* Apple hardware is the only virtual-mode OF implementation in | * Apple hardware is the only virtual-mode OF implementation in | ||||
* existence, so far as I am aware, so use that as a flag. | * existence, so far as I am aware, so use that as a flag. | ||||
*/ | */ | ||||
if (!(mfmsr() & PSL_DR)) | if (!(mfmsr() & PSL_DR)) | ||||
setenv("usefdt", "1", 1); | setenv("usefdt", "1", 1); | ||||
archsw.arch_getdev = ofw_getdev; | |||||
archsw.arch_copyin = ofw_copyin; | |||||
archsw.arch_copyout = ofw_copyout; | |||||
archsw.arch_readin = ofw_readin; | |||||
#ifdef CAS | |||||
setenv("cas", "1", 0); | |||||
archsw.arch_autoload = ppc64_autoload; | |||||
#else | |||||
archsw.arch_autoload = ofw_autoload; | |||||
#endif | |||||
interact(); /* doesn't return */ | interact(); /* doesn't return */ | ||||
OF_exit(); | OF_exit(); | ||||
return 0; | return 0; | ||||
} | } | ||||
Show All 19 Lines |