From: Sergei Shtylyov <sshtylyov@mvista.com>
To: "Grosen, Mark" <mgrosen@ti.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
davinci-linux-open-source
<davinci-linux-open-source@linux.davincidsp.com>,
Arnd Bergmann <arnd@arndb.de>,
Brian Swetland <swetland@google.com>,
Rusty Russell <rusty@rustcorp.com.au>,
Grant Likely <grant.likely@secretlab.ca>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [RFC 5/8] remoteproc: add davinci implementation
Date: Fri, 24 Jun 2011 19:13:50 +0400 [thread overview]
Message-ID: <4E04A9AE.3030801@mvista.com> (raw)
In-Reply-To: <FFF198FBBF957F4393BA834040FEFFA202D66E@DFLE35.ent.ti.com>
Hello.
Grosen, Mark wrote:
>> It should work on DA830 as well,
So please make it dependent on ARCH_DAVINCI_DA8XX.
>> but not on real DaVinci, so the name is misleading...
> Yes, we debated calling it da8xx, but felt that with minor changes it could
> accomodate the other SoCs in the davinci family.
I don't think it's a good idea. Using cpu_is_*() is drivers is bad. Using
#ifdef's is not an option either.
> However, it may be better
> to start with just the da8xx/omapl13x parts and then rename if we add the
> others.
>> [...]
>>> +
>>> +/*
>>> + * Technical Reference:
>>> + * OMAP-L138 Applications Processor System Reference Guide
>>> + * http://www.ti.com/litv/pdf/sprugm7d
>>> + */
>>> +
>>> +/* local reset bit (0 is asserted) in MDCTL15 register (section
>> 9.6.18) */
>>> +#define LRST BIT(8)
>> Perhaps this should be named nLRST or something if the sense is inverted?
> If there is an established naming convention for this, I'll adopt it.
Looking into my old PSC manual (can't get the recent documentation from TI's
site right now), the bit is called LRSTz.
It's worth moving this #define into <mach/psc.h> as well.
>>> +/* register for DSP boot address in SYSCFG0 module (section 11.5.6)
>> */
>>> +#define HOST1CFG 0x44
>> Worth declaring in <mach/da8xx.h> instead...
> Possibly - since it is only used for the DSP, I thought it would be better
> to keep local to this implementation. I'll adopt whichever approach is the
> convention.
Well, the general approach is to keep the #define's where they are used, so
maybe we should keep this #define here.
>>> +static inline int davinci_rproc_start(struct rproc *rproc, u64
>> bootaddr)
>>> +{
>>> + struct device *dev = rproc->dev;
>>> + struct davinci_rproc_pdata *pdata = dev->platform_data;
>>> + struct davinci_soc_info *soc_info = &davinci_soc_info;
>>> + void __iomem *psc_base;
>>> + struct clk *dsp_clk;
>>> +
>>> + /* hw requires the start (boot) address be on 1KB boundary */
>>> + if (bootaddr & 0x3ff) {
>>> + dev_err(dev, "invalid boot address: must be aligned to
>> 1KB\n");
>>> + return -EINVAL;
>>> + }
>>> +
>>> + dsp_clk = clk_get(dev, pdata->clk_name);
>> We could match using clkdev functionality, but the clock entry
>> would need to be changed then...
> I followed the existing pattern I saw in other drivers.
Probably MUSB? We're trying to move away from passing the clock name to thge
drivers, using match by device instead.
> If there is a new, better way, please point me to an example.
Look at the da850_clks[] in mach-davinci/da850.c: if the device name is
specified as a first argument to CLK() macro (instead of clock name the second
argument), the matching is done by device, so you don't need to specify the
clock name to clk_get(), passing NULL instead.
>>> + if (IS_ERR_OR_NULL(dsp_clk)) {
>>> + dev_err(dev, "clk_get error: %ld\n", PTR_ERR(dsp_clk));
>>> + return PTR_ERR(dsp_clk);
>>> + }
>>> +
>>> + clk_enable(dsp_clk);
>> This seems rather senseless activity as on DA8xx the DSP core
>> boots the ARM core, so the DSP clock will be already enabled.
> I think it is needed. It's true that the DSP initiates the boot, but then it is
> reset and the clock disabled. See Section 13.2 of
Hm, didn't know that. Contrarywise, we had to work around the races between
ARM and DSP cores on accessing locked SYSCFG registers -- in kernel. So I was
under impression that DSP code continues running some stuff of its own.
> http://focus.ti.com/lit/ug/sprugm7e/sprugm7e.pdf:
> 13.2 DSP Wake Up
> Following deassertion of device reset, the DSP intializes the ARM296 so that
> it can execute the ARM ROM bootloader. Upon successful wake up, the ARM
> places the DSP in a reset and clock gated (SwRstDisable) state that is
> controlled by the LPSC and the SYSCFG modules.
> Besides, the boot loader could have disabled it to save power. The ARM and
> DSP are clocked independently, so I think it's best to use clock management.
OK, agreed.
>>> + rproc->priv = dsp_clk;
>>> +
>>> + psc_base = ioremap(soc_info->psc_bases[0], SZ_4K);
>>> +
>>> + /* insure local reset is asserted before writing start address */
>>> + __raw_writel(NEXT_ENABLED, psc_base + MDCTL + 4 *
>> DA8XX_LPSC0_GEM);
>>> +
>>> + __raw_writel(bootaddr, DA8XX_SYSCFG0_VIRT(HOST1CFG));
>> DA8XX_SYSCFG0_VIRT() is not supposed to be used outside mach-davinci. The
>> variable it refers is not exported, so driver module won't work.
> Ooops, I clearly did not build this as a module. Suggestion how to fix this?
Using the normal ioremap() of SYSCFG0 space, I suppose.
> Mark
WBR, Sergei
next prev parent reply other threads:[~2011-06-24 15:15 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-21 7:18 [RFC 0/8] Introducing a generic AMP/IPC framework Ohad Ben-Cohen
2011-06-21 7:18 ` [RFC 1/8] drivers: add generic remoteproc framework Ohad Ben-Cohen
2011-06-22 17:55 ` Randy Dunlap
2011-06-22 19:11 ` Ohad Ben-Cohen
2011-06-27 20:49 ` Grant Likely
2011-06-27 21:52 ` Grosen, Mark
2011-06-27 22:24 ` Grant Likely
2011-06-27 23:54 ` Grosen, Mark
2011-06-27 23:29 ` Russell King - ARM Linux
2011-06-27 23:35 ` Grant Likely
2011-06-28 21:55 ` Ohad Ben-Cohen
2011-06-28 21:41 ` Ohad Ben-Cohen
2011-06-21 7:18 ` [RFC 2/8] remoteproc: add omap implementation Ohad Ben-Cohen
2011-06-22 10:05 ` Will Newton
2011-06-22 10:50 ` Ohad Ben-Cohen
2011-06-27 21:00 ` Grant Likely
2011-06-29 15:04 ` Ohad Ben-Cohen
2011-06-29 15:31 ` Grant Likely
2011-06-21 7:18 ` [RFC 3/8] omap: add carveout memory support for remoteproc Ohad Ben-Cohen
2011-06-21 7:18 ` [RFC 4/8] omap: add remoteproc devices Ohad Ben-Cohen
2011-06-21 7:18 ` [RFC 5/8] remoteproc: add davinci implementation Ohad Ben-Cohen
2011-06-23 15:27 ` Sergei Shtylyov
2011-06-24 4:25 ` Grosen, Mark
2011-06-24 15:13 ` Sergei Shtylyov [this message]
2011-06-24 15:43 ` Nori, Sekhar
2011-06-27 18:31 ` Grosen, Mark
2011-07-05 5:29 ` Nori, Sekhar
2011-07-05 16:54 ` Grosen, Mark
2011-07-05 5:34 ` Nori, Sekhar
2011-07-05 16:54 ` Grosen, Mark
2011-07-06 4:36 ` Nori, Sekhar
2011-06-27 18:20 ` Grosen, Mark
2011-06-28 9:36 ` Nori, Sekhar
2011-06-21 7:18 ` [RFC 6/8] davinci: da850: add remoteproc dsp device Ohad Ben-Cohen
2011-06-28 10:18 ` Sergei Shtylyov
2011-06-21 7:18 ` [RFC 7/8] drivers: introduce rpmsg, a remote-processor messaging bus Ohad Ben-Cohen
2011-06-09 17:12 ` Pavel Machek
2011-07-19 5:38 ` Ohad Ben-Cohen
2011-06-22 2:42 ` Rusty Russell
2011-06-22 3:11 ` Sasha Levin
2011-06-22 10:46 ` Ohad Ben-Cohen
2011-09-14 18:38 ` Ohad Ben-Cohen
2011-09-15 0:12 ` Rusty Russell
2011-09-15 14:56 ` Ohad Ben-Cohen
2011-06-27 22:21 ` Grant Likely
2011-06-28 22:46 ` Ohad Ben-Cohen
2011-06-28 22:51 ` Grant Likely
2011-06-28 23:00 ` Ohad Ben-Cohen
2011-06-29 15:43 ` Grant Likely
2011-07-01 15:13 ` Ohad Ben-Cohen
2011-06-28 23:44 ` Randy Dunlap
2011-06-29 6:30 ` Ohad Ben-Cohen
2011-06-29 11:59 ` Arnd Bergmann
2011-06-29 12:29 ` Ohad Ben-Cohen
2011-06-21 7:18 ` [RFC 8/8] rpmsg: add omap host backend Ohad Ben-Cohen
2011-06-21 7:50 ` [RFC 0/8] Introducing a generic AMP/IPC framework Ohad Ben-Cohen
2011-06-21 9:30 ` Ohad Ben-Cohen
2011-06-21 14:20 ` Arnd Bergmann
2011-06-21 15:54 ` Grant Likely
2011-06-22 11:41 ` Ohad Ben-Cohen
2011-06-22 13:05 ` Arnd Bergmann
2011-06-22 13:09 ` Ohad Ben-Cohen
2011-06-23 12:23 ` Michael Williamson
2011-06-23 16:27 ` Grosen, Mark
2011-06-23 18:46 ` Arnd Bergmann
2011-06-24 4:32 ` Grosen, Mark
2011-06-24 20:16 ` Stephen Boyd
2011-06-26 1:11 ` Ohad Ben-Cohen
2011-06-26 1:17 ` Brian Swetland
2011-06-27 21:22 ` Grosen, Mark
2011-06-28 11:26 ` Ohad Ben-Cohen
2011-06-28 11:36 ` Brian Swetland
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=4E04A9AE.3030801@mvista.com \
--to=sshtylyov@mvista.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mgrosen@ti.com \
--cc=ohad@wizery.com \
--cc=rusty@rustcorp.com.au \
--cc=swetland@google.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