From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/9] ARM: PRIMA2: initialize l2x0 according to mach from DT
Date: Wed, 2 Jan 2013 13:43:53 +0000 [thread overview]
Message-ID: <20130102134353.GD25907@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1356005639-23466-4-git-send-email-Barry.Song@csr.com>
On Thu, Dec 20, 2012 at 12:13:53PM +0000, Barry Song wrote:
> From: Barry Song <Baohua.Song@csr.com>
>
> prima2 and marco have diffetent l2 cache configuration, so
> we initialize l2x0 cache based on dtb given to kernel.
>
> Signed-off-by: Barry Song <Baohua.Song@csr.com>
> ---
> arch/arm/mach-prima2/l2x0.c | 14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-prima2/l2x0.c b/arch/arm/mach-prima2/l2x0.c
> index c998377..909cc6f 100644
> --- a/arch/arm/mach-prima2/l2x0.c
> +++ b/arch/arm/mach-prima2/l2x0.c
> @@ -16,6 +16,11 @@ static struct of_device_id prima2_l2x0_ids[] = {
> {},
> };
>
> +static struct of_device_id marco_l2x0_ids[] = {
> + { .compatible = "sirf,marco-pl310-cache" },
> + {},
> +};
> +
> static int __init sirfsoc_l2x0_init(void)
> {
> struct device_node *np;
> @@ -26,6 +31,15 @@ static int __init sirfsoc_l2x0_init(void)
> return l2x0_of_init(0x40000, 0);
> }
>
> + np = of_find_matching_node(NULL, marco_l2x0_ids);
> + if (np) {
> + pr_info("Initializing marco L2 cache\n");
> + /* Way size: 32KB Associativity: 16-way */
> + return l2x0_of_init((2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) |
> + (1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT),
> + L2X0_AUX_CTRL_MASK);
> + }
> +
> return 0;
> }
> early_initcall(sirfsoc_l2x0_init);
Rather than individually testing each match against the table, could you not
place the configuration values in a struct, and map to this with
of_device_id::data?
Thanks,
Mark.
next prev parent reply other threads:[~2013-01-02 13:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-20 12:13 [PATCH 0/9] ARM: PRIMA2: bringup new CSR SiRFmarco SMP SoC Barry Song
2012-12-20 12:13 ` [PATCH 1/9] ARM: PRIMA2: add CSR SiRFmarco device tree .dts Barry Song
2013-01-02 12:19 ` Mark Rutland
2013-01-03 10:28 ` Barry Song
2012-12-20 12:13 ` [PATCH 2/9] ARM: PRIMA2: enable AUTO_ZRELADDR for SIRF in Kconfig Barry Song
2012-12-20 12:13 ` [PATCH 3/9] ARM: PRIMA2: initialize l2x0 according to mach from DT Barry Song
2013-01-02 13:43 ` Mark Rutland [this message]
2013-01-03 10:20 ` Barry Song
2012-12-20 12:13 ` [PATCH 4/9] ARM: PRIMA2: mv timer to timer-prima2 as we will add timer-marco Barry Song
2013-01-06 2:52 ` [PATCH 0/9] ARM: PRIMA2: bringup new CSR SiRFmarco SMP SoC Barry Song
2013-01-14 11:07 ` Arnd Bergmann
2013-01-14 14:30 ` Barry Song
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=20130102134353.GD25907@e106331-lin.cambridge.arm.com \
--to=mark.rutland@arm.com \
--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).