From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: shmobile: r8a7790 SMP prototype v2
Date: Thu, 27 Jun 2013 12:01:13 +0000 [thread overview]
Message-ID: <201306271401.13198.arnd@arndb.de> (raw)
In-Reply-To: <20130626235837.11576.86389.sendpatchset@w520>
On Thursday 27 June 2013, Magnus Damm wrote:
> +#include <asm/cacheflush.h>
> +#include <asm/cp15.h>
> +#include <asm/smp_plat.h>
> +
> +#define SYSC 0xe6180000
> +#define SYSCSR 0x0000
> +
> +#define RST 0xe6160000
> +#define CA15BAR 0x6020
> +#define CA15RESCNT 0x0040
> +#define CA7BAR 0x4030
> +#define CA7RESCNT 0x0044
> +#define RESCNT 0x0050
> +
> +#define APMU 0xe6150000
> +#define CA15WUPCR 0x2010
> +#define CA7WUPCR 0x1010
> +
> +#define MERAM 0xe8080000
Please get the base addresses from device tree if you can,
using of_iomap().
> +#define r8a7790_clst_id(cpu) (cpu_logical_map((cpu)) >> 8)
> +#define r8a7790_cpu_id(cpu) (cpu_logical_map((cpu)) & 0xff)
> +
> +static void r8a7790_deassert_reset(unsigned int cpu)
> +{
> + void __iomem *p, *carescnt;
> + u32 bar, mask, magic;
> + unsigned int clst_id = r8a7790_clst_id(cpu);
> +
> + /* setup reset vectors */
> + p = ioremap_nocache(RST, 0x7000);
> + bar = (MERAM >> 8) & 0xfffffc00;
> + __raw_writel(bar, p + r8a7790_clst[clst_id].cabar);
> + __raw_writel(bar | 0x10, p + r8a7790_clst[clst_id].cabar);
> +
> + /* enable clocks for cluster */
> + if (r8a7790_clst[clst_id].use_count++ = 0) {
> + mask = 1 << r8a7790_clst[clst_id].rescnt_bit;
> + __raw_writel(__raw_readl(p + RESCNT) & ~mask, p + RESCNT);
> + }
If you cannot use writel_relaxed() here, add a comment. Otherwise
change it to writel or writel_relaxed.
> +static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
> +{
> + void __iomem *p;
> + unsigned int k;
> +
> + shmobile_boot_fn = virt_to_phys(shmobile_invalidate_start);
> +
> + /* MERAM for jump stub, because BAR requires 256KB aligned address */
> + p = ioremap_nocache(MERAM, 16);
> + memcpy(p, shmobile_boot_vector, 16);
> + iounmap(p);
On the other hand here you have to use __raw_writel() or
memcpy_toio() because memcpy cannot operate on __iomem tokens.
Also, if this is actually memory, you probably want to use ioremap_cached
or ioremap_writecombine.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: shmobile: r8a7790 SMP prototype v2
Date: Thu, 27 Jun 2013 14:01:13 +0200 [thread overview]
Message-ID: <201306271401.13198.arnd@arndb.de> (raw)
In-Reply-To: <20130626235837.11576.86389.sendpatchset@w520>
On Thursday 27 June 2013, Magnus Damm wrote:
> +#include <asm/cacheflush.h>
> +#include <asm/cp15.h>
> +#include <asm/smp_plat.h>
> +
> +#define SYSC 0xe6180000
> +#define SYSCSR 0x0000
> +
> +#define RST 0xe6160000
> +#define CA15BAR 0x6020
> +#define CA15RESCNT 0x0040
> +#define CA7BAR 0x4030
> +#define CA7RESCNT 0x0044
> +#define RESCNT 0x0050
> +
> +#define APMU 0xe6150000
> +#define CA15WUPCR 0x2010
> +#define CA7WUPCR 0x1010
> +
> +#define MERAM 0xe8080000
Please get the base addresses from device tree if you can,
using of_iomap().
> +#define r8a7790_clst_id(cpu) (cpu_logical_map((cpu)) >> 8)
> +#define r8a7790_cpu_id(cpu) (cpu_logical_map((cpu)) & 0xff)
> +
> +static void r8a7790_deassert_reset(unsigned int cpu)
> +{
> + void __iomem *p, *carescnt;
> + u32 bar, mask, magic;
> + unsigned int clst_id = r8a7790_clst_id(cpu);
> +
> + /* setup reset vectors */
> + p = ioremap_nocache(RST, 0x7000);
> + bar = (MERAM >> 8) & 0xfffffc00;
> + __raw_writel(bar, p + r8a7790_clst[clst_id].cabar);
> + __raw_writel(bar | 0x10, p + r8a7790_clst[clst_id].cabar);
> +
> + /* enable clocks for cluster */
> + if (r8a7790_clst[clst_id].use_count++ == 0) {
> + mask = 1 << r8a7790_clst[clst_id].rescnt_bit;
> + __raw_writel(__raw_readl(p + RESCNT) & ~mask, p + RESCNT);
> + }
If you cannot use writel_relaxed() here, add a comment. Otherwise
change it to writel or writel_relaxed.
> +static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
> +{
> + void __iomem *p;
> + unsigned int k;
> +
> + shmobile_boot_fn = virt_to_phys(shmobile_invalidate_start);
> +
> + /* MERAM for jump stub, because BAR requires 256KB aligned address */
> + p = ioremap_nocache(MERAM, 16);
> + memcpy(p, shmobile_boot_vector, 16);
> + iounmap(p);
On the other hand here you have to use __raw_writel() or
memcpy_toio() because memcpy cannot operate on __iomem tokens.
Also, if this is actually memory, you probably want to use ioremap_cached
or ioremap_writecombine.
Arnd
next prev parent reply other threads:[~2013-06-27 12:01 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 9:59 [PATCH] ARM: shmobile: r8a7790 SMP prototype v1 (CA15 x 4) Magnus Damm
2013-06-26 23:58 ` [PATCH] ARM: shmobile: r8a7790 SMP prototype v2 Magnus Damm
2013-06-26 23:58 ` Magnus Damm
2013-06-27 8:43 ` Russell King - ARM Linux
2013-06-27 8:43 ` Russell King - ARM Linux
2013-07-08 4:48 ` Magnus Damm
2013-07-08 4:48 ` Magnus Damm
2013-06-27 12:01 ` Arnd Bergmann [this message]
2013-06-27 12:01 ` Arnd Bergmann
2013-07-08 4:52 ` Magnus Damm
2013-07-08 4:52 ` Magnus Damm
2013-07-08 23:21 ` Arnd Bergmann
2013-07-08 23:21 ` Arnd Bergmann
2013-07-09 1:29 ` Magnus Damm
2013-07-09 1:29 ` Magnus Damm
2013-07-01 6:13 ` [PATCH] ARM: shmobile: r8a7790 SMP prototype v3 Magnus Damm
2013-07-01 6:13 ` Magnus Damm
2013-07-08 2:24 ` Shinya Kuribayashi
2013-07-08 2:24 ` Shinya Kuribayashi
2013-07-08 4:57 ` Magnus Damm
2013-07-08 4:57 ` Magnus Damm
2013-07-10 10:41 ` [PATCH] ARM: shmobile: r8a7790 SMP prototype v4 Magnus Damm
2013-07-10 10:41 ` Magnus Damm
2013-07-11 9:50 ` Shinya Kuribayashi
2013-07-11 9:50 ` Shinya Kuribayashi
2013-07-11 9:51 ` [PATCH 1/4] ARM: shmobile: smp-r8a7790: remove the obsolete RESCNT register Shinya Kuribayashi
2013-07-11 9:51 ` Shinya Kuribayashi
2013-07-11 9:52 ` [PATCH 2/4] ARM: shmobile: smp-r8a7790: rename s/carescnt/rescnt/g Shinya Kuribayashi
2013-07-11 9:52 ` Shinya Kuribayashi
2013-07-11 9:52 ` [PATCH 3/4] ARM: shmobile: smp-r8a7790: rename s/cabar/bar/g as well Shinya Kuribayashi
2013-07-11 9:52 ` Shinya Kuribayashi
2013-07-11 9:52 ` [PATCH 4/4] ARM: shmobile: smp-r8a7790: power up a CPU core at .smp_boot_secondary stage Shinya Kuribayashi
2013-07-11 9:52 ` Shinya Kuribayashi
2013-07-17 20:49 ` [PATCH] ARM: shmobile: r8a7790 SMP prototype v5 Magnus Damm
2013-07-17 20:49 ` Magnus Damm
2013-07-18 0:32 ` Shinya Kuribayashi
2013-07-18 0:32 ` Shinya Kuribayashi
2013-07-19 2:29 ` Simon Horman
2013-07-19 2:29 ` Simon Horman
2013-07-23 4:31 ` Simon Horman
2013-07-23 4:31 ` Simon Horman
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=201306271401.13198.arnd@arndb.de \
--to=arnd@arndb.de \
--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.