[PATCH u-boot-marvell 4/9] watchdog: armada_37xx: Convert to official DT bindings

Stefan Roese sr at denx.de
Tue Feb 15 10:25:31 CET 2022


On 2/14/22 11:34, Pali Rohár wrote:
> Official DT bindings have only one reg property: watchdog address space.
> Convert armada-37xx-wdt.c driver to offical DT bindings and access sel_reg
> register via MVEBU_REGISTER() macro, as its value (required by U-Boot
> driver) is not in DT yet. In later stage can be driver cleaned to not use
> it.

Yes, that would be good.

> This change would allow U-Boot to use A3720 watchdog DTS structure from
> Linux kernel.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   arch/arm/dts/armada-37xx.dtsi      | 3 +--
>   drivers/watchdog/armada-37xx-wdt.c | 7 ++-----
>   2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/dts/armada-37xx.dtsi b/arch/arm/dts/armada-37xx.dtsi
> index a427d9cf6218..4c686c380cee 100644
> --- a/arch/arm/dts/armada-37xx.dtsi
> +++ b/arch/arm/dts/armada-37xx.dtsi
> @@ -109,8 +109,7 @@
>   
>   			wdt: watchdog-timer at 8300 {
>   				compatible = "marvell,armada-3700-wdt";
> -				reg = <0xd064 0x4>,
> -				      <0x8300 0x40>;
> +				reg = <0x8300 0x40>;
>   			};
>   
>   			nb_periph_clk: nb-periph-clk at 13000 {
> diff --git a/drivers/watchdog/armada-37xx-wdt.c b/drivers/watchdog/armada-37xx-wdt.c
> index 6b5e1ab6fc35..2e119b9b5aad 100644
> --- a/drivers/watchdog/armada-37xx-wdt.c
> +++ b/drivers/watchdog/armada-37xx-wdt.c
> @@ -155,12 +155,9 @@ static int a37xx_wdt_probe(struct udevice *dev)
>   	struct a37xx_wdt *priv = dev_get_priv(dev);
>   	fdt_addr_t addr;
>   
> -	addr = dev_read_addr_index(dev, 0);
> -	if (addr == FDT_ADDR_T_NONE)
> -		goto err;
> -	priv->sel_reg = (void __iomem *)addr;
> +	priv->sel_reg = (void __iomem *)MVEBU_REGISTER(0x0d064);
>   
> -	addr = dev_read_addr_index(dev, 1);
> +	addr = dev_read_addr(dev);
>   	if (addr == FDT_ADDR_T_NONE)
>   		goto err;
>   	priv->reg = (void __iomem *)addr;

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list