From: David Lechner <david@lechnology.com>
To: Suman Anna <s-anna@ti.com>, linux-arm-kernel@lists.infradead.org
Cc: Rob Herring <robh+dt@kernel.org>,
Santosh Shilimkar <ssantosh@kernel.org>,
Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>,
Sekhar Nori <nsekhar@ti.com>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] soc: ti: pruss: add support for AM18XX/OMAP-L138 PRUSS
Date: Sat, 16 Jan 2021 14:15:38 -0600 [thread overview]
Message-ID: <2ae31c89-fe5c-bc80-f7cc-a24f55616d9a@lechnology.com> (raw)
In-Reply-To: <4b60b60b-7e59-28fb-dc3a-f3f097e4cc8a@ti.com>
On 1/15/21 6:52 PM, Suman Anna wrote:
> Hi David,
>
> On 1/4/21 12:30 PM, David Lechner wrote:
>> This adds support for the PRUSS found in AM18XX/OMAP-L138. This PRUSS
>> doesn't have a CFG register, so that is made optional as selected by
>> the device tree compatible string.
>>
>> ARCH_DAVINCI is added in the Kconfig so that the driver can be selected
>> on that platform.
>>
>> Signed-off-by: David Lechner <david@lechnology.com>
>> ---
>> drivers/soc/ti/Kconfig | 2 +-
>> drivers/soc/ti/pruss.c | 76 ++++++++++++++++++++++++------------------
>> 2 files changed, 45 insertions(+), 33 deletions(-)
>>
>> diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
>> index 7e2fb1c16af1..7a692a21480a 100644
>> --- a/drivers/soc/ti/Kconfig
>> +++ b/drivers/soc/ti/Kconfig
>> @@ -85,7 +85,7 @@ config TI_K3_SOCINFO
>>
>> config TI_PRUSS
>> tristate "TI PRU-ICSS Subsystem Platform drivers"
>> - depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX || ARCH_KEYSTONE || ARCH_K3
>> + depends on ARCH_DAVINCI || SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX || ARCH_KEYSTONE || ARCH_K3
>> select MFD_SYSCON
>> help
>> TI PRU-ICSS Subsystem platform specific support.
>> diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
>> index 5d6e7132a5c4..bfaf3ff74b01 100644
>> --- a/drivers/soc/ti/pruss.c
>> +++ b/drivers/soc/ti/pruss.c
>> @@ -24,10 +24,12 @@
>> * struct pruss_private_data - PRUSS driver private data
>> * @has_no_sharedram: flag to indicate the absence of PRUSS Shared Data RAM
>> * @has_core_mux_clock: flag to indicate the presence of PRUSS core clock
>> + * @has_cfg: flag to indicate the presence of PRUSS CFG registers
>
> I recommend to change this to a negative flag as the Davinci platforms are the
> only ones that don't have CFG (being the very first SoCs with a PRUSS IP)
> sub-module.
Negative flags hurt my brain. :-)
I was actually thinking about submitting a patch to convert
has_no_sharedram to a positive flag as well. But I understand
the sentiment of only setting the flag true for the odd case
rather than the usual case.
>
>> */
>> struct pruss_private_data {
>> bool has_no_sharedram;
>> bool has_core_mux_clock;
>> + bool has_cfg;
>> };
>>
>> static void pruss_of_free_clk_provider(void *data)
>> @@ -239,42 +241,44 @@ static int pruss_probe(struct platform_device *pdev)
>> goto rpm_disable;
>> }
>>
>
> And use it here to skip all the cfg code parsing. All the below delta is just
> for the additional indentation for the flag. If you don't like goto's in
> non-error paths, then we can refactor the CFG parse code into a separate function.
>
Refactoring to a separate function sounds good to me.
next prev parent reply other threads:[~2021-01-16 20:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 18:30 [PATCH 0/2] Add support for TI AM18XX/OMAP-L138 PRUSS David Lechner
2021-01-04 18:30 ` [PATCH 1/2] dt-bindings: soc: ti: ti,pruss: add ti,am1806-pruss David Lechner
2021-01-11 22:39 ` Rob Herring
2021-01-15 16:45 ` Suman Anna
2021-01-16 20:18 ` David Lechner
2021-01-18 4:58 ` Sekhar Nori
2021-01-04 18:30 ` [PATCH 2/2] soc: ti: pruss: add support for AM18XX/OMAP-L138 PRUSS David Lechner
2021-01-16 0:52 ` Suman Anna
2021-01-16 20:15 ` David Lechner [this message]
2021-01-25 4:42 ` [PATCH 0/2] Add support for TI " santosh.shilimkar
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=2ae31c89-fe5c-bc80-f7cc-a24f55616d9a@lechnology.com \
--to=david@lechnology.com \
--cc=bgolaszewski@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=grzegorz.jaszczyk@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=robh+dt@kernel.org \
--cc=s-anna@ti.com \
--cc=ssantosh@kernel.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 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).