Re: [ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage

2016-11-30 Thread Alexander Dahl
Hei hei,

On Tue, Nov 29, 2016 at 10:04:19AM +0100, Marc Kleine-Budde wrote:
> What happens if you build a older kernel and don't configure
> PTXCONF_KERNEL_LOADADDR via ptxdist? Does it break while it used to work
> with an older ptxdist?

If I understood you correctly, that's not the case. Older kernels
don't need this passed, but somehow determine it. For example with
ptxdist 2015.10 and kernel 2.6.36.4 for at91sam9g20ek the loadaddr in
the final uImage is 0x20008000. The code for generating the image is
in arch/arm/boot/Makefile but I could not find out, where the actual
address comes from, if I don't pass LOADADDR. If I pass it (e.g. with
the backported patch) the address I pass is used (tried this with
another address).

So while LOADADDR needs to be passed for newer kernels, the build is
successful on older kernels with or without passing LOADADDR. Without
it is somehow determined by the kernel make files I suppose. When
passing LOADADDR the result is the same as for newer kernels.

Does this answer your question?

Í'm not sure how the patch would have to be extended, though.

Greets
Alex

-- 
»With the first link, the chain is forged. The first speech censured, 
the first thought forbidden, the first freedom denied, chains us all 
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: C28E E6B9 0263 95CF 8FAF  08FA 34AD CD00 7221 5CC6 ***


pgpUdYgpUUVAa.pgp
Description: PGP signature
___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage

2016-11-29 Thread Marc Kleine-Budde
On 11/29/2016 10:21 AM, Alexander Stein wrote:
> On Tuesday 29 November 2016 10:04:19, Marc Kleine-Budde wrote:
>> On 11/28/2016 05:46 PM, Michael Olbrich wrote:
>>> On Mon, Nov 28, 2016 at 11:21:31AM +0100, Alexander Dahl wrote:
 On newer kernels (4.x ?) kernel build fails when building an uImage
 unless you provide LOADADDR as kernel make var, which is put in the
 resulting uImage header. You could append it to
 PTXCONF_KERNEL_EXTRA_MAKEVARS but this would be just a workaround. This
 patch extends the menu if uImage is selected so you can directly input
 the desired address.
>>>
>>> I don't have a lot of experience with uImages. Marc, what do you think?
>>
>> According to rmk uimages are considered obsolete. However there are
>> probably some old bootloaders around that insist of that format.
> 
> What image format is the successor then? Or which should be used instead?

zImage

Marc

-- 
Pengutronix e.K.  | Marc Kleine-Budde   |
Industrial Linux Solutions| Phone: +49-231-2826-924 |
Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



signature.asc
Description: OpenPGP digital signature
___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage

2016-11-29 Thread Alexander Stein
On Tuesday 29 November 2016 10:04:19, Marc Kleine-Budde wrote:
> On 11/28/2016 05:46 PM, Michael Olbrich wrote:
> > On Mon, Nov 28, 2016 at 11:21:31AM +0100, Alexander Dahl wrote:
> >> On newer kernels (4.x ?) kernel build fails when building an uImage
> >> unless you provide LOADADDR as kernel make var, which is put in the
> >> resulting uImage header. You could append it to
> >> PTXCONF_KERNEL_EXTRA_MAKEVARS but this would be just a workaround. This
> >> patch extends the menu if uImage is selected so you can directly input
> >> the desired address.
> > 
> > I don't have a lot of experience with uImages. Marc, what do you think?
> 
> According to rmk uimages are considered obsolete. However there are
> probably some old bootloaders around that insist of that format.

What image format is the successor then? Or which should be used instead?

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein
SYS TEC electronic GmbH
alexander.st...@systec-electronic.com

Legal and Commercial Address:
Am Windrad 2
08468 Heinsdorfergrund
Germany

Office: +49 (0) 3765 38600-0
Fax:+49 (0) 3765 38600-4100
 
Managing Directors:
Director Technology/CEO: Dipl.-Phys. Siegmar Schmidt;
Director Commercial Affairs/COO: Dipl. Ing. (FH) Armin von Collrepp
Commercial Registry:
Amtsgericht Chemnitz, HRB 28082; USt.-Id Nr. DE150534010


___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage

2016-11-29 Thread Uwe Kleine-König
On Tue, Nov 29, 2016 at 10:04:19AM +0100, Marc Kleine-Budde wrote:
> What happens if you build a older kernel and don't configure
> PTXCONF_KERNEL_LOADADDR via ptxdist? Does it break while it used to work
> with an older ptxdist?

Passing LOADADDR is necessary since Linux commit 
938f94cde74b ("ARM: 7656/1: uImage: Error out on build of multiplatform without 
LOADADDR")

The first release including this one is v3.9-rc1.

Best regards
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage

2016-11-29 Thread Michael Olbrich
On Tue, Nov 29, 2016 at 10:04:19AM +0100, Marc Kleine-Budde wrote:
> On 11/28/2016 05:46 PM, Michael Olbrich wrote:
> > On Mon, Nov 28, 2016 at 11:21:31AM +0100, Alexander Dahl wrote:
> >> On newer kernels (4.x ?) kernel build fails when building an uImage
> >> unless you provide LOADADDR as kernel make var, which is put in the
> >> resulting uImage header. You could append it to
> >> PTXCONF_KERNEL_EXTRA_MAKEVARS but this would be just a workaround. This
> >> patch extends the menu if uImage is selected so you can directly input
> >> the desired address.
> > 
> > I don't have a lot of experience with uImages. Marc, what do you think?
> 
> According to rmk uimages are considered obsolete. However there are
> probably some old bootloaders around that insist of that format.
> 
> >> Signed-off-by: Alexander Dahl 
> >> ---
> >>  platforms/kernel.in | 7 +++
> >>  rules/kernel.make   | 5 +
> >>  2 files changed, 12 insertions(+)
> >>
> >> diff --git a/platforms/kernel.in b/platforms/kernel.in
> >> index fd1c492..2a00122 100644
> >> --- a/platforms/kernel.in
> >> +++ b/platforms/kernel.in
> >> @@ -213,6 +213,13 @@ config KERNEL_IMAGE
> >>  config KERNEL_DTC
> >>bool
> >>  
> >> +config KERNEL_LOADADDR
> >> +  hex
> >> +  prompt "uImage load address"
> >> +  depends on KERNEL_IMAGE_U
> >> +  help
> >> +Newer kernels want this passed if you build an uImage.
> >> +
> > 
> > This should be right after the image selection.
> > 
> > Michael
> > 
> >>  config KERNEL_XZ
> >>prompt "build xz-utils hosttool"
> >>bool
> >> diff --git a/rules/kernel.make b/rules/kernel.make
> >> index d02a69c..3270231 100644
> >> --- a/rules/kernel.make
> >> +++ b/rules/kernel.make
> >> @@ -71,6 +71,11 @@ KERNEL_MAKEVARS += \
> >>DEPMOD=$(PTXCONF_SYSROOT_HOST)/sbin/depmod
> >>  endif
> >>  
> >> +ifdef PTXCONF_KERNEL_IMAGE_U
> >> +KERNEL_MAKEVARS += \
> >> +  LOADADDR=$(PTXCONF_KERNEL_LOADADDR)
> >> +endif
> >> +
> 
> What happens if you build a older kernel and don't configure
> PTXCONF_KERNEL_LOADADDR via ptxdist? Does it break while it used to work
> with an older ptxdist?

We should add an 'empty' check. And the help text should include the kernel
version that introduced this requirement.

Michael


-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage

2016-11-29 Thread Marc Kleine-Budde
On 11/28/2016 05:46 PM, Michael Olbrich wrote:
> On Mon, Nov 28, 2016 at 11:21:31AM +0100, Alexander Dahl wrote:
>> On newer kernels (4.x ?) kernel build fails when building an uImage
>> unless you provide LOADADDR as kernel make var, which is put in the
>> resulting uImage header. You could append it to
>> PTXCONF_KERNEL_EXTRA_MAKEVARS but this would be just a workaround. This
>> patch extends the menu if uImage is selected so you can directly input
>> the desired address.
> 
> I don't have a lot of experience with uImages. Marc, what do you think?

According to rmk uimages are considered obsolete. However there are
probably some old bootloaders around that insist of that format.

>> Signed-off-by: Alexander Dahl 
>> ---
>>  platforms/kernel.in | 7 +++
>>  rules/kernel.make   | 5 +
>>  2 files changed, 12 insertions(+)
>>
>> diff --git a/platforms/kernel.in b/platforms/kernel.in
>> index fd1c492..2a00122 100644
>> --- a/platforms/kernel.in
>> +++ b/platforms/kernel.in
>> @@ -213,6 +213,13 @@ config KERNEL_IMAGE
>>  config KERNEL_DTC
>>  bool
>>  
>> +config KERNEL_LOADADDR
>> +hex
>> +prompt "uImage load address"
>> +depends on KERNEL_IMAGE_U
>> +help
>> +  Newer kernels want this passed if you build an uImage.
>> +
> 
> This should be right after the image selection.
> 
> Michael
> 
>>  config KERNEL_XZ
>>  prompt "build xz-utils hosttool"
>>  bool
>> diff --git a/rules/kernel.make b/rules/kernel.make
>> index d02a69c..3270231 100644
>> --- a/rules/kernel.make
>> +++ b/rules/kernel.make
>> @@ -71,6 +71,11 @@ KERNEL_MAKEVARS += \
>>  DEPMOD=$(PTXCONF_SYSROOT_HOST)/sbin/depmod
>>  endif
>>  
>> +ifdef PTXCONF_KERNEL_IMAGE_U
>> +KERNEL_MAKEVARS += \
>> +LOADADDR=$(PTXCONF_KERNEL_LOADADDR)
>> +endif
>> +

What happens if you build a older kernel and don't configure
PTXCONF_KERNEL_LOADADDR via ptxdist? Does it break while it used to work
with an older ptxdist?

Marc
-- 
Pengutronix e.K.  | Marc Kleine-Budde   |
Industrial Linux Solutions| Phone: +49-231-2826-924 |
Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



signature.asc
Description: OpenPGP digital signature
___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage

2016-11-28 Thread Michael Olbrich
On Mon, Nov 28, 2016 at 11:21:31AM +0100, Alexander Dahl wrote:
> On newer kernels (4.x ?) kernel build fails when building an uImage
> unless you provide LOADADDR as kernel make var, which is put in the
> resulting uImage header. You could append it to
> PTXCONF_KERNEL_EXTRA_MAKEVARS but this would be just a workaround. This
> patch extends the menu if uImage is selected so you can directly input
> the desired address.

I don't have a lot of experience with uImages. Marc, what do you think?

> Signed-off-by: Alexander Dahl 
> ---
>  platforms/kernel.in | 7 +++
>  rules/kernel.make   | 5 +
>  2 files changed, 12 insertions(+)
> 
> diff --git a/platforms/kernel.in b/platforms/kernel.in
> index fd1c492..2a00122 100644
> --- a/platforms/kernel.in
> +++ b/platforms/kernel.in
> @@ -213,6 +213,13 @@ config KERNEL_IMAGE
>  config KERNEL_DTC
>   bool
>  
> +config KERNEL_LOADADDR
> + hex
> + prompt "uImage load address"
> + depends on KERNEL_IMAGE_U
> + help
> +   Newer kernels want this passed if you build an uImage.
> +

This should be right after the image selection.

Michael

>  config KERNEL_XZ
>   prompt "build xz-utils hosttool"
>   bool
> diff --git a/rules/kernel.make b/rules/kernel.make
> index d02a69c..3270231 100644
> --- a/rules/kernel.make
> +++ b/rules/kernel.make
> @@ -71,6 +71,11 @@ KERNEL_MAKEVARS += \
>   DEPMOD=$(PTXCONF_SYSROOT_HOST)/sbin/depmod
>  endif
>  
> +ifdef PTXCONF_KERNEL_IMAGE_U
> +KERNEL_MAKEVARS += \
> + LOADADDR=$(PTXCONF_KERNEL_LOADADDR)
> +endif
> +
>  #
>  # Make the build more predictable if $(KERNEL_DIR) is not a symlink
>  #
> -- 
> 2.1.4
> 
> 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] [PATCH 1/2] kernel: pass loadaddr for building uImage

2016-11-28 Thread Alexander Dahl
On newer kernels (4.x ?) kernel build fails when building an uImage
unless you provide LOADADDR as kernel make var, which is put in the
resulting uImage header. You could append it to
PTXCONF_KERNEL_EXTRA_MAKEVARS but this would be just a workaround. This
patch extends the menu if uImage is selected so you can directly input
the desired address.

Signed-off-by: Alexander Dahl 
---
 platforms/kernel.in | 7 +++
 rules/kernel.make   | 5 +
 2 files changed, 12 insertions(+)

diff --git a/platforms/kernel.in b/platforms/kernel.in
index fd1c492..2a00122 100644
--- a/platforms/kernel.in
+++ b/platforms/kernel.in
@@ -213,6 +213,13 @@ config KERNEL_IMAGE
 config KERNEL_DTC
bool
 
+config KERNEL_LOADADDR
+   hex
+   prompt "uImage load address"
+   depends on KERNEL_IMAGE_U
+   help
+ Newer kernels want this passed if you build an uImage.
+
 config KERNEL_XZ
prompt "build xz-utils hosttool"
bool
diff --git a/rules/kernel.make b/rules/kernel.make
index d02a69c..3270231 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -71,6 +71,11 @@ KERNEL_MAKEVARS += \
DEPMOD=$(PTXCONF_SYSROOT_HOST)/sbin/depmod
 endif
 
+ifdef PTXCONF_KERNEL_IMAGE_U
+KERNEL_MAKEVARS += \
+   LOADADDR=$(PTXCONF_KERNEL_LOADADDR)
+endif
+
 #
 # Make the build more predictable if $(KERNEL_DIR) is not a symlink
 #
-- 
2.1.4


___
ptxdist mailing list
ptxdist@pengutronix.de