diff mbox

[for,soc] socfpga: map uart into virtual address space so that early_printk() works

Message ID 20121029002724.GA27891@elf.ucw.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Machek Oct. 29, 2012, 12:27 a.m. UTC
Early printk code needs UART to be mapped early during
boot. early_printk() is left there during the start-up; it is useful
as our emulators are fairly slow.

Signed-off-by: Pavel Machek <pavel@denx.de>
Acked-by: Dinh Nguyen <dinguyen@altera.com>

Comments

Pavel Machek Nov. 3, 2012, 11:26 a.m. UTC | #1
Hi!

> Early printk code needs UART to be mapped early during
> boot. early_printk() is left there during the start-up; it is useful
> as our emulators are fairly slow.
> 
> Signed-off-by: Pavel Machek <pavel@denx.de>
> Acked-by: Dinh Nguyen <dinguyen@altera.com>

Could we get this one applied? No comments for quite a while... and it
is needed for machine not to crash with early_printk used...
								Pavel

> diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
> index ab81ea9..49fb62b 100644
> --- a/arch/arm/mach-socfpga/socfpga.c
> +++ b/arch/arm/mach-socfpga/socfpga.c
> @@ -37,6 +37,15 @@ static struct map_desc scu_io_desc __initdata = {
>  	.type		= MT_DEVICE,
>  };
>  
> +
> +
> +static struct map_desc uart_io_desc __initdata = {
> +	.virtual	= 0xfec02000,
> +	.pfn		= __phys_to_pfn(0xffc02000),
> +	.length		= SZ_8K,
> +	.type		= MT_DEVICE,
> +};
> +
>  static void __init socfpga_scu_map_io(void)
>  {
>  	unsigned long base;
> @@ -51,6 +60,8 @@ static void __init socfpga_scu_map_io(void)
>  static void __init socfpga_map_io(void)
>  {
>  	socfpga_scu_map_io();
> +	iotable_init(&uart_io_desc, 1);
> +	early_printk("Early printk initialized\n");
>  }
>  
>  const static struct of_device_id irq_match[] = {
>
Olof Johansson Nov. 5, 2012, 5:18 p.m. UTC | #2
On Sat, Nov 03, 2012 at 12:26:14PM +0100, Pavel Machek wrote:
> Hi!
> 
> > Early printk code needs UART to be mapped early during
> > boot. early_printk() is left there during the start-up; it is useful
> > as our emulators are fairly slow.
> > 
> > Signed-off-by: Pavel Machek <pavel@denx.de>
> > Acked-by: Dinh Nguyen <dinguyen@altera.com>
> 
> Could we get this one applied? No comments for quite a while... and it
> is needed for machine not to crash with early_printk used...
> 								Pavel

Sorry, we've been delayed on applying patches due to Linaro Connect and travel.

I've applied this now with a minor edit to remove the extra added lines before
the struct.


Regards,


-Olof
diff mbox

Patch

diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
index ab81ea9..49fb62b 100644
--- a/arch/arm/mach-socfpga/socfpga.c
+++ b/arch/arm/mach-socfpga/socfpga.c
@@ -37,6 +37,15 @@  static struct map_desc scu_io_desc __initdata = {
 	.type		= MT_DEVICE,
 };
 
+
+
+static struct map_desc uart_io_desc __initdata = {
+	.virtual	= 0xfec02000,
+	.pfn		= __phys_to_pfn(0xffc02000),
+	.length		= SZ_8K,
+	.type		= MT_DEVICE,
+};
+
 static void __init socfpga_scu_map_io(void)
 {
 	unsigned long base;
@@ -51,6 +60,8 @@  static void __init socfpga_scu_map_io(void)
 static void __init socfpga_map_io(void)
 {
 	socfpga_scu_map_io();
+	iotable_init(&uart_io_desc, 1);
+	early_printk("Early printk initialized\n");
 }
 
 const static struct of_device_id irq_match[] = {