From: "Cousson, Benoit" <b-cousson@ti.com>
To: Omar Ramirez Luna <omar.luna@linaro.org>
Cc: Tony Lindgren <tony@atomide.com>,
Russell King <linux@arm.linux.org.uk>,
Ohad Ben-Cohen <ohad@wizery.com>,
Joerg Roedel <joerg.roedel@amd.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Felipe Contreras <felipe.contreras@gmail.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
iommu@lists.linux-foundation.org
Subject: Re: [PATCH 3/6] ARM: OMAP4: hwmod data: add mmu hwmod for ipu and dsp
Date: Tue, 19 Jun 2012 19:48:07 +0200 [thread overview]
Message-ID: <4FE0BB57.3080403@ti.com> (raw)
In-Reply-To: <CALLhW=67d7=4Jx1T4Kn5ddNz7vQ5YeN4AzuOuXrW1_UGYwpG2A@mail.gmail.com>
On 6/19/2012 6:39 PM, Omar Ramirez Luna wrote:
> Hi Benoit,
>
> On 19 June 2012 07:36, Cousson, Benoit <b-cousson@ti.com> wrote:
>> On 6/16/2012 3:56 AM, Omar Ramirez Luna wrote:
> ...
>>> +static struct omap_hwmod omap44xx_ipu_mmu_hwmod = {
>>> + .name = "ipu_mmu",
>>> + .class = &omap44xx_mmu_hwmod_class,
>>> + .clkdm_name = "ducati_clkdm",
>>> + .mpu_irqs = omap44xx_ipu_mmu_irqs,
>>> + .rst_lines = omap44xx_ipu_mmu_resets,
>>> + .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_mmu_resets),
>>> + .main_clk = "ipu_fck",
>>> + .prcm = {
>>> + .omap4 = {
>>> + .clkctrl_offs = OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET,
>>> + .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
>>> + .context_offs = OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET,
>>> + .modulemode = MODULEMODE_HWCTRL,
>>> + },
>>> + },
>>> + .dev_attr = &ipu_mmu_dev_attr,
>>> +};
>>
>> In fact, the MMU_IPU hwmod is now almost the same one than the previous IPU one...
>> If we do that we should maybe just rename the IPU -> MMU_IPU and DSP -> MMU_DSP.
>>
>> But by doing that we will assume that the MMU does represent the subsystem, which is not necessarily super nice.
>>
>> I guess that a much better representation will be to keep the subsystem (IPU) to handle the PRCM part:
>>
>> + .main_clk = "ipu_fck",
>> + .prcm = {
>> + .clkctrl_offs = OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET,
>> + .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
>> + .context_offs = OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET,
>> + .modulemode = MODULEMODE_HWCTRL,
>>
>> And then the MMU_IPU will handle the configuration registers part and the reset + irq.
>>
>> But then, you will have to create a parent child dependency between your devices to ensure that the IPU subsystem device will be enabled before trying to access the MMU_IPU.
>>
>> This is what the DSS is about to do to handle the same kind of power dependency. The DSS device is the parent of all the DSS IPs (DISPC, HDMI...) and thus pm_runtime will ensure that the parent is enabled before trying to enable the children.
>>
>> In term of DT, just to illustrate the situation, it will be something like that:
>>
>> ipu {
>> compatible = "simple-bus";
>> ti,hwmods = "ipu";
>>
>> ipu_mmu: mmu@4a066000 {
>> compatible = "omap-mmu";
>> ti,hwmods = "mmu_ipu";
>> reg...;
>> irqs...;
>> }
>> }
>>
>> Is it something you can handle with your current framework?
>
> I agree it would be nice only IPU managed the prcm, however we can't
> do that right now because hwmod expects the IP block to be out of
> reset to continue the _enable sequence. On IPU both reset lines are
> asserted at that point and hence _are_any_hardreset_lines_asserted
> check will bail out, and ipu resets can't be lifted without a
> configured iommu otherwise it might execute random garbage.
That's a good point, but like Paul said, the hard reset was removed
outside of the fmwk due to the lack of understanding about the real
usage / need for it.
If we do have a better understanding, we might add some more support in
the fmwk or at least improve it.
I'm now realizing that aborting the init if some reset lines are
asserted is not what we want to do for the IPU SS hwmod that will
contain the IPU (processor) reset control.
In fact the previous approach with a fake hwmod for the ipu_c0 processor
would have been avoided that issue.
If we do not want to go back with that, we should clearly revise the
_are_any_hardreset_lines_asserted approach and not prevent the init in
such case since it will prevent all the subsystem to start properly.
> So, for IPU and DSP the mmu must be deasserted and configured before
> the processor reset line (which is more like a parking brake) is
> deasserted, and the latter should be made before _enable is called so
> it can fully execute the enable sequence.
Yep, so we have to change the way it is handled today.
Paul,
If we consider that the reset lines are stored in the subsystem hwmod
(IPU, DSP or IVA), we cannot prevent the init phase because some line
are asserted. Otherwise we will never allow the MMU or processor to be
enabled later.
We might have to remove that check, maybe based on flag if we want to
keep that functionality or do an explicit reset control like we use to do.
What do you think?
Regards,
Benoit
next prev parent reply other threads:[~2012-06-19 17:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-16 1:55 [PATCH 0/6] OMAP: iommu: hwmod, reset handling and runtime PM Omar Ramirez Luna
2012-06-16 1:56 ` [PATCH 6/6] ARM: OMAP3/4: iommu: adapt to runtime pm Omar Ramirez Luna
[not found] ` <1339811764-5337-1-git-send-email-omar.luna-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-06-16 1:55 ` [PATCH 1/6] ARM: OMAP: iommu: fix including iommu.h without IOMMU_API selected Omar Ramirez Luna
2012-06-16 1:56 ` [PATCH 2/6] ARM: OMAP3: hwmod data: add mmu data for iva and isp Omar Ramirez Luna
2012-06-16 1:56 ` [PATCH 3/6] ARM: OMAP4: hwmod data: add mmu hwmod for ipu and dsp Omar Ramirez Luna
2012-06-19 12:36 ` Cousson, Benoit
2012-06-19 16:39 ` Omar Ramirez Luna
2012-06-19 17:48 ` Cousson, Benoit [this message]
2012-06-28 1:27 ` Omar Ramirez Luna
2012-07-09 13:50 ` Omar Ramirez Luna
2012-06-16 1:56 ` [PATCH 4/6] ARM: OMAP3/4: iommu: migrate to hwmod framework Omar Ramirez Luna
2012-06-16 1:56 ` [PATCH 5/6] ARM: OMAP2+: iommu: add reset handling Omar Ramirez Luna
2012-07-17 10:11 ` [PATCH 0/6] OMAP: iommu: hwmod, reset handling and runtime PM Joerg Roedel
2012-07-17 10:51 ` Ohad Ben-Cohen
2012-07-18 17:15 ` Omar Ramirez Luna
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=4FE0BB57.3080403@ti.com \
--to=b-cousson@ti.com \
--cc=felipe.contreras@gmail.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joerg.roedel@amd.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=ohad@wizery.com \
--cc=omar.luna@linaro.org \
--cc=tony@atomide.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