1
0

init: Initialize serial subsystem before init_earlyinitcalls()

Otherwise, the serial sybsystem isn't initialized before the serial
drivers attempt to register themselves.
This commit is contained in:
Aaron Lindsay 2012-10-06 14:53:00 -04:00
parent 9d86813d8c
commit 8cb4100463
2 changed files with 14 additions and 4 deletions

View File

@ -33,8 +33,12 @@ struct serial_dev *serial_first_device() {
return first_serial_dev; return first_serial_dev;
} }
/*
* Initialize the serial sybsystem.
* Note: this is called directly from the kernel initialization as opposed to
* being an initcall because it has to be called before the serial drivers get
* initialized in earlyinitcalls.
*/
void serial_init() { void serial_init() {
first_serial_dev = 0; first_serial_dev = 0;
} }
driversubsys_initcall(serial_init);

View File

@ -64,8 +64,9 @@ void serial_console_init() {
print_init(sdev->putc); print_init(sdev->putc);
} }
void serial_init();
void kmalloc_init(); void kmalloc_init();
int main(void) { int main(void) {
char *lower, *upper; char *lower, *upper;
struct atag *atags; struct atag *atags;
@ -73,8 +74,13 @@ int main(void) {
//setup MMU //setup MMU
mmu_reinit(); mmu_reinit();
/* Initialize the serial subsystem before
* init_earlyinitcalls(), because console drivers get
* initialized here so as to have an output console as
* early as possible, and we don't want those
* initializations to fail. */
serial_init();
init_earlyinitcalls(); init_earlyinitcalls();
serial_console_init(); serial_console_init();
//setup memory //setup memory