linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: olof@lixom.net (Olof Johansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/2] ARM: EXYNOS: SMC instruction (aka firmware) support
Date: Mon, 27 Aug 2012 15:10:30 -0700	[thread overview]
Message-ID: <20120827221030.GC7431@lumpy> (raw)
In-Reply-To: <20120824083357.GA25384@july>

Hi,

See below.

On Fri, Aug 24, 2012 at 05:33:57PM +0900, Kyungmin Park wrote:

> diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
> index 9b58024..8ee779c 100644
> --- a/arch/arm/mach-exynos/Makefile
> +++ b/arch/arm/mach-exynos/Makefile
> @@ -30,6 +30,11 @@ obj-$(CONFIG_EXYNOS4_MCT)	+= mct.o
>  
>  obj-$(CONFIG_HOTPLUG_CPU)	+= hotplug.o
>  
> +obj-$(CONFIG_ARM_FIRMWARE)	+= exynos-smc.o firmware.o
> +
> +plus_sec := $(call as-instr,.arch_extension sec,+sec)
> +AFLAGS_exynos-smc.o		:=-Wa,-march=armv7-a$(plus_sec)

Again, no need for a config option here.

> diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
> new file mode 100644
> index 0000000..a144593
> --- /dev/null
> +++ b/arch/arm/mach-exynos/firmware.c
> @@ -0,0 +1,37 @@
> +/*
> + *  Copyright (C) 2012 Samsung Electronics.
> + *  Kyungmin Park <kyungmin.park@samsung.com>
> + *
> + * This program is free software,you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +
> +#include <asm/firmware.h>
> +
> +#include "smc.h"
> +
> +static int exynos_do_idle(void)
> +{
> +        exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
> +        return 0;
> +}
> +
> +static void exynos_cpu_boot(int cpu)
> +{
> +	exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
> +}
> +
> +static struct firmware_ops exynos_firmware_ops __initdata = {
> +	.do_idle	= exynos_do_idle,
> +	.cpu_boot	= exynos_cpu_boot,
> +};
> +
> +int __init exynos_firmware_init(void)
> +{
> +	firmware_ops = exynos_firmware_ops;
> +	return 0;
> +}

If you add a check for SMC presence/execution mode here, then you can
make this a runtime instead of boot time option, thus making it possible
to build a kernel that boots and runs both with and without SMC support.


-Olof

  parent reply	other threads:[~2012-08-27 22:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24  8:33 [PATCH v5 2/2] ARM: EXYNOS: SMC instruction (aka firmware) support Kyungmin Park
2012-08-24 17:15 ` Tomasz Figa
2012-08-27 22:10 ` Olof Johansson [this message]
2012-08-28  8:39   ` Kyungmin Park

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=20120827221030.GC7431@lumpy \
    --to=olof@lixom.net \
    --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).