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: Tue, 15 Apr 2014 07:30:41 -0500 [thread overview]
Message-ID: <534D2671.4030101@linaro.org> (raw)
In-Reply-To: <533F0076.4090407@linaro.org>
On 04/04/2014 01:56 PM, Alex Elder wrote:
> 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.
I'm going to re-submit this series this morning. I looked at
where this function might be used, and it looks like only one
other platform could use it (in hi3xxx_smp_prepare_cpus()).
Man of the others define get their scu base address some
other way (using a fixed constant or using device tree).
For now I'm going to keep it where it is. If you or someone else
reiterate the suggestion I'll move it to arch/arm/kernel/smp_scu.c.
-Alex
WARNING: multiple messages have this Message-ID (diff)
From: Alex Elder <elder-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Tim Kryger <tim.kryger-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Matt Porter <mporter-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Christian Daudt <bcm-xK7y4jjYLqYh9ZMKESR00Q@public.gmane.org>,
Device Tree List
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
Broadcom Kernel Feedback List
<bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
ARM Kernel List
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/5] ARM: add SMP support for Broadcom mobile SoCs
Date: Tue, 15 Apr 2014 07:30:41 -0500 [thread overview]
Message-ID: <534D2671.4030101@linaro.org> (raw)
In-Reply-To: <533F0076.4090407-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
On 04/04/2014 01:56 PM, Alex Elder wrote:
> On 04/04/2014 10:30 AM, Tim Kryger wrote:
>> On Thu, Apr 3, 2014 at 7:18 PM, Alex Elder <elder-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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.
I'm going to re-submit this series this morning. I looked at
where this function might be used, and it looks like only one
other platform could use it (in hi3xxx_smp_prepare_cpus()).
Man of the others define get their scu base address some
other way (using a fixed constant or using device tree).
For now I'm going to keep it where it is. If you or someone else
reiterate the suggestion I'll move it to arch/arm/kernel/smp_scu.c.
-Alex
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Alex Elder <elder@linaro.org>
To: Tim Kryger <tim.kryger@linaro.org>
Cc: Matt Porter <mporter@linaro.org>,
Christian Daudt <bcm@fixthebug.org>,
Device Tree List <devicetree@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
sboyd@codeaurora.org,
Broadcom Kernel Feedback List
<bcm-kernel-feedback-list@broadcom.com>,
ARM Kernel List <linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] ARM: add SMP support for Broadcom mobile SoCs
Date: Tue, 15 Apr 2014 07:30:41 -0500 [thread overview]
Message-ID: <534D2671.4030101@linaro.org> (raw)
In-Reply-To: <533F0076.4090407@linaro.org>
On 04/04/2014 01:56 PM, Alex Elder wrote:
> 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.
I'm going to re-submit this series this morning. I looked at
where this function might be used, and it looks like only one
other platform could use it (in hi3xxx_smp_prepare_cpus()).
Man of the others define get their scu base address some
other way (using a fixed constant or using device tree).
For now I'm going to keep it where it is. If you or someone else
reiterate the suggestion I'll move it to arch/arm/kernel/smp_scu.c.
-Alex
next prev parent reply other threads:[~2014-04-15 12:30 UTC|newest]
Thread overview: 44+ 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 ` Alex Elder
2014-04-04 2:18 ` Alex Elder
2014-04-04 2:18 ` [PATCH 1/5] ARM: introduce CPU_METHOD_OF_DECLARE_SETUP() Alex Elder
2014-04-04 2:18 ` Alex Elder
2014-04-04 2:18 ` Alex Elder
2014-04-04 2:18 ` [PATCH 2/5] ARM: add SMP support for Broadcom mobile SoCs Alex Elder
2014-04-04 2:18 ` Alex Elder
2014-04-04 2:26 ` Alex Elder
2014-04-04 2:26 ` Alex Elder
2014-04-04 2:26 ` Alex Elder
2014-04-04 15:30 ` Tim Kryger
2014-04-04 15:30 ` Tim Kryger
2014-04-04 15:30 ` Tim Kryger
2014-04-04 18:56 ` Alex Elder
2014-04-04 18:56 ` Alex Elder
2014-04-04 18:56 ` Alex Elder
2014-04-15 12:30 ` Alex Elder [this message]
2014-04-15 12:30 ` Alex Elder
2014-04-15 12:30 ` Alex Elder
2014-04-04 17:55 ` Stephen Boyd
2014-04-04 17:55 ` Stephen Boyd
2014-04-04 19:30 ` Alex Elder
2014-04-04 19:30 ` Alex Elder
2014-04-04 19:30 ` Alex Elder
2014-05-05 22:02 ` Alex Elder
2014-05-05 22:02 ` Alex Elder
2014-05-06 1:43 ` Stephen Boyd
2014-05-06 1:43 ` Stephen Boyd
2014-05-06 1:43 ` Stephen Boyd
2014-05-06 4:05 ` Alex Elder
2014-05-06 4:05 ` Alex Elder
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 2:18 ` Alex Elder
2014-04-04 2:18 ` Alex Elder
2014-04-04 10:21 ` Alex Elder
2014-04-04 10:21 ` 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 ` Alex Elder
2014-04-04 2:18 ` [PATCH 5/5] ARM: dts: enable SMP support for bcm21664 Alex Elder
2014-04-04 2:18 ` Alex Elder
2014-04-04 2:18 ` 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=534D2671.4030101@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.