diff mbox

scripts/link-vmlinux.sh: correct base address for some ARM special cases

Message ID 20140226135352.GY21483@n2100.arm.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Russell King - ARM Linux Feb. 26, 2014, 1:53 p.m. UTC
On Wed, Feb 26, 2014 at 02:46:05PM +0100, Uwe Kleine-König wrote:
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1595,6 +1595,7 @@ endchoice
>  
>  config PAGE_OFFSET
>  	hex
> +	default DRAM_BASE if !MMU
>  	default 0x40000000 if VMSPLIT_1G
>  	default 0x80000000 if VMSPLIT_2G
>  	default 0xC0000000

I'd prefer this actually:


It's more to the point.  The first hunk hides the "Memory split" option
which is irrelevent on !MMU.  We already know that PAGE_OFFSET should
be the same as PHYS_OFFSET for noMMU, so let's make that explicit.
Note that it already is by way of the bit in the last hunk - which as
a result of this change can now be removed... especially so as we have
nothing defining PAGE_OFFSET in arch/arm/*/include...

Comments

Arnd Bergmann Feb. 26, 2014, 2:02 p.m. UTC | #1
On Wednesday 26 February 2014 13:53:52 Russell King - ARM Linux wrote:
> It's more to the point.  The first hunk hides the "Memory split" option
> which is irrelevent on !MMU.  We already know that PAGE_OFFSET should
> be the same as PHYS_OFFSET for noMMU, so let's make that explicit.
> Note that it already is by way of the bit in the last hunk - which as
> a result of this change can now be removed... especially so as we have
> nothing defining PAGE_OFFSET in arch/arm/*/include...

Looks good to me as well. I first wasn't sure about what this would do
for platforms that define their own PLAT_PHYS_OFFSET, but we they are
broken anyway if you set a DRAM_BASE that is not the same as
PLAT_PHYS_OFFSET.

	Arnd
Uwe Kleine-König Feb. 26, 2014, 2:06 p.m. UTC | #2
On Wed, Feb 26, 2014 at 01:53:52PM +0000, Russell King - ARM Linux wrote:
> On Wed, Feb 26, 2014 at 02:46:05PM +0100, Uwe Kleine-König wrote:
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -1595,6 +1595,7 @@ endchoice
> >  
> >  config PAGE_OFFSET
> >  	hex
> > +	default DRAM_BASE if !MMU
> >  	default 0x40000000 if VMSPLIT_1G
> >  	default 0x80000000 if VMSPLIT_2G
> >  	default 0xC0000000
> 
> I'd prefer this actually:
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 24d65aae0491..09289d7b7f68 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1593,6 +1593,7 @@ config BL_SWITCHER_DUMMY_IF
>  
>  choice
>  	prompt "Memory split"
> +	depends on MMU
>  	default VMSPLIT_3G
>  	help
>  	  Select the desired split between kernel and user memory.
This hunk is already in my working copy, too :-)

> @@ -1610,6 +1611,7 @@ endchoice
>  
>  config PAGE_OFFSET
>  	hex
> +	default PHYS_OFFSET if !MMU
>  	default 0x40000000 if VMSPLIT_1G
>  	default 0x80000000 if VMSPLIT_2G
>  	default 0xC0000000
> diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> index 8756e4bcdba0..5ccc4a627192 100644
> --- a/arch/arm/include/asm/memory.h
> +++ b/arch/arm/include/asm/memory.h
> @@ -104,10 +104,6 @@
>  #define END_MEM     		(UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE)
>  #endif
>  
> -#ifndef PAGE_OFFSET
> -#define PAGE_OFFSET		PLAT_PHYS_OFFSET
> -#endif
> -
>  /*
>   * The module can be at any place in ram in nommu mode.
>   */
> 
> It's more to the point.  The first hunk hides the "Memory split" option
> which is irrelevent on !MMU.  We already know that PAGE_OFFSET should
> be the same as PHYS_OFFSET for noMMU, so let's make that explicit.
> Note that it already is by way of the bit in the last hunk - which as
> a result of this change can now be removed... especially so as we have
> nothing defining PAGE_OFFSET in arch/arm/*/include...
Looks reasonable. Maybe we can also get rid of PLAT_PHYS_OFFSET then.

Best regards
Uwe
Arnd Bergmann Feb. 26, 2014, 2:16 p.m. UTC | #3
On Wednesday 26 February 2014 15:06:32 Uwe Kleine-König wrote:
> > It's more to the point.  The first hunk hides the "Memory split" option
> > which is irrelevent on !MMU.  We already know that PAGE_OFFSET should
> > be the same as PHYS_OFFSET for noMMU, so let's make that explicit.
> > Note that it already is by way of the bit in the last hunk - which as
> > a result of this change can now be removed... especially so as we have
> > nothing defining PAGE_OFFSET in arch/arm/*/include...
>
> Looks reasonable. Maybe we can also get rid of PLAT_PHYS_OFFSET then.

I think we still need PLAT_PHYS_OFFSET for the configurations that cannot
use ARM_PATCH_PHYS_VIRT, which are:

* Anything using XIP_KERNEL with MMU=y
* mach-realview with the custom __phys_to_virt hack
* ZBOOT_ROM

	Arnd
Arnd Bergmann Feb. 26, 2014, 2:18 p.m. UTC | #4
On Wednesday 26 February 2014 15:16:40 Arnd Bergmann wrote:
> On Wednesday 26 February 2014 15:06:32 Uwe Kleine-König wrote:
> > > It's more to the point.  The first hunk hides the "Memory split" option
> > > which is irrelevent on !MMU.  We already know that PAGE_OFFSET should
> > > be the same as PHYS_OFFSET for noMMU, so let's make that explicit.
> > > Note that it already is by way of the bit in the last hunk - which as
> > > a result of this change can now be removed... especially so as we have
> > > nothing defining PAGE_OFFSET in arch/arm/*/include...
> >
> > Looks reasonable. Maybe we can also get rid of PLAT_PHYS_OFFSET then.
> 
> I think we still need PLAT_PHYS_OFFSET for the configurations that cannot
> use ARM_PATCH_PHYS_VIRT, which are:
> 
> * Anything using XIP_KERNEL with MMU=y
> * mach-realview with the custom __phys_to_virt hack
> * ZBOOT_ROM

Ah, nevermind. We need either PLAT_PHYS_OFFSET /or/ CONFIG_PHYS_OFFSET
for these case, but we could in theory drop the former.

	Arnd
Russell King - ARM Linux Feb. 26, 2014, 2:32 p.m. UTC | #5
On Wed, Feb 26, 2014 at 03:06:32PM +0100, Uwe Kleine-König wrote:
> Looks reasonable. Maybe we can also get rid of PLAT_PHYS_OFFSET then.

I don't think so - try grep.
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 24d65aae0491..09289d7b7f68 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1593,6 +1593,7 @@  config BL_SWITCHER_DUMMY_IF
 
 choice
 	prompt "Memory split"
+	depends on MMU
 	default VMSPLIT_3G
 	help
 	  Select the desired split between kernel and user memory.
@@ -1610,6 +1611,7 @@  endchoice
 
 config PAGE_OFFSET
 	hex
+	default PHYS_OFFSET if !MMU
 	default 0x40000000 if VMSPLIT_1G
 	default 0x80000000 if VMSPLIT_2G
 	default 0xC0000000
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 8756e4bcdba0..5ccc4a627192 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -104,10 +104,6 @@ 
 #define END_MEM     		(UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE)
 #endif
 
-#ifndef PAGE_OFFSET
-#define PAGE_OFFSET		PLAT_PHYS_OFFSET
-#endif
-
 /*
  * The module can be at any place in ram in nommu mode.
  */