From: elder@linaro.org (Alex Elder)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] ARM: add SMP support for Broadcom mobile SoCs
Date: Fri, 04 Apr 2014 13:56:54 -0500 [thread overview]
Message-ID: <533F0076.4090407@linaro.org> (raw)
In-Reply-To: <CAAYSxhqOh4F=vSDJYUwFE85og-Tgc9Hi8c79biEZYYjb8z1Qkg@mail.gmail.com>
On 04/04/2014 10:30 AM, Tim Kryger wrote:
> On Thu, Apr 3, 2014 at 7:18 PM, Alex Elder <elder@linaro.org> wrote:
>
>> diff --git a/arch/arm/mach-bcm/platsmp.c b/arch/arm/mach-bcm/platsmp.c
>> new file mode 100644
>> index 0000000..46a64f2
>> --- /dev/null
>> +++ b/arch/arm/mach-bcm/platsmp.c
>
>> +/* Size of mapped Cortex A9 SCU address space */
>> +#define SCU_SIZE 0x58
>
>> +/*
>> + * Enable the Cortex A9 Snoop Control Unit
>> + *
>> + * By the time this is called we already know there are multiple
>> + * cores present. We assume we're running on a Cortex A9 processor,
>> + * so any trouble getting the base address register or getting the
>> + * SCU base is a problem.
>> + *
>> + * Return 0 if successful or an error code otherwise.
>> + */
>> +static int __init scu_a9_enable(void)
>> +{
>> + unsigned long config_base;
>> + void __iomem *scu_base;
>> +
>> + if (!scu_a9_has_base()) {
>> + pr_err("no configuration base address register!\n");
>> + return -ENXIO;
>> + }
>> +
>> + /* Config base address register value is zero for uniprocessor */
>> + config_base = scu_a9_get_base();
>> + if (!config_base) {
>> + pr_err("hardware reports only one core; disabling SMP\n");
>> + return -ENOENT;
>> + }
>> +
>> + scu_base = ioremap((phys_addr_t)config_base, SCU_SIZE);
>> + if (!scu_base) {
>> + pr_err("failed to remap config base (%lu/%u) for SCU\n",
>> + config_base, SCU_SIZE);
>> + return -ENOMEM;
>> + }
>> +
>> + scu_enable(scu_base);
>> +
>> + iounmap(scu_base); /* That's the last we'll need of this */
>> +
>> + return 0;
>> +}
>
> This function seems useful for Cortex A9 MPCore in general.
>
> While you gave it a generic name, you put it in a Broadcom file.
>
> Is there a better location for this code?
I think it belongs in arch/arm/kernel/smp_scu.c. I was thinking
it might be generally useful when I wrote it (hence the more
complete header comment, for example). And I'll gladly move
it there, I just didn't want anybody to get hung up on that.
-Alex
next prev parent reply other threads:[~2014-04-04 18:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 2:18 [PATCH 0/5] ARM: SMP: support Broadcom mobile SoCs Alex Elder
2014-04-04 2:18 ` [PATCH 1/5] ARM: introduce CPU_METHOD_OF_DECLARE_SETUP() Alex Elder
2014-04-04 2:18 ` [PATCH 2/5] ARM: add SMP support for Broadcom mobile SoCs Alex Elder
2014-04-04 2:26 ` Alex Elder
2014-04-04 15:30 ` Tim Kryger
2014-04-04 18:56 ` Alex Elder [this message]
2014-04-15 12:30 ` Alex Elder
2014-04-04 17:55 ` Stephen Boyd
2014-04-04 19:30 ` Alex Elder
2014-05-05 22:02 ` Alex Elder
2014-05-06 1:43 ` Stephen Boyd
2014-05-06 4:05 ` Alex Elder
2014-04-04 2:18 ` [PATCH 3/5] ARM: configs: enable SMP in bcm_defconfig Alex Elder
2014-04-04 10:21 ` Alex Elder
2014-04-04 2:18 ` [PATCH 4/5] ARM: dts: enable SMP support for bcm28155 Alex Elder
2014-04-04 2:18 ` [PATCH 5/5] ARM: dts: enable SMP support for bcm21664 Alex Elder
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=533F0076.4090407@linaro.org \
--to=elder@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).