All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCHv3 1/8] devfreq: exynos: Add generic exynos memory bus frequency driver
@ 2015-01-13  8:42 ` MyungJoo Ham
  0 siblings, 0 replies; 8+ messages in thread
From: MyungJoo Ham @ 2015-01-13  8:42 UTC (permalink / raw)
  To: 최찬우, kgene@kernel.org
  Cc: 박경민, rafael.j.wysocki@intel.com,
	mark.rutland@arm.com, ABHILASH KESAVAN, tomasz.figa@gmail.com,
	Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	robh+dt@kernel.org, 대인기,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org

>   
>  This patch adds the generic exynos bus frequency driver for memory bus
> with DEVFREQ framework. The Samsung Exynos SoCs have the common architecture
> for memory bus between DRAM memory and MMC/sub IP in SoC. This driver can
> support the memory bus frequency driver for Exynos SoCs.
> 
> Each memory bus block has a clock for memory bus speed and frequency
> table which is changed according to the utilization of memory bus on runtime.
> And then each memory bus group has the one more memory bus blocks and
> OPP table (including frequency and voltage), regulator, devfreq-event
> devices.
> 
> There are a little difference about the number of memory bus because each Exynos
> SoC have the different sub-IP and different memory bus speed. In spite of this
> difference among Exynos SoCs, we can support almost Exynos SoC by adding
> unique data of memory bus to devicetree file.
> 
> Cc: Myungjoo Ham <myungjoo.ham@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Kukjin Kim <kgene@kernel.org>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  drivers/devfreq/Kconfig          |  15 +
>  drivers/devfreq/Makefile         |   1 +
>  drivers/devfreq/exynos-busfreq.c | 589 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 605 insertions(+)
>  create mode 100644 drivers/devfreq/exynos-busfreq.c

Exynos drivers are located at drivers/devfreq/exynos/
Please relocate/rename exynos-busfreq.c

[]

> diff --git a/drivers/devfreq/exynos-busfreq.c b/drivers/devfreq/exynos-busfreq.c
> new file mode 100644
> index 0000000..b180f43
> --- /dev/null
> +++ b/drivers/devfreq/exynos-busfreq.c

[]

> +
> +#define BUS_SATURATION_RATIO	40

In order to be a common driver, this should be tunable.

Because .dts is supposed to have hardware configuration only,
you may keep a table of { chip-name, saturation ratio} in this
driver and look up the saturation ratio based on the chip-name.

> +#define SAFEVOLT		50000
> +
> +struct exynos_memory_bus_opp_info {
> +	unsigned long rate;
> +	unsigned long volt;
> +};
> +
> +struct exynos_memory_bus_block {
> +	struct clk *clk;
> +	struct exynos_memory_bus_opp_info *freq_table;
> +};
> +

[]

> +#ifdef CONFIG_PM_SLEEP
> +static int exynos_busfreq_resume(struct device *dev)
> +{
> +	struct exynos_memory_bus_data *data = dev_get_drvdata(dev);
> +	int ret;
> +
> +	ret = exynos_busfreq_enable_edev(data);
> +	if (ret < 0) {
> +		dev_err(dev, "failed to enable the devfreq-event devices\n");
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
> +static int exynos_busfreq_suspend(struct device *dev)
> +{
> +	struct exynos_memory_bus_data *data = dev_get_drvdata(dev);
> +	int ret;
> +
> +	ret = exynos_busfreq_disable_edev(data);
> +	if (ret < 0) {
> +		dev_err(dev, "failed to disable the devfreq-event devices\n");
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +#endif

Please disable regulator at suspend and resume it at resume.

You may interfere with low-power mode of corresponding voltage line,
which is often implemented to be activated if the regulator is
explicitely disabled for "alive" regulators like this one.

> +
> +static const struct dev_pm_ops exynos_busfreq_pm = {
> +	SET_SYSTEM_SLEEP_PM_OPS(exynos_busfreq_suspend, exynos_busfreq_resume)
> +};
> +
> +static const struct of_device_id exynos_busfreq_of_match[] = {
> +	{ .compatible = "samsung,exynos-memory-bus", },
> +	{ /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, exynos_busfreq_of_match);
> +
> +static struct platform_driver exynos_busfreq_platdrv = {
> +	.probe		= exynos_busfreq_probe,
> +	.remove		= exynos_busfreq_remove,
> +	.driver = {
> +		.name	= "exynos-memory-bus",
> +		.owner	= THIS_MODULE,
> +		.pm	= &exynos_busfreq_pm,
> +		.of_match_table = of_match_ptr(exynos_busfreq_of_match),
> +	},
> +};
> +module_platform_driver(exynos_busfreq_platdrv);
> +
> +MODULE_DESCRIPTION("Generic Exynos Memory Bus Frequency driver");
> +MODULE_AUTHOR("Chanwoo Choi <cw00.choi@samsung.com>");
> +MODULE_LICENSE("GPL v2");
> -- 
> 1.8.5.5
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Re: [PATCHv3 1/8] devfreq: exynos: Add generic exynos memory bus frequency driver
@ 2015-01-13  9:07 MyungJoo Ham
  2015-01-13 10:29   ` Chanwoo Choi
  0 siblings, 1 reply; 8+ messages in thread
From: MyungJoo Ham @ 2015-01-13  9:07 UTC (permalink / raw)
  To: 최찬우
  Cc: kgene@kernel.org, 박경민,
	rafael.j.wysocki@intel.com, mark.rutland@arm.com,
	ABHILASH KESAVAN, tomasz.figa@gmail.com, Krzysztof Kozlowski,
	Bartlomiej Zolnierkiewicz, robh+dt@kernel.org,
	대인기, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org

>  
> Dear Myungjoo,
>
>On 01/13/2015 05:42 PM, MyungJoo Ham wrote:
>>>   
>>>  This patch adds the generic exynos bus frequency driver for memory bus
>>> with DEVFREQ framework. The Samsung Exynos SoCs have the common architecture
>>> for memory bus between DRAM memory and MMC/sub IP in SoC. This driver can
>>> support the memory bus frequency driver for Exynos SoCs.
>>>
>>> Each memory bus block has a clock for memory bus speed and frequency
>>> table which is changed according to the utilization of memory bus on runtime.
>>> And then each memory bus group has the one more memory bus blocks and
>>> OPP table (including frequency and voltage), regulator, devfreq-event
>>> devices.
>>>
>>> There are a little difference about the number of memory bus because each Exynos
>>> SoC have the different sub-IP and different memory bus speed. In spite of this
>>> difference among Exynos SoCs, we can support almost Exynos SoC by adding
>>> unique data of memory bus to devicetree file.
>>>
>>> Cc: Myungjoo Ham <myungjoo.ham@samsung.com>
>>> Cc: Kyungmin Park <kyungmin.park@samsung.com>
>>> Cc: Kukjin Kim <kgene@kernel.org>
>>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>>> ---
>>>  drivers/devfreq/Kconfig          |  15 +
>>>  drivers/devfreq/Makefile         |   1 +
>>>  drivers/devfreq/exynos-busfreq.c | 589 +++++++++++++++++++++++++++++++++++++++
>>>  3 files changed, 605 insertions(+)
>>>  create mode 100644 drivers/devfreq/exynos-busfreq.c
>> 
>> Exynos drivers are located at drivers/devfreq/exynos/
>> Please relocate/rename exynos-busfreq.c
>
>OK. I'll move it at drivers/devfreq/exynos directory.
>Do you prefer 'exynos-bus.c' instead of 'exynos-busfreq.c'?
>If you reply, I'll change it.

exynos-bus looks more pretty :)

>
>> 
>> []
>> 
>>> diff --git a/drivers/devfreq/exynos-busfreq.c b/drivers/devfreq/exynos-busfreq.c
>>> new file mode 100644
>>> index 0000000..b180f43
>>> --- /dev/null
>>> +++ b/drivers/devfreq/exynos-busfreq.c
>> 
>> []
>> 
>>> +
>>> +#define BUS_SATURATION_RATIO	40
>> 
>> In order to be a common driver, this should be tunable.
>> 
>> Because .dts is supposed to have hardware configuration only,
>> you may keep a table of { chip-name, saturation ratio} in this
>> driver and look up the saturation ratio based on the chip-name.
>
>OK, I'll add new property for saturation_ratio.
>
>I'll implement to use default saturation_ratio value ,
>if dt node don't include saturation_ratio property.

Yes. I didn't talk with DT maintainers and I do not have much
experience with DT; however, it appears that such values are not
recommended to be in DTS files and this value is determined by
the SoC model number without complications in the driver file.


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCHv3 0/8] devfreq: Add generic exynos memory-bus frequency driver
@ 2015-01-08  1:40 Chanwoo Choi
  2015-01-08  1:40   ` Chanwoo Choi
  0 siblings, 1 reply; 8+ messages in thread
From: Chanwoo Choi @ 2015-01-08  1:40 UTC (permalink / raw)
  To: myungjoo.ham, kgene
  Cc: kyungmin.park, rafael.j.wysocki, mark.rutland, a.kesavan,
	tomasz.figa, k.kozlowski, b.zolnierkie, robh+dt, cw00.choi,
	inki.dae, linux-pm, linux-kernel, linux-arm-kernel,
	linux-samsung-soc

This patch-set adds the generic exynos bus frequency driver for memory bus
with DEVFREQ framework. The Samsung Exynos SoCs have the common architecture
for memory bus between DRAM memory and MMC/sub IP in SoC. This driver can
support the memory bus frequency driver for Exynos SoCs.

Each memory bus block has a clock for memory bus speed and frequency
table which is changed according to the utilization of memory bus on runtime.
And then each memory bus group has the one more memory bus blocks and
OPP table (including frequency and voltage), regulator, devfreq-event
devices.

There are a little difference about the number of memory bus because each Exynos
SoC have the different sub-IP and different memory bus speed. In spite of this
difference among Exynos SoCs, we can support almost Exynos SoC by adding
unique data of memory bus to devicetree file.

Depend on:
- v3.19-rc3
- [PATCHv7 00/10] devfreq: Add devfreq-event class to provide raw data for devfreq device
  : https://lkml.org/lkml/2015/1/7/795

Changelog:

Changes from v2:
(https://lkml.org/lkml/2014/12/31/2)
- Support the memory bus frequency feature for Exynos3250-based Monk board
- Fix build warning about variable uninitialized

Changes from v1:
(https://lkml.org/lkml/2014/12/23/178)
- This patchset is rebased on v3.19-rc2.
- Fix bug after wake-up from suspend state. If devfreq device fail to get event,
  exynos-busfreq retry to set the event for starting.
- Add memory bus group of Exynos4x12/Exynos4210
- Add divider clock id for Exynos4 memory bus frequency
- Support memory bus frequency driver on Exynos4412-based TRATS2 board
- This patch-set has the dependency on following patch-set[1]:
  [1] [PATCHv6 0/9] devfreq: Add devfreq-event class to provide raw data for devfreq device
  : https://lkml.org/lkml/2014/12/28/139

Chanwoo Choi (8):
  devfreq: exynos: Add generic exynos memory bus frequency driver
  devfreq: exynos: Add documentation for generic exynos memory bus frequency driver
  ARM: dts: Add memory bus node for Exynos3250
  clk: samsung: exynos4: Add divider clock id for memory bus frequency
  ARM: dts: Add memory bus node for Exynos4x12
  ARM: dts: Add memory bus node for Exynos4210
  ARM: dts: Add memory bus node for Exynos3250-based Rinato/Monk board
  ARM: dts: Add memory bus node for Exynos4412-based TRATS2 board

 .../devicetree/bindings/devfreq/exynos-busfreq.txt | 184 +++++++
 arch/arm/boot/dts/exynos3250-monk.dts              |  12 +
 arch/arm/boot/dts/exynos3250-rinato.dts            |  12 +
 arch/arm/boot/dts/exynos3250.dtsi                  | 125 +++++
 arch/arm/boot/dts/exynos4210.dtsi                  |  93 ++++
 arch/arm/boot/dts/exynos4412-trats2.dts            |  12 +
 arch/arm/boot/dts/exynos4x12.dtsi                  | 121 +++++
 drivers/clk/samsung/clk-exynos4.c                  |  10 +-
 drivers/devfreq/Kconfig                            |  15 +
 drivers/devfreq/Makefile                           |   1 +
 drivers/devfreq/exynos-busfreq.c                   | 589 +++++++++++++++++++++
 include/dt-bindings/clock/exynos4.h                |   7 +-
 12 files changed, 1175 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-busfreq.txt
 create mode 100644 drivers/devfreq/exynos-busfreq.c

-- 
1.8.5.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-13 10:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-13  8:42 [PATCHv3 1/8] devfreq: exynos: Add generic exynos memory bus frequency driver MyungJoo Ham
2015-01-13  8:42 ` MyungJoo Ham
2015-01-13  8:55 ` Chanwoo Choi
2015-01-13  8:55   ` Chanwoo Choi
  -- strict thread matches above, loose matches on Subject: below --
2015-01-13  9:07 MyungJoo Ham
2015-01-13 10:29 ` Chanwoo Choi
2015-01-13 10:29   ` Chanwoo Choi
2015-01-08  1:40 [PATCHv3 0/8] devfreq: Add generic exynos memory-bus " Chanwoo Choi
2015-01-08  1:40 ` [PATCHv3 1/8] devfreq: exynos: Add generic exynos memory bus " Chanwoo Choi
2015-01-08  1:40   ` Chanwoo Choi

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.