linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tim Kryger <tim.kryger@linaro.org>
To: Alex Elder <elder@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: Fri, 4 Apr 2014 08:30:16 -0700	[thread overview]
Message-ID: <CAAYSxhqOh4F=vSDJYUwFE85og-Tgc9Hi8c79biEZYYjb8z1Qkg@mail.gmail.com> (raw)
In-Reply-To: <1396577891-2713-3-git-send-email-elder@linaro.org>

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?

  parent reply	other threads:[~2014-04-04 15:30 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 [this message]
2014-04-04 18:56     ` Alex Elder
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='CAAYSxhqOh4F=vSDJYUwFE85og-Tgc9Hi8c79biEZYYjb8z1Qkg@mail.gmail.com' \
    --to=tim.kryger@linaro.org \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bcm@fixthebug.org \
    --cc=devicetree@vger.kernel.org \
    --cc=elder@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mporter@linaro.org \
    --cc=sboyd@codeaurora.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).