Hi Arnd,

Great thanks, will fix those:
(1)drop ARM_AMBA
(2)
#if IS_BUILTIN(CONFIG_OF)  and #endif (but can I set  depends on  OF ??)

Are you saying I can drop ARM64 also? this IP core maybe in ARM , but is that possible on other platform(x68/mips/ppc)?

On 12 May 2015 at 21:13, Arnd Bergmann <arnd@arndb.de> wrote:
On Tuesday 12 May 2015, fu.wei@linaro.org wrote:
> From: Fu Wei <fu.wei@linaro.org>
>
>     (1)Use linux kernel watchdog framework
>     (2)Work with FDT on ARM64
>     (3)Use "pretimeout" in watchdog framework.
>     (4)In first timeout(WS0), do panic to save system context.
>
> Signed-off-by: Fu Wei <fu.wei@linaro.org>
> ---
>  drivers/watchdog/Kconfig     |  10 +
>  drivers/watchdog/Makefile    |   1 +
>  drivers/watchdog/sbsa_gwdt.c | 560 +++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 571 insertions(+)
>  create mode 100644 drivers/watchdog/sbsa_gwdt.c
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index e5e7c55..46d6f46 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -152,6 +152,16 @@ config ARM_SP805_WATCHDOG
>         ARM Primecell SP805 Watchdog timer. This will reboot your system when
>         the timeout is reached.
>
> +config ARM_SBSA_WATCHDOG
> +     tristate "ARM SBSA Generic Watchdog"
> +     depends on ARM64 && ARM_AMBA
> +     select WATCHDOG_CORE


Ideally make it possible to build this on all architectures, so we get compile
coverage on x86 builds.

You should also drop the ARM_AMBA dependency because this is regular
platform_driver.

ARM_AMBA is only used for primecell devices, which this is not.

> +#if IS_BUILTIN(CONFIG_OF)
> +static const struct of_device_id sbsa_gwdt_of_match[] = {
> +     { .compatible = "arm,sbsa-gwdt", },
> +     {},
> +};
> +MODULE_DEVICE_TABLE(of, sbsa_gwdt_of_match);
> +#endif
> +
> +static const struct dev_pm_ops sbsa_gwdt_pm_ops = {
> +     SET_SYSTEM_SLEEP_PM_OPS(sbsa_gwdt_suspend, sbsa_gwdt_resume)
> +};
> +
> +static struct platform_driver sbsa_gwdt_driver = {
> +     .driver = {
> +             .name = "sbsa-gwdt",
> +             .pm = &sbsa_gwdt_pm_ops,
> +             .of_match_table = sbsa_gwdt_of_match,
> +     },

But fix the undefined reference here first: sbsa_gwdt_of_match is hidden
behind CONFIG_OF, which is always set on ARM64. Just remove the #ifdef
and it will build on other architectures as well.

        arnd



--
Best regards,

Fu Wei
Software Engineer
Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch
Ph: +86 21 61221326(direct)
Ph: +86 186 2020 4684 (mobile)
Room 1512, Regus One Corporate Avenue,Level 15,
One Corporate Avenue,222 Hubin Road,Huangpu District,
Shanghai,China 200021