kernel stops after udbg0 in MPC8548CDS_20071214-ltib

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

kernel stops after udbg0 in MPC8548CDS_20071214-ltib

1,518 Views
contributor3
Contributor III

Hello, 

I built MPC8548CDS_20071214-ltib and tried on MPC8548e platform. 

The kernel boots and after some time it stops at this print (the CPU is in idle state at this point).

 

ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx

i2c /dev entries driver

TCP cubic registered

Initializing XFRM netlink socket

NET: Registered protocol family 1

NET: Registered protocol family 17

turn off boot console udbg0

-- No more messages after this on ttyS1 or ttyS0 -- 

 

here are my boot args:

setenv bootargs root=/dev/ram rw console=ttyS0,115200n8

setenv consoledev ttyS0

setenv ramboot "setenv bootargs root=/dev/ram rw console=ttyS0,115200"

 

I also tried setting consoledev = ttyS1 and console=ttyS1 in bootargs and ramboot with same result.

 

 

 

Best Regards

0 Kudos
8 Replies

1,477 Views
contributor3
Contributor III

After further debugging, found that register console fails at 'serial8250_console_setup'

Both port->iobase and port->membase are 0x0

static int __init serial8250_console_setup(struct console *co, char *options)
{
struct uart_port *port;
int baud = 9600;
int bits = 8;
int parity = 'n';
int flow = 'n';
printk(KERN_ERR "---> %s %d \n",__FUNCTION__,__LINE__);

/*
* Check whether an invalid uart number has been specified, and
* if so, search for the first available port that does have
* console support.
*/
if (co->index >= nr_uarts){
printk(KERN_ERR "---> %s %d \n",__FUNCTION__,__LINE__);
co->index = 0;
}
port = &serial8250_ports[co->index].port;

printk(KERN_ERR "---> %s %d index = %d\n",__FUNCTION__,__LINE__,co->index);
printk(KERN_ERR "---> %s %d name = %s\n",__FUNCTION__,__LINE__,co->name);

printk(KERN_ERR "---> %s %d port->iobase = %x\n",__FUNCTION__,__LINE__,port->iobase);
printk(KERN_ERR "---> %s %d port->membase = %x\n",__FUNCTION__,__LINE__,port->membase);


if (!port->iobase && !port->membase){
printk(KERN_ERR "---> %s %d \n",__FUNCTION__,__LINE__);
return -ENODEV; <--------------------------------------------------------------------------------- returns ENODEV
}

if (options){
printk(KERN_ERR "---> %s %d \n",__FUNCTION__,__LINE__);
uart_parse_options(options, &baud, &parity, &bits, &flow);
}
printk(KERN_ERR "before return ---> %s %d \n",__FUNCTION__,__LINE__);
return uart_set_options(port, co, baud, parity, bits, flow);
}

 

what could be the issue?

0 Kudos

1,463 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to the following dts definition.

serial0: serial@4500 {
cell-index = <0>;
device_type = "serial";
compatible = "fsl,ns16550", "ns16550";
reg = <0x4500 0x100>;
clock-frequency = <0>;
interrupts = <42 2 0 0>;
};

serial1: serial@4600 {
cell-index = <1>;
device_type = "serial";
compatible = "fsl,ns16550", "ns16550";
reg = <0x4600 0x100>;
clock-frequency = <0>;
interrupts = <42 2 0 0>;
};

0 Kudos

1,473 Views
yipingwang
NXP TechSupport
NXP TechSupport

Did you get the same debug information when config bootargs as the following?

setenv bootargs "root=/dev/ram rw console=ttyS1,115200"

0 Kudos

1,469 Views
contributor3
Contributor III

yes I tried with ttyS1 and I got same result.

0 Kudos

1,506 Views
contributor3
Contributor III

I found that the register_console function in kernel/printk.c is breaking at this point 

	/*
	 *	See if this console matches one we selected on
	 *	the command line.
	 */
	for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0];
			i++) {
		if (strcmp(console_cmdline[i].name, console->name) != 0)
			continue;
		if (console->index >= 0 &&
		    console->index != console_cmdline[i].index)
			continue;
		if (console->index < 0)
			console->index = console_cmdline[i].index;
		if (console->setup &&
		    console->setup(console, console_cmdline[i].options) != 0)
			break; <--------------------------------------------- breaking here
		console->flags |= CON_ENABLED;
		console->index = console_cmdline[i].index;
		if (i == selected_console) {
			console->flags |= CON_CONSDEV;
			preferred_console = selected_console;
		}
		break;
	}
0 Kudos

1,493 Views
yipingwang
NXP TechSupport
NXP TechSupport

Would you please provide the whole Linux kernel boot up log? Especially "Kernel command line" information.

0 Kudos

1,492 Views
contributor3
Contributor III

Hi,

Please find the log attached.

 

After further debugging I found that the serial 8250 driver is failing here.

static int serial8250_request_rsa_resource(struct uart_8250_port *up)
{
unsigned long start = UART_RSA_BASE << up->port.regshift;
unsigned int size = 8 << up->port.regshift;
int ret = -EINVAL;

switch (up->port.iotype) {
case UPIO_HUB6:
case UPIO_PORT:
start += up->port.iobase;
if (request_region(start, size, "serial-rsa"))
ret = 0;
else
ret = -EBUSY;
break;
}

return ret; <------------ returns -EINVAL because up->port.iotype is UPIO_MEM. 
}

 

what could be the problem?

here is my device tree entry:

serial@4500 {
device_type = "serial";
compatible = "ns16550";
reg = <0x4500 0x100>;
clock-frequency = <0x0>;
interrupts = <0x2a 0x2>;
interrupt-parent = <0x1>;
};

serial@4600 {
device_type = "serial";
compatible = "ns16550";
reg = <0x4600 0x100>;
clock-frequency = <0x0>;
interrupts = <0x2a 0x2>;
interrupt-parent = <0x1>;
};

Best Regards

0 Kudos

1,448 Views
contributor3
Contributor III

Hi I already have the same in my device tree. 

I hacked kernel to register_console in the function uart_add_one_port in drivers/serial/serial_core.c 

 

-if (port->type != PORT_UNKNOWN &&
-port->cons && !(port->cons->flags & CON_ENABLED)) 
+ if(port->cons && !(port->cons->flags & CON_ENABLED))
+ register_console(port->cons);

 

It goes a little further now and the /dev/console is opened. but now it is struck in the /sbin/init process. 

 

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
i2c /dev entries driver
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 124k init
--->opened /dev/console init_post 785

 

after this the kernel starts "/sbin/init", no output on the console after running the init. 

 

Tags (1)
0 Kudos