All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	Jason Cooper <jason@lakedaemon.net>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
	Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>,
	linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v4 2/4] mvebu: Dove: Instantiate cpufreq driver.
Date: Wed, 4 Dec 2013 14:36:28 +0000	[thread overview]
Message-ID: <20131204143628.GB29200@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1386166641-7567-3-git-send-email-andrew@lunn.ch>

On Wed, Dec 04, 2013 at 02:17:19PM +0000, Andrew Lunn wrote:
> Add a platform driver definition to instantiate the dove cpufreq
> driver. Also indicate the ARCH has cpufreq support, so allowing the
> cpufreq framework to be enabled.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Make resource names consistent.
> Fix length of ranges
> ---
>  arch/arm/Kconfig                       |  1 +
>  arch/arm/mach-dove/board-dt.c          |  3 +++
>  arch/arm/mach-dove/common.c            | 36 ++++++++++++++++++++++++++++++++++
>  arch/arm/mach-dove/common.h            |  1 +
>  arch/arm/mach-dove/include/mach/dove.h |  1 +
>  5 files changed, 42 insertions(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index c1f1a7eee953..908b02f8d901 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -500,6 +500,7 @@ config ARCH_IXP4XX
>  
>  config ARCH_DOVE
>  	bool "Marvell Dove"
> +	select ARCH_HAS_CPUFREQ
>  	select ARCH_REQUIRE_GPIOLIB
>  	select CPU_PJ4
>  	select GENERIC_CLOCKEVENTS
> diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
> index 49fa9abd09da..845e8b328432 100644
> --- a/arch/arm/mach-dove/board-dt.c
> +++ b/arch/arm/mach-dove/board-dt.c
> @@ -27,6 +27,9 @@ static void __init dove_dt_init(void)
>  	tauros2_init(0);
>  #endif
>  	BUG_ON(mvebu_mbus_dt_init());
> +
> +	dove_cpufreq_init();
> +
>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>  }
>  
> diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
> index c122bcff9f7c..323fcd4b27b6 100644
> --- a/arch/arm/mach-dove/common.c
> +++ b/arch/arm/mach-dove/common.c
> @@ -344,6 +344,42 @@ void __init dove_sdio1_init(void)
>  	platform_device_register(&dove_sdio1);
>  }
>  
> +/*****************************************************************************
> + * CPU Frequency
> + ****************************************************************************/
> +static struct resource dove_cpufreq_resources[] = {
> +	[0] = {
> +		.start  = DOVE_PMU_PHYS_BASE,
> +		.end    = DOVE_PMU_PHYS_BASE + 0x7,
> +		.flags  = IORESOURCE_MEM,
> +		.name   = "cpufreq: DFS"
> +	},
> +	[1] = {
> +		.start  = DOVE_PMU_PHYS_BASE + 0x8000,
> +		.end    = DOVE_PMU_PHYS_BASE + 0x8003,
> +		.flags  = IORESOURCE_MEM,
> +		.name   = "cpufreq: PMU CR"
> +	},
> +	[2] = {
> +		.start  = DOVE_PMU_PHYS_BASE + 0x0044,
> +		.end    = DOVE_PMU_PHYS_BASE + 0x0047,
> +		.flags  = IORESOURCE_MEM,
> +		.name   = "cpufreq: PMU Clk Div"
> +	},
> +};
> +
> +static struct platform_device dove_cpufreq_device = {
> +	.name		= "dove-cpufreq",
> +	.id		= -1,
> +	.num_resources	= ARRAY_SIZE(dove_cpufreq_resources),
> +	.resource	= dove_cpufreq_resources,
> +};
> +
> +void __init dove_cpufreq_init(void)
> +{
> +	platform_device_register(&dove_cpufreq_device);
> +}

Please describe your power management unit in the DT. Your hardcoding
physical addresses that can easily be described in the DT, and you don't
appear to have an early probing requirement.

> +
>  void __init dove_setup_cpu_wins(void)
>  {
>  	/*
> diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
> index 1d725224d146..5c9a77bdd442 100644
> --- a/arch/arm/mach-dove/common.h
> +++ b/arch/arm/mach-dove/common.h
> @@ -44,6 +44,7 @@ void dove_spi1_init(void);
>  void dove_i2c_init(void);
>  void dove_sdio0_init(void);
>  void dove_sdio1_init(void);
> +void dove_cpufreq_init(void);
>  void dove_restart(enum reboot_mode, const char *);
>  
>  #endif
> diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
> index 0c4b35f4ee5b..48db186ae6bc 100644
> --- a/arch/arm/mach-dove/include/mach/dove.h
> +++ b/arch/arm/mach-dove/include/mach/dove.h
> @@ -144,6 +144,7 @@
>  #define  DOVE_SD0_GPIO_SEL		(1 << 0)
>  
>  /* Power Management */
> +#define DOVE_PMU_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xd0000)
>  #define DOVE_PMU_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xd0000)
>  #define DOVE_PMU_SIG_CTRL	(DOVE_PMU_VIRT_BASE + 0x802c)

If you need to describe the large block this appears to be in, do that
too.

Thanks,
Mark.

WARNING: multiple messages have this Message-ID (diff)
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/4] mvebu: Dove: Instantiate cpufreq driver.
Date: Wed, 4 Dec 2013 14:36:28 +0000	[thread overview]
Message-ID: <20131204143628.GB29200@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1386166641-7567-3-git-send-email-andrew@lunn.ch>

On Wed, Dec 04, 2013 at 02:17:19PM +0000, Andrew Lunn wrote:
> Add a platform driver definition to instantiate the dove cpufreq
> driver. Also indicate the ARCH has cpufreq support, so allowing the
> cpufreq framework to be enabled.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> ---
> Make resource names consistent.
> Fix length of ranges
> ---
>  arch/arm/Kconfig                       |  1 +
>  arch/arm/mach-dove/board-dt.c          |  3 +++
>  arch/arm/mach-dove/common.c            | 36 ++++++++++++++++++++++++++++++++++
>  arch/arm/mach-dove/common.h            |  1 +
>  arch/arm/mach-dove/include/mach/dove.h |  1 +
>  5 files changed, 42 insertions(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index c1f1a7eee953..908b02f8d901 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -500,6 +500,7 @@ config ARCH_IXP4XX
>  
>  config ARCH_DOVE
>  	bool "Marvell Dove"
> +	select ARCH_HAS_CPUFREQ
>  	select ARCH_REQUIRE_GPIOLIB
>  	select CPU_PJ4
>  	select GENERIC_CLOCKEVENTS
> diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
> index 49fa9abd09da..845e8b328432 100644
> --- a/arch/arm/mach-dove/board-dt.c
> +++ b/arch/arm/mach-dove/board-dt.c
> @@ -27,6 +27,9 @@ static void __init dove_dt_init(void)
>  	tauros2_init(0);
>  #endif
>  	BUG_ON(mvebu_mbus_dt_init());
> +
> +	dove_cpufreq_init();
> +
>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>  }
>  
> diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
> index c122bcff9f7c..323fcd4b27b6 100644
> --- a/arch/arm/mach-dove/common.c
> +++ b/arch/arm/mach-dove/common.c
> @@ -344,6 +344,42 @@ void __init dove_sdio1_init(void)
>  	platform_device_register(&dove_sdio1);
>  }
>  
> +/*****************************************************************************
> + * CPU Frequency
> + ****************************************************************************/
> +static struct resource dove_cpufreq_resources[] = {
> +	[0] = {
> +		.start  = DOVE_PMU_PHYS_BASE,
> +		.end    = DOVE_PMU_PHYS_BASE + 0x7,
> +		.flags  = IORESOURCE_MEM,
> +		.name   = "cpufreq: DFS"
> +	},
> +	[1] = {
> +		.start  = DOVE_PMU_PHYS_BASE + 0x8000,
> +		.end    = DOVE_PMU_PHYS_BASE + 0x8003,
> +		.flags  = IORESOURCE_MEM,
> +		.name   = "cpufreq: PMU CR"
> +	},
> +	[2] = {
> +		.start  = DOVE_PMU_PHYS_BASE + 0x0044,
> +		.end    = DOVE_PMU_PHYS_BASE + 0x0047,
> +		.flags  = IORESOURCE_MEM,
> +		.name   = "cpufreq: PMU Clk Div"
> +	},
> +};
> +
> +static struct platform_device dove_cpufreq_device = {
> +	.name		= "dove-cpufreq",
> +	.id		= -1,
> +	.num_resources	= ARRAY_SIZE(dove_cpufreq_resources),
> +	.resource	= dove_cpufreq_resources,
> +};
> +
> +void __init dove_cpufreq_init(void)
> +{
> +	platform_device_register(&dove_cpufreq_device);
> +}

Please describe your power management unit in the DT. Your hardcoding
physical addresses that can easily be described in the DT, and you don't
appear to have an early probing requirement.

> +
>  void __init dove_setup_cpu_wins(void)
>  {
>  	/*
> diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
> index 1d725224d146..5c9a77bdd442 100644
> --- a/arch/arm/mach-dove/common.h
> +++ b/arch/arm/mach-dove/common.h
> @@ -44,6 +44,7 @@ void dove_spi1_init(void);
>  void dove_i2c_init(void);
>  void dove_sdio0_init(void);
>  void dove_sdio1_init(void);
> +void dove_cpufreq_init(void);
>  void dove_restart(enum reboot_mode, const char *);
>  
>  #endif
> diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
> index 0c4b35f4ee5b..48db186ae6bc 100644
> --- a/arch/arm/mach-dove/include/mach/dove.h
> +++ b/arch/arm/mach-dove/include/mach/dove.h
> @@ -144,6 +144,7 @@
>  #define  DOVE_SD0_GPIO_SEL		(1 << 0)
>  
>  /* Power Management */
> +#define DOVE_PMU_PHYS_BASE	(DOVE_SB_REGS_PHYS_BASE + 0xd0000)
>  #define DOVE_PMU_VIRT_BASE	(DOVE_SB_REGS_VIRT_BASE + 0xd0000)
>  #define DOVE_PMU_SIG_CTRL	(DOVE_PMU_VIRT_BASE + 0x802c)

If you need to describe the large block this appears to be in, do that
too.

Thanks,
Mark.

  reply	other threads:[~2013-12-04 14:36 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 14:17 [PATCH v4 0/4] Dove cpufreq driver Andrew Lunn
2013-12-04 14:17 ` Andrew Lunn
2013-12-04 14:17 ` [PATCH v4 1/4] cpufreq: Add a cpufreq driver for Marvell Dove Andrew Lunn
2013-12-04 14:17   ` Andrew Lunn
2013-12-04 14:33   ` Jason Cooper
2013-12-04 14:33     ` Jason Cooper
2013-12-04 14:56     ` Andrew Lunn
2013-12-04 14:56       ` Andrew Lunn
2013-12-04 15:01       ` Jason Cooper
2013-12-04 15:01         ` Jason Cooper
2013-12-04 14:54   ` Mark Rutland
2013-12-04 14:54     ` Mark Rutland
2013-12-04 15:27     ` Andrew Lunn
2013-12-04 15:27       ` Andrew Lunn
2013-12-05 18:23       ` Mark Rutland
2013-12-05 18:23         ` Mark Rutland
2013-12-17 21:41     ` [RFC PATCH v5 0/4] Dove Cpufreq driver Andrew Lunn
2013-12-17 21:41       ` Andrew Lunn
2013-12-17 21:41       ` [RFC PATCH v5 1/4] cpufreq: Add a cpufreq driver for Marvell Dove Andrew Lunn
2013-12-17 21:41         ` Andrew Lunn
2013-12-20  3:32         ` Jason Cooper
2013-12-20  3:32           ` Jason Cooper
2013-12-21 16:26           ` Andrew Lunn
2013-12-21 16:26             ` Andrew Lunn
2013-12-21 19:25             ` Jason Cooper
2013-12-21 19:25               ` Jason Cooper
2013-12-21 21:54               ` Andrew Lunn
2013-12-21 21:54                 ` Andrew Lunn
2013-12-22  4:00                 ` Jason Cooper
2013-12-22  4:00                   ` Jason Cooper
2013-12-17 21:41       ` [RFC PATCH v5 2/4] mvebu: Dove: Indicate the architecture supports cpufreq Andrew Lunn
2013-12-17 21:41         ` Andrew Lunn
2013-12-17 21:41       ` [RFC PATCH v5 3/4] mvebu: Dove: Enable cpufreq driver in defconfig Andrew Lunn
2013-12-17 21:41         ` Andrew Lunn
2013-12-17 21:41       ` [RFC PATCH v5 4/4] mvebu: Dove: Add PMU node for cpufreq driver Andrew Lunn
2013-12-17 21:41         ` Andrew Lunn
2013-12-16  8:40   ` [PATCH v4 1/4] cpufreq: Add a cpufreq driver for Marvell Dove Viresh Kumar
2013-12-16  8:40     ` Viresh Kumar
2013-12-17 22:06     ` Andrew Lunn
2013-12-17 22:06       ` Andrew Lunn
2013-12-04 14:17 ` [PATCH v4 2/4] mvebu: Dove: Instantiate cpufreq driver Andrew Lunn
2013-12-04 14:17   ` Andrew Lunn
2013-12-04 14:36   ` Mark Rutland [this message]
2013-12-04 14:36     ` Mark Rutland
2013-12-04 15:02     ` Andrew Lunn
2013-12-04 15:02       ` Andrew Lunn
2013-12-05 17:54       ` Mark Rutland
2013-12-05 17:54         ` Mark Rutland
2013-12-05 18:29         ` Andrew Lunn
2013-12-05 18:29           ` Andrew Lunn
2013-12-08  0:50           ` Jason Cooper
2013-12-08  0:50             ` Jason Cooper
2013-12-04 14:17 ` [PATCH v4 3/4] mvebu: Dove: Enable cpufreq driver in defconfig Andrew Lunn
2013-12-04 14:17   ` Andrew Lunn
2013-12-04 14:17 ` [PATCH v4 4/4] mvebu: Dove: Add clocks and DFS interrupt to cpu node in DT Andrew Lunn
2013-12-04 14:17   ` Andrew Lunn
2013-12-04 14:39   ` Mark Rutland
2013-12-04 14:39     ` Mark Rutland
2013-12-04 14:55     ` Mark Rutland
2013-12-04 14:55       ` Mark Rutland
2013-12-04 14:43   ` Jason Cooper
2013-12-04 14:43     ` Jason Cooper

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=20131204143628.GB29200@e106331-lin.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=andrew@lunn.ch \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sebastian.hesselbarth@googlemail.com \
    --cc=viresh.kumar@linaro.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.