diff mbox

[01/52] ARM: introduce atag_offset to replace boot_params

Message ID 1309920457-21913-1-git-send-email-nicolas.pitre@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Nicolas Pitre July 6, 2011, 2:46 a.m. UTC
The boot_params member of the mdesc structure is used to provide a
default physical address for the ATAG list.  Since this value is fixed
at compile time and often based on ARCH_PHYS_OFFSET, it gets in the way
of runtime PHYS_OFFSET usage.

Let's introduce atag_offset which should contains only the relative
offset from start of memory instead of an absolute value, in preparation
to move all instance of boot_params over to it.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
---
 arch/arm/include/asm/mach/arch.h |    1 +
 arch/arm/kernel/setup.c          |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

Comments

Stephen Boyd July 6, 2011, 4:28 a.m. UTC | #1
On 07/05/2011 07:46 PM, Nicolas Pitre wrote:
> diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
> index 7b79a00..1bdf6e1 100644
> --- a/arch/arm/include/asm/mach/arch.h
> +++ b/arch/arm/include/asm/mach/arch.h
> @@ -18,6 +18,7 @@ struct machine_desc {
>  	unsigned int		nr;		/* architecture number	*/
>  	const char		*name;		/* architecture name	*/
>  	unsigned long		boot_params;	/* tagged list		*/
> +	unsigned long		atag_offset;	/* tagged list (relative) */
>  	const char		**dt_compat;	/* array of device tree
>  						 * 'compatible' strings	*/
>  
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index e0db84d..4cc3e2b 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -816,6 +816,8 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
>  
>  	if (__atags_pointer)
>  		tags = phys_to_virt(__atags_pointer);
> +	else if(mdesc->atag_offset)
> +		tags = PAGE_OFFSET + mdesc->atag_offset;
>  	else if (mdesc->boot_params) {
>  #ifdef CONFIG_MMU
>  		/*

Would it make sense to drop the atag_offset in most board files and
default it to 0x100 in the MACHINE_START macro itself? It's almost a
universal value and would cut down on hundreds of lines.
Nicolas Pitre July 6, 2011, 12:54 p.m. UTC | #2
On Tue, 5 Jul 2011, Stephen Boyd wrote:

> On 07/05/2011 07:46 PM, Nicolas Pitre wrote:
> > diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
> > index 7b79a00..1bdf6e1 100644
> > --- a/arch/arm/include/asm/mach/arch.h
> > +++ b/arch/arm/include/asm/mach/arch.h
> > @@ -18,6 +18,7 @@ struct machine_desc {
> >  	unsigned int		nr;		/* architecture number	*/
> >  	const char		*name;		/* architecture name	*/
> >  	unsigned long		boot_params;	/* tagged list		*/
> > +	unsigned long		atag_offset;	/* tagged list (relative) */
> >  	const char		**dt_compat;	/* array of device tree
> >  						 * 'compatible' strings	*/
> >  
> > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> > index e0db84d..4cc3e2b 100644
> > --- a/arch/arm/kernel/setup.c
> > +++ b/arch/arm/kernel/setup.c
> > @@ -816,6 +816,8 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
> >  
> >  	if (__atags_pointer)
> >  		tags = phys_to_virt(__atags_pointer);
> > +	else if(mdesc->atag_offset)
> > +		tags = PAGE_OFFSET + mdesc->atag_offset;
> >  	else if (mdesc->boot_params) {
> >  #ifdef CONFIG_MMU
> >  		/*
> 
> Would it make sense to drop the atag_offset in most board files and
> default it to 0x100 in the MACHINE_START macro itself? It's almost a
> universal value and would cut down on hundreds of lines.

Well, no more than 50 lines actually.

And there are those cases where that value is not set to anything, and 
therefore I'd prefer we don't start always assuming something at 0x*100 
for them.  IOW, this is meant to be functionally transparent.


Nicolas
Stephen Boyd July 6, 2011, 5:59 p.m. UTC | #3
On 07/06/2011 05:54 AM, Nicolas Pitre wrote:
> On Tue, 5 Jul 2011, Stephen Boyd wrote:
>
>>
>> Would it make sense to drop the atag_offset in most board files and
>> default it to 0x100 in the MACHINE_START macro itself? It's almost a
>> universal value and would cut down on hundreds of lines.
>
> Well, no more than 50 lines actually.
>
> And there are those cases where that value is not set to anything, and 
> therefore I'd prefer we don't start always assuming something at 0x*100 
> for them.  IOW, this is meant to be functionally transparent.

Fair enough. Probably too magical anyway.
Hartley Sweeten July 7, 2011, 12:43 a.m. UTC | #4
On Tuesday, July 05, 2011 7:47 PM, Nicolas Pitre wrote:
> The boot_params member of the mdesc structure is used to provide a
> default physical address for the ATAG list.  Since this value is fixed
> at compile time and often based on ARCH_PHYS_OFFSET, it gets in the way
> of runtime PHYS_OFFSET usage.
> 
> Let's introduce atag_offset which should contains only the relative
> offset from start of memory instead of an absolute value, in preparation
> to move all instance of boot_params over to it.
> 
> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> ---
>  arch/arm/include/asm/mach/arch.h |    1 +
>  arch/arm/kernel/setup.c          |    2 ++
>  2 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
> index 7b79a00..1bdf6e1 100644
> --- a/arch/arm/include/asm/mach/arch.h
> +++ b/arch/arm/include/asm/mach/arch.h
> @@ -18,6 +18,7 @@ struct machine_desc {
>  	unsigned int		nr;		/* architecture number	*/
>  	const char		*name;		/* architecture name	*/
>  	unsigned long		boot_params;	/* tagged list		*/
> +	unsigned long		atag_offset;	/* tagged list (relative) */
>  	const char		**dt_compat;	/* array of device tree
>  						 * 'compatible' strings	*/
>  
> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index e0db84d..4cc3e2b 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -816,6 +816,8 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
>  
>  	if (__atags_pointer)
>  		tags = phys_to_virt(__atags_pointer);
> +	else if(mdesc->atag_offset)
> +		tags = PAGE_OFFSET + mdesc->atag_offset;

This results in a warning...

arch/arm/kernel/setup.c: In function 'setup_arch':
arch/arm/kernel/setup.c:820: warning: assignment makes pointer from integer without a cast

Regards,
Hartley
Nicolas Pitre July 7, 2011, 4:04 a.m. UTC | #5
On Wed, 6 Jul 2011, H Hartley Sweeten wrote:

> On Tuesday, July 05, 2011 7:47 PM, Nicolas Pitre wrote:
> > The boot_params member of the mdesc structure is used to provide a
> > default physical address for the ATAG list.  Since this value is fixed
> > at compile time and often based on ARCH_PHYS_OFFSET, it gets in the way
> > of runtime PHYS_OFFSET usage.
> > 
> > Let's introduce atag_offset which should contains only the relative
> > offset from start of memory instead of an absolute value, in preparation
> > to move all instance of boot_params over to it.
> > 
> > Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> > ---
> >  arch/arm/include/asm/mach/arch.h |    1 +
> >  arch/arm/kernel/setup.c          |    2 ++
> >  2 files changed, 3 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
> > index 7b79a00..1bdf6e1 100644
> > --- a/arch/arm/include/asm/mach/arch.h
> > +++ b/arch/arm/include/asm/mach/arch.h
> > @@ -18,6 +18,7 @@ struct machine_desc {
> >  	unsigned int		nr;		/* architecture number	*/
> >  	const char		*name;		/* architecture name	*/
> >  	unsigned long		boot_params;	/* tagged list		*/
> > +	unsigned long		atag_offset;	/* tagged list (relative) */
> >  	const char		**dt_compat;	/* array of device tree
> >  						 * 'compatible' strings	*/
> >  
> > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> > index e0db84d..4cc3e2b 100644
> > --- a/arch/arm/kernel/setup.c
> > +++ b/arch/arm/kernel/setup.c
> > @@ -816,6 +816,8 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
> >  
> >  	if (__atags_pointer)
> >  		tags = phys_to_virt(__atags_pointer);
> > +	else if(mdesc->atag_offset)
> > +		tags = PAGE_OFFSET + mdesc->atag_offset;
> 
> This results in a warning...
> 
> arch/arm/kernel/setup.c: In function 'setup_arch':
> arch/arm/kernel/setup.c:820: warning: assignment makes pointer from integer without a cast

Bleh.  Fixed, thanks.


Nicolas
Sergei Shtylyov July 7, 2011, 11:37 a.m. UTC | #6
Hello.

On 06-07-2011 6:46, Nicolas Pitre wrote:

> The boot_params member of the mdesc structure is used to provide a
> default physical address for the ATAG list.  Since this value is fixed
> at compile time and often based on ARCH_PHYS_OFFSET, it gets in the way
> of runtime PHYS_OFFSET usage.

> Let's introduce atag_offset which should contains only the relative
> offset from start of memory instead of an absolute value, in preparation
> to move all instance of boot_params over to it.

> Signed-off-by: Nicolas Pitre<nicolas.pitre@linaro.org>
[...]

> diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> index e0db84d..4cc3e2b 100644
> --- a/arch/arm/kernel/setup.c
> +++ b/arch/arm/kernel/setup.c
> @@ -816,6 +816,8 @@ static struct machine_desc * __init setup_machine_tags(unsigned int nr)
>
>   	if (__atags_pointer)
>   		tags = phys_to_virt(__atags_pointer);
> +	else if(mdesc->atag_offset)

    Should be space after *if* -- checkpatch.pl should have complained.

WBR, Sergei
Nicolas Pitre July 7, 2011, 3:37 p.m. UTC | #7
On Thu, 7 Jul 2011, Sergei Shtylyov wrote:

> Hello.
> 
> On 06-07-2011 6:46, Nicolas Pitre wrote:
> 
> > The boot_params member of the mdesc structure is used to provide a
> > default physical address for the ATAG list.  Since this value is fixed
> > at compile time and often based on ARCH_PHYS_OFFSET, it gets in the way
> > of runtime PHYS_OFFSET usage.
> 
> > Let's introduce atag_offset which should contains only the relative
> > offset from start of memory instead of an absolute value, in preparation
> > to move all instance of boot_params over to it.
> 
> > Signed-off-by: Nicolas Pitre<nicolas.pitre@linaro.org>
> [...]
> 
> > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
> > index e0db84d..4cc3e2b 100644
> > --- a/arch/arm/kernel/setup.c
> > +++ b/arch/arm/kernel/setup.c
> > @@ -816,6 +816,8 @@ static struct machine_desc * __init
> > setup_machine_tags(unsigned int nr)
> > 
> >   	if (__atags_pointer)
> >   		tags = phys_to_virt(__atags_pointer);
> > +	else if(mdesc->atag_offset)
> 
>    Should be space after *if* -- checkpatch.pl should have complained.

Indeed, thanks.


Nicolas
Hartley Sweeten July 7, 2011, 6:28 p.m. UTC | #8
On Wednesday, July 06, 2011 9:04 PM, Nicolas Pitre wrote:
> On Wed, 6 Jul 2011, H Hartley Sweeten wrote:
>>> +	else if(mdesc->atag_offset)
>>> +		tags = PAGE_OFFSET + mdesc->atag_offset;
>> 
>> This results in a warning...
>> 
>> arch/arm/kernel/setup.c: In function 'setup_arch':
>> arch/arm/kernel/setup.c:820: warning: assignment makes pointer from integer without a cast
>
> Bleh.  Fixed, thanks.

Thanks.

Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Russell King - ARM Linux July 8, 2011, 8:36 p.m. UTC | #9
On Tue, Jul 05, 2011 at 10:46:46PM -0400, Nicolas Pitre wrote:
> The boot_params member of the mdesc structure is used to provide a
> default physical address for the ATAG list.  Since this value is fixed
> at compile time and often based on ARCH_PHYS_OFFSET, it gets in the way
> of runtime PHYS_OFFSET usage.
> 
> Let's introduce atag_offset which should contains only the relative
> offset from start of memory instead of an absolute value, in preparation
> to move all instance of boot_params over to it.

I don't like this.

While I understand the issue (the oops when we try to dereference the
absolute address), the fact is that's how it is.

Take a moment to think about this.  The ATAG list is normally setup at a
fixed physical address by the boot loader.  While there are some boot
loaders which allow you to load the kernel at different physical addresses,
they still place the ATAG list at that same physical address.

That means if you change this into an offset from the kernels idea of
PHYS_OFFSET, it's not going to find the ATAGs.

So we're probably better off checking whether the platform provided ATAG
pointer is below our idea of PHYS_OFFSET, and if it is to ignore that.
The ultimate effect will be the same - the kernel won't find the ATAGs
and won't crash instead.  And no need for all this churn either.
Nicolas Pitre July 8, 2011, 9:20 p.m. UTC | #10
On Fri, 8 Jul 2011, Russell King - ARM Linux wrote:

> On Tue, Jul 05, 2011 at 10:46:46PM -0400, Nicolas Pitre wrote:
> > The boot_params member of the mdesc structure is used to provide a
> > default physical address for the ATAG list.  Since this value is fixed
> > at compile time and often based on ARCH_PHYS_OFFSET, it gets in the way
> > of runtime PHYS_OFFSET usage.
> > 
> > Let's introduce atag_offset which should contains only the relative
> > offset from start of memory instead of an absolute value, in preparation
> > to move all instance of boot_params over to it.
> 
> I don't like this.
> 
> While I understand the issue (the oops when we try to dereference the
> absolute address), the fact is that's how it is.
> 
> Take a moment to think about this.  The ATAG list is normally setup at a
> fixed physical address by the boot loader.  While there are some boot
> loaders which allow you to load the kernel at different physical addresses,
> they still place the ATAG list at that same physical address.

Would they really load the kernel at a different address?

> That means if you change this into an offset from the kernels idea of
> PHYS_OFFSET, it's not going to find the ATAGs.

Is this going to be a real issue in practice?

> So we're probably better off checking whether the platform provided ATAG
> pointer is below our idea of PHYS_OFFSET, and if it is to ignore that.

The code already does that.

Alternatively, I can make the boot_params values into numeric values 
instead of PLAT_PHYS_OFFSET or any other symbolic define I'd like to get 
rid of.  What do you think?


Nicolas
Nicolas Pitre July 11, 2011, 2:59 p.m. UTC | #11
On Fri, 8 Jul 2011, Nicolas Pitre wrote:

> On Fri, 8 Jul 2011, Russell King - ARM Linux wrote:
> 
> > On Tue, Jul 05, 2011 at 10:46:46PM -0400, Nicolas Pitre wrote:
> > > The boot_params member of the mdesc structure is used to provide a
> > > default physical address for the ATAG list.  Since this value is fixed
> > > at compile time and often based on ARCH_PHYS_OFFSET, it gets in the way
> > > of runtime PHYS_OFFSET usage.
> > > 
> > > Let's introduce atag_offset which should contains only the relative
> > > offset from start of memory instead of an absolute value, in preparation
> > > to move all instance of boot_params over to it.
> > 
> > I don't like this.
> > 
> > While I understand the issue (the oops when we try to dereference the
> > absolute address), the fact is that's how it is.
> > 
> > Take a moment to think about this.  The ATAG list is normally setup at a
> > fixed physical address by the boot loader.  While there are some boot
> > loaders which allow you to load the kernel at different physical addresses,
> > they still place the ATAG list at that same physical address.
> 
> Would they really load the kernel at a different address?
> 
> > That means if you change this into an offset from the kernels idea of
> > PHYS_OFFSET, it's not going to find the ATAGs.
> 
> Is this going to be a real issue in practice?
> 
> > So we're probably better off checking whether the platform provided ATAG
> > pointer is below our idea of PHYS_OFFSET, and if it is to ignore that.
> 
> The code already does that.
> 
> Alternatively, I can make the boot_params values into numeric values 
> instead of PLAT_PHYS_OFFSET or any other symbolic define I'd like to get 
> rid of.  What do you think?

After looking at it some more, this can't work either as on ep93xx the 
RAM offset is currently selected a kernel config time and we do want to 
get rid of that.

Furthermore, the code in setup_machine_tags() always validates the atags 
pointer with ATAG_CORE and assigns it the address of init_tags 
otherwise.  Given that the atag offset is always within the first 
megabyte which is always mapped, the kernel won't crash even if the 
ATAGs are not there.


Nicolas
Hartley Sweeten July 11, 2011, 5:17 p.m. UTC | #12
On Monday, July 11, 2011 7:59 AM, Nicolas Pitre wrote:
> After looking at it some more, this can't work either as on ep93xx the 
> RAM offset is currently selected a kernel config time and we do want to 
> get rid of that.

The ep93xx actually uses the same relative offset for the boot_params (+0x100)
for all memory configurations.  The issue is the base physical address of the
system memory.

There are four sdram chip selects available on the ep93xx.  These, along with
the ASDO boot option pin, define the base address for the sdram.

nSDCS3, ASDO=1	0x00000000
nSDCS3, ASDO=0	0xf0000000
nSDCS2, ASDO=x	0xe0000000
nSDCS1, ASDO=x	0xd0000000
nSDCS0, ASDO=x	0xc0000000

Unfortunately, all the ep93xx boards I have are designed with the sdram using
nSDCS0 so I can't test the other boot configurations.

Regardless, with these patches, and having ARM_PATCH_PHYS_VIRT enabled, I am
able to boot all of my boards successfully.

The EDB9315 dev board can be jumper selected so that the sdram is connected
to either nSDSC0 or nSDCS3 (default).

The EDB9312 dev board can be jumper selected to use any of the chip selects
for the sdram.

If anyone has access to either of these boards and could test these patches
it would be a great help.

Before the ARM_PATCH_PHYS_VIRT patch the Kconfig options to select the
"EP93xx first SDRAM bank selection" was needed to limit the board selections
so that only board which shared an SDRAM chip select configuration could be
selected.  With ARM_PATCH_PHYS_VIRT I don't think this is needed any longer.

But, if the boot_params are still going to be used, the bank selection is still
needed so that the physical address of the boot_params is correct.  Changing it
to an atag_offset makes it work on the ep93xx.

Just my 2 cents....

Regards,
Hartley
Petr Štetiar July 12, 2011, 8:48 p.m. UTC | #13
H Hartley Sweeten <hartleys@visionengravers.com> [2011-07-11 12:17:25]:

> Unfortunately, all the ep93xx boards I have are designed with the sdram using
> nSDCS0 so I can't test the other boot configurations.

I've tested that actual patchset from nico/redux git branch[1,2] on
ts-7250/32M and ts-7300/128M (both nSDCS3) and it boots, so you can add my
tested-by if you like:

Tested-by: Petr Štetiar <ynezz@true.cz>

1. git://git.linaro.org/people/nico/linux.git redux
2. git hash bc869e434e411ee7f3fcfed7594ee64b1d56b3c9

-- ynezz
Hartley Sweeten July 12, 2011, 9:39 p.m. UTC | #14
On Tuesday, July 12, 2011 1:48 PM, Petr Štetiar wrote:
> H Hartley Sweeten <hartleys@visionengravers.com> [2011-07-11 12:17:25]:
>
>> Unfortunately, all the ep93xx boards I have are designed with the sdram using
>> nSDCS0 so I can't test the other boot configurations.
>
> I've tested that actual patchset from nico/redux git branch[1,2] on
> ts-7250/32M and ts-7300/128M (both nSDCS3) and it boots, so you can add my
> tested-by if you like:
> 
> Tested-by: Petr Štetiar <ynezz@true.cz>
> 
> 1. git://git.linaro.org/people/nico/linux.git redux
> 2. git hash bc869e434e411ee7f3fcfed7594ee64b1d56b3c9

So, I guess the big test would be to see if a kernel that boots on your boards
using nSDCS3 will also boot on mine using nSDCS0.

Could you rebuild your kernel with MACH_EDB9307A also selected in your
config?  After verifying that it still boots please either send me the zImage
or place it somewhere I can grab it and I will make sure it boots on mine.

Regards,
Hartley
Nicolas Pitre July 13, 2011, 3:22 a.m. UTC | #15
On Tue, 12 Jul 2011, Petr Štetiar wrote:

> H Hartley Sweeten <hartleys@visionengravers.com> [2011-07-11 12:17:25]:
> 
> > Unfortunately, all the ep93xx boards I have are designed with the sdram using
> > nSDCS0 so I can't test the other boot configurations.
> 
> I've tested that actual patchset from nico/redux git branch[1,2] on
> ts-7250/32M and ts-7300/128M (both nSDCS3) and it boots, so you can add my
> tested-by if you like:
> 
> Tested-by: Petr Štetiar <ynezz@true.cz>

Thanks.


Nicolas
Petr Štetiar July 15, 2011, 6:48 a.m. UTC | #16
H Hartley Sweeten <hartleys@visionengravers.com> [2011-07-12 16:39:47]:

> Could you rebuild your kernel with MACH_EDB9307A also selected in your
> config?  After verifying that it still boots please either send me the zImage
> or place it somewhere I can grab it and I will make sure it boots on mine.

Verified, kernel[1,2] boots. Source tree[3] used to build it (including config etc).

1. http://ynezz.true.cz/redux/zImage 
2. http://ynezz.true.cz/redux/zImage.md5sum 
3. https://github.com/ynezz/linux-2.6/commits/test-redux

-- ynezz
Hartley Sweeten July 15, 2011, 10:40 p.m. UTC | #17
On Thursday, July 14, 2011 11:49 PM, Petr Štetiar wrote:
> H Hartley Sweeten <hartleys@visionengravers.com> [2011-07-12 16:39:47]:
>
>> Could you rebuild your kernel with MACH_EDB9307A also selected in your
>> config?  After verifying that it still boots please either send me the zImage
>> or place it somewhere I can grab it and I will make sure it boots on mine.
>
> Verified, kernel[1,2] boots. Source tree[3] used to build it (including config etc).
>
> 1. http://ynezz.true.cz/redux/zImage 
> 2. http://ynezz.true.cz/redux/zImage.md5sum 
> 3. https://github.com/ynezz/linux-2.6/commits/test-redux

Well... Partial success...

The kernel does boot, but then panic's when trying to mount the root fs.

All my development boards are setup to pull the rootfs from a tftp server
and then use root=/dev/ram as the rootfs.  This kernel must be missing something
for that to work.

Regardless, the kernel _does_ boot so the phys offset is correctly being
worked out at run-time and the memory configuration looks correct so the
atags offset must be working.

So, as far as the ep39xx goes, for this patchset you can have either of these:

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Regards,
Hartley
Nicolas Pitre July 16, 2011, 2:44 a.m. UTC | #18
On Fri, 15 Jul 2011, H Hartley Sweeten wrote:

> On Thursday, July 14, 2011 11:49 PM, Petr Štetiar wrote:
> > H Hartley Sweeten <hartleys@visionengravers.com> [2011-07-12 16:39:47]:
> >
> >> Could you rebuild your kernel with MACH_EDB9307A also selected in your
> >> config?  After verifying that it still boots please either send me the zImage
> >> or place it somewhere I can grab it and I will make sure it boots on mine.
> >
> > Verified, kernel[1,2] boots. Source tree[3] used to build it (including config etc).
> >
> > 1. http://ynezz.true.cz/redux/zImage 
> > 2. http://ynezz.true.cz/redux/zImage.md5sum 
> > 3. https://github.com/ynezz/linux-2.6/commits/test-redux
> 
> Well... Partial success...
> 
> The kernel does boot, but then panic's when trying to mount the root fs.
> 
> All my development boards are setup to pull the rootfs from a tftp server
> and then use root=/dev/ram as the rootfs.  This kernel must be missing something
> for that to work.
> 
> Regardless, the kernel _does_ boot so the phys offset is correctly being
> worked out at run-time and the memory configuration looks correct so the
> atags offset must be working.
> 
> So, as far as the ep39xx goes, for this patchset you can have either of these:
> 
> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> 
> Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Thanks a lot for the testing.  This validates the basic concept.


Nicolas
diff mbox

Patch

diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 7b79a00..1bdf6e1 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -18,6 +18,7 @@  struct machine_desc {
 	unsigned int		nr;		/* architecture number	*/
 	const char		*name;		/* architecture name	*/
 	unsigned long		boot_params;	/* tagged list		*/
+	unsigned long		atag_offset;	/* tagged list (relative) */
 	const char		**dt_compat;	/* array of device tree
 						 * 'compatible' strings	*/
 
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index e0db84d..4cc3e2b 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -816,6 +816,8 @@  static struct machine_desc * __init setup_machine_tags(unsigned int nr)
 
 	if (__atags_pointer)
 		tags = phys_to_virt(__atags_pointer);
+	else if(mdesc->atag_offset)
+		tags = PAGE_OFFSET + mdesc->atag_offset;
 	else if (mdesc->boot_params) {
 #ifdef CONFIG_MMU
 		/*