* [PATCH 0/2] Devicetree support for Loongson-1 watchdog
@ 2023-04-07 11:00 Keguang Zhang
2023-04-07 11:00 ` [PATCH 1/2] dt-bindings: watchdog: Add " Keguang Zhang
2023-04-07 11:00 ` [PATCH 2/2] watchdog: loongson1_wdt: Add DT support Keguang Zhang
0 siblings, 2 replies; 7+ messages in thread
From: Keguang Zhang @ 2023-04-07 11:00 UTC (permalink / raw)
To: linux-watchdog, devicetree, linux-mips, linux-kernel
Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
Yang Ling, Keguang Zhang
Add DT support and dt-binding document for Loongson-1 watchdog.
Keguang Zhang (2):
dt-bindings: watchdog: Add Loongson-1 watchdog
watchdog: loongson1_wdt: Add DT support
.../bindings/watchdog/loongson,ls1x-wdt.yaml | 40 +++++++++++++++++++
drivers/watchdog/loongson1_wdt.c | 12 +++++-
2 files changed, 51 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
base-commit: cf3be7e82b129ed34f811f116f2b113f6299d449
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] dt-bindings: watchdog: Add Loongson-1 watchdog
2023-04-07 11:00 [PATCH 0/2] Devicetree support for Loongson-1 watchdog Keguang Zhang
@ 2023-04-07 11:00 ` Keguang Zhang
2023-04-07 13:43 ` Krzysztof Kozlowski
2023-04-07 14:21 ` Rob Herring
2023-04-07 11:00 ` [PATCH 2/2] watchdog: loongson1_wdt: Add DT support Keguang Zhang
1 sibling, 2 replies; 7+ messages in thread
From: Keguang Zhang @ 2023-04-07 11:00 UTC (permalink / raw)
To: linux-watchdog, devicetree, linux-mips, linux-kernel
Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
Yang Ling, Keguang Zhang
Add devicetree binding document for Loongson-1 watchdog.
Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
---
.../bindings/watchdog/loongson,ls1x-wdt.yaml | 40 +++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
diff --git a/Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml b/Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
new file mode 100644
index 000000000000..203726da14ff
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/loongson,ls1x-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson-1 Watchdog Timer
+
+maintainers:
+ - Keguang Zhang <keguang.zhang@gmail.com>
+
+allOf:
+ - $ref: watchdog.yaml#
+
+properties:
+ compatible:
+ const: loongson,ls1x-wdt
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - clocks
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/loongson,ls1x-clk.h>
+ watchdog: watchdog@1fe5c060 {
+ compatible = "loongson,ls1x-wdt";
+ reg = <0x1fe5c060 0xc>;
+
+ clocks = <&clkc LS1X_CLKID_APB>;
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] watchdog: loongson1_wdt: Add DT support
2023-04-07 11:00 [PATCH 0/2] Devicetree support for Loongson-1 watchdog Keguang Zhang
2023-04-07 11:00 ` [PATCH 1/2] dt-bindings: watchdog: Add " Keguang Zhang
@ 2023-04-07 11:00 ` Keguang Zhang
2023-04-07 12:46 ` Guenter Roeck
2023-04-08 6:12 ` kernel test robot
1 sibling, 2 replies; 7+ messages in thread
From: Keguang Zhang @ 2023-04-07 11:00 UTC (permalink / raw)
To: linux-watchdog, devicetree, linux-mips, linux-kernel
Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
Yang Ling, Keguang Zhang
This patch adds the of_match_table to enable DT support
of Loongson-1 watchdog driver.
And modify the parameter of devm_clk_get() accordingly.
Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
---
drivers/watchdog/loongson1_wdt.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/loongson1_wdt.c b/drivers/watchdog/loongson1_wdt.c
index bb3d075c0633..c2694222ea86 100644
--- a/drivers/watchdog/loongson1_wdt.c
+++ b/drivers/watchdog/loongson1_wdt.c
@@ -5,6 +5,7 @@
#include <linux/clk.h>
#include <linux/module.h>
+#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/watchdog.h>
#include <loongson1.h>
@@ -100,7 +101,7 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
if (IS_ERR(drvdata->base))
return PTR_ERR(drvdata->base);
- drvdata->clk = devm_clk_get(dev, pdev->name);
+ drvdata->clk = devm_clk_get(dev, NULL);
if (IS_ERR(drvdata->clk))
return PTR_ERR(drvdata->clk);
@@ -142,10 +143,19 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id ls1x_wdt_dt_ids[] = {
+ { .compatible = "loongson,ls1x-wdt", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, ls1x_wdt_dt_ids);
+#endif
+
static struct platform_driver ls1x_wdt_driver = {
.probe = ls1x_wdt_probe,
.driver = {
.name = "ls1x-wdt",
+ .of_match_table = ls1x_wdt_dt_ids,
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] watchdog: loongson1_wdt: Add DT support
2023-04-07 11:00 ` [PATCH 2/2] watchdog: loongson1_wdt: Add DT support Keguang Zhang
@ 2023-04-07 12:46 ` Guenter Roeck
2023-04-08 6:12 ` kernel test robot
1 sibling, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2023-04-07 12:46 UTC (permalink / raw)
To: Keguang Zhang, linux-watchdog, devicetree, linux-mips,
linux-kernel
Cc: Wim Van Sebroeck, Rob Herring, Krzysztof Kozlowski, Yang Ling
On 4/7/23 04:00, Keguang Zhang wrote:
> This patch adds the of_match_table to enable DT support
> of Loongson-1 watchdog driver.
> And modify the parameter of devm_clk_get() accordingly.
>
> Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
> ---
> drivers/watchdog/loongson1_wdt.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/loongson1_wdt.c b/drivers/watchdog/loongson1_wdt.c
> index bb3d075c0633..c2694222ea86 100644
> --- a/drivers/watchdog/loongson1_wdt.c
> +++ b/drivers/watchdog/loongson1_wdt.c
> @@ -5,6 +5,7 @@
>
> #include <linux/clk.h>
> #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/platform_device.h>
> #include <linux/watchdog.h>
> #include <loongson1.h>
> @@ -100,7 +101,7 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
> if (IS_ERR(drvdata->base))
> return PTR_ERR(drvdata->base);
>
> - drvdata->clk = devm_clk_get(dev, pdev->name);
> + drvdata->clk = devm_clk_get(dev, NULL);
> if (IS_ERR(drvdata->clk))
> return PTR_ERR(drvdata->clk);
>
> @@ -142,10 +143,19 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id ls1x_wdt_dt_ids[] = {
> + { .compatible = "loongson,ls1x-wdt", },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, ls1x_wdt_dt_ids);
> +#endif
> +
> static struct platform_driver ls1x_wdt_driver = {
> .probe = ls1x_wdt_probe,
> .driver = {
> .name = "ls1x-wdt",
> + .of_match_table = ls1x_wdt_dt_ids,
If CONFIG_OF=n, this would result in a missing symbol.
Guenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: watchdog: Add Loongson-1 watchdog
2023-04-07 11:00 ` [PATCH 1/2] dt-bindings: watchdog: Add " Keguang Zhang
@ 2023-04-07 13:43 ` Krzysztof Kozlowski
2023-04-07 14:21 ` Rob Herring
1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-07 13:43 UTC (permalink / raw)
To: Keguang Zhang, linux-watchdog, devicetree, linux-mips,
linux-kernel
Cc: Wim Van Sebroeck, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
Yang Ling
On 07/04/2023 13:00, Keguang Zhang wrote:
> Add devicetree binding document for Loongson-1 watchdog.
>
> Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
> ---
> .../bindings/watchdog/loongson,ls1x-wdt.yaml | 40 +++++++++++++++++++
> 1 file changed, 40 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
>
> diff --git a/Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml b/Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
> new file mode 100644
> index 000000000000..203726da14ff
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
> @@ -0,0 +1,40 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/watchdog/loongson,ls1x-wdt.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Loongson-1 Watchdog Timer
> +
> +maintainers:
> + - Keguang Zhang <keguang.zhang@gmail.com>
> +
> +allOf:
> + - $ref: watchdog.yaml#
> +
> +properties:
> + compatible:
> + const: loongson,ls1x-wdt
No wildcards in compatibles. What does "x" stand for?
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> +
> +additionalProperties: false
Instead:
unevaluatedProperties: false
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: watchdog: Add Loongson-1 watchdog
2023-04-07 11:00 ` [PATCH 1/2] dt-bindings: watchdog: Add " Keguang Zhang
2023-04-07 13:43 ` Krzysztof Kozlowski
@ 2023-04-07 14:21 ` Rob Herring
1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2023-04-07 14:21 UTC (permalink / raw)
To: Keguang Zhang
Cc: linux-kernel, Rob Herring, devicetree, linux-watchdog, Yang Ling,
Wim Van Sebroeck, Krzysztof Kozlowski, linux-mips, Guenter Roeck
On Fri, 07 Apr 2023 19:00:24 +0800, Keguang Zhang wrote:
> Add devicetree binding document for Loongson-1 watchdog.
>
> Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
> ---
> .../bindings/watchdog/loongson,ls1x-wdt.yaml | 40 +++++++++++++++++++
> 1 file changed, 40 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
>
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.example.dts:18:18: fatal error: dt-bindings/clock/loongson,ls1x-clk.h: No such file or directory
18 | #include <dt-bindings/clock/loongson,ls1x-clk.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.example.dtb] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1512: dt_binding_check] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230407110025.516405-2-keguang.zhang@gmail.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] watchdog: loongson1_wdt: Add DT support
2023-04-07 11:00 ` [PATCH 2/2] watchdog: loongson1_wdt: Add DT support Keguang Zhang
2023-04-07 12:46 ` Guenter Roeck
@ 2023-04-08 6:12 ` kernel test robot
1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-04-08 6:12 UTC (permalink / raw)
To: Keguang Zhang, linux-watchdog, devicetree, linux-mips,
linux-kernel
Cc: llvm, oe-kbuild-all, Wim Van Sebroeck, Guenter Roeck, Rob Herring,
Krzysztof Kozlowski, Yang Ling, Keguang Zhang
Hi Keguang,
kernel test robot noticed the following build errors:
[auto build test ERROR on cf3be7e82b129ed34f811f116f2b113f6299d449]
url: https://github.com/intel-lab-lkp/linux/commits/Keguang-Zhang/dt-bindings-watchdog-Add-Loongson-1-watchdog/20230407-190222
base: cf3be7e82b129ed34f811f116f2b113f6299d449
patch link: https://lore.kernel.org/r/20230407110025.516405-3-keguang.zhang%40gmail.com
patch subject: [PATCH 2/2] watchdog: loongson1_wdt: Add DT support
config: mips-loongson1c_defconfig (https://download.01.org/0day-ci/archive/20230408/202304081301.6Ukja1z0-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 2c57868e2e877f73c339796c3374ae660bb77f0d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mipsel-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/26b8fbfd577b41f39d6af516ef7c49cbffa05117
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Keguang-Zhang/dt-bindings-watchdog-Add-Loongson-1-watchdog/20230407-190222
git checkout 26b8fbfd577b41f39d6af516ef7c49cbffa05117
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304081301.6Ukja1z0-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/watchdog/loongson1_wdt.c:158:21: error: use of undeclared identifier 'ls1x_wdt_dt_ids'
.of_match_table = ls1x_wdt_dt_ids,
^
1 error generated.
vim +/ls1x_wdt_dt_ids +158 drivers/watchdog/loongson1_wdt.c
153
154 static struct platform_driver ls1x_wdt_driver = {
155 .probe = ls1x_wdt_probe,
156 .driver = {
157 .name = "ls1x-wdt",
> 158 .of_match_table = ls1x_wdt_dt_ids,
159 },
160 };
161
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-04-08 6:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07 11:00 [PATCH 0/2] Devicetree support for Loongson-1 watchdog Keguang Zhang
2023-04-07 11:00 ` [PATCH 1/2] dt-bindings: watchdog: Add " Keguang Zhang
2023-04-07 13:43 ` Krzysztof Kozlowski
2023-04-07 14:21 ` Rob Herring
2023-04-07 11:00 ` [PATCH 2/2] watchdog: loongson1_wdt: Add DT support Keguang Zhang
2023-04-07 12:46 ` Guenter Roeck
2023-04-08 6:12 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).