ARM: P2V: avoid initializers and assembly using PHYS_OFFSET
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 4 Jan 2011 19:03:16 +0000 (19:03 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 17 Feb 2011 23:27:30 +0000 (23:27 +0000)
As PHYS_OFFSET will be becoming a variable, we can't have it used in
initializers nor assembly code.  Replace those in generic code with
a run-time initialization.  Replace those in platform code using the
individual platform specific PLAT_PHYS_OFFSET.

Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: David Brown <davidb@codeaurora.org>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 files changed:
arch/arm/kernel/setup.c
arch/arm/mach-msm/board-msm7x27.c
arch/arm/mach-msm/board-msm7x30.c
arch/arm/mach-msm/board-qsd8x50.c
arch/arm/mach-msm/board-sapphire.c
arch/arm/mach-pxa/balloon3.c
arch/arm/mach-realview/realview_eb.c
arch/arm/mach-realview/realview_pb1176.c
arch/arm/mach-realview/realview_pb11mp.c
arch/arm/mach-realview/realview_pba8.c
arch/arm/mach-realview/realview_pbx.c
arch/arm/mach-s5pv210/sleep.S
arch/arm/mach-tcc8k/board-tcc8000-sdk.c
arch/arm/mach-vexpress/ct-ca9x4.c
arch/arm/plat-omap/include/plat/serial.h

index 78678b0..056bf18 100644 (file)
@@ -740,7 +740,7 @@ static struct init_tags {
        { tag_size(tag_core), ATAG_CORE },
        { 1, PAGE_SIZE, 0xff },
        { tag_size(tag_mem32), ATAG_MEM },
-       { MEM_SIZE, PHYS_OFFSET },
+       { MEM_SIZE },
        { 0, ATAG_NONE }
 };
 
@@ -839,6 +839,8 @@ void __init setup_arch(char **cmdline_p)
        struct machine_desc *mdesc;
        char *from = default_command_line;
 
+       init_tags.mem.start = PHYS_OFFSET;
+
        unwind_init();
 
        setup_processor();
index e7a76ef..08fcd40 100644 (file)
@@ -132,7 +132,7 @@ static void __init msm7x2x_map_io(void)
 MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params    = PHYS_OFFSET + 0x100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
        .map_io         = msm7x2x_map_io,
        .init_irq       = msm7x2x_init_irq,
        .init_machine   = msm7x2x_init,
@@ -142,7 +142,7 @@ MACHINE_END
 MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params    = PHYS_OFFSET + 0x100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
        .map_io         = msm7x2x_map_io,
        .init_irq       = msm7x2x_init_irq,
        .init_machine   = msm7x2x_init,
@@ -152,7 +152,7 @@ MACHINE_END
 MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params    = PHYS_OFFSET + 0x100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
        .map_io         = msm7x2x_map_io,
        .init_irq       = msm7x2x_init_irq,
        .init_machine   = msm7x2x_init,
@@ -162,7 +162,7 @@ MACHINE_END
 MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params    = PHYS_OFFSET + 0x100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
        .map_io         = msm7x2x_map_io,
        .init_irq       = msm7x2x_init_irq,
        .init_machine   = msm7x2x_init,
index decbf80..25db8fd 100644 (file)
@@ -85,7 +85,7 @@ static void __init msm7x30_map_io(void)
 MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params = PHYS_OFFSET + 0x100,
+       .boot_params = PLAT_PHYS_OFFSET + 0x100,
        .map_io = msm7x30_map_io,
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
@@ -95,7 +95,7 @@ MACHINE_END
 MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params = PHYS_OFFSET + 0x100,
+       .boot_params = PLAT_PHYS_OFFSET + 0x100,
        .map_io = msm7x30_map_io,
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
@@ -105,7 +105,7 @@ MACHINE_END
 MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params = PHYS_OFFSET + 0x100,
+       .boot_params = PLAT_PHYS_OFFSET + 0x100,
        .map_io = msm7x30_map_io,
        .init_irq = msm7x30_init_irq,
        .init_machine = msm7x30_init,
index 6dde818..15c2bbd 100644 (file)
@@ -118,7 +118,7 @@ static void __init qsd8x50_init(void)
 MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params = PHYS_OFFSET + 0x100,
+       .boot_params = PLAT_PHYS_OFFSET + 0x100,
        .map_io = qsd8x50_map_io,
        .init_irq = qsd8x50_init_irq,
        .init_machine = qsd8x50_init,
@@ -128,7 +128,7 @@ MACHINE_END
 MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params = PHYS_OFFSET + 0x100,
+       .boot_params = PLAT_PHYS_OFFSET + 0x100,
        .map_io = qsd8x50_map_io,
        .init_irq = qsd8x50_init_irq,
        .init_machine = qsd8x50_init,
index 8919ffb..83604f5 100644 (file)
@@ -107,7 +107,7 @@ MACHINE_START(SAPPHIRE, "sapphire")
 /* Maintainer: Brian Swetland <swetland@google.com> */
 #ifdef CONFIG_MSM_DEBUG_UART
 #endif
-       .boot_params    = PHYS_OFFSET + 0x100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
        .fixup          = sapphire_fixup,
        .map_io         = sapphire_map_io,
        .init_irq       = sapphire_init_irq,
index a134a14..e194d92 100644 (file)
@@ -829,5 +829,5 @@ MACHINE_START(BALLOON3, "Balloon3")
        .init_irq       = balloon3_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = balloon3_init,
-       .boot_params    = PHYS_OFFSET + 0x100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x100,
 MACHINE_END
index 6ef5c5e..8ede983 100644 (file)
@@ -484,7 +484,7 @@ static void __init realview_eb_init(void)
 
 MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .boot_params    = PHYS_OFFSET + 0x00000100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
        .fixup          = realview_fixup,
        .map_io         = realview_eb_map_io,
        .init_irq       = gic_init_irq,
index cbdc97a..9f26369 100644 (file)
@@ -379,7 +379,7 @@ static void __init realview_pb1176_init(void)
 
 MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .boot_params    = PHYS_OFFSET + 0x00000100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
        .fixup          = realview_pb1176_fixup,
        .map_io         = realview_pb1176_map_io,
        .init_irq       = gic_init_irq,
index 8e8ab7d..dea06b2 100644 (file)
@@ -381,7 +381,7 @@ static void __init realview_pb11mp_init(void)
 
 MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .boot_params    = PHYS_OFFSET + 0x00000100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
        .fixup          = realview_fixup,
        .map_io         = realview_pb11mp_map_io,
        .init_irq       = gic_init_irq,
index 841118e..7d0f173 100644 (file)
@@ -331,7 +331,7 @@ static void __init realview_pba8_init(void)
 
 MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .boot_params    = PHYS_OFFSET + 0x00000100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
        .fixup          = realview_fixup,
        .map_io         = realview_pba8_map_io,
        .init_irq       = gic_init_irq,
index 02b755b..b89e28f 100644 (file)
@@ -414,7 +414,7 @@ static void __init realview_pbx_init(void)
 
 MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
        /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
-       .boot_params    = PHYS_OFFSET + 0x00000100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
        .fixup          = realview_pbx_fixup,
        .map_io         = realview_pbx_map_io,
        .init_irq       = gic_init_irq,
index d4d222b..2737622 100644 (file)
@@ -65,7 +65,7 @@ resume_with_mmu:
        /*
         * After MMU is turned on, restore the previous MMU table.
         */
-       ldr     r9 , =(PAGE_OFFSET - PHYS_OFFSET)
+       ldr     r9 , =(PAGE_OFFSET - PLAT_PHYS_OFFSET)
        add     r4, r4, r9
        str     r12, [r4]
 
index 7991415..fb6426d 100644 (file)
@@ -54,7 +54,7 @@ static void __init tcc8k_map_io(void)
 }
 
 MACHINE_START(TCC8000_SDK, "Telechips TCC8000-SDK Demo Board")
-       .boot_params    = PHYS_OFFSET + 0x00000100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
        .map_io         = tcc8k_map_io,
        .init_irq       = tcc8k_init_irq,
        .init_machine   = tcc8k_init,
index e628402..e9bccc5 100644 (file)
@@ -243,7 +243,7 @@ static void __init ct_ca9x4_init(void)
 }
 
 MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4")
-       .boot_params    = PHYS_OFFSET + 0x00000100,
+       .boot_params    = PLAT_PHYS_OFFSET + 0x00000100,
        .map_io         = ct_ca9x4_map_io,
        .init_irq       = ct_ca9x4_init_irq,
 #if 0
index cec5d56..8ff605c 100644 (file)
@@ -27,7 +27,7 @@
  * 2. We assume printascii is called at least once before paging_init,
  *    and addruart has a chance to read OMAP_UART_INFO
  */
-#define OMAP_UART_INFO         (PHYS_OFFSET + 0x3ffc)
+#define OMAP_UART_INFO         (PLAT_PHYS_OFFSET + 0x3ffc)
 
 /* OMAP1 serial ports */
 #define OMAP1_UART1_BASE       0xfffb0000