[PATCH] ARM: clps711x: Switch to devicetree usage

Ahmad Fatoum a.fatoum at pengutronix.de
Fri May 20 02:56:23 PDT 2022


Hello,

On 20.05.22 10:24, Alexander Shiyan wrote:
> This is a complex patch that switches the ARM CLPS711X architecture
> to work with the device tree. Includes changes to board initialization
> and any architecture drivers used.
> 
> Signed-off-by: Alexander Shiyan <eagle.alexander923 at gmail.com>

> diff --git a/arch/arm/boards/clep7212/Makefile b/arch/arm/boards/clep7212/Makefile
> index 096120e567..85d92c8a7f 100644
> --- a/arch/arm/boards/clep7212/Makefile
> +++ b/arch/arm/boards/clep7212/Makefile

> +static __init int clep7212_fixup(void)
> +{
> +	if (of_machine_is_compatible("cirrus,ep7209"))
> +		of_register_fixup(clep7212_dt_fixup, NULL);
> +
> +	return 0;
> +}
> +postcore_initcall(clep7212_fixup);

You can replace this with the new barebox_set_serial_number(), see:
https://git.pengutronix.de/cgit/barebox/commit/?h=next&id=f6756e9ce6f26dc22506e25bd5cf1a4f6a173636

> -void __naked __bare_init barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint32_t r2)
> +ENTRY_FUNCTION(start_ep7212_clep7212, r0, r1, r2)
>  {
> +	void *fdt;
> +
>  	arm_cpu_lowlevel_init();
>  
> -	clps711x_barebox_entry(CLPS711X_CPU_PLL_MULT, NULL);
> +	/* Stack in SRAM */
> +	arm_setup_stack(CS6_BASE - 16);

please use ENTRY_FUNCTION_WITHSTACK instead to be a bit more
future-proof. Also - 16 is not necessary, see
6b3dc4abd884 ("ARM: Cleanup stack offset cargo cult").

> diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c
> new file mode 100644
> index 0000000000..d9f702a9b1
> --- /dev/null
> +++ b/arch/arm/mach-clps711x/common.c

> +static void clps711x_bus_patch(struct device_node *node,
> +			       u32 compare, u32 change)
> +{

Could you add a comment why this is necessary?

Cheers,
Ahmad


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list