]> git.baikalelectronics.ru Git - uboot.git/commitdiff
watchdog: armada_37xx: Convert to official DT bindings
authorPali Rohár <pali@kernel.org>
Mon, 14 Feb 2022 10:34:25 +0000 (11:34 +0100)
committerStefan Roese <sr@denx.de>
Thu, 17 Feb 2022 13:17:07 +0000 (14:17 +0100)
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.

This change would allow U-Boot to use A3720 watchdog DTS structure from
Linux kernel.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/arm/dts/armada-37xx.dtsi
drivers/watchdog/armada-37xx-wdt.c

index a427d9cf6218beb02e9bba7ee2617abfb6ac44ae..4c686c380cee73f0da506031324581da69167c1a 100644 (file)
 
                        wdt: watchdog-timer@8300 {
                                compatible = "marvell,armada-3700-wdt";
-                               reg = <0xd064 0x4>,
-                                     <0x8300 0x40>;
+                               reg = <0x8300 0x40>;
                        };
 
                        nb_periph_clk: nb-periph-clk@13000 {
index 6b5e1ab6fc3583aed16bf2b29ec1bb49388f7c8a..2e119b9b5aadf3ce544abccf3d4bc9970d4119b2 100644 (file)
@@ -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;