[PATCH] ARM: Use armlinux_bootparams address for DTB

Sascha Hauer s.hauer at pengutronix.de
Tue Jul 9 13:54:33 EDT 2013


On Tue, Jul 09, 2013 at 04:56:40PM +0400, Alexander Shiyan wrote:
> In some cases, the address of the devicetree, which is obtained
> dynamically, may be located in the kernel text area, which leads
> to malfunction of the devicetree. The patch uses the address of
> the devicetree, designed for the board, if it possible.
> 
> Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
> ---
>  arch/arm/lib/armlinux.c | 20 ++++++++++++--------
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
> index 40a63ea..12fb06d 100644
> --- a/arch/arm/lib/armlinux.c
> +++ b/arch/arm/lib/armlinux.c
> @@ -261,16 +261,20 @@ void start_linux(void *adr, int swap, unsigned long initrd_address,
>  		unsigned long initrd_size, void *oftree)
>  {
>  	void (*kernel)(int zero, int arch, void *params) = adr;
> -	void *params = NULL;
>  	int architecture;
>  
>  	if (oftree) {
> -		printf("booting Linux kernel with devicetree\n");

This is a useful information that gets removed here. Could you keep it?

> -		params = oftree;
> -	} else {
> +		if (armlinux_bootparams) {
> +			struct fdt_header *header = oftree;
> +
> +			printf("Relocate DTB to 0x%p\n", armlinux_bootparams);

This is more useful for verbose mode, but I think not for the normal
case.

Sascha

-- 
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-5555 |



More information about the barebox mailing list