* where do 8250 serial port initialize its mapbase and membase when booting?
@ 2010-06-20 17:27 wilbur.chan
2010-06-21 0:13 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: wilbur.chan @ 2010-06-20 17:27 UTC (permalink / raw)
To: linuxppc-dev; +Cc: chelly wilbur, chen.yu10
linux 2.6.21.7
where do serial 8250 port fill its membase and mapbase fileds in
system initializing ?
I found that , when calling do_initcalls---> serial8250_init ---->
platform_driver_register--->bus_for_each_dev, system found
an device of serial 8250, which has already fill the membase and mapbase fileds.
That is to say, before serial8250_init ---->
platform_driver_register, system has create a serial device with
membase and mapbase initialized.
do_initcalls---> serial8250_init ----> platform_driver_register--->
dev = bus_for_each_dev
---> struct plat_serial8250_port *p = dev->platform_data;
/* at this point , p->membase and p->mapbase are
all assigned with proper value by system */
I searched the whole source code with keyword 'membase' , and found
the following code :
serial8250_request_std_resource:
case UPIO_MEM:
if (!up->port.mapbase)
break;
if (!request_mem_region(up->port.mapbase, size, "serial")) {
ret = -EBUSY;
break;
}
/*I guess membase is generated according to mapbase ,*
so I add some debug print here.
However, I found membase and mapbase are already initialized
before these codes. */
if (up->port.flags & UPF_IOREMAP) {
up->port.membase = ioremap(up->port.mapbase, size);
if (!up->port.membase) {
release_mem_region(up->port.mapbase, size);
ret = -ENOMEM;
}
}
So I am really confused with serial 8250
initializing----------------where do kernel apply membase and mapbase
filed to 8250 port?
Thx
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: where do 8250 serial port initialize its mapbase and membase when booting?
2010-06-20 17:27 where do 8250 serial port initialize its mapbase and membase when booting? wilbur.chan
@ 2010-06-21 0:13 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2010-06-21 0:13 UTC (permalink / raw)
To: wilbur.chan; +Cc: linuxppc-dev, chen.yu10
[-- Attachment #1: Type: text/plain, Size: 380 bytes --]
On Mon, 2010-06-21 at 01:27 +0800, wilbur.chan wrote:
> linux 2.6.21.7
>
> where do serial 8250 port fill its membase and mapbase fileds in
> system initializing ?
>
..
> So I am really confused with serial 8250
> initializing----------------where do kernel apply membase and mapbase
> filed to 8250 port?
Probably serial_dev_init() in legacy_serial.c
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-21 0:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-20 17:27 where do 8250 serial port initialize its mapbase and membase when booting? wilbur.chan
2010-06-21 0:13 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).