From: Julien Grall <julien.grall@linaro.org>
To: Suriyan Ramasami <suriyan.r@gmail.com>, xen-devel@lists.xen.org
Cc: keir@xen.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com,
jbeulich@suse.com, tim@xen.org
Subject: Re: [ARM:PATCH v1 1/1] Add Odroid-XU (Exynos5410) support
Date: Fri, 25 Jul 2014 13:19:23 +0100 [thread overview]
Message-ID: <53D24B4B.7020908@linaro.org> (raw)
In-Reply-To: <1406242066-7001-1-git-send-email-suriyan.r@gmail.com>
Hi Suriyan,
On 07/24/2014 11:47 PM, Suriyan Ramasami wrote:
> XEN/ARM: Add Odroid-XU support
>
> The Odroid-XU from hardkernel is an Exynos5410 based board.
> This patch adds support for the above said board.
>
> Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
> ---
> xen/arch/arm/platforms/exynos5.c | 52 +++++++++++++++++++++++++++++++++
> xen/include/asm-arm/platforms/exynos5.h | 7 +++++
> 2 files changed, 59 insertions(+)
>
> diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c
> index 65e584f..a210404 100644
> --- a/xen/arch/arm/platforms/exynos5.c
> +++ b/xen/arch/arm/platforms/exynos5.c
> @@ -26,6 +26,7 @@
> #include <asm/platforms/exynos5.h>
> #include <asm/platform.h>
> #include <asm/io.h>
> +#include <asm/delay.h>
>
> static int exynos5_init_time(void)
> {
> @@ -85,6 +86,46 @@ static int __init exynos5_smp_init(void)
> return 0;
> }
>
> +static int __init exynos5410_smp_init(void)
> +{
> + void __iomem *sysram;
> + void __iomem *power;
> + char *c;
> + int i;
> +
> + /* Power the secondary cores. */
> + for (i = 1; i < EXYNOS5410_NUM_CPUS; i++) {
Can we avoid hardcoding the number of CPUs here and rely on the device tree?
> + power = ioremap_nocache(EXYNOS5410_POWER_CPU_BASE +
> + i * EXYNOS5410_POWER_CPU_OFFSET, PAGE_SIZE);
You forgot to check the return of ioremap_nocache.
> + c = (char *) power;
> + dprintk(XENLOG_INFO, "Power: %x status: %x\n", c[0], c[4]);
> + c[0] = EXYNOS5410_POWER_ENABLE;
You have to use read*, write* helpers when the MMIO is mapped via ioremap_*.
Otherwise the compiler may reorder the access to the region and the
behavior would be undefined.
The remark is the same everywhere in this function.
> + dprintk(XENLOG_INFO, "Waiting for power status to change to %d\n",
> + EXYNOS5410_POWER_ENABLE);
> + while (c[4] != EXYNOS5410_POWER_ENABLE) {
The Xen coding style request the "{" to be on a newline.
> + udelay(1);
> + }
> + dprintk(XENLOG_INFO, "Power status changed to %d!\n",
> + EXYNOS5410_POWER_ENABLE);
> + iounmap(power);
> +
> + sysram = ioremap_nocache(EXYNOS5410_PA_SYSRAM, PAGE_SIZE);
> + if ( !sysram )
> + {
> + dprintk(XENLOG_ERR, "Unable to map exynos5 MMIO\n");
> + return -EFAULT;
> + }
> +
> + printk("Set SYSRAM to %"PRIpaddr" (%p)\n",
> + __pa(init_secondary), init_secondary);
> + writel(__pa(init_secondary), sysram);
> +
> + iounmap(sysram);
> +
> + }
> + return 0;
> +}
> +
Regards,
--
Julien Grall
next prev parent reply other threads:[~2014-07-25 12:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-24 22:47 [ARM:PATCH v1 1/1] Add Odroid-XU (Exynos5410) support Suriyan Ramasami
2014-07-25 8:18 ` Ian Campbell
2014-07-25 12:19 ` Julien Grall [this message]
2014-07-25 12:39 ` Ian Campbell
2014-07-25 17:45 ` Suriyan Ramasami
2014-07-25 20:05 ` Ian Campbell
2014-07-26 0:06 ` Suriyan Ramasami
2014-07-26 7:26 ` Suriyan Ramasami
2014-07-26 11:28 ` Julien Grall
2014-07-26 16:02 ` Suriyan Ramasami
2014-07-26 17:58 ` Julien Grall
2014-07-26 20:26 ` Suriyan Ramasami
2014-07-26 21:24 ` Julien Grall
2014-07-26 21:26 ` Julien Grall
2014-07-27 18:12 ` Suriyan Ramasami
2014-07-28 12:53 ` Julien Grall
2014-07-28 18:06 ` Suriyan Ramasami
2014-07-28 20:19 ` Suriyan Ramasami
2014-07-28 22:25 ` Suriyan Ramasami
2014-07-29 7:30 ` Ian Campbell
2014-07-29 15:49 ` Suriyan Ramasami
2014-07-29 17:36 ` Ian Campbell
2014-08-12 19:05 ` Suriyan Ramasami
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=53D24B4B.7020908@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=suriyan.r@gmail.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.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.