[PATCH v2 8/9] powerpc/boot: Fixup device-tree on little endian

Nicholas Piggin npiggin at gmail.com
Sat Jun 19 13:14:20 AEST 2021


Excerpts from Paul Mackerras's message of June 18, 2021 1:49 pm:
> From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> 
> This fixes the core devtree.c functions and the ns16550 UART backend.

Looks okay. Can sparse be run on arch/powerpc/boot? Would be nice to
get that working and endian annotations at some point.

> @@ -240,7 +249,6 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
>  		return 0;
>  
>  	dt_get_reg_format(parent, &naddr, &nsize);
> -
>  	if (nsize > 2)
>  		return 0;
>  

Unrelated hunk.

> @@ -278,7 +286,6 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
>  
>  		offset = find_range(last_addr, prop_buf, prev_naddr,
>  		                    naddr, prev_nsize, buflen / 4);
> -
>  		if (offset < 0)
>  			return 0;
>  

And there.

> diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c
> index b0da4466d419..f16d2be1d0f3 100644
> --- a/arch/powerpc/boot/ns16550.c
> +++ b/arch/powerpc/boot/ns16550.c
> @@ -15,6 +15,7 @@
>  #include "stdio.h"
>  #include "io.h"
>  #include "ops.h"
> +#include "of.h"
>  
>  #define UART_DLL	0	/* Out: Divisor Latch Low */
>  #define UART_DLM	1	/* Out: Divisor Latch High */
> @@ -58,16 +59,20 @@ int ns16550_console_init(void *devp, struct serial_console_data *scdp)
>  	int n;
>  	u32 reg_offset;
>  
> -	if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1)
> +	if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1) {
> +		printf("virt reg parse fail...\r\n");
>  		return -1;
> +	}

Leftover debug.  Otherwise,

Acked-by: Nicholas Piggin <npiggin at gmail.com>

Thanks,
Nick


More information about the Linuxppc-dev mailing list