From: Zev Weiss <zweiss@equinix.com>
To: linux-aspeed@lists.ozlabs.org
Subject: [PATCH 2/2] watchdog: aspeed: Add support for aspeed,reset-mask DT property
Date: Wed, 11 Oct 2023 18:19:09 +0000 [thread overview]
Message-ID: <20231011181909.GK19997@packtop> (raw)
In-Reply-To: <CACPK8Xe5UEDt+ko_FtF-fi1TZDNZeZMtzaU_ZBxt6CO+UHJEpg@mail.gmail.com>
On Wed, Oct 11, 2023 at 02:26:32AM PDT, Joel Stanley wrote:
>On Fri, 22 Sept 2023 at 20:12, Zev Weiss <zev@bewilderbeest.net> wrote:
>>
>> This property allows the device-tree to specify how the Aspeed
>> watchdog timer's reset mask register(s) should be set, so that
>> peripherals can be individually exempted from (or opted in to) being
>> reset when the watchdog timer expires.
>>
>> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
>
>Reviewed-by: Joel Stanley <joel@jms.id.au>
>
>A note below.
>
>> ---
>> drivers/watchdog/aspeed_wdt.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
>> index b72a858bbac7..b4773a6aaf8c 100644
>> --- a/drivers/watchdog/aspeed_wdt.c
>> +++ b/drivers/watchdog/aspeed_wdt.c
>> @@ -79,6 +79,8 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table);
>> #define WDT_TIMEOUT_STATUS_BOOT_SECONDARY BIT(1)
>> #define WDT_CLEAR_TIMEOUT_STATUS 0x14
>> #define WDT_CLEAR_TIMEOUT_AND_BOOT_CODE_SELECTION BIT(0)
>> +#define WDT_RESET_MASK1 0x1c
>> +#define WDT_RESET_MASK2 0x20
>>
>> /*
>> * WDT_RESET_WIDTH controls the characteristics of the external pulse (if
>> @@ -402,6 +404,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
>>
>> if ((of_device_is_compatible(np, "aspeed,ast2500-wdt")) ||
>> (of_device_is_compatible(np, "aspeed,ast2600-wdt"))) {
>> + u32 reset_mask[2];
>> + size_t nrstmask = of_device_is_compatible(np, "aspeed,ast2600-wdt") ? 2 : 1;
>> u32 reg = readl(wdt->base + WDT_RESET_WIDTH);
>>
>> reg &= wdt->cfg->ext_pulse_width_mask;
>> @@ -419,6 +423,13 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
>> reg |= WDT_OPEN_DRAIN_MAGIC;
>>
>> writel(reg, wdt->base + WDT_RESET_WIDTH);
>> +
>> + ret = of_property_read_u32_array(np, "aspeed,reset-mask", reset_mask, nrstmask);
>> + if (!ret) {
>> + writel(reset_mask[0], wdt->base + WDT_RESET_MASK1);
>> + if (nrstmask > 1)
>> + writel(reset_mask[1], wdt->base + WDT_RESET_MASK2);
>> + }
>
>This will do funky things if someone is careless enough to put the
>property in an ast2400 device tree.
>
>The ast2700 has four reset mask registers. Not really your problem at
>this point, but we might need to move to a per-soc callback in the
>platform data or similar.
>
This chunk is within an 'if' block that only runs on ast2500 & ast2600,
so it should be safely ignored on anything else.
>> }
>>
>> if (!of_property_read_u32(np, "aspeed,ext-pulse-duration", &duration)) {
>> --
>> 2.40.0.5.gf6e3b97ba6d2.dirty
>>
WARNING: multiple messages have this Message-ID (diff)
From: Zev Weiss <zweiss@equinix.com>
To: Joel Stanley <joel@jms.id.au>
Cc: "Zev Weiss" <zev@bewilderbeest.net>,
"Wim Van Sebroeck" <wim@linux-watchdog.org>,
"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
"Andrew Jeffery" <andrew@aj.id.au>,
"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
"Eddie James" <eajames@linux.ibm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"Ivan Mikhaylov" <i.mikhaylov@yadro.com>,
"Milton D. Miller II" <mdmii@outlook.com>,
"Guenter Roeck" <linux@roeck-us.net>
Subject: Re: [PATCH 2/2] watchdog: aspeed: Add support for aspeed,reset-mask DT property
Date: Wed, 11 Oct 2023 18:19:09 +0000 [thread overview]
Message-ID: <20231011181909.GK19997@packtop> (raw)
In-Reply-To: <CACPK8Xe5UEDt+ko_FtF-fi1TZDNZeZMtzaU_ZBxt6CO+UHJEpg@mail.gmail.com>
On Wed, Oct 11, 2023 at 02:26:32AM PDT, Joel Stanley wrote:
>On Fri, 22 Sept 2023 at 20:12, Zev Weiss <zev@bewilderbeest.net> wrote:
>>
>> This property allows the device-tree to specify how the Aspeed
>> watchdog timer's reset mask register(s) should be set, so that
>> peripherals can be individually exempted from (or opted in to) being
>> reset when the watchdog timer expires.
>>
>> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
>
>Reviewed-by: Joel Stanley <joel@jms.id.au>
>
>A note below.
>
>> ---
>> drivers/watchdog/aspeed_wdt.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
>> index b72a858bbac7..b4773a6aaf8c 100644
>> --- a/drivers/watchdog/aspeed_wdt.c
>> +++ b/drivers/watchdog/aspeed_wdt.c
>> @@ -79,6 +79,8 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table);
>> #define WDT_TIMEOUT_STATUS_BOOT_SECONDARY BIT(1)
>> #define WDT_CLEAR_TIMEOUT_STATUS 0x14
>> #define WDT_CLEAR_TIMEOUT_AND_BOOT_CODE_SELECTION BIT(0)
>> +#define WDT_RESET_MASK1 0x1c
>> +#define WDT_RESET_MASK2 0x20
>>
>> /*
>> * WDT_RESET_WIDTH controls the characteristics of the external pulse (if
>> @@ -402,6 +404,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
>>
>> if ((of_device_is_compatible(np, "aspeed,ast2500-wdt")) ||
>> (of_device_is_compatible(np, "aspeed,ast2600-wdt"))) {
>> + u32 reset_mask[2];
>> + size_t nrstmask = of_device_is_compatible(np, "aspeed,ast2600-wdt") ? 2 : 1;
>> u32 reg = readl(wdt->base + WDT_RESET_WIDTH);
>>
>> reg &= wdt->cfg->ext_pulse_width_mask;
>> @@ -419,6 +423,13 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
>> reg |= WDT_OPEN_DRAIN_MAGIC;
>>
>> writel(reg, wdt->base + WDT_RESET_WIDTH);
>> +
>> + ret = of_property_read_u32_array(np, "aspeed,reset-mask", reset_mask, nrstmask);
>> + if (!ret) {
>> + writel(reset_mask[0], wdt->base + WDT_RESET_MASK1);
>> + if (nrstmask > 1)
>> + writel(reset_mask[1], wdt->base + WDT_RESET_MASK2);
>> + }
>
>This will do funky things if someone is careless enough to put the
>property in an ast2400 device tree.
>
>The ast2700 has four reset mask registers. Not really your problem at
>this point, but we might need to move to a per-soc callback in the
>platform data or similar.
>
This chunk is within an 'if' block that only runs on ast2500 & ast2600,
so it should be safely ignored on anything else.
>> }
>>
>> if (!of_property_read_u32(np, "aspeed,ext-pulse-duration", &duration)) {
>> --
>> 2.40.0.5.gf6e3b97ba6d2.dirty
>>
WARNING: multiple messages have this Message-ID (diff)
From: Zev Weiss <zweiss@equinix.com>
To: Joel Stanley <joel@jms.id.au>
Cc: "Zev Weiss" <zev@bewilderbeest.net>,
"Milton D. Miller II" <mdmii@outlook.com>,
"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
"Andrew Jeffery" <andrew@aj.id.au>,
"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
"Eddie James" <eajames@linux.ibm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Guenter Roeck" <linux@roeck-us.net>,
"Ivan Mikhaylov" <i.mikhaylov@yadro.com>,
"Wim Van Sebroeck" <wim@linux-watchdog.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] watchdog: aspeed: Add support for aspeed,reset-mask DT property
Date: Wed, 11 Oct 2023 18:19:09 +0000 [thread overview]
Message-ID: <20231011181909.GK19997@packtop> (raw)
In-Reply-To: <CACPK8Xe5UEDt+ko_FtF-fi1TZDNZeZMtzaU_ZBxt6CO+UHJEpg@mail.gmail.com>
On Wed, Oct 11, 2023 at 02:26:32AM PDT, Joel Stanley wrote:
>On Fri, 22 Sept 2023 at 20:12, Zev Weiss <zev@bewilderbeest.net> wrote:
>>
>> This property allows the device-tree to specify how the Aspeed
>> watchdog timer's reset mask register(s) should be set, so that
>> peripherals can be individually exempted from (or opted in to) being
>> reset when the watchdog timer expires.
>>
>> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
>
>Reviewed-by: Joel Stanley <joel@jms.id.au>
>
>A note below.
>
>> ---
>> drivers/watchdog/aspeed_wdt.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
>> index b72a858bbac7..b4773a6aaf8c 100644
>> --- a/drivers/watchdog/aspeed_wdt.c
>> +++ b/drivers/watchdog/aspeed_wdt.c
>> @@ -79,6 +79,8 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table);
>> #define WDT_TIMEOUT_STATUS_BOOT_SECONDARY BIT(1)
>> #define WDT_CLEAR_TIMEOUT_STATUS 0x14
>> #define WDT_CLEAR_TIMEOUT_AND_BOOT_CODE_SELECTION BIT(0)
>> +#define WDT_RESET_MASK1 0x1c
>> +#define WDT_RESET_MASK2 0x20
>>
>> /*
>> * WDT_RESET_WIDTH controls the characteristics of the external pulse (if
>> @@ -402,6 +404,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
>>
>> if ((of_device_is_compatible(np, "aspeed,ast2500-wdt")) ||
>> (of_device_is_compatible(np, "aspeed,ast2600-wdt"))) {
>> + u32 reset_mask[2];
>> + size_t nrstmask = of_device_is_compatible(np, "aspeed,ast2600-wdt") ? 2 : 1;
>> u32 reg = readl(wdt->base + WDT_RESET_WIDTH);
>>
>> reg &= wdt->cfg->ext_pulse_width_mask;
>> @@ -419,6 +423,13 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
>> reg |= WDT_OPEN_DRAIN_MAGIC;
>>
>> writel(reg, wdt->base + WDT_RESET_WIDTH);
>> +
>> + ret = of_property_read_u32_array(np, "aspeed,reset-mask", reset_mask, nrstmask);
>> + if (!ret) {
>> + writel(reset_mask[0], wdt->base + WDT_RESET_MASK1);
>> + if (nrstmask > 1)
>> + writel(reset_mask[1], wdt->base + WDT_RESET_MASK2);
>> + }
>
>This will do funky things if someone is careless enough to put the
>property in an ast2400 device tree.
>
>The ast2700 has four reset mask registers. Not really your problem at
>this point, but we might need to move to a per-soc callback in the
>platform data or similar.
>
This chunk is within an 'if' block that only runs on ast2500 & ast2600,
so it should be safely ignored on anything else.
>> }
>>
>> if (!of_property_read_u32(np, "aspeed,ext-pulse-duration", &duration)) {
>> --
>> 2.40.0.5.gf6e3b97ba6d2.dirty
>>
WARNING: multiple messages have this Message-ID (diff)
From: Zev Weiss <zweiss@equinix.com>
To: Joel Stanley <joel@jms.id.au>
Cc: "Zev Weiss" <zev@bewilderbeest.net>,
"Wim Van Sebroeck" <wim@linux-watchdog.org>,
"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
"Andrew Jeffery" <andrew@aj.id.au>,
"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
"Eddie James" <eajames@linux.ibm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"Ivan Mikhaylov" <i.mikhaylov@yadro.com>,
"Milton D. Miller II" <mdmii@outlook.com>,
"Guenter Roeck" <linux@roeck-us.net>
Subject: Re: [PATCH 2/2] watchdog: aspeed: Add support for aspeed,reset-mask DT property
Date: Wed, 11 Oct 2023 18:19:09 +0000 [thread overview]
Message-ID: <20231011181909.GK19997@packtop> (raw)
In-Reply-To: <CACPK8Xe5UEDt+ko_FtF-fi1TZDNZeZMtzaU_ZBxt6CO+UHJEpg@mail.gmail.com>
On Wed, Oct 11, 2023 at 02:26:32AM PDT, Joel Stanley wrote:
>On Fri, 22 Sept 2023 at 20:12, Zev Weiss <zev@bewilderbeest.net> wrote:
>>
>> This property allows the device-tree to specify how the Aspeed
>> watchdog timer's reset mask register(s) should be set, so that
>> peripherals can be individually exempted from (or opted in to) being
>> reset when the watchdog timer expires.
>>
>> Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
>
>Reviewed-by: Joel Stanley <joel@jms.id.au>
>
>A note below.
>
>> ---
>> drivers/watchdog/aspeed_wdt.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
>> index b72a858bbac7..b4773a6aaf8c 100644
>> --- a/drivers/watchdog/aspeed_wdt.c
>> +++ b/drivers/watchdog/aspeed_wdt.c
>> @@ -79,6 +79,8 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table);
>> #define WDT_TIMEOUT_STATUS_BOOT_SECONDARY BIT(1)
>> #define WDT_CLEAR_TIMEOUT_STATUS 0x14
>> #define WDT_CLEAR_TIMEOUT_AND_BOOT_CODE_SELECTION BIT(0)
>> +#define WDT_RESET_MASK1 0x1c
>> +#define WDT_RESET_MASK2 0x20
>>
>> /*
>> * WDT_RESET_WIDTH controls the characteristics of the external pulse (if
>> @@ -402,6 +404,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
>>
>> if ((of_device_is_compatible(np, "aspeed,ast2500-wdt")) ||
>> (of_device_is_compatible(np, "aspeed,ast2600-wdt"))) {
>> + u32 reset_mask[2];
>> + size_t nrstmask = of_device_is_compatible(np, "aspeed,ast2600-wdt") ? 2 : 1;
>> u32 reg = readl(wdt->base + WDT_RESET_WIDTH);
>>
>> reg &= wdt->cfg->ext_pulse_width_mask;
>> @@ -419,6 +423,13 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
>> reg |= WDT_OPEN_DRAIN_MAGIC;
>>
>> writel(reg, wdt->base + WDT_RESET_WIDTH);
>> +
>> + ret = of_property_read_u32_array(np, "aspeed,reset-mask", reset_mask, nrstmask);
>> + if (!ret) {
>> + writel(reset_mask[0], wdt->base + WDT_RESET_MASK1);
>> + if (nrstmask > 1)
>> + writel(reset_mask[1], wdt->base + WDT_RESET_MASK2);
>> + }
>
>This will do funky things if someone is careless enough to put the
>property in an ast2400 device tree.
>
>The ast2700 has four reset mask registers. Not really your problem at
>this point, but we might need to move to a per-soc callback in the
>platform data or similar.
>
This chunk is within an 'if' block that only runs on ast2500 & ast2600,
so it should be safely ignored on anything else.
>> }
>>
>> if (!of_property_read_u32(np, "aspeed,ext-pulse-duration", &duration)) {
>> --
>> 2.40.0.5.gf6e3b97ba6d2.dirty
>>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-10-11 18:19 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-22 10:42 [PATCH 0/2] watchdog: aspeed: Add aspeed,reset-mask property Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-09-22 10:42 ` [PATCH 1/2] dt-bindings: watchdog: aspeed-wdt: " Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-09-22 22:51 ` Rob Herring
2023-09-22 22:51 ` Rob Herring
2023-09-22 22:51 ` Rob Herring
2023-09-22 22:51 ` Rob Herring
2023-09-25 2:42 ` Andrew Jeffery
2023-09-25 2:42 ` Andrew Jeffery
2023-09-25 2:42 ` Andrew Jeffery
2023-09-25 2:42 ` Andrew Jeffery
2023-09-26 0:04 ` Zev Weiss
2023-09-26 0:04 ` Zev Weiss
2023-09-26 0:04 ` Zev Weiss
2023-09-26 0:04 ` Zev Weiss
2023-09-26 0:35 ` Guenter Roeck
2023-09-26 0:35 ` Guenter Roeck
2023-09-26 0:35 ` Guenter Roeck
2023-09-26 0:35 ` Guenter Roeck
2023-09-26 0:57 ` Andrew Jeffery
2023-09-26 0:57 ` Andrew Jeffery
2023-09-26 0:57 ` Andrew Jeffery
2023-09-26 0:57 ` Andrew Jeffery
2023-10-27 15:07 ` Guenter Roeck
2023-10-27 15:07 ` Guenter Roeck
2023-09-22 10:42 ` [PATCH 2/2] watchdog: aspeed: Add support for aspeed,reset-mask DT property Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-09-22 10:42 ` Zev Weiss
2023-10-11 9:26 ` Joel Stanley
2023-10-11 9:26 ` Joel Stanley
2023-10-11 9:26 ` Joel Stanley
2023-10-11 9:26 ` Joel Stanley
2023-10-11 18:19 ` Zev Weiss [this message]
2023-10-11 18:19 ` Zev Weiss
2023-10-11 18:19 ` Zev Weiss
2023-10-11 18:19 ` Zev Weiss
2023-10-27 15:07 ` Guenter Roeck
2023-10-27 11:00 ` [PATCH 0/2] watchdog: aspeed: Add aspeed,reset-mask property Zev Weiss
2023-10-27 11:00 ` Zev Weiss
2023-10-27 11:00 ` Zev Weiss
2023-10-27 11:00 ` Zev Weiss
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231011181909.GK19997@packtop \
--to=zweiss@equinix.com \
--cc=linux-aspeed@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.