On Thu, Apr 10, 2025 at 12:28 PM Eugen Hristev <eugen.hris...@linaro.org> wrote:
>
> This breaks sama5d2_xplained_mmc_defconfig for example.
>
> In file included from arch/arm/mach-at91/spl.c:8:
> arch/arm/mach-at91/spl.c: In function ‘at91_disable_wdt’:
> arch/arm/mach-at91/spl.c:19:39: error: invalid use of undefined type
> ‘struct at91_wdt’
>    19 |         writel(AT91_WDT_MR_WDDIS, &wdt->mr);
>       |                                       ^~
> ./arch/arm/include/asm/io.h:31:69: note: in definition of macro
> ‘__arch_putl’
>    31 | #define __arch_putl(v,a)                (*(volatile unsigned int
> *)(a) = (v))
>       |
>    ^
> arch/arm/mach-at91/spl.c:19:9: note: in expansion of macro ‘writel’
>    19 |         writel(AT91_WDT_MR_WDDIS, &wdt->mr);
>       |         ^~~~~~
>

Thank you for the spot. I can add a patch like this:

 #if !defined(CONFIG_WDT_AT91)
 void at91_disable_wdt(void)
 {
-    struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT;
-
-    writel(AT91_WDT_MR_WDDIS, &wdt->mr);
+#if defined(CONFIG_SAM9X60)
+    writel(AT91_SAM9X60_MR_WDDIS, ATMEL_BASE_WDT + AT91_WDT_MR);
+#else
+    writel(AT91_WDT_MR_WDDIS, ATMEL_BASE_WDT + AT91_WDT_MR);
+#endif
 }
 #endif

Zixun

Reply via email to