From: Matthias Brugger <matthias.bgg@gmail.com>
To: Sean Wang <sean.wang@mediatek.com>, Argus Lin <argus.lin@mediatek.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Chenglin Xu <chenglin.xu@mediatek.com>,
wsd_upstream@mediatek.com, henryc.chen@mediatek.com,
flora.fu@mediatek.com, Chen Zhong <chen.zhong@mediatek.com>,
Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH V4 5/8] soc: mediatek: pwrap: add pwrap for mt6797 SoCs
Date: Fri, 4 May 2018 10:39:28 +0200 [thread overview]
Message-ID: <69e4766f-8c7a-7729-93f8-4f87d2ceff8b@gmail.com> (raw)
In-Reply-To: <1525403052.14792.131.camel@mtkswgap22>
On 05/04/2018 05:04 AM, Sean Wang wrote:
> On Thu, 2018-05-03 at 14:20 +0800, Argus Lin wrote:
>> On Thu, 2018-05-03 at 12:01 +0800, Sean Wang wrote:
>>> };
>
> [...]
>
>>>> @@ -1503,11 +1581,13 @@ static int pwrap_probe(struct platform_device *pdev)
>>>> if (IS_ERR(wrp->base))
>>>> return PTR_ERR(wrp->base);
>>>>
>>>> - wrp->rstc = devm_reset_control_get(wrp->dev, "pwrap");
>>>> - if (IS_ERR(wrp->rstc)) {
>>>> - ret = PTR_ERR(wrp->rstc);
>>>> - dev_dbg(wrp->dev, "cannot get pwrap reset: %d\n", ret);
>>>> - return ret;
>>>> + if (HAS_CAP(wrp->master->caps, PWRAP_CAP_RESET)) {
>>>> + wrp->rstc = devm_reset_control_get(wrp->dev, "pwrap");
>>>
>>> there should be a reset bit present for pwrap on infrasys.
>>>
>>> the specific condition can be dropped when the reset cell is exported from infrasys and then the device has a reference to it.
>> hmm, I think it need to keep here.
>> because after pwrap initialized, it can't be reset alone.
>> It needs to reset PMIC simultaneously, too.
>
> Reset a pair, either a master or its slave, all had been a part of
> pwrap_init.
>
> The reset controller provided here is just to reset pwrap device.
> And for its slave reset, it should be done by pwrap_reset_spislave.
>
> So for MT6397, it should be able to fall into the same procedure.
>
>>>
>>>> + if (IS_ERR(wrp->rstc)) {
>>>> + ret = PTR_ERR(wrp->rstc);
>>>> + dev_dbg(wrp->dev, "cannot get pwrap reset: %d\n", ret);
>>>> + return ret;
>>>> + }
>>>> }
>>>>
>>>> if (HAS_CAP(wrp->master->caps, PWRAP_CAP_BRIDGE)) {
>>>> @@ -1549,9 +1629,17 @@ static int pwrap_probe(struct platform_device *pdev)
>>>> if (ret)
>>>> goto err_out1;
>>>>
>>>> - /* Enable internal dynamic clock */
>>>> - pwrap_writel(wrp, 1, PWRAP_DCM_EN);
>>>> - pwrap_writel(wrp, 0, PWRAP_DCM_DBC_PRD);
>>>> + /*
>>>> + * add dcm capability check
>>>> + */
>>>> + if (HAS_CAP(wrp->master->caps, PWRAP_CAP_DCM)) {
>>>
>>> the specific condition can be dropped since so far all devices the driver can support are owning PWRAP_CAP_DCM
>> We did not support DCM for future chips.
>> MT6797 is the last one.
>> This why I want to add judgement here.
>
> The series is only for MT6797 pwrap, so it's fine with only adding these
> things the SoC actually relies on.
>
> PWRAP_CAP_DCM should not be added until a new SoC without dcm is really
> introduced.
>
I agree (and I think I said this already in a previous review).
Regards,
Matthias
>>>
>>>> + if (wrp->master->type == PWRAP_MT6797)
>>>> + pwrap_writel(wrp, 3, PWRAP_DCM_EN);
>>>
>>> the setup for MT6797 can be moved into .init_soc_specific callback ?
>>
>> I think put it here is more generally.
>>>
>>>> + else
>>>> + pwrap_writel(wrp, 1, PWRAP_DCM_EN);
>>>> +
>>>> + pwrap_writel(wrp, 0, PWRAP_DCM_DBC_PRD);
>>>> + }
>>>>
>>>> /*
>>>> * The PMIC could already be initialized by the bootloader.
>>>> @@ -1580,6 +1668,12 @@ static int pwrap_probe(struct platform_device *pdev)
>>>> pwrap_writel(wrp, wrp->master->wdt_src, PWRAP_WDT_SRC_EN);
>>>> pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
>>>> pwrap_writel(wrp, wrp->master->int_en_all, PWRAP_INT_EN);
>>>> + /*
>>>> + * We add INT1 interrupt to handle starvation and request exception
>>>> + * If we support it, we should enable them here.
>>>> + */
>>>> + if (HAS_CAP(wrp->master->caps, PWRAP_CAP_INT1_EN))
>>>> + pwrap_writel(wrp, wrp->master->int1_en_all, PWRAP_INT1_EN);
>>>>
>>>
>>> if there is no explicitly enabling on INT1, then ISR handling for INT1 is also unnecessary
>>
>> It's ok for me.
>>>
>>>> irq = platform_get_irq(pdev, 0);
>>>> ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt,
>>>
>>>
>>>
>>
>>
>
>
next prev parent reply other threads:[~2018-05-04 8:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 9:21 [PATCH V4 0/8] Pwrap: Mediatek pwrap driver for mt6797 argus.lin
2018-05-02 9:21 ` [PATCH V4 1/8] dt-bindings: pwrap: mediatek: add MT6351 PMIC support for MT6797 argus.lin
2018-05-03 2:01 ` Sean Wang
2018-05-02 9:21 ` [PATCH V4 2/8] soc: mediatek: pwrap: add caps flag for pwrap argus.lin
2018-05-02 10:27 ` Matthias Brugger
2018-05-02 9:21 ` [PATCH V4 3/8] soc: mediatek: pwrap: remove has_bridge flag argus.lin
2018-05-02 10:27 ` Matthias Brugger
2018-05-02 9:21 ` [PATCH V4 4/8] soc: mediatek: pwrap: add int1_en_all flag argus.lin
2018-05-02 10:29 ` Matthias Brugger
2018-05-02 9:21 ` [PATCH V4 5/8] soc: mediatek: pwrap: add pwrap for mt6797 SoCs argus.lin
2018-05-02 10:37 ` Matthias Brugger
2018-05-03 4:01 ` Sean Wang
2018-05-03 6:20 ` Argus Lin
2018-05-04 3:04 ` Sean Wang
2018-05-04 8:39 ` Matthias Brugger [this message]
2018-05-02 9:21 ` [PATCH V4 6/8] soc: mediatek: pwrap: fix cipher init argus.lin
2018-05-02 9:21 ` [PATCH V4 7/8] soc: mediatek: pwrap: add mt6351 for mt6797 SoCs argus.lin
2018-05-03 3:53 ` Sean Wang
2018-05-02 9:21 ` [PATCH V4 8/8] arm64: dts: mt6797: add pwrap support for mt6797 argus.lin
2018-05-03 2:22 ` Sean Wang
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=69e4766f-8c7a-7729-93f8-4f87d2ceff8b@gmail.com \
--to=matthias.bgg@gmail.com \
--cc=argus.lin@mediatek.com \
--cc=catalin.marinas@arm.com \
--cc=chen.zhong@mediatek.com \
--cc=chenglin.xu@mediatek.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=devicetree@vger.kernel.org \
--cc=flora.fu@mediatek.com \
--cc=henryc.chen@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=sean.wang@mediatek.com \
--cc=will.deacon@arm.com \
--cc=wsd_upstream@mediatek.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 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).