All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Florian Fainelli" <f.fainelli@gmail.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Wim Van Sebroeck" <wim@linux-watchdog.org>,
	"Rob Herring" <robh+dt@kernel.org>
Cc: bcm-kernel-feedback-list@broadcom.com,
	linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-mips@vger.kernel.org, "Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH 3/3] watchdog: bcm7038_wdt: support BCM4908 SoC
Date: Thu, 28 Oct 2021 09:57:43 -0700	[thread overview]
Message-ID: <ce6ccb22-a81c-336e-4b2e-44f9ad6de246@roeck-us.net> (raw)
In-Reply-To: <f78d1573-4909-039d-8647-d4fc13205f47@gmail.com>

On 10/28/21 9:29 AM, Florian Fainelli wrote:
> On 10/28/21 2:30 AM, Rafał Miłecki wrote:
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> Hardware supported by this driver goes back to the old bcm63xx days. It
>> was then reused in BCM7038 and later also in BCM4908.
>>
>> Depending on SoC model registers layout differs a bit. This commit
>> introduces support for per-chipset registers offsets & adds BCM4908
>> layout.
>>
>> Later on BCM63xx SoCs support should be added too (probably as platform
>> devices due to missing DT). Eventually this driver should replace
>> bcm63xx_wdt.c.
>>
Seems unrelated / irrelevant in this commit log, except maybe after '---'.

>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> ---
> 
> [snip]
> 
>> +
>> +static const u16 bcm7038_wdt_regs_bcm4908[] = {
>> +	[BCM63XX_WDT_REG_DEFVAL]	= 0x28,

REG_DEFVAL is an odd name for this register. I can see that the
bcm63xx driver uses it, but in reality it seems to be the timeout
value, not some default value, only the bcm63xx driver doesn't
seem to use it properly. I think REG_TIMEOUT or similar would
be a much better name.

>> +	[BCM63XX_WDT_REG_CTL]		= 0x2c,
>> +	[BCM63XX_WDT_REG_SOFTRESET]	= 0x34,
> 
> I don't understand what you are doing here and why you are not
> offsetting the "reg" property appropriately when you create your
> bcm4908-wdt Device Tree node such that the base starts at 0, and the
> existing driver becomes usable as-is. This does not make any sense to me
> when it is obviously the simplest way to make the driver "accept" the
> resource being passed.
> 

Agreed. This adds a lot of complexity that could be avoided.

> I am going to send my patch series converting the bcm63xx_wdt.c driver
> over to bcm7038_wdt.c, feel free to use or discard it.
> 
For my part I am very much looking forward to it.

Guenter

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: "Florian Fainelli" <f.fainelli@gmail.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Wim Van Sebroeck" <wim@linux-watchdog.org>,
	"Rob Herring" <robh+dt@kernel.org>
Cc: bcm-kernel-feedback-list@broadcom.com,
	linux-watchdog@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-mips@vger.kernel.org, "Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH 3/3] watchdog: bcm7038_wdt: support BCM4908 SoC
Date: Thu, 28 Oct 2021 09:57:43 -0700	[thread overview]
Message-ID: <ce6ccb22-a81c-336e-4b2e-44f9ad6de246@roeck-us.net> (raw)
In-Reply-To: <f78d1573-4909-039d-8647-d4fc13205f47@gmail.com>

On 10/28/21 9:29 AM, Florian Fainelli wrote:
> On 10/28/21 2:30 AM, Rafał Miłecki wrote:
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> Hardware supported by this driver goes back to the old bcm63xx days. It
>> was then reused in BCM7038 and later also in BCM4908.
>>
>> Depending on SoC model registers layout differs a bit. This commit
>> introduces support for per-chipset registers offsets & adds BCM4908
>> layout.
>>
>> Later on BCM63xx SoCs support should be added too (probably as platform
>> devices due to missing DT). Eventually this driver should replace
>> bcm63xx_wdt.c.
>>
Seems unrelated / irrelevant in this commit log, except maybe after '---'.

>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> ---
> 
> [snip]
> 
>> +
>> +static const u16 bcm7038_wdt_regs_bcm4908[] = {
>> +	[BCM63XX_WDT_REG_DEFVAL]	= 0x28,

REG_DEFVAL is an odd name for this register. I can see that the
bcm63xx driver uses it, but in reality it seems to be the timeout
value, not some default value, only the bcm63xx driver doesn't
seem to use it properly. I think REG_TIMEOUT or similar would
be a much better name.

>> +	[BCM63XX_WDT_REG_CTL]		= 0x2c,
>> +	[BCM63XX_WDT_REG_SOFTRESET]	= 0x34,
> 
> I don't understand what you are doing here and why you are not
> offsetting the "reg" property appropriately when you create your
> bcm4908-wdt Device Tree node such that the base starts at 0, and the
> existing driver becomes usable as-is. This does not make any sense to me
> when it is obviously the simplest way to make the driver "accept" the
> resource being passed.
> 

Agreed. This adds a lot of complexity that could be avoided.

> I am going to send my patch series converting the bcm63xx_wdt.c driver
> over to bcm7038_wdt.c, feel free to use or discard it.
> 
For my part I am very much looking forward to it.

Guenter

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-10-28 16:57 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28  9:30 [PATCH 1/3] dt-bindings: watchdog: convert Broadcom's WDT to the json-schema Rafał Miłecki
2021-10-28  9:30 ` Rafał Miłecki
2021-10-28  9:30 ` [PATCH 2/3] dt-bindings: watchdog: brcm,bcm63xx-wdt: add BCM4908 compatibility Rafał Miłecki
2021-10-28  9:30   ` [PATCH 2/3] dt-bindings: watchdog: brcm, bcm63xx-wdt: " Rafał Miłecki
2021-10-28  9:30 ` [PATCH 3/3] watchdog: bcm7038_wdt: support BCM4908 SoC Rafał Miłecki
2021-10-28  9:30   ` Rafał Miłecki
2021-10-28 16:29   ` Florian Fainelli
2021-10-28 16:29     ` Florian Fainelli
2021-10-28 16:57     ` Guenter Roeck [this message]
2021-10-28 16:57       ` Guenter Roeck
2021-10-29 12:15       ` Rafał Miłecki
2021-10-29 12:15         ` Rafał Miłecki
2021-10-29 14:15         ` Guenter Roeck
2021-10-29 14:15           ` Guenter Roeck
2021-10-29 14:18           ` Rafał Miłecki
2021-10-29 14:18             ` Rafał Miłecki
2021-10-29 11:39     ` Rafał Miłecki
2021-10-29 11:39       ` Rafał Miłecki
2021-10-29 13:03       ` Rob Herring
2021-10-29 13:03         ` Rob Herring
2021-10-29 16:45         ` Florian Fainelli
2021-10-29 16:45           ` Florian Fainelli
2021-10-29 16:56           ` Rafał Miłecki
2021-10-29 16:56             ` Rafał Miłecki
2021-10-29 17:43           ` Guenter Roeck
2021-10-29 17:43             ` Guenter Roeck
2021-10-29 17:53             ` Florian Fainelli
2021-10-29 17:53               ` Florian Fainelli
2021-10-29 18:10               ` Guenter Roeck
2021-10-29 18:10                 ` Guenter Roeck
2021-10-29 18:26                 ` Florian Fainelli
2021-10-29 18:26                   ` Florian Fainelli
2021-11-01 17:28           ` Rob Herring
2021-11-01 17:28             ` Rob Herring
2021-10-28 16:31 ` [PATCH 1/3] dt-bindings: watchdog: convert Broadcom's WDT to the json-schema Florian Fainelli
2021-10-28 16:31   ` Florian Fainelli

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=ce6ccb22-a81c-336e-4b2e-44f9ad6de246@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=rafal@milecki.pl \
    --cc=robh+dt@kernel.org \
    --cc=wim@linux-watchdog.org \
    --cc=zajec5@gmail.com \
    /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.