[PATCH v2 3/3] arm: boot: beaglex15: pass correct interrupt
From: Felipe Balbi According to latest schematics [1], GPIO_1/VBUSDET on TPS659038 is tied to AM57x GPIO4_21. We can use that as a VBUS interrupt, instead of relying on PMIC's VBUS interrupts which don't seem to be firing on x15 at all. A follow up patch will add support for using this GPIO-based interrupt mechanism for notifying about VBUS. [1] https://github.com/beagleboard/beagleboard-x15/blob/master/BeagleBoard-X15_RevA2.pdf Signed-off-by: Felipe Balbi [cw00.choi: Use the 'vbus-gpio' property instead of 'interrupts-extended'] Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/am57xx-beagle-x15.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts b/arch/arm/boot/dts/am57xx-beagle-x15.dts index be4990608c77..3887ba89d2a5 100644 --- a/arch/arm/boot/dts/am57xx-beagle-x15.dts +++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts @@ -560,6 +560,7 @@ extcon_usb2: tps659038_usb { compatible = "ti,palmas-usb-vid"; ti,enable-vbus-detection; + vbus-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 2/3] arm: boot: dts: beaglex15: Remove ID GPIO
From: Felipe Balbi According to latest schematics [1], this board leaves ID pin floating. It's not connected to anything at all. So let's remove it. [1] https://github.com/beagleboard/beagleboard-x15/blob/master/BeagleBoard-X15_RevA2.pdf Signed-off-by: Felipe Balbi Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/am57xx-beagle-x15.dts | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts b/arch/arm/boot/dts/am57xx-beagle-x15.dts index d9ba6b879fc1..be4990608c77 100644 --- a/arch/arm/boot/dts/am57xx-beagle-x15.dts +++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts @@ -560,8 +560,6 @@ extcon_usb2: tps659038_usb { compatible = "ti,palmas-usb-vid"; ti,enable-vbus-detection; - ti,enable-id-detection; - id-gpios = <&gpio7 24 GPIO_ACTIVE_HIGH>; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/3] arm: beaglex15: fix USB Gadget
This patchset make the extcon-palmas.c more generic style and then send v2 patchset. I add the Felipe comment of v1 patchset as following: But, I have not test on real board because I don't have it. Just, I modify this patchset based on v1 patchset[1] from Felipe Balbi. - Felipe comment of this patchset: "Hi, with the following patches I can get USB Gadget working with my beagle x15 with today's Linus' tree. regards". [1] https://lkml.org/lkml/2015/11/12/508 Changes from v1: (https://lkml.org/lkml/2015/11/12/508) - Refactoring the extcon-palmas.c driver with more generic style to support the VBUS gpio pin. - Use the 'vbus-gpio' property instead of 'interrupts-extended'] Felipe Balbi (3): extcon: palmas: Add the support for VBUS detection by using GPIO arm: boot: dts: beaglex15: Remove ID GPIO arm: boot: beaglex15: pass correct interrupt arch/arm/boot/dts/am57xx-beagle-x15.dts | 3 +- drivers/extcon/extcon-palmas.c | 50 + include/linux/mfd/palmas.h | 3 ++ 3 files changed, 54 insertions(+), 2 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/3] extcon: palmas: Add the support for VBUS detection by using GPIO
From: Felipe Balbi This patch support for VBUS detection by using GPIO pin. Signed-off-by: Felipe Balbi Signed-off-by: Chanwoo Choi --- drivers/extcon/extcon-palmas.c | 50 ++ include/linux/mfd/palmas.h | 3 +++ 2 files changed, 53 insertions(+) diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c index 93c30a885740..885ee95a6a7b 100644 --- a/drivers/extcon/extcon-palmas.c +++ b/drivers/extcon/extcon-palmas.c @@ -216,11 +216,23 @@ static int palmas_usb_probe(struct platform_device *pdev) return PTR_ERR(palmas_usb->id_gpiod); } + palmas_usb->vbus_gpiod = devm_gpiod_get_optional(&pdev->dev, "vbus", + GPIOD_IN); + if (IS_ERR(palmas_usb->vbus_gpiod)) { + dev_err(&pdev->dev, "failed to get vbus gpio\n"); + return PTR_ERR(palmas_usb->vbus_gpiod); + } + if (palmas_usb->enable_id_detection && palmas_usb->id_gpiod) { palmas_usb->enable_id_detection = false; palmas_usb->enable_gpio_id_detection = true; } + if (palmas_usb->enable_vbus_detection && palmas_usb->vbus_gpiod) { + palmas_usb->enable_vbus_detection = false; + palmas_usb->enable_gpio_vbus_detection = true; + } + if (palmas_usb->enable_gpio_id_detection) { u32 debounce; @@ -311,6 +323,40 @@ static int palmas_usb_probe(struct platform_device *pdev) palmas_usb->vbus_irq, status); return status; } + } else if (palmas_usb->enable_gpio_vbus_detection) { + /* remux GPIO_1 as VBUSDET */ + status = palmas_update_bits(palmas, + PALMAS_PU_PD_OD_BASE, + PALMAS_PRIMARY_SECONDARY_PAD1, + PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_1_MASK, + (1 << PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_1_SHIFT)); + if (status < 0) { + dev_err(&pdev->dev, "can't remux GPIO1\n"); + return status; + } + + palmas_usb->vbus_otg_irq = regmap_irq_get_virq(palmas->irq_data, + PALMAS_VBUS_OTG_IRQ); + palmas_usb->gpio_vbus_irq = gpiod_to_irq(palmas_usb->vbus_gpiod); + if (palmas_usb->gpio_vbus_irq < 0) { + dev_err(&pdev->dev, "failed to get vbus irq\n"); + return palmas_usb->gpio_vbus_irq; + } + status = devm_request_threaded_irq(&pdev->dev, + palmas_usb->gpio_vbus_irq, + NULL, + palmas_vbus_irq_handler, + IRQF_TRIGGER_FALLING | + IRQF_TRIGGER_RISING | + IRQF_ONESHOT | + IRQF_EARLY_RESUME, + "palmas_usb_vbus", + palmas_usb); + if (status < 0) { + dev_err(&pdev->dev, + "failed to request handler for vbus irq\n"); + return status; + } } palmas_enable_irq(palmas_usb); @@ -337,6 +383,8 @@ static int palmas_usb_suspend(struct device *dev) if (device_may_wakeup(dev)) { if (palmas_usb->enable_vbus_detection) enable_irq_wake(palmas_usb->vbus_irq); + if (palmas_usb->enable_gpio_vbus_detection) + enable_irq_wake(palmas_usb->gpio_vbus_irq); if (palmas_usb->enable_id_detection) enable_irq_wake(palmas_usb->id_irq); if (palmas_usb->enable_gpio_id_detection) @@ -352,6 +400,8 @@ static int palmas_usb_resume(struct device *dev) if (device_may_wakeup(dev)) { if (palmas_usb->enable_vbus_detection) disable_irq_wake(palmas_usb->vbus_irq); + if (palmas_usb->enable_gpio_vbus_detection) + disable_irq_wake(palmas_usb->gpio_vbus_irq); if (palmas_usb->enable_id_detection) disable_irq_wake(palmas_usb->id_irq); if (palmas_usb->enable_gpio_id_detection) diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 13e1d96935ed..7b2526
Re: [PATCH v5] extcon: add Maxim MAX3355 driver
On 2015년 12월 22일 20:15, Sergei Shtylyov wrote: > Hello. > > On 12/22/2015 4:13 AM, Chanwoo Choi wrote: > >>>>>> This patch depend on GPIOLIB configuration as following: >>>>>> I modified it with following diff and applied it. >>>>>> >>>>>> diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig >>>>>> index ba4db7d..3d89e60 100644 >>>>>> --- a/drivers/extcon/Kconfig >>>>>> +++ b/drivers/extcon/Kconfig >>>>>> @@ -54,6 +54,7 @@ config EXTCON_MAX14577 >>>>>> >>>>>> config EXTCON_MAX3355 >>>>>>tristate "Maxim MAX3355 USB OTG EXTCON Support" >>>>>> + depends on GPIOLIB || COMPILE_TEST >>>>> >>>>> If it won't compile w/o gpiolib, what's the use of COMIPLE_TEST? >>>>> And no, it shouldn't depend on gpiolib. It has empty stubs for the >>>>> case of CONFIG_GPIOLIB=n. Obviously something is wrong with the GPIO >>>>> headers, I'll look into it. >>>> >>>> Yes. When GPIOLIB is disabled, the build issue don't happen. >>> >>> What? It surely does happen! >> >> hmm >> Sure. you need to check the include/linux/gpio/consumer.h. >> >> Because of build error happen, you miss to include the >> "linux/gpio/consumer.h" >> header file in extcon-max3355.c. Please test it for enough time. > >Yes, with this file #include'd, it build fine now. > >>>> because include/linux/gpio/consumer.h implement the dummy function >>>> for all gpio functions if CONFIG_GPIOLIB is disabled. >>> >>> Linus W. advised to #include this header explicitly -- I'll try and >>> post. >> >> Don't necessary. I already updated it including the >> "include/linux/gpio/consumer.h". > >I saw that, yes. > >>>> For correct operation of max3355, you should add the dependency >>>> to the extcon-max3355.c driver. This driver use the GPIO library >>>> certainly. >>> >>> I disagree. The driver will just cease to load in this case. I don't >>> see why we need such dependency. Only compilation time dependencies should >>> be >>> specified, I think. >> >> This driver have to depend on GPIOLIB. >> Why are you disagreeing the COMPILE_TEST dependency? It is just compile test >> without anything. > >I agree now. I still disagree about the gpiolib dependency though. If gpiolib is disabled, extcon-max3355.c might not operate it correctly. Just this driver could be built without operation because gpiolib function will not do the any behavior. I think that it is not too much problem. I should send the pull request within this week. If you want to need more discussion of extcon-max3355.c, I will not include it on pull request for v4.5 because there is issue. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5] extcon: add Maxim MAX3355 driver
On 2015년 12월 21일 20:01, Sergei Shtylyov wrote: > Hello. > > On 12/21/2015 5:38 AM, Chanwoo Choi wrote: > >>>> This patch depend on GPIOLIB configuration as following: >>>> I modified it with following diff and applied it. >>>> >>>> diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig >>>> index ba4db7d..3d89e60 100644 >>>> --- a/drivers/extcon/Kconfig >>>> +++ b/drivers/extcon/Kconfig >>>> @@ -54,6 +54,7 @@ config EXTCON_MAX14577 >>>> >>>>config EXTCON_MAX3355 >>>> tristate "Maxim MAX3355 USB OTG EXTCON Support" >>>> + depends on GPIOLIB || COMPILE_TEST >>> >>> If it won't compile w/o gpiolib, what's the use of COMIPLE_TEST? >>> And no, it shouldn't depend on gpiolib. It has empty stubs for the case >>> of CONFIG_GPIOLIB=n. Obviously something is wrong with the GPIO headers, >>> I'll look into it. >> >> Yes. When GPIOLIB is disabled, the build issue don't happen. > >What? It surely does happen! hmm Sure. you need to check the include/linux/gpio/consumer.h. Because of build error happen, you miss to include the "linux/gpio/consumer.h" header file in extcon-max3355.c. Please test it for enough time. > >> because include/linux/gpio/consumer.h implement the dummy function >> for all gpio functions if CONFIG_GPIOLIB is disabled. > >Linus W. advised to #include this header explicitly -- I'll try and post. Don't necessary. I already updated it including the "include/linux/gpio/consumer.h". > >> For correct operation of max3355, you should add the dependency >> to the extcon-max3355.c driver. This driver use the GPIO library >> certainly. > >I disagree. The driver will just cease to load in this case. I don't see > why we need such dependency. Only compilation time dependencies should be > specified, I think. This driver have to depend on GPIOLIB. Why are you disagreeing the COMPILE_TEST dependency? It is just compile test without anything. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5] extcon: add Maxim MAX3355 driver
Hi, On 2015년 12월 21일 02:15, Sergei Shtylyov wrote: > Hello. > > On 12/20/2015 05:31 PM, Chanwoo Choi wrote: > >> This patch depend on GPIOLIB configuration as following: >> I modified it with following diff and applied it. >> >> diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig >> index ba4db7d..3d89e60 100644 >> --- a/drivers/extcon/Kconfig >> +++ b/drivers/extcon/Kconfig >> @@ -54,6 +54,7 @@ config EXTCON_MAX14577 >> >> config EXTCON_MAX3355 >> tristate "Maxim MAX3355 USB OTG EXTCON Support" >> + depends on GPIOLIB || COMPILE_TEST > >If it won't compile w/o gpiolib, what's the use of COMIPLE_TEST? >And no, it shouldn't depend on gpiolib. It has empty stubs for the case of > CONFIG_GPIOLIB=n. Obviously something is wrong with the GPIO headers, I'll > look into it. Yes. When GPIOLIB is disabled, the build issue don't happen. because include/linux/gpio/consumer.h implement the dummy function for all gpio functions if CONFIG_GPIOLIB is disabled. For correct operation of max3355, you should add the dependency to the extcon-max3355.c driver. This driver use the GPIO library certainly. COMPILE_TEST is used for just build test. You can see the detailed data[1]. [1] https://lkml.org/lkml/2013/5/22/155 Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5] extcon: add Maxim MAX3355 driver
Hi, This patch depend on GPIOLIB configuration as following: I modified it with following diff and applied it. diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig index ba4db7d..3d89e60 100644 --- a/drivers/extcon/Kconfig +++ b/drivers/extcon/Kconfig @@ -54,6 +54,7 @@ config EXTCON_MAX14577 config EXTCON_MAX3355 tristate "Maxim MAX3355 USB OTG EXTCON Support" + depends on GPIOLIB || COMPILE_TEST help If you say yes here you get support for the USB OTG role detection by MAX3355. The MAX3355 chip integrates a charge pump and comparators to Thanks, Chanwoo Choi On Sat, Dec 19, 2015 at 8:17 AM, Sergei Shtylyov wrote: > Maxim Integrated MAX3355E chip integrates a charge pump and comparators to > enable a system with an integrated USB OTG dual-role transceiver to > function as an USB OTG dual-role device. In addition to sensing/controlling > Vbus, the chip also passes thru the ID signal from the USB OTG connector. > On some Renesas boards, this signal is just fed into the SoC thru a GPIO > pin -- there's no real OTG controller, only host and gadget USB controllers > sharing the same USB bus; however, we'd like to allow host or gadget > drivers to be loaded depending on the cable type, hence the need for the > MAX3355 extcon driver. The Vbus status signals are also wired to GPIOs > (however, we aren't currently interested in them), the OFFVBUS# signal is > controlled by the host controllers, there's also the SHDN# signal wired to > a GPIO, it should be driven high for the normal operation. > > Signed-off-by: Sergei Shtylyov > Acked-by: Chanwoo Choi > > --- > Changes in version 5: > - removed unused variable in the probe() method; > - removed reference to the Koelsch board from the binding document; > - added Chanwoo Choi's ACK. > > Changes in version 4: > - stopped calling kstrdup() for the device name; > - removed unneeded 'owner' field initializer; > - moved devm_extcon_allocate() call further down in the probe() method; > - extended the driver copyright; > - indented the continuation lines in the binding document. > > Changes in version 3: > - reformatted the change log. > > Changes in version 2: > - added the USB gadget cable support; > - added the remove() driver method which drives SHDN# GPIO low to save power; > - dropped vendor prefix from the ID GPIO property name; > - changed the GPIO property name suffix to "-gpios"; > - switched to usign extcon_set_cable_state_() API; > - switched to using the gpiod/sleeping 'gpiolib' APIs; > - addded error messages to max3355_probe(); > - added IRQF_NO_SUSPEND flasg to the devm_request_threaded_irq() call; > - renamed 'ret' variable to 'err' in max3355_probe(); > - expanded the Kconfig entry help text; > - added vendor name to the patch summary, the bindings document, the Kconfig > entry, the driver heading comment, the module description, and the change > log; > - fixed up and reformatted the change log. > > Documentation/devicetree/bindings/extcon/extcon-max3355.txt | 21 + > drivers/extcon/Kconfig |8 > drivers/extcon/Makefile |1 > drivers/extcon/extcon-max3355.c | 150 > > 4 files changed, 180 insertions(+) > > Index: extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > === > --- /dev/null > +++ extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > @@ -0,0 +1,21 @@ > +Maxim Integrated MAX3355 USB OTG chip > +- > + > +MAX3355 integrates a charge pump and comparators to enable a system with an > +integrated USB OTG dual-role transceiver to function as a USB OTG dual-role > +device. > + > +Required properties: > +- compatible: should be "maxim,max3355"; > +- maxim,shdn-gpios: should contain a phandle and GPIO specifier for the GPIO > pin > + connected to the MAX3355's SHDN# pin; > +- id-gpios: should contain a phandle and GPIO specifier for the GPIO pin > + connected to the MAX3355's ID_OUT pin. > + > +Example: > + > + usb-otg { > + compatible = "maxim,max3355"; > + maxim,shdn-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; > + id-gpios = <&gpio5 31 GPIO_ACTIVE_HIGH>; > + }; > Index: extcon/drivers/extcon/Kconfig > === > --- extcon.orig/drivers/extcon/Kconfig > +++ extcon/drivers/extcon/Kconfig > @@ -52,6 +52,14 @@ config E
Re: [PATCH v4 05/20] PM / devfreq: Add new passive governor
On 2015년 12월 14일 18:04, MyungJoo Ham wrote: >> >> This patch adds the new passive governor for DEVFREQ framework. The >> following >> governors are already present and used for DVFS (Dynamic Voltage and >> Frequency >> Scaling) drivers. The following governors are independently used for one >> device >> driver which don't give the influence to other device drviers and also don't >> receive the effect from other device drivers. >> - ondemand / performance / powersave / userspace >> >> The passive governor depends on operation of parent driver with specific >> governos extremely and is not able to decide the new frequency by oneself. >> According to the decided new frequency of parent driver with governor, >> the passive governor uses it to decide the appropriate frequency for own >> device driver. The passive governor must need the following information >> from device tree: >> - the source clock and OPP tables >> - the instance of parent device >> >> For exameple, >> there are one more devfreq device drivers which need to change their source >> clock according to their utilization on runtime. But, they share the same >> power line (e.g., regulator). So, specific device driver is operated as >> parent >> with ondemand governor and then the rest device driver with passive governor >> is influenced by parent device. >> >> Suggested-by: Myungjoo Ham >> Signed-off-by: Chanwoo Choi >> [linux.amoon: Tested on Odroid U3] >> Tested-by: Anand Moon >> --- >> drivers/devfreq/Kconfig| 9 >> drivers/devfreq/Makefile | 1 + >> drivers/devfreq/devfreq.c | 47 >> drivers/devfreq/governor_passive.c | 108 >> + >> include/linux/devfreq.h| 15 ++ >> 5 files changed, 180 insertions(+) >> create mode 100644 drivers/devfreq/governor_passive.c >> >> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig >> index 55ec774f794c..d03f635a93e1 100644 >> --- a/drivers/devfreq/Kconfig >> +++ b/drivers/devfreq/Kconfig >> @@ -64,6 +64,15 @@ config DEVFREQ_GOV_USERSPACE >>Otherwise, the governor does not change the frequnecy >>given at the initialization. >> >> +config DEVFREQ_GOV_PASSIVE >> +tristate "Passive" >> +help >> + Sets the frequency by other governors (simple_ondemand, performance, >> + powersave, usersapce) of a parent devfreq device. This governor >> + always has the dependency on the chosen frequency from paired >> + governor. This governor does not change the frequency by oneself >> + through sysfs entry. > > Sets the frequency based on the frequency of its parent devfreq > device. This governor does not change the frequency by itself > through sysfs entries. OK. I'll modify it. > >> + >> comment "DEVFREQ Drivers" >> >> config ARM_EXYNOS_BUS_DEVFREQ >> diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile >> index 375ebbb4fcfb..f81c313b4b79 100644 >> --- a/drivers/devfreq/Makefile >> +++ b/drivers/devfreq/Makefile > [] >> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c >> index 984c5e9e7bdd..15e58779e4c0 100644 >> --- a/drivers/devfreq/devfreq.c >> +++ b/drivers/devfreq/devfreq.c >> @@ -190,6 +190,31 @@ static struct devfreq_governor >> *find_devfreq_governor(const char *name) >> >> /* Load monitoring helper functions for governors use */ >> >> +static int update_devfreq_passive(struct devfreq *devfreq, unsigned long >> freq) >> +{ >> +struct devfreq *passive; >> +unsigned long rate; >> +int ret; >> + >> +list_for_each_entry(passive, &devfreq->passive_dev_list, passive_node) { >> +if (!passive->governor) >> +continue; >> +rate = freq; >> + >> +ret = passive->governor->get_target_freq(passive, &rate); >> +if (ret) >> +return ret; >> + >> +ret = passive->profile->target(passive->dev.parent, &rate, 0); >> +if (ret) >> +return ret; >> + >> +passive->previous_freq = rate; >> +} >> + >> +return 0; >> +} >> + >> /** >> * update_devfreq() - Reevaluate the device and configure frequency. >> * @devfreq:the devfre
Re: [PATCH v4] extcon: add Maxim MAX3355 driver
Hi Sergei, Except for just one comment below, Looks good to me. Acked-by: Chanwoo Choi I'll wait for a few days to get the review from DT maintainer before applying it on extcon-next branch. On 2015년 12월 18일 07:47, Sergei Shtylyov wrote: > Maxim Integrated MAX3355E chip integrates a charge pump and comparators to > enable a system with an integrated USB OTG dual-role transceiver to > function as an USB OTG dual-role device. In addition to sensing/controlling > Vbus, the chip also passes thru the ID signal from the USB OTG connector. > On some Renesas boards, this signal is just fed into the SoC thru a GPIO > pin -- there's no real OTG controller, only host and gadget USB controllers > sharing the same USB bus; however, we'd like to allow host or gadget > drivers to be loaded depending on the cable type, hence the need for the > MAX3355 extcon driver. The Vbus status signals are also wired to GPIOs > (however, we aren't currently interested in them), the OFFVBUS# signal is > controlled by the host controllers, there's also the SHDN# signal wired to > a GPIO, it should be driven high for the normal operation. > > Signed-off-by: Sergei Shtylyov > > --- > The patch is against the 'extcon-next' branch of the 'extcon.git' repo. > > Changes in version 4: > - stopped calling kstrdup() for the device name; > - removed unneeded 'owner' field initializer; > - moved devm_extcon_allocate() call further down in the probe() method; > - extended the driver copyright; > - indented the continuation lines in the binding document. > > Changes in version 3: > - reformatted the change log. > > Changes in version 2: > - added the USB gadget cable support; > - added the remove() driver method which drives SHDN# GPIO low to save power; > - dropped vendor prefix from the ID GPIO property name; > - changed the GPIO property name suffix to "-gpios"; > - switched to usign extcon_set_cable_state_() API; > - switched to using the gpiod/sleeping 'gpiolib' APIs; > - addded error messages to max3355_probe(); > - added IRQF_NO_SUSPEND flasg to the devm_request_threaded_irq() call; > - renamed 'ret' variable to 'err' in max3355_probe(); > - expanded the Kconfig entry help text; > - added vendor name to the patch summary, the bindings document, the Kconfig > entry, the driver heading comment, the module description, and the change > log; > - fixed up and reformatted the change log. > > Documentation/devicetree/bindings/extcon/extcon-max3355.txt | 21 + > drivers/extcon/Kconfig |8 > drivers/extcon/Makefile |1 > drivers/extcon/extcon-max3355.c | 151 > > 4 files changed, 181 insertions(+) > > Index: extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > === > --- /dev/null > +++ extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > @@ -0,0 +1,21 @@ > +Maxim Integrated MAX3355 USB OTG chip > +- > + > +MAX3355 integrates a charge pump and comparators to enable a system with an > +integrated USB OTG dual-role transceiver to function as a USB OTG dual-role > +device. > + > +Required properties: > +- compatible: should be "maxim,max3355"; > +- maxim,shdn-gpios: should contain a phandle and GPIO specifier for the GPIO > pin > + connected to the MAX3355's SHDN# pin; > +- id-gpios: should contain a phandle and GPIO specifier for the GPIO pin > + connected to the MAX3355's ID_OUT pin. > + > +Example (Koelsch board): You mean that "koelsch" board might be arch/arm/boot/dts/r8a7791-koelsch.dts. But, the max3355 dt node isn't really included in r8a7791-koelsch.dts. I recommend that you add the accurate information because the wrong info causes the confusion. So, I'd like you to change it as following: "Example (Koelsch board):" -> "Example:" After adding the max3355 dt node to Koelsch board on separate patch, you modify this documentation for real usage case of max3355 dt node. > + > + usb-otg { > + compatible = "maxim,max3355"; > + maxim,shdn-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; > + id-gpios = <&gpio5 31 GPIO_ACTIVE_HIGH>; > + }; > Index: extcon/drivers/extcon/Kconfig > === > --- extcon.orig/drivers/extcon/Kconfig > +++ extcon/drivers/extcon/Kconfig > @@ -52,6 +52,14 @@ config EXTCON_MAX14577 > Maxim MAX14577/77836. The MAX14577/77836 MUIC is a USB port accessory > detector and switch. [snip] Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] extcon: add Maxim MAX3355 driver
On 2015년 12월 18일 06:20, Sergei Shtylyov wrote: > Hello. > > On 12/17/2015 05:34 AM, Chanwoo Choi wrote: > >>> On 2015년 12월 17일 03:07, Sergei Shtylyov wrote: >>>> Maxim Integrated MAX3355E chip integrates a charge pump and comparators to >>>> enable a system with an integrated USB OTG dual-role transceiver to >>>> function as an USB OTG dual-role device. In addition to sensing/controlling >>>> Vbus, the chip also passes thru the ID signal from the USB OTG connector. >>>> On some Renesas boards, this signal is just fed into the SoC thru a GPIO >>>> pin -- there's no real OTG controller, only host and gadget USB controllers >>>> sharing the same USB bus; however, we'd like to allow host or gadget >>>> drivers to be loaded depending on the cable type, hence the need for the >>>> MAX3355 extcon driver. The Vbus status signals are also wired to GPIOs >>>> (however, we aren't currently interested in them), the OFFVBUS# signal is >>>> controlled by the host controllers, there's also the SHDN# signal wired to >>>> a GPIO, it should be driven high for the normal operation. >>>> >>>> Signed-off-by: Sergei Shtylyov >>>> >>>> --- >>>> Changes in version 3: >>>> - reformatted the change log. >>>> >>>> Changes in version 2: >>>> - added the USB gadget cable support; >>>> - added the remove() driver method which drives SHDN# GPIO low to save >>>> power; >>>> - dropped vendor prefix from the ID GPIO property name; >>>> - changed the GPIO property name suffix to "-gpios"; >>>> - switched to usign extcon_set_cable_state_() API; >>>> - switched to using the gpiod/sleeping 'gpiolib' APIs; >>>> - addded error messages to max3355_probe(); >>>> - added IRQF_NO_SUSPEND flasg to the devm_request_threaded_irq() call; >>>> - renamed 'ret' variable to 'err' in max3355_probe(); >>>> - expanded the Kconfig entry help text; >>>> - added vendor name to the patch summary, the bindings document, the >>>> Kconfig >>>>entry, the driver heading comment, the module description, and the >>>> change log; >>>> - fixed up and reformatted the change log. >>>> >>>> Documentation/devicetree/bindings/extcon/extcon-max3355.txt | 21 + >>>> drivers/extcon/Kconfig |8 >>>> drivers/extcon/Makefile |1 >>>> drivers/extcon/extcon-max3355.c | 153 >>>> >>>> 4 files changed, 183 insertions(+) >>>> >> >> [snip] >> >>>> +return 0; >>>> +} >>>> + >>>> +static int max3355_remove(struct platform_device *pdev) >>>> +{ >>>> +struct max3355_data *data = platform_get_drvdata(pdev); >>>> + >>>> +gpiod_set_value_cansleep(data->shdn_gpiod, 0); >> >> Don't need to handle the 'shdn' gpio on resume/suspend funtcion? >> >> But, if the interrput of id gpio is used for wakeup source, >> there is no reason to handle it for suspend mode. > >You told me to pass IRQF_NO_SUSPEND to devm_request_threaded_irq(), didn't > you? Yes. You add the this flag on v4 patch. Looks good to me. Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
On 2015년 12월 18일 09:34, Chanwoo Choi wrote: > Hi, > > On 2015년 12월 15일 12:41, Krzysztof Kozlowski wrote: >> On 14.12.2015 15:38, Chanwoo Choi wrote: >>> This patch adds the generic exynos bus frequency driver for AMBA AXI bus >>> of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC >>> have the common architecture for bus between DRAM and sub-blocks in SoC. >>> This driver can support the generic bus frequency driver for Exynos SoCs. >>> >>> In devicetree, Each bus block has a bus clock, regulator, operation-point >>> and devfreq-event devices which measure the utilization of each bus block. >>> >>> Signed-off-by: Chanwoo Choi >>> [linux.amoon: Tested on Odroid U3] >>> Tested-by: Anand Moon >>> --- >>> drivers/devfreq/Kconfig | 15 ++ >>> drivers/devfreq/Makefile| 1 + >>> drivers/devfreq/exynos/Makefile | 1 + >>> drivers/devfreq/exynos/exynos-bus.c | 449 >>> >>> 4 files changed, 466 insertions(+) >>> create mode 100644 drivers/devfreq/exynos/exynos-bus.c >>> >>> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig >>> index 64281bb2f650..55ec774f794c 100644 >>> --- a/drivers/devfreq/Kconfig >>> +++ b/drivers/devfreq/Kconfig >>> @@ -66,6 +66,21 @@ config DEVFREQ_GOV_USERSPACE >>> >>> comment "DEVFREQ Drivers" >>> >>> +config ARM_EXYNOS_BUS_DEVFREQ >>> + bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" >>> + depends on ARCH_EXYNOS >>> + select DEVFREQ_GOV_SIMPLE_ONDEMAND >>> + select DEVFREQ_EVENT_EXYNOS_PPMU >>> + select PM_DEVFREQ_EVENT >>> + select PM_OPP >>> + help >>> + This adds the common DEVFREQ driver for Exynos Memory bus. Exynos >>> + Memory bus has one more group of memory bus (e.g, MIF and INT block). >>> + Each memory bus group could contain many memoby bus block. It reads >>> + PPMU counters of memory controllers by using DEVFREQ-event device >>> + and adjusts the operating frequencies and voltages with OPP support. >>> + This does not yet operate with optimal voltages. >>> + >>> config ARM_EXYNOS4_BUS_DEVFREQ >>> bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" >>> depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && >>> !ARCH_MULTIPLATFORM >>> diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile >>> index 5134f9ee983d..375ebbb4fcfb 100644 >>> --- a/drivers/devfreq/Makefile >>> +++ b/drivers/devfreq/Makefile >>> @@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o >>> obj-$(CONFIG_DEVFREQ_GOV_USERSPACE)+= governor_userspace.o >>> >>> # DEVFREQ Drivers >>> +obj-$(CONFIG_ARCH_EXYNOS) += exynos/ >> >> Why limiting it to ARCH_EXYNOS? Are there real dependencies on exynos >> mach code? Or on ARM code? > > There is no dependency. > >> >> If not, then this probably should be obj-y to allow compile testing. >> Particular objects would be selected by ARM_EXYNOS_BUS_DEVFREQ. > > OK. I'll alter it as obj-y. As you commented, CONFIG_ARM_EXYNOS_BUS_DEVFREQ is more appropriate without exynos/ directory as following: +obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
Hi, On 2015년 12월 15일 12:41, Krzysztof Kozlowski wrote: > On 14.12.2015 15:38, Chanwoo Choi wrote: >> This patch adds the generic exynos bus frequency driver for AMBA AXI bus >> of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC >> have the common architecture for bus between DRAM and sub-blocks in SoC. >> This driver can support the generic bus frequency driver for Exynos SoCs. >> >> In devicetree, Each bus block has a bus clock, regulator, operation-point >> and devfreq-event devices which measure the utilization of each bus block. >> >> Signed-off-by: Chanwoo Choi >> [linux.amoon: Tested on Odroid U3] >> Tested-by: Anand Moon >> --- >> drivers/devfreq/Kconfig | 15 ++ >> drivers/devfreq/Makefile| 1 + >> drivers/devfreq/exynos/Makefile | 1 + >> drivers/devfreq/exynos/exynos-bus.c | 449 >> >> 4 files changed, 466 insertions(+) >> create mode 100644 drivers/devfreq/exynos/exynos-bus.c >> >> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig >> index 64281bb2f650..55ec774f794c 100644 >> --- a/drivers/devfreq/Kconfig >> +++ b/drivers/devfreq/Kconfig >> @@ -66,6 +66,21 @@ config DEVFREQ_GOV_USERSPACE >> >> comment "DEVFREQ Drivers" >> >> +config ARM_EXYNOS_BUS_DEVFREQ >> +bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" >> +depends on ARCH_EXYNOS >> +select DEVFREQ_GOV_SIMPLE_ONDEMAND >> +select DEVFREQ_EVENT_EXYNOS_PPMU >> +select PM_DEVFREQ_EVENT >> +select PM_OPP >> +help >> + This adds the common DEVFREQ driver for Exynos Memory bus. Exynos >> + Memory bus has one more group of memory bus (e.g, MIF and INT block). >> + Each memory bus group could contain many memoby bus block. It reads >> + PPMU counters of memory controllers by using DEVFREQ-event device >> + and adjusts the operating frequencies and voltages with OPP support. >> + This does not yet operate with optimal voltages. >> + >> config ARM_EXYNOS4_BUS_DEVFREQ >> bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" >> depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && >> !ARCH_MULTIPLATFORM >> diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile >> index 5134f9ee983d..375ebbb4fcfb 100644 >> --- a/drivers/devfreq/Makefile >> +++ b/drivers/devfreq/Makefile >> @@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o >> obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o >> >> # DEVFREQ Drivers >> +obj-$(CONFIG_ARCH_EXYNOS) += exynos/ > > Why limiting it to ARCH_EXYNOS? Are there real dependencies on exynos > mach code? Or on ARM code? There is no dependency. > > If not, then this probably should be obj-y to allow compile testing. > Particular objects would be selected by ARM_EXYNOS_BUS_DEVFREQ. OK. I'll alter it as obj-y. Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] extcon: add Maxim MAX3355 driver
Hi, On 2015년 12월 17일 11:16, Chanwoo Choi wrote: > Hi Sergei, > > On 2015년 12월 17일 03:07, Sergei Shtylyov wrote: >> Maxim Integrated MAX3355E chip integrates a charge pump and comparators to >> enable a system with an integrated USB OTG dual-role transceiver to >> function as an USB OTG dual-role device. In addition to sensing/controlling >> Vbus, the chip also passes thru the ID signal from the USB OTG connector. >> On some Renesas boards, this signal is just fed into the SoC thru a GPIO >> pin -- there's no real OTG controller, only host and gadget USB controllers >> sharing the same USB bus; however, we'd like to allow host or gadget >> drivers to be loaded depending on the cable type, hence the need for the >> MAX3355 extcon driver. The Vbus status signals are also wired to GPIOs >> (however, we aren't currently interested in them), the OFFVBUS# signal is >> controlled by the host controllers, there's also the SHDN# signal wired to >> a GPIO, it should be driven high for the normal operation. >> >> Signed-off-by: Sergei Shtylyov >> >> --- >> Changes in version 3: >> - reformatted the change log. >> >> Changes in version 2: >> - added the USB gadget cable support; >> - added the remove() driver method which drives SHDN# GPIO low to save power; >> - dropped vendor prefix from the ID GPIO property name; >> - changed the GPIO property name suffix to "-gpios"; >> - switched to usign extcon_set_cable_state_() API; >> - switched to using the gpiod/sleeping 'gpiolib' APIs; >> - addded error messages to max3355_probe(); >> - added IRQF_NO_SUSPEND flasg to the devm_request_threaded_irq() call; >> - renamed 'ret' variable to 'err' in max3355_probe(); >> - expanded the Kconfig entry help text; >> - added vendor name to the patch summary, the bindings document, the Kconfig >> entry, the driver heading comment, the module description, and the change >> log; >> - fixed up and reformatted the change log. >> >> Documentation/devicetree/bindings/extcon/extcon-max3355.txt | 21 + >> drivers/extcon/Kconfig |8 >> drivers/extcon/Makefile |1 >> drivers/extcon/extcon-max3355.c | 153 >> >> 4 files changed, 183 insertions(+) >> [snip] >> +return 0; >> +} >> + >> +static int max3355_remove(struct platform_device *pdev) >> +{ >> +struct max3355_data *data = platform_get_drvdata(pdev); >> + >> +gpiod_set_value_cansleep(data->shdn_gpiod, 0); Don't need to handle the 'shdn' gpio on resume/suspend funtcion? But, if the interrput of id gpio is used for wakeup source, there is no reason to handle it for suspend mode. [snip] Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] extcon: add Maxim MAX3355 driver
. Allocate the memory of max3355_data *data. 2. Parse and initialize the gpio (id, shdn) 3. Allocate the memory of extcon_dev and register it. 4. Request the interrupt. > + > + platform_set_drvdata(pdev, data); > + > + /* Perform initial detection */ > + max3355_id_irq(irq, data); > + > + return 0; > +} > + > +static int max3355_remove(struct platform_device *pdev) > +{ > + struct max3355_data *data = platform_get_drvdata(pdev); > + > + gpiod_set_value_cansleep(data->shdn_gpiod, 0); > + > + return 0; > +} > + > +static const struct of_device_id max3355_match_table[] = { > + { .compatible = "maxim,max3355", }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, max3355_match_table); > + > +static struct platform_driver max3355_driver = { > + .probe = max3355_probe, > + .remove = max3355_remove, > + .driver = { > + .name = "extcon-max3355", > + .of_match_table = max3355_match_table, > + .owner = THIS_MODULE, You don't need to add the 'owner'. > + }, > +}; > + > +module_platform_driver(max3355_driver); > + > +MODULE_AUTHOR("Sergei Shtylyov "); > +MODULE_DESCRIPTION("Maxim MAX3355 extcon driver"); > +MODULE_LICENSE("GPL v2"); Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
On 2015년 12월 14일 17:28, MyungJoo Ham wrote: >> >> This patch adds the generic exynos bus frequency driver for AMBA AXI bus >> of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC >> have the common architecture for bus between DRAM and sub-blocks in SoC. >> This driver can support the generic bus frequency driver for Exynos SoCs. >> >> In devicetree, Each bus block has a bus clock, regulator, operation-point >> and devfreq-event devices which measure the utilization of each bus block. >> >> Signed-off-by: Chanwoo Choi >> [linux.amoon: Tested on Odroid U3] >> Tested-by: Anand Moon >> > > Chanwoo, could you please show me testing this set of patches in your site? > Please let me know when is ok to visit you. > (I do not have exynos machines right now.) > >> diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile >> index 5134f9ee983d..375ebbb4fcfb 100644 >> --- a/drivers/devfreq/Makefile >> +++ b/drivers/devfreq/Makefile >> @@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o >> obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o >> >> # DEVFREQ Drivers >> +obj-$(CONFIG_ARCH_EXYNOS) += exynos/ >> obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos/ >> obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos/ > > CONFIG_ARCH_EXYNOS is true if > CONFIG_ARM_EXYNOS4_BUS_DEVFREQ is true > or > CONFIG_ARM_EXYNOS5_BUS_DEVFREQ is true > Thus, the two lines after you've added have become useless. (dead code) > > Please delete them. In this series, patch11 deletes all of both exynos4_bus.c and exynos5_bus.c. > > [] >> --- /dev/null >> +++ b/drivers/devfreq/exynos/exynos-bus.c > [] >> +static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 >> flags) >> +{ >> +struct exynos_bus *bus = dev_get_drvdata(dev); >> +struct dev_pm_opp *new_opp; >> +unsigned long old_freq, new_freq, old_volt, new_volt; >> +int ret = 0; >> + >> +/* Get new opp-bus instance according to new bus clock */ >> +rcu_read_lock(); >> +new_opp = devfreq_recommended_opp(dev, freq, flags); >> +if (IS_ERR_OR_NULL(new_opp)) { >> +dev_err(dev, "failed to get recommed opp instance\n"); >> +rcu_read_unlock(); >> +return PTR_ERR(new_opp); >> +} >> + >> +new_freq = dev_pm_opp_get_freq(new_opp); >> +new_volt = dev_pm_opp_get_voltage(new_opp); >> +old_freq = dev_pm_opp_get_freq(bus->curr_opp); >> +old_volt = dev_pm_opp_get_voltage(bus->curr_opp); >> +rcu_read_unlock(); >> + >> +if (old_freq == new_freq) >> +return 0; >> + >> +/* Change voltage and frequency according to new OPP level */ >> +mutex_lock(&bus->lock); >> + >> +if (old_freq < new_freq) { >> +ret = regulator_set_voltage(bus->regulator, new_volt, new_volt); > > Setting the maximum volt same as the minimum volt is not recommended. > Especially for any DVFS mechanisms, I recommend to set values as: > min_volt = minimum voltage that does not harm the stability > max_volt = maximum voltage that does not break the circuit > > Please refer to /include/linux/regulator/driver.h > "@set_voltage" comments. > > For the rest of regulator_set_voltage usages, I'd say the same. OK. I'll add the 'voltage-tolerance' property as cpufreq-dt.c driver. The cpufreq-dt.c get the percentage value by using 'voltage-tolerance' devicetree property. For example, if (of_property_read_u32(np, "exynos,voltage-tolerance", &bus->voltage_tolerance)) bus->voltage_tolerance = DEFAULT_VOLTAGE_TOLERANCE; tol = new_volt * bus->voltage_tolerance / 100; regulator_set_voltage_tol(regulator, new_volt, tol); > > [] >> +static int exynos_bus_get_dev_status(struct device *dev, >> + struct devfreq_dev_status *stat) >> +{ >> +struct exynos_bus *bus = dev_get_drvdata(dev); >> +struct devfreq_event_data edata; >> +int ret; >> + >> +rcu_read_lock(); >> +stat->current_frequency = dev_pm_opp_get_freq(bus->curr_opp); >> +rcu_read_unlock(); >> + >> +ret = exynos_bus_get_event(bus, &edata); >> +if (ret < 0) { >> +stat->total_time = stat->busy_time = 0; >> +goto err; >> +} >> + >> +stat->busy_tim
Re: [PATCH v2] extcon: add Maxim MAX3355 driver
Hi Sergei, On 2015년 12월 12일 08:22, Sergei Shtylyov wrote: > Maxim Integrated MAX3355E chip integrates a charge pump and comparators to ^^ ^^ > enable a system with an integrated USB OTG dual-role transceiver to function > as an USB OTG dual-role device. In addition to sensing/controlling Vbus, ^^ ^^ ^^ ^^ > the chip also passes thru the ID signal from the USB OTG connector. ^^ > On some Renesas boards, this signal is just fed into the SoC thru a GPIO ^^ ^^ > pin -- there's no real OTG controller, only host and gadget USB controllers ^^ ^^ > sharing the same USB bus; however, we'd like to allow host or gadget drivers ^^ > to be loaded depending on the cable type, hence the need for the MAX3355 ^^ > extcon driver. The Vbus status signals are also wired to GPIOs (however, we > aren't currently interested in them), the OFFVBUS# signal is controlled by ^^ ^^ > the host controllers, there's also the SHDN# signal wired to a GPIO, it ^^ > should be driven high for the normal operation. ^^ As above '^' expression, you used the double space between words. You should fix it. Thanks, Chanwoo Choi > > Signed-off-by: Sergei Shtylyov > > --- > The patch is against the 'extcon-next' branch of the 'extcon.git' repo. > > Changes in version 2: > - added the USB gadget cable support; > - added the remove() driver method which drives SHDN# GPIO low to save power; > - dropped vendor prefix from the ID GPIO property name; > - changed the GPIO property name suffix to "-gpios"; > - switched to usign extcon_set_cable_state_() API; > - switched to using the gpiod/sleeping 'gpiolib' APIs; > - addded error messages to max3355_probe(); > - added IRQF_NO_SUSPEND flasg to the devm_request_threaded_irq() call; > - renamed 'ret' variable to 'err' in max3355_probe(); > - expanded the Kconfig entry help text; > - added vendor name to the patch summary, the bindings document, the Kconfig > entry, the driver heading comment, the module description, and the change > log; > - fixed up and reformatted the change log. > > Documentation/devicetree/bindings/extcon/extcon-max3355.txt | 21 + > drivers/extcon/Kconfig |8 > drivers/extcon/Makefile |1 > drivers/extcon/extcon-max3355.c | 153 > > 4 files changed, 183 insertions(+) > > Index: extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > === > --- /dev/null > +++ extcon/Documentation/devicetree/bindings/extcon/extcon-max3355.txt > @@ -0,0 +1,21 @@ > +Maxim Integrated MAX3355 USB OTG chip > +- > + > +MAX3355 integrates a charge pump and comparators to enable a system with an > +integrated USB OTG dual-role transceiver to function as a USB OTG dual-role > +device. > + > +Required properties: > +- compatible: should be "maxim,max3355"; > +- maxim,shdn-gpios: should contain a phandle and GPIO specifier for the GPIO > pin > + connected to the MAX3355's SHDN# pin; > +- id-gpios: should contain a phandle and GPIO specifier for the GPIO pin > + connected to the MAX3355's ID_OUT pin. > + > +Example (Koelsch board): > + > + usb-otg { > + compatible = "maxim,max3355"; > + maxim,shdn-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; > + id-gpios = <&gpio5 31 GPIO_ACTIVE_HIGH>; > + }; > Index: extcon/drivers/extcon/Kconfig > === > --- extcon.orig/drivers/extcon/Kconfig > +++ extcon/drivers/extcon/Kconfig > @@ -52,6 +52,14 @@ config EXTCON_MAX14577 > Maxim MAX14577/77836. The MAX14577/77836 MUIC is a USB port accessory > detector and switch. > > +config EXTCON_MAX3355 > + tristate "Maxim MAX3355 USB OTG EXTCON Support" > + help > + If you say yes here you get support for the USB OTG role detection by > + MAX3355. The MAX3355 chip integrates a charge pump and comparators to > + enable a system with an integrated USB OTG dual-role transceiver to > + function as an USB OTG dual-role device. > + > config
Re: [PATCH v2 1/3] extcon: arizona: Add device bindings for the micd configurations
On 2015년 12월 14일 19:37, Charles Keepax wrote: > Add device bindings to support configuring the jack detection > configurations. Each configuration needs to specify the connection of > the mic det pins, which micbias should be used and the value of the > micd polarity GPIO required to activate that configuration. > > Signed-off-by: Charles Keepax > Acked-by: Chanwoo Choi > --- > > Changes since v1: > - Report error from arizona_extcon_get_micd_configs > > Thanks, > Charles > > drivers/extcon/extcon-arizona.c | 56 > +++-- > 1 file changed, 54 insertions(+), 2 deletions(-) Applied it. Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/3] extcon: arizona: Update device tree binding for mic detect configurations
On 2015년 12월 14일 19:37, Charles Keepax wrote: > Update the device tree binding documentation to include documentation for > the wlf,micd-configs property that is used to specify the configurations > for headset polarity detection (CTIA / OTMP). > > Signed-off-by: Charles Keepax > Acked-by: Rob Herring > --- > > No changes since v1. > > Thanks, > Charles > > Documentation/devicetree/bindings/extcon/extcon-arizona.txt | 8 > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > b/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > index 238e10e..fd9b898 100644 > --- a/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > +++ b/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > @@ -37,5 +37,13 @@ Optional properties: > milliseconds. >- wlf,micd-force-micbias : Force MICBIAS continuously on during microphone > detection. > + - wlf,micd-configs : Headset polarity configurations (generally used for > +detection of CTIA / OMTP headsets), the field can be of variable length > +but should always be a multiple of 3 cells long, each three cell group > +represents one polarity configuration. > +The first cell defines the accessory detection pin, zero will use MICDET1 > +and all other values will use MICDET2. > +The second cell represents the MICBIAS to be used. > +The third cell represents the value of the micd-pol-gpio pin. > >- wlf,gpsw : Settings for the general purpose switch > Applied it. Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] extcon: arizona: Add DT binding examples
On 2015년 12월 14일 19:37, Charles Keepax wrote: > Add an example for all elements of the Arizona extcon device tree > binding. > > Signed-off-by: Charles Keepax > --- > .../devicetree/bindings/extcon/extcon-arizona.txt | 26 > ++ > 1 file changed, 26 insertions(+) > > diff --git a/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > b/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > index fd9b898..e27341f 100644 > --- a/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > +++ b/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > @@ -47,3 +47,29 @@ Optional properties: > The third cell represents the value of the micd-pol-gpio pin. > >- wlf,gpsw : Settings for the general purpose switch > + > +Example: > + > +codec: wm8280@0 { > + compatible = "wlf,wm8280"; > + reg = <0>; > + ... > + > + wlf,use-jd2; > + wlf,use-jd2-nopull; > + wlf,jd-invert; > + > + wlf,micd-software-compare; > + wlf,micd-detect-debounce = <0>; > + wlf,micd-pol-gpio = <&codec 2 0>; > + wlf,micd-rate = ; > + wlf,micd-dbtime = <4>; > + wlf,micd-timeout-ms = <100>; > + wlf,micd-force-micbias; > + wlf,micd-configs = < > + 0 1 0 /* MICDET1 MICBIAS1 GPIO=low */ > + 1 2 1 /* MICDET2 MICBIAS2 GPIO=high */ > + >; > + > + wlf,gpsw = <0>; > +}; > Looks good to me. Applied it. Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 02/20] PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver
On 2015년 12월 14일 17:40, MyungJoo Ham wrote: >> >> This patch adds the documentation for generic exynos bus frequency >> driver. >> >> Signed-off-by: Chanwoo Choi >> Reviewed-by: Krzysztof Kozlowski > > A little changes following: > >> --- >> .../devicetree/bindings/devfreq/exynos-bus.txt | 93 >> ++ >> 1 file changed, 93 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> >> diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> new file mode 100644 >> index ..e32daef328da >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> @@ -0,0 +1,93 @@ >> +* Generic Exynos Bus frequency device >> + >> +The Samsung Exynos SoC have many buses for data transfer between DRAM > > +The Samsung Exynos SoC has many buses for data transfer between DRAM > > or > > +The Samsung Exynos SoCs have many buses for data transfer between DRAM > (because you intend to support mulitple Exynos SoCs) > >> +and sub-blocks in SoC. Almost Exynos SoC have the common architecture > > +and sub-blocks in SoC. Most Exynos SoCs share the common architecture > >> +for buses. Generally, the each bus of Exynos SoC includes the source clock > > +for buses. Generally, each bus of Exynos SoC includes a source clock > >> +and power line and then is able to change the clock according to the usage > > +and a power line, which are able to change the clock frequency > >> +of each buses on runtime. When gathering the usage of each buses on runtime, > > +of the bus in runtime. To monitor the usage of each bus in runtime, > >> +the driver uses the PPMU (Platform Performance Monitoring Unit) which > > +the driver uses the PPMU (Platform Performance Monitoring Unit), which > >> +is able to measure the current load of sub-blocks. >> + >> +There are a little different composition among Exynos SoC because each >> Exynos >> +SoC has the different sub-blocks. So, this difference should be specified > > +SoC has different sub-blocks. Therefore, such difference should be specified > >> +in devicetree file instead of each device driver. In result, this driver >> +is able to support the bus frequency for all Exynos SoCs. >> + Okay. I'll modify it. Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v4 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
On 2015년 12월 14일 17:28, MyungJoo Ham wrote: >> >> This patch adds the generic exynos bus frequency driver for AMBA AXI bus >> of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC >> have the common architecture for bus between DRAM and sub-blocks in SoC. >> This driver can support the generic bus frequency driver for Exynos SoCs. >> >> In devicetree, Each bus block has a bus clock, regulator, operation-point >> and devfreq-event devices which measure the utilization of each bus block. >> >> Signed-off-by: Chanwoo Choi >> [linux.amoon: Tested on Odroid U3] >> Tested-by: Anand Moon >> > > Chanwoo, could you please show me testing this set of patches in your site? > Please let me know when is ok to visit you. > (I do not have exynos machines right now.) Sure. I can show it tomorrow whenever you want. Before visiting to me, just let me know. I'll prepare the demonstartion. Regards, Chanwo oChoi > >> diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile >> index 5134f9ee983d..375ebbb4fcfb 100644 >> --- a/drivers/devfreq/Makefile >> +++ b/drivers/devfreq/Makefile >> @@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o >> obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o >> >> # DEVFREQ Drivers >> +obj-$(CONFIG_ARCH_EXYNOS) += exynos/ >> obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos/ >> obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos/ > > CONFIG_ARCH_EXYNOS is true if > CONFIG_ARM_EXYNOS4_BUS_DEVFREQ is true > or > CONFIG_ARM_EXYNOS5_BUS_DEVFREQ is true > Thus, the two lines after you've added have become useless. (dead code) > > Please delete them. > > [] >> --- /dev/null >> +++ b/drivers/devfreq/exynos/exynos-bus.c > [] >> +static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 >> flags) >> +{ >> +struct exynos_bus *bus = dev_get_drvdata(dev); >> +struct dev_pm_opp *new_opp; >> +unsigned long old_freq, new_freq, old_volt, new_volt; >> +int ret = 0; >> + >> +/* Get new opp-bus instance according to new bus clock */ >> +rcu_read_lock(); >> +new_opp = devfreq_recommended_opp(dev, freq, flags); >> +if (IS_ERR_OR_NULL(new_opp)) { >> +dev_err(dev, "failed to get recommed opp instance\n"); >> +rcu_read_unlock(); >> +return PTR_ERR(new_opp); >> +} >> + >> +new_freq = dev_pm_opp_get_freq(new_opp); >> +new_volt = dev_pm_opp_get_voltage(new_opp); >> +old_freq = dev_pm_opp_get_freq(bus->curr_opp); >> +old_volt = dev_pm_opp_get_voltage(bus->curr_opp); >> +rcu_read_unlock(); >> + >> +if (old_freq == new_freq) >> +return 0; >> + >> +/* Change voltage and frequency according to new OPP level */ >> +mutex_lock(&bus->lock); >> + >> +if (old_freq < new_freq) { >> +ret = regulator_set_voltage(bus->regulator, new_volt, new_volt); > > Setting the maximum volt same as the minimum volt is not recommended. > Especially for any DVFS mechanisms, I recommend to set values as: > min_volt = minimum voltage that does not harm the stability > max_volt = maximum voltage that does not break the circuit > > Please refer to /include/linux/regulator/driver.h > "@set_voltage" comments. > > For the rest of regulator_set_voltage usages, I'd say the same. > > [] >> +static int exynos_bus_get_dev_status(struct device *dev, >> + struct devfreq_dev_status *stat) >> +{ >> +struct exynos_bus *bus = dev_get_drvdata(dev); >> +struct devfreq_event_data edata; >> +int ret; >> + >> +rcu_read_lock(); >> +stat->current_frequency = dev_pm_opp_get_freq(bus->curr_opp); >> +rcu_read_unlock(); >> + >> +ret = exynos_bus_get_event(bus, &edata); >> +if (ret < 0) { >> +stat->total_time = stat->busy_time = 0; >> +goto err; >> +} >> + >> +stat->busy_time = (edata.load_count * 100) / bus->ratio; >> +stat->total_time = edata.total_count; >> + >> +dev_dbg(dev, "Usage of devfreq-event : %ld/%ld\n", stat->busy_time, >> +stat->total_time); > > These two values are unsigned long. > > [] >> +static int exynos_bus_parse_of(struct device_node *np, >> + s
Re: [PATCH v3 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
Hi Krzysztof and Myungjoo, On 2015년 12월 11일 17:03, Krzysztof Kozlowski wrote: > On 11.12.2015 16:52, Chanwoo Choi wrote: >> Dear MyungJoo, >> >> Almost device tree patches in this series are reviewed by Exynos maintainer. >> Could you please review this series? > > Are there any objections to merging DT patches through Samsung-soc? > > Looking at the code, there are no dependencies between DT and drivers, > right? Yes. There is no dependency between exynos-bus.c patches and DT patches. If the design concept of exynos-bus.c don't be changed, there is no problem to merge the DT patches to samsung-soc tree. Best Regards, Chanwoo Choi > > Best regards, > Krzysztof > >> >> Best Regards, >> Chanwoo Choi >> >> On 2015년 12월 11일 14:07, Chanwoo Choi wrote: >>> This patch adds the generic exynos bus frequency driver for AMBA AXI bus >>> of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC >>> have the common architecture for bus between DRAM and sub-blocks in SoC. >>> This driver can support the generic bus frequency driver for Exynos SoCs. >>> >>> In devicetree, Each bus block has a bus clock, regulator, operation-point >>> and devfreq-event devices which measure the utilization of each bus block. >>> >>> Signed-off-by: Chanwoo Choi >>> [linux.amoon: Tested on Odroid U3] >>> Tested-by: Anand Moon >>> --- >>> drivers/devfreq/Kconfig | 15 ++ >>> drivers/devfreq/Makefile| 1 + >>> drivers/devfreq/exynos/Makefile | 1 + >>> drivers/devfreq/exynos/exynos-bus.c | 449 >>> >>> 4 files changed, 466 insertions(+) >>> create mode 100644 drivers/devfreq/exynos/exynos-bus.c > > -- > To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" > in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 04/20] ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk
This patch adds the DMC (Dynamic Memory Controller) bus frequency node which includes the devfreq-events and regulator properties. The bus frequency support the DVFS (Dynamic Voltage Frequency Scaling) feature with ondemand governor. The devfreq-events (ppmu_dmc0*) can monitor the utilization of DMC bus on runtime and the buck1_reg (VDD_MIF power line) supplies the power to the DMC block. Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos3250-monk.dts | 6 ++ arch/arm/boot/dts/exynos3250-rinato.dts | 6 ++ 2 files changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250-monk.dts b/arch/arm/boot/dts/exynos3250-monk.dts index 443a35085846..456844a81189 100644 --- a/arch/arm/boot/dts/exynos3250-monk.dts +++ b/arch/arm/boot/dts/exynos3250-monk.dts @@ -156,6 +156,12 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; }; diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts b/arch/arm/boot/dts/exynos3250-rinato.dts index 3e64d5dcdd60..d6bb990ce931 100644 --- a/arch/arm/boot/dts/exynos3250-rinato.dts +++ b/arch/arm/boot/dts/exynos3250-rinato.dts @@ -147,6 +147,12 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 03/20] ARM: dts: Add DMC bus node for Exynos3250
This patch adds the DMC (Dynamic Memory Controller) bus node for Exynos3250 SoC. The DMC is an AMBA AXI-compliant slave to interface external JEDEC standard SDRAM devices. The bus includes the OPP tables and the source clock for DMC block. Following list specifies the detailed relation between the clock and DMC block: - The source clock of DMC block : div_dmc Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos3250.dtsi | 34 ++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi index 18e3deffbf48..262b3b1995fd 100644 --- a/arch/arm/boot/dts/exynos3250.dtsi +++ b/arch/arm/boot/dts/exynos3250.dtsi @@ -701,6 +701,40 @@ clock-names = "ppmu"; status = "disabled"; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu_dmc CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp@5000 { + opp-hz = /bits/ 64 <5000>; + opp-microvolt = <80>; + }; + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <80>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <80>; + }; + opp@2 { + opp-hz = /bits/ 64 <2>; + opp-microvolt = <825000>; + }; + opp@4 { + opp-hz = /bits/ 64 <4>; + opp-microvolt = <875000>; + }; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 06/20] PM / devfreq: Add devfreq_get_devfreq_by_phandle()
This patch adds the new devfreq_get_devfreq_by_phandle() OF helper function which can find the instance of devfreq device by using phandle ("devfreq"). Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/devfreq.c | 44 include/linux/devfreq.h | 9 + 2 files changed, 53 insertions(+) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 15e58779e4c0..78ea4cdaa82c 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "governor.h" static struct class *devfreq_class; @@ -686,6 +687,49 @@ struct devfreq *devm_devfreq_add_device(struct device *dev, } EXPORT_SYMBOL(devm_devfreq_add_device); +#ifdef CONFIG_OF +/* + * devfreq_get_devfreq_by_phandle - Get the devfreq device from devicetree + * @dev - instance to the given device + * @index - index into list of devfreq + * + * return the instance of devfreq device + */ +struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index) +{ + struct device_node *node; + struct devfreq *devfreq; + + if (!dev) + return ERR_PTR(-EINVAL); + + if (!dev->of_node) + return ERR_PTR(-EINVAL); + + node = of_parse_phandle(dev->of_node, "devfreq", index); + if (!node) + return ERR_PTR(-ENODEV); + + mutex_lock(&devfreq_list_lock); + list_for_each_entry(devfreq, &devfreq_list, node) { + if (devfreq->dev.parent + && devfreq->dev.parent->of_node == node) { + mutex_unlock(&devfreq_list_lock); + return devfreq; + } + } + mutex_unlock(&devfreq_list_lock); + + return ERR_PTR(-EPROBE_DEFER); +} +#else +struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index) +{ + return ERR_PTR(-ENODEV); +} +#endif /* CONFIG_OF */ +EXPORT_SYMBOL_GPL(devfreq_get_devfreq_by_phandle); + /** * devm_devfreq_remove_device() - Resource-managed devfreq_remove_device() * @dev: the device to add devfreq feature. diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 95c54578a1b4..cf972befca2b 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -211,6 +211,9 @@ extern int devm_devfreq_register_opp_notifier(struct device *dev, extern void devm_devfreq_unregister_opp_notifier(struct device *dev, struct devfreq *devfreq); +extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, + int index); + /** * devfreq_update_stats() - update the last_status pointer in struct devfreq * @df:the devfreq instance whose status needs updating @@ -322,6 +325,12 @@ static inline void devm_devfreq_unregister_opp_notifier(struct device *dev, { } +static inline struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, + int index) +{ + return ERR_PTR(-ENODEV); +} + static inline int devfreq_update_stats(struct devfreq *df) { return -EINVAL; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 02/20] PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver
This patch adds the documentation for generic exynos bus frequency driver. Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/devfreq/exynos-bus.txt | 93 ++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-bus.txt diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt new file mode 100644 index ..e32daef328da --- /dev/null +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt @@ -0,0 +1,93 @@ +* Generic Exynos Bus frequency device + +The Samsung Exynos SoC have many buses for data transfer between DRAM +and sub-blocks in SoC. Almost Exynos SoC have the common architecture +for buses. Generally, the each bus of Exynos SoC includes the source clock +and power line and then is able to change the clock according to the usage +of each buses on runtime. When gathering the usage of each buses on runtime, +the driver uses the PPMU (Platform Performance Monitoring Unit) which +is able to measure the current load of sub-blocks. + +There are a little different composition among Exynos SoC because each Exynos +SoC has the different sub-blocks. So, this difference should be specified +in devicetree file instead of each device driver. In result, this driver +is able to support the bus frequency for all Exynos SoCs. + +Required properties for bus device: +- compatible: Should be "samsung,exynos-bus". +- clock-names : the name of clock used by the bus, "bus". +- clocks : phandles for clock specified in "clock-names" property. +- operating-points-v2: the OPP table including frequency/voltage information + to support DVFS (Dynamic Voltage/Frequency Scaling) feature. +- vdd-supply: the regulator to provide the buses with the voltage. +- devfreq-events: the devfreq-event device to monitor the current utilization + of buses. + +Optional properties for bus device: +- exynos,saturation-ratio: the percentage value which is used to calibrate + the performance count against total cycle count. + +Example1: + Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to + power line (regulator). The MIF (Memory Interface) AXI bus is used to + transfer data between DRAM and CPU and uses the VDD_MIF regualtor. + + - power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block + + - MIF bus's frequency/voltage table + --- + |Lv| Freq | Voltage | + --- + |L1| 5 |80 | + |L2| 10 |80 | + |L3| 134000 |80 | + |L4| 20 |825000 | + |L5| 40 |875000 | + --- + +Example2 : + The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi + is listed below: + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu_dmc CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp@5000 { + opp-hz = /bits/ 64 <5000>; + opp-microvolt = <80>; + }; + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <80>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <80>; + }; + opp@2 { + opp-hz = /bits/ 64 <2>; + opp-microvolt = <825000>; + }; + opp@4 { + opp-hz = /bits/ 64 <4>; + opp-microvolt = <875000>; + }; + }; + + Usage case to handle the frequency and voltage of bus on runtime + in exynos3250-rinato.dts is listed below: + + &bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; /* VDD_MIF */ + status = "okay"; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 05/20] PM / devfreq: Add new passive governor
This patch adds the new passive governor for DEVFREQ framework. The following governors are already present and used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The following governors are independently used for one device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers. - ondemand / performance / powersave / userspace The passive governor depends on operation of parent driver with specific governos extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree: - the source clock and OPP tables - the instance of parent device For exameple, there are one more devfreq device drivers which need to change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, specific device driver is operated as parent with ondemand governor and then the rest device driver with passive governor is influenced by parent device. Suggested-by: Myungjoo Ham Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/Kconfig| 9 drivers/devfreq/Makefile | 1 + drivers/devfreq/devfreq.c | 47 drivers/devfreq/governor_passive.c | 108 + include/linux/devfreq.h| 15 ++ 5 files changed, 180 insertions(+) create mode 100644 drivers/devfreq/governor_passive.c diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 55ec774f794c..d03f635a93e1 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -64,6 +64,15 @@ config DEVFREQ_GOV_USERSPACE Otherwise, the governor does not change the frequnecy given at the initialization. +config DEVFREQ_GOV_PASSIVE + tristate "Passive" + help + Sets the frequency by other governors (simple_ondemand, performance, + powersave, usersapce) of a parent devfreq device. This governor + always has the dependency on the chosen frequency from paired + governor. This governor does not change the frequency by oneself + through sysfs entry. + comment "DEVFREQ Drivers" config ARM_EXYNOS_BUS_DEVFREQ diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile index 375ebbb4fcfb..f81c313b4b79 100644 --- a/drivers/devfreq/Makefile +++ b/drivers/devfreq/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) += governor_simpleondemand.o obj-$(CONFIG_DEVFREQ_GOV_PERFORMANCE) += governor_performance.o obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE)+= governor_powersave.o obj-$(CONFIG_DEVFREQ_GOV_USERSPACE)+= governor_userspace.o +obj-$(CONFIG_DEVFREQ_GOV_PASSIVE) += governor_passive.o # DEVFREQ Drivers obj-$(CONFIG_ARCH_EXYNOS) += exynos/ diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 984c5e9e7bdd..15e58779e4c0 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -190,6 +190,31 @@ static struct devfreq_governor *find_devfreq_governor(const char *name) /* Load monitoring helper functions for governors use */ +static int update_devfreq_passive(struct devfreq *devfreq, unsigned long freq) +{ + struct devfreq *passive; + unsigned long rate; + int ret; + + list_for_each_entry(passive, &devfreq->passive_dev_list, passive_node) { + if (!passive->governor) + continue; + rate = freq; + + ret = passive->governor->get_target_freq(passive, &rate); + if (ret) + return ret; + + ret = passive->profile->target(passive->dev.parent, &rate, 0); + if (ret) + return ret; + + passive->previous_freq = rate; + } + + return 0; +} + /** * update_devfreq() - Reevaluate the device and configure frequency. * @devfreq: the devfreq instance. @@ -233,10 +258,18 @@ int update_devfreq(struct devfreq *devfreq) flags |= DEVFREQ_FLAG_LEAST_UPPER_BOUND; /* Use LUB */ } + if (!list_empty(&devfreq->passive_dev_list) + && devfreq->previous_freq > freq) + update_devfreq_passive(devfreq, freq); + err = devfreq->profile->target(devfreq->dev.parent, &freq, flags); if (err) return err; + if (!list_empty(&devfreq->passive_dev_list) + && devfreq->previous_freq < freq) + update_devfreq_passive(devfreq, freq); + if (devfreq->profile->freq_table)
[PATCH v4 08/20] PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor
This patch adds the support of bus frequency feature for sub-blocks which share the one power line. If each bus depends on the power line, each bus is not able to change the voltage by oneself. To optimize the power-consumption on runtime, some buses using the same power line should change the source clock and regulator at the same time. So, this patch uses the passive governor to support the bus frequency for all buses which sharing the one power line. For example, Exynos3250 include the two power line for AXI buses as following: : VDD_MIF : MIF (Memory Interface) provide the DMC (Dynamic Memory Controller) with the power (regulator). : VDD_INT : INT (Internal) provide the various sub-blocks with the power (regulator). Each bus is included in as follwoing block. In the case of VDD_MIF, only DMC bus use the power line. So, there is no any depencency between buese. But, in the case of VDD_INT, various buses share the one power line of VDD_INT. We need to make the depenency between buses. When using passive governor, there is no problem to support the bus frequency as DVFS for all buses. One bus should be operated as the parent bus device which gathering the current load of INT block and then decides the new frequency with some governors except of passive governor. After deciding the new frequency by the parent bus device, the rest bus devices will change the each source clock according to new frequency of the parent bus device. - MIF (Memory Interface) block : VDD_MIF |--- DMC - INT (Internal) block : VDD_INT |--- LEFTBUS (parent) |--- PERIL |--- MFC |--- G3D |--- RIGHTBUS |--- FSYS |--- LCD0 |--- PERIR |--- ISP |--- CAM Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/Kconfig | 1 + drivers/devfreq/exynos/exynos-bus.c | 179 2 files changed, 144 insertions(+), 36 deletions(-) diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index d03f635a93e1..88f7cc4539b8 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -79,6 +79,7 @@ config ARM_EXYNOS_BUS_DEVFREQ bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" depends on ARCH_EXYNOS select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_GOV_PASSIVE select DEVFREQ_EVENT_EXYNOS_PPMU select PM_DEVFREQ_EVENT select PM_OPP diff --git a/drivers/devfreq/exynos/exynos-bus.c b/drivers/devfreq/exynos/exynos-bus.c index f1bc20839650..d1c137ea22ca 100644 --- a/drivers/devfreq/exynos/exynos-bus.c +++ b/drivers/devfreq/exynos/exynos-bus.c @@ -91,7 +91,7 @@ static int exynos_bus_get_event(struct exynos_bus *bus, } /* - * Must necessary function for devfreq governor + * Must necessary function for devfreq simple-ondemand governor */ static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags) { @@ -205,57 +205,74 @@ static void exynos_bus_exit(struct device *dev) dev_pm_opp_of_remove_table(dev); } -static int exynos_bus_parse_of(struct device_node *np, - struct exynos_bus *bus) +/* + * Must necessary function for devfreq passive governor + */ +static int exynos_bus_passive_target(struct device *dev, unsigned long *freq, + u32 flags) { - struct device *dev = bus->dev; - unsigned long rate; - int i, ret, count, size; + struct exynos_bus *bus = dev_get_drvdata(dev); + struct dev_pm_opp *new_opp; + unsigned long old_freq, new_freq; + int ret = 0; - /* Get the clock to provide each bus with source clock */ - bus->clk = devm_clk_get(dev, "bus"); - if (IS_ERR(bus->clk)) { - dev_err(dev, "failed to get bus clock\n"); - return PTR_ERR(bus->clk); + /* Get new opp-bus instance according to new bus clock */ + rcu_read_lock(); + new_opp = devfreq_recommended_opp(dev, freq, flags); + if (IS_ERR_OR_NULL(new_opp)) { + dev_err(dev, "failed to get recommed opp instance\n"); + rcu_read_unlock(); + return PTR_ERR(new_opp); } - ret = clk_prepare_enable(bus->clk); - if (ret < 0) { - dev_err(dev, "failed to get enable clock\n"); - return ret; - } + new_freq = dev_pm_opp_get_freq(new_opp); + old_freq = dev_pm_opp_get_freq(bus->curr_opp); + rcu_read_unlock(); - /* Get the freq/voltage OPP table to scale the bus frequency */ - rcu_read_lock(); - ret = dev_pm_opp_of_add_table(dev); + if (old_freq == new_freq) + return 0; + + /* Change the frequency according to new OPP level */ + mutex_lock(&bus->lock); + + ret = clk_set_rate(bus->clk, new_freq
[PATCH v4 07/20] PM / devfreq: Show the related information according to governor type
This patch modifies the following sysfs entry of DEVFREQ framework because the devfreq device using passive governor don't need the same information of the devfreq device using rest governor. - polling_interval: passive gov don't use the sampling rate. - available_governors : passive gov don't be changed on runtime in this version. - trans_stat : passive governor don't support trans_stat in this version. Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/devfreq.c | 31 +-- drivers/devfreq/governor.h| 7 +++ drivers/devfreq/governor_passive.c| 1 + drivers/devfreq/governor_performance.c| 1 + drivers/devfreq/governor_powersave.c | 1 + drivers/devfreq/governor_simpleondemand.c | 1 + drivers/devfreq/governor_userspace.c | 1 + include/linux/devfreq.h | 2 ++ 8 files changed, 39 insertions(+), 6 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 78ea4cdaa82c..18ad956fec93 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -597,7 +597,7 @@ struct devfreq *devfreq_add_device(struct device *dev, goto err_init; } - if (!strncmp(devfreq->governor_name, "passive", 7)) { + if (devfreq->governor->type == DEVFREQ_GOV_PASSIVE) { struct devfreq *parent_devfreq = ((struct devfreq_passive_data *)data)->parent; @@ -963,13 +963,23 @@ static ssize_t available_governors_show(struct device *d, struct device_attribute *attr, char *buf) { - struct devfreq_governor *tmp_governor; + struct devfreq *devfreq = to_devfreq(d); ssize_t count = 0; mutex_lock(&devfreq_list_lock); - list_for_each_entry(tmp_governor, &devfreq_governor_list, node) + if (devfreq->governor->type == DEVFREQ_GOV_PASSIVE) { count += scnprintf(&buf[count], (PAGE_SIZE - count - 2), - "%s ", tmp_governor->name); + "%s ", devfreq->governor->name); + } else { + struct devfreq_governor *tmp_governor; + + list_for_each_entry(tmp_governor, &devfreq_governor_list, node) { + if (tmp_governor->type == DEVFREQ_GOV_PASSIVE) + continue; + count += scnprintf(&buf[count], (PAGE_SIZE - count - 2), + "%s ", tmp_governor->name); + } + } mutex_unlock(&devfreq_list_lock); /* Truncate the trailing space */ @@ -1006,6 +1016,11 @@ static DEVICE_ATTR_RO(target_freq); static ssize_t polling_interval_show(struct device *dev, struct device_attribute *attr, char *buf) { + struct devfreq *df = to_devfreq(dev); + + if (df->governor->type == DEVFREQ_GOV_PASSIVE) + return sprintf(buf, "Not Supported.\n"); + return sprintf(buf, "%d\n", to_devfreq(dev)->profile->polling_ms); } @@ -1020,6 +1035,9 @@ static ssize_t polling_interval_store(struct device *dev, if (!df->governor) return -EINVAL; + if (df->governor->type == DEVFREQ_GOV_PASSIVE) + return -EINVAL; + ret = sscanf(buf, "%u", &value); if (ret != 1) return -EINVAL; @@ -1137,11 +1155,12 @@ static ssize_t trans_stat_show(struct device *dev, int i, j; unsigned int max_state = devfreq->profile->max_state; + if (max_state == 0 || devfreq->governor->type == DEVFREQ_GOV_PASSIVE) + return sprintf(buf, "Not Supported.\n"); + if (!devfreq->stop_polling && devfreq_update_status(devfreq, devfreq->previous_freq)) return 0; - if (max_state == 0) - return sprintf(buf, "Not Supported.\n"); len = sprintf(buf, " From : To\n"); len += sprintf(buf + len, " :"); diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index fad7d6321978..43513a58f5bf 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -18,6 +18,13 @@ #define to_devfreq(DEV)container_of((DEV), struct devfreq, dev) +/* Devfreq governor type */ +#define DEVFREQ_GOV_ONDEMAND 0x1 +#define DEVFREQ_GOV_PERFORMANCE0x2 +#define DEVFREQ_GOV_POWERSAVE 0x3 +#define DEVFREQ_GOV_USERSPACE 0x4 +#define DEVFREQ_GOV_PASSIVE0x4 + /* De
[PATCH v4 10/20] PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line
This patch adds the detailed corrleation between sub-blocks and power line for Exynos3250, Exynos4210 and Exynos4x12. Signed-off-by: Chanwoo Choi --- .../devicetree/bindings/devfreq/exynos-bus.txt | 51 ++ 1 file changed, 51 insertions(+) diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt index a251f9120561..f3a32b310dc7 100644 --- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt @@ -51,6 +51,57 @@ Optional properties only for parent bus device: - exynos,saturation-ratio: the percentage value which is used to calibrate the performance count against total cycle count. +Detailed correlation between sub-blocks and power line according to Exynos SoC: +- In case of Exynos3250, there are two power line as following: + VDD_MIF |--- DMC + + VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC + |--- G3D + |--- RIGHTBUS + |--- PERIR + |--- FSYS + |--- LCD0 + |--- PERIR + |--- ISP + |--- CAM + +- In case of Exynos4210, there is one power line as following: + VDD_INT |--- DMC (parent device) + |--- LEFTBUS + |--- PERIL + |--- MFC(L) + |--- G3D + |--- TV + |--- LCD0 + |--- RIGHTBUS + |--- PERIR + |--- MFC(R) + |--- CAM + |--- FSYS + |--- GPS + |--- LCD0 + |--- LCD1 + +- In case of Exynos4x12, there are two power line as following: + VDD_MIF |--- DMC + + VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC(L) + |--- G3D + |--- TV + |--- IMAGE + |--- RIGHTBUS + |--- PERIR + |--- MFC(R) + |--- CAM + |--- FSYS + |--- GPS + |--- LCD0 + |--- ISP + Example1: Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to power line (regulator). The MIF (Memory Interface) AXI bus is used to -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 09/20] PM / devfreq: exynos: Update documentation for bus devices using passive governor
This patch updates the documentation for passive bus devices and adds the detailed example of Exynos3250. Signed-off-by: Chanwoo Choi --- .../devicetree/bindings/devfreq/exynos-bus.txt | 250 - 1 file changed, 247 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt index e32daef328da..a251f9120561 100644 --- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt @@ -8,22 +8,46 @@ of each buses on runtime. When gathering the usage of each buses on runtime, the driver uses the PPMU (Platform Performance Monitoring Unit) which is able to measure the current load of sub-blocks. +The Exynos SoC includes the various sub-blocks which have the each AXI bus. +The each AXI bus has the owned source clock but, has not the only owned +power line. The power line might be shared among one more sub-blocks. +So, we can divide into two type of device as the role of each sub-block. +There are two type of bus devices as following: +- parent bus device +- passive bus device + +Basically, parent and passive bus device share the same power line. +The parent bus device can only change the voltage of shared power line +and the rest bus devices (passive bus device) depend on the decision of +the parent bus device. If there are three blocks which share the VDD_xxx +power line, Only one block should be parent device and then the rest blocks +should depend on the parent device as passive device. + + VDD_xxx |--- A block (parent) + |--- B block (passive) + |--- C block (passive) + There are a little different composition among Exynos SoC because each Exynos SoC has the different sub-blocks. So, this difference should be specified in devicetree file instead of each device driver. In result, this driver is able to support the bus frequency for all Exynos SoCs. -Required properties for bus device: +Required properties for all bus devices: - compatible: Should be "samsung,exynos-bus". - clock-names : the name of clock used by the bus, "bus". - clocks : phandles for clock specified in "clock-names" property. - operating-points-v2: the OPP table including frequency/voltage information to support DVFS (Dynamic Voltage/Frequency Scaling) feature. + +Required properties only for parent bus device: - vdd-supply: the regulator to provide the buses with the voltage. - devfreq-events: the devfreq-event device to monitor the current utilization of buses. -Optional properties for bus device: +Required properties only for passive bus device: +- devfreq: the parent bus device. + +Optional properties only for parent bus device: - exynos,saturation-ratio: the percentage value which is used to calibrate the performance count against total cycle count. @@ -32,7 +56,20 @@ Example1: power line (regulator). The MIF (Memory Interface) AXI bus is used to transfer data between DRAM and CPU and uses the VDD_MIF regualtor. - - power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block + - MIF (Memory Interface) block + : VDD_MIF |--- DMC (Dynamic Memory Controller) + + - INT (Internal) block + : VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC + |--- G3D + |--- RIGHTBUS + |--- FSYS + |--- LCD0 + |--- PERIR + |--- ISP + |--- CAM - MIF bus's frequency/voltage table --- @@ -45,6 +82,24 @@ Example1: |L5| 40 |875000 | --- + - INT bus's frequency/voltage table + -- + |Block|LEFTBUS|RIGHTBUS|MCUISP |ISP|PERIL ||VDD_INT | + | name| |LCD0| | | ||| + | | |FSYS| | | ||| + | | |MFC | | | ||| + -- + |Mode |*parent|passive |passive|passive|passive||| + -- + |Lv |Frequency ||Voltage | + -- + |L1 |5 |5 |5 |5 |5 ||90 | + |L2 |8 |8 |8 |8 |8 ||90 | + |L3 |10 |10 |10 |10 |10 ||100 | + |L4 |134000 |134000 |20 |20 | ||100 | + |L5 |20 |20 |40 |30 | ||100 | + -- + Example2 : The bus
[PATCH v4 11/20] PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver
This patch removes the unused exynos4/5 busfreq driver. Instead, generic exynos-bus frequency driver support the all Exynos SoCs. Signed-off-by: Chanwoo Choi --- drivers/devfreq/Kconfig | 22 - drivers/devfreq/exynos/Makefile |2 - drivers/devfreq/exynos/exynos4_bus.c | 1055 -- drivers/devfreq/exynos/exynos4_bus.h | 110 drivers/devfreq/exynos/exynos5_bus.c | 431 -- drivers/devfreq/exynos/exynos_ppmu.c | 119 drivers/devfreq/exynos/exynos_ppmu.h | 86 --- 7 files changed, 1825 deletions(-) delete mode 100644 drivers/devfreq/exynos/exynos4_bus.c delete mode 100644 drivers/devfreq/exynos/exynos4_bus.h delete mode 100644 drivers/devfreq/exynos/exynos5_bus.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.h diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 88f7cc4539b8..e82b1d8cd200 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -91,28 +91,6 @@ config ARM_EXYNOS_BUS_DEVFREQ and adjusts the operating frequencies and voltages with OPP support. This does not yet operate with optimal voltages. -config ARM_EXYNOS4_BUS_DEVFREQ - bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" - depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM - select DEVFREQ_GOV_SIMPLE_ONDEMAND - select PM_OPP - help - This adds the DEVFREQ driver for Exynos4210 memory bus (vdd_int) - and Exynos4212/4412 memory interface and bus (vdd_mif + vdd_int). - It reads PPMU counters of memory controllers and adjusts - the operating frequencies and voltages with OPP support. - This does not yet operate with optimal voltages. - -config ARM_EXYNOS5_BUS_DEVFREQ - tristate "ARM Exynos5250 Bus DEVFREQ Driver" - depends on SOC_EXYNOS5250 - select DEVFREQ_GOV_SIMPLE_ONDEMAND - select PM_OPP - help - This adds the DEVFREQ driver for Exynos5250 bus interface (vdd_int). - It reads PPMU counters of memory controllers and adjusts the - operating frequencies and voltages with OPP support. - config ARM_TEGRA_DEVFREQ tristate "Tegra DEVFREQ Driver" depends on ARCH_TEGRA_124_SOC diff --git a/drivers/devfreq/exynos/Makefile b/drivers/devfreq/exynos/Makefile index 4ec06d322996..bc695ad81c7d 100644 --- a/drivers/devfreq/exynos/Makefile +++ b/drivers/devfreq/exynos/Makefile @@ -1,4 +1,2 @@ # Exynos DEVFREQ Drivers obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o -obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos_ppmu.o exynos4_bus.o -obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos_ppmu.o exynos5_bus.o diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c deleted file mode 100644 index da9509205169.. --- a/drivers/devfreq/exynos/exynos4_bus.c +++ /dev/null @@ -1,1055 +0,0 @@ -/* drivers/devfreq/exynos4210_memorybus.c - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. - * http://www.samsung.com/ - * MyungJoo Ham - * - * EXYNOS4 - Memory/Bus clock frequency scaling support in DEVFREQ framework - * This version supports EXYNOS4210 only. This changes bus frequencies - * and vddint voltages. Exynos4412/4212 should be able to be supported - * with minor modifications. - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "exynos_ppmu.h" -#include "exynos4_bus.h" - -#define MAX_SAFEVOLT 120 /* 1.2V */ - -enum exynos4_busf_type { - TYPE_BUSF_EXYNOS4210, - TYPE_BUSF_EXYNOS4x12, -}; - -/* Assume that the bus is saturated if the utilization is 40% */ -#define BUS_SATURATION_RATIO 40 - -enum busclk_level_idx { - LV_0 = 0, - LV_1, - LV_2, - LV_3, - LV_4, - _LV_END -}; - -enum exynos_ppmu_idx { - PPMU_DMC0, - PPMU_DMC1, - PPMU_END, -}; - -#define EX4210_LV_MAX LV_2 -#define EX4x12_LV_MAX LV_4 -#define EX4210_LV_NUM (LV_2 + 1) -#define EX4x12_LV_NUM (LV_4 + 1) - -/** - * struct busfreq_opp_info - opp information for bus - * @rate: Frequency in hertz - * @volt: Voltage in microvolts corresponding to this OPP - */ -struct busfreq_opp_info { - unsigned long rate; - unsigned long volt; -}; - -struct busfreq_data { - enum exynos4_busf_type type; - struct device *dev; - struct devfreq *devfreq; - bool disabled; - struct regulator *vdd_int; - struct regulator *vdd_mif; /* Exynos4412/4212 only */ - struct busfreq_opp_info curr_oppinfo; -
[PATCH v4 13/20] ARM: dts: Add bus nodes using VDD_INT for Exynos3250
This patch adds the bus nodes using VDD_INT for Exynos3250 SoC. Exynos3250 has following AXI buses to translate data between DRAM and sub-blocks. Following list specifies the detailed relation between DRAM and sub-blocks: - ACLK400 clock for MCUISP - ACLK266 clock for ISP - ACLK200 clock for FSYS - ACLK160 clock for LCD0 - ACLK100 clock for PERIL - GDL clock for LEFTBUS - GDR clock for RIGHTBUS - SCLK_MFC clock for MFC Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos3250.dtsi | 147 ++ 1 file changed, 147 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi index 262b3b1995fd..5cc98cf13173 100644 --- a/arch/arm/boot/dts/exynos3250.dtsi +++ b/arch/arm/boot/dts/exynos3250.dtsi @@ -735,6 +735,153 @@ opp-microvolt = <875000>; }; }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_lcd0: bus_lcd0 { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_160>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_200>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_mcuisp: bus_mcuisp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>; + clock-names = "bus"; + operating-points-v2 = <&bus_mcuisp_opp_table>; + status = "disabled"; + }; + + bus_isp: bus_isp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_266>; + clock-names = "bus"; + operating-points-v2 = <&bus_isp_opp_table>; + status = "disabled"; + }; + + bus_peril: bus_peril { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peril_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp@5000 { + opp-hz = /bits/ 64 <5000>; + opp-microvolt = <90>; + }; + opp@8000 { + opp-hz = /bits/ 64 <8000>; + opp-microvolt = <90>; + }; + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <100>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <100>; +
[PATCH v4 12/20] MAINTAINERS: Add samsung bus frequency driver entry
This patch adds the 'SAMSUNG BUS FREQUENCY DRIVER' entry to review the patches as supporter. Patches will be picked up by DEVFREQ maintainer on devfreq git repository. Signed-off-by: Chanwoo Choi --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ff2d20173d98..89e645688a3c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3434,6 +3434,15 @@ F: drivers/devfreq/devfreq-event.c F: include/linux/devfreq-event.h F: Documentation/devicetree/bindings/devfreq/event/ +SAMSUNG BUS FREQUENCY DRIVER +M: Chanwoo Choi +L: linux...@vger.kernel.org +L: linux-samsung-...@vger.kernel.org +T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git +S: Supported +F: drivers/devfreq/exynos/exynos-bus.c +F: Documentation/devicetree/bindings/devfreq/exynos-bus.txt + DEVICE NUMBER REGISTRY M: Torben Mathiasen W: http://lanana.org/docs/device-list/index.html -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 16/20] ARM: dts: Add bus nodes using VDD_MIF for Exynos4210
This patch adds the bus nodes for Exynos4210 SoC. Exynos4210 SoC has one power line for all buses to translate data between DRAM and sub-blocks. Following list specifies the detailed relation between DRAM and sub-blocks: - DMC/ACP clock for DMC (Dynamic Memory Controller) - ACLK200 clock for LCD0 - ACLK100 clock for PERIL/PERIR/MFC(PCLK) - ACLK160 clock for CAM/TV/LCD0/LCD1 - ACLK133 clock for FSYS/GPS - GDL/GDR clock for LEFTBUS/RIGHTBUS - SCLK_MFC clock for MFC Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos4210.dtsi | 159 ++ 1 file changed, 159 insertions(+) diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi index c1cb8df6da07..2d9b02967105 100644 --- a/arch/arm/boot/dts/exynos4210.dtsi +++ b/arch/arm/boot/dts/exynos4210.dtsi @@ -257,6 +257,165 @@ power-domains = <&pd_lcd1>; #iommu-cells = <0>; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_acp: bus_acp { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_ACP>; + clock-names = "bus"; + operating-points-v2 = <&bus_acp_opp_table>; + status = "disabled"; + }; + + bus_peri: bus_peri { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peri_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK133>; + clock-names = "bus"; + operating-points-v2 = <&bus_fsys_opp_table>; + status = "disabled"; + }; + + bus_display: bus_display { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK160>; + clock-names = "bus"; + operating-points-v2 = <&bus_display_opp_table>; + status = "disabled"; + }; + + bus_lcd0: bus_lcd0 { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK200>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <1025000>; + }; + opp@26700 { + opp-hz = /bits/ 64 <26700>; + opp-microvolt = <105>; + }; + opp@4 { + opp-hz = /bits/ 64 <4>; + opp-microvolt = <115>; + }; + }; + + bus_acp_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp@13400 { + opp-hz = /bits/ 64 <13400>; + }; + opp@16000 { + opp-hz = /bits/ 64 <16000>; + }; + opp@2 { +
[PATCH v4 15/20] ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
This patch adds the bus nodes using VDD_INT for Exynos4x12 SoC. Exynos4x12 has the following AXI buses to translate data between DRAM and sub-blocks. Following list specifies the detailed relation between DRAM and sub-blocks: - ACLK100 clock for PERIL/PERIR/MFC(PCLK) - ACLK160 clock for CAM/TV/LCD : The minimum clock of ACLK160 should be over 160MHz. When drop the clock under 160MHz, show the broken image. - ACLK133 clock for FSYS - GDL clock for LEFTBUS - GDR clock for RIGHTBUS - SCLK_MFC clock for MFC Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos4x12.dtsi | 106 ++ 1 file changed, 106 insertions(+) diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi index 99a0f4ca3d47..e5173107ed44 100644 --- a/arch/arm/boot/dts/exynos4x12.dtsi +++ b/arch/arm/boot/dts/exynos4x12.dtsi @@ -349,6 +349,112 @@ opp-hz = /bits/ 64 <26700>; }; }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_display: bus_display { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK160>; + clock-names = "bus"; + operating-points-v2 = <&bus_display_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK133>; + clock-names = "bus"; + operating-points-v2 = <&bus_fsys_opp_table>; + status = "disabled"; + }; + + bus_peri: bus_peri { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peri_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table3 { + compatible = "operating-points-v2"; + opp-shared; + + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <90>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <925000>; + }; + opp@16000 { + opp-hz = /bits/ 64 <16000>; + opp-microvolt = <95>; + }; + opp@2 { + opp-hz = /bits/ 64 <2>; + opp-microvolt = <100>; + }; + }; + + bus_display_opp_table: opp_table4 { + compatible = "operating-points-v2"; + opp-shared; + + opp@16000 { + opp-hz = /bits/ 64 <16000>; + }; + opp@2 { + opp-hz = /bits/ 64 <2>; + }; + }; + + bus_fsys_opp_table: opp_table5 { + compatible = "operating-points-v2"; + opp-shared; + + opp@1 { + opp-hz = /bits/ 64 <1>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + }; + }; + + bus_peri_opp_table: opp_table6 { + compatible = "operating-points-v2"; + opp-shared; + + opp@5000 { + opp-hz = /bits/ 64 <5000>; + }; + opp@1 { + opp-hz = /bits/ 64 <1>; + }; + }; }; &combiner { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 17/20] ARM: dts: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU nodes
This patch adds the exynos4412-ppmu-common.dtsi to remove duplicate PPMU nodes because exynos3250-rinato/monk, exynos4412-trats2/odroidu3 has the same PPMU device tree node. Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos3250-monk.dts | 41 +--- arch/arm/boot/dts/exynos3250-rinato.dts | 41 +--- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 + arch/arm/boot/dts/exynos4412-ppmu-common.dtsi | 50 + arch/arm/boot/dts/exynos4412-trats2.dts | 41 +--- 5 files changed, 54 insertions(+), 120 deletions(-) create mode 100644 arch/arm/boot/dts/exynos4412-ppmu-common.dtsi diff --git a/arch/arm/boot/dts/exynos3250-monk.dts b/arch/arm/boot/dts/exynos3250-monk.dts index 456844a81189..a4e525e5e6e4 100644 --- a/arch/arm/boot/dts/exynos3250-monk.dts +++ b/arch/arm/boot/dts/exynos3250-monk.dts @@ -14,6 +14,7 @@ /dts-v1/; #include "exynos3250.dtsi" +#include "exynos4412-ppmu-common.dtsi" #include #include #include @@ -464,46 +465,6 @@ status = "okay"; }; -&ppmu_dmc0 { - status = "okay"; - - events { - ppmu_dmc0_3: ppmu-event3-dmc0 { - event-name = "ppmu-event3-dmc0"; - }; - }; -}; - -&ppmu_dmc1 { - status = "okay"; - - events { - ppmu_dmc1_3: ppmu-event3-dmc1 { - event-name = "ppmu-event3-dmc1"; - }; - }; -}; - -&ppmu_leftbus { - status = "okay"; - - events { - ppmu_leftbus_3: ppmu-event3-leftbus { - event-name = "ppmu-event3-leftbus"; - }; - }; -}; - -&ppmu_rightbus { - status = "okay"; - - events { - ppmu_rightbus_3: ppmu-event3-rightbus { - event-name = "ppmu-event3-rightbus"; - }; - }; -}; - &xusbxti { clock-frequency = <2400>; }; diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts b/arch/arm/boot/dts/exynos3250-rinato.dts index d6bb990ce931..2a1c22598fdc 100644 --- a/arch/arm/boot/dts/exynos3250-rinato.dts +++ b/arch/arm/boot/dts/exynos3250-rinato.dts @@ -14,6 +14,7 @@ /dts-v1/; #include "exynos3250.dtsi" +#include "exynos4412-ppmu-common.dtsi" #include #include #include @@ -641,46 +642,6 @@ status = "okay"; }; -&ppmu_dmc0 { - status = "okay"; - - events { - ppmu_dmc0_3: ppmu-event3-dmc0 { - event-name = "ppmu-event3-dmc0"; - }; - }; -}; - -&ppmu_dmc1 { - status = "okay"; - - events { - ppmu_dmc1_3: ppmu-event3-dmc1 { - event-name = "ppmu-event3-dmc1"; - }; - }; -}; - -&ppmu_leftbus { - status = "okay"; - - events { - ppmu_leftbus_3: ppmu-event3-leftbus { - event-name = "ppmu-event3-leftbus"; - }; - }; -}; - -&ppmu_rightbus { - status = "okay"; - - events { - ppmu_rightbus_3: ppmu-event3-rightbus { - event-name = "ppmu-event3-rightbus"; - }; - }; -}; - &xusbxti { clock-frequency = <2400>; }; diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index 395c3ca9601e..cda1ec86dfba 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -11,6 +11,7 @@ #include #include #include "exynos4412.dtsi" +#include "exynos4412-ppmu-common.dtsi" #include / { diff --git a/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi b/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi new file mode 100644 index ..16e4b77d8cb1 --- /dev/null +++ b/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi @@ -0,0 +1,50 @@ +/* + * Device tree sources for Exynos4412 PPMU common device tree + * + * Copyright (C) 2015 Samsung Electronics + * Author: Chanwoo Choi + * + * 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. + */ + +&ppmu_dmc0 { + status = "okay"; + + events { + ppmu_dmc0_3: ppmu-event3-dmc0 { + event-name = "ppmu-event3-dmc0"; + }; + }; +}; + +&ppmu_dmc1 { + status = "okay"; + + events { + ppmu_dmc1_3: ppmu-event3-dmc1 { + event-name = "ppmu-event3-dmc1"; + };
[PATCH v4 20/20] ARM: dts: Add support of bus frequency for exynos4412-trats/odroidu3
THis patch adds the bus device tree nodes for both MIF (Memory) and INT (Internal) block to enable the bus frequency. The DMC bus is parent device in MIF block using VDD_MIF and the LEFTBUS bus is parent device in INT block using VDD_INT. Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 47 + arch/arm/boot/dts/exynos4412-trats2.dts | 47 + 2 files changed, 94 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index 7bd65026761e..cb7e54df6a23 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -109,6 +109,53 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + +&bus_acp { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_c2c { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; +}; + +&bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_display { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_peri { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; }; diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 92438eb6eec6..9f33c651e37a 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -289,6 +289,53 @@ status = "okay"; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + +&bus_acp { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_c2c { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; +}; + +&bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_display { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_peri { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 19/20] ARM: dts: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3
This patch expands the voltage range of buck1/3 regulator due to as following: - MIF (Memory Interface) bus frequency needs the range of '900 - 1050 mV'. - INT (Internal) bus frequency needs the range of '900 - 1000 mV'. Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index cda1ec86dfba..7bd65026761e 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -356,8 +356,8 @@ buck1_reg: BUCK1 { regulator-name = "vdd_mif"; - regulator-min-microvolt = <100>; - regulator-max-microvolt = <100>; + regulator-min-microvolt = <90>; + regulator-max-microvolt = <105>; regulator-always-on; regulator-boot-on; }; @@ -372,7 +372,7 @@ buck3_reg: BUCK3 { regulator-name = "vdd_int"; - regulator-min-microvolt = <100>; + regulator-min-microvolt = <90>; regulator-max-microvolt = <100>; regulator-always-on; regulator-boot-on; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 14/20] ARM: dts: Add bus nodes using VDD_MIF for Exynos4x12
This patch adds the bus nodes using VDD_MIF for Exynos4x12 SoC. Exynos4x12 has the following AXI buses to translate data between DRAM and DMC/ACP/C2C. Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos4x12.dtsi | 68 +++ 1 file changed, 68 insertions(+) diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi index 84a23f962946..99a0f4ca3d47 100644 --- a/arch/arm/boot/dts/exynos4x12.dtsi +++ b/arch/arm/boot/dts/exynos4x12.dtsi @@ -281,6 +281,74 @@ clocks = <&clock CLK_SMMU_LITE1>, <&clock CLK_FIMC_LITE1>; #iommu-cells = <0>; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_acp: bus_acp { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_ACP>; + clock-names = "bus"; + operating-points-v2 = <&bus_acp_opp_table>; + status = "disabled"; + }; + + bus_c2c: bus_c2c { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_C2C>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <90>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <90>; + }; + opp@16000 { + opp-hz = /bits/ 64 <16000>; + opp-microvolt = <90>; + }; + opp@26700 { + opp-hz = /bits/ 64 <26700>; + opp-microvolt = <95>; + }; + opp@4 { + opp-hz = /bits/ 64 <4>; + opp-microvolt = <105>; + }; + }; + + bus_acp_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp@1 { + opp-hz = /bits/ 64 <1>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + }; + opp@16000 { + opp-hz = /bits/ 64 <16000>; + }; + opp@26700 { + opp-hz = /bits/ 64 <26700>; + }; + }; }; &combiner { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 18/20] ARM: dts: Add support of bus frequency using VDD_INT for exynos3250-rinato
This patch adds the bus device-tree nodes of INT (internal) block to enable the bus frequency scaling. The following sub-blocks share the VDD_INT power source: - LEFTBUS (parent device) - RIGHTBUS - PERIL - LCD0 - FSYS - MCUISP / ISP - MFC The LEFTBUS is parent device with devfreq ondemand governor and the rest of devices depend on the LEFTBUS device. Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos3250-rinato.dts | 41 + 1 file changed, 41 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts b/arch/arm/boot/dts/exynos3250-rinato.dts index 2a1c22598fdc..c29d5533ec1f 100644 --- a/arch/arm/boot/dts/exynos3250-rinato.dts +++ b/arch/arm/boot/dts/exynos3250-rinato.dts @@ -154,6 +154,47 @@ status = "okay"; }; +&bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; +}; + +&bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_lcd0 { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_mcuisp { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_isp { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_peril { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v4 00/20] PM / devferq: Add generic exynos bus frequency driver and new passive governor
opp-microvolt = <825000>; }; opp@4 { opp-hz = /bits/ 64 <4>; opp-microvolt = <875000>; }; }; - Usage case to handle the frequency and voltage of bus on runtime in exynos3250-rinato.dts are listed below: &bus_dmc { devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; vdd-supply = <&buck1_reg>; /* VDD_MIF */ status = "okay"; }; 2. Add new passive governor of DEVFREQ framework (patch5-patch7) : This patch-set add the new passive governor for DEVFREQ framework. The existing governors (ondemand, performance and so on) are used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The existing governors are independently used for specific device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers. The passive governor depends on operation of parent driver with existing governors(ondemand, performance and so on) extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree: For exameple, There are one more bus device drivers in Exynos3250 which need to change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, LEFTBUS bus driver is operated as parent with ondemand governor and then the rest device driver with passive governor. The buses of Internal block in exynos3250.dtsi are listed below: When LEFTBUS bus driver (parent) changes the bus frequency with ondemand governor on runtime, the rest bus devices which sharing the same power line (VDD_INT) will change the each bus frequency according to the decision of LEFTBUS bus driver (parent). - INT (Internal) block : VDD_INT |--- LEFTBUS |--- PERIL |--- MFC |--- G3D |--- RIGHTBUS |--- FSYS |--- LCD0 |--- PERIR |--- ISP |--- CAM - The buss of INT block in exynos3250.dtsi are listed below: bus_leftbus: bus_leftbus { compatible = "samsung,exynos-bus"; clocks = <&cmu CLK_DIV_GDL>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; status = "disabled"; }; bus_rightbus: bus_rightbus { compatible = "samsung,exynos-bus"; clocks = <&cmu CLK_DIV_GDR>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; status = "disabled"; }; (Omit the rest bus dt node) - Usage case to handle the frequency and voltage of bus on runtime in exynos3250-rinato.dts are listed below: /* Parent bus device of VDD_INT */ &bus_leftbus { devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; vdd-supply = <&buck3_reg>; status = "okay"; }; /* Passive bus device depend on LEFTBUS bus. */ &bus_rightbus { devfreq = <&bus_leftbus>; /* 'devfreq' property indicates the phandle of parent device. */ status = "okay"; }; (Omit the rest bus dt node) Chanwoo Choi (20): PM / devfreq: exynos: Add generic exynos bus frequency driver PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver ARM: dts: Add DMC bus node for Exynos3250 ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk PM / devfreq: Add new passive governor PM / devfreq: Add devfreq_get_devfreq_by_phandle() PM / devfreq: Show the related information according to governor type PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor PM / devfreq: exynos: Update documentation for bus devices using passive governor PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver MAINTAINERS: Add samsung bus frequency driver entry ARM: dts: Add bus nodes using VDD_INT for Exynos3250 ARM: dts: Add bus nodes using VDD_MIF for Exynos4x12 ARM: dts: Add bus nodes using VDD_INT for Exynos4x12 ARM: dts: Add bus nodes using VDD_MIF for Exynos4210 ARM: dts: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU nodes
[PATCH v4 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
This patch adds the generic exynos bus frequency driver for AMBA AXI bus of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC have the common architecture for bus between DRAM and sub-blocks in SoC. This driver can support the generic bus frequency driver for Exynos SoCs. In devicetree, Each bus block has a bus clock, regulator, operation-point and devfreq-event devices which measure the utilization of each bus block. Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/Kconfig | 15 ++ drivers/devfreq/Makefile| 1 + drivers/devfreq/exynos/Makefile | 1 + drivers/devfreq/exynos/exynos-bus.c | 449 4 files changed, 466 insertions(+) create mode 100644 drivers/devfreq/exynos/exynos-bus.c diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 64281bb2f650..55ec774f794c 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -66,6 +66,21 @@ config DEVFREQ_GOV_USERSPACE comment "DEVFREQ Drivers" +config ARM_EXYNOS_BUS_DEVFREQ + bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" + depends on ARCH_EXYNOS + select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_EVENT_EXYNOS_PPMU + select PM_DEVFREQ_EVENT + select PM_OPP + help + This adds the common DEVFREQ driver for Exynos Memory bus. Exynos + Memory bus has one more group of memory bus (e.g, MIF and INT block). + Each memory bus group could contain many memoby bus block. It reads + PPMU counters of memory controllers by using DEVFREQ-event device + and adjusts the operating frequencies and voltages with OPP support. + This does not yet operate with optimal voltages. + config ARM_EXYNOS4_BUS_DEVFREQ bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile index 5134f9ee983d..375ebbb4fcfb 100644 --- a/drivers/devfreq/Makefile +++ b/drivers/devfreq/Makefile @@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o obj-$(CONFIG_DEVFREQ_GOV_USERSPACE)+= governor_userspace.o # DEVFREQ Drivers +obj-$(CONFIG_ARCH_EXYNOS) += exynos/ obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos/ obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos/ obj-$(CONFIG_ARM_TEGRA_DEVFREQ)+= tegra-devfreq.o diff --git a/drivers/devfreq/exynos/Makefile b/drivers/devfreq/exynos/Makefile index 49bc9175f923..4ec06d322996 100644 --- a/drivers/devfreq/exynos/Makefile +++ b/drivers/devfreq/exynos/Makefile @@ -1,3 +1,4 @@ # Exynos DEVFREQ Drivers +obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos_ppmu.o exynos4_bus.o obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos_ppmu.o exynos5_bus.o diff --git a/drivers/devfreq/exynos/exynos-bus.c b/drivers/devfreq/exynos/exynos-bus.c new file mode 100644 index ..f1bc20839650 --- /dev/null +++ b/drivers/devfreq/exynos/exynos-bus.c @@ -0,0 +1,449 @@ +/* + * Generic Exynos Bus frequency driver with DEVFREQ Framework + * + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Author : Chanwoo Choi + * + * This driver support Exynos Bus frequency feature by using + * DEVFREQ framework and is based on drivers/devfreq/exynos/exynos4_bus.c. + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFAULT_SATURATION_RATIO 40 + +struct exynos_bus { + struct device *dev; + + struct devfreq *devfreq; + struct devfreq_event_dev **edev; + unsigned int edev_count; + struct mutex lock; + + struct dev_pm_opp *curr_opp; + + struct regulator *regulator; + struct clk *clk; + int ratio; +}; + +/* + * Control the devfreq-event device to get the current state of bus + */ +#define exynos_bus_ops_edev(ops) \ +static int exynos_bus_##ops(struct exynos_bus *bus)\ +{ \ + int i, ret; \ + \ + for (i = 0; i < bus->edev_count; i++) { \ + if (!bus->edev[i]) \ + continue; \ + ret = devfreq_event_##ops(bus->edev[i]);\ + if (ret < 0)
Re: [PATCH 1/2] extcon: arizona: Add device bindings for the micd configurations
Hi Charles, On 2015년 12월 11일 02:08, Charles Keepax wrote: > Add device bindings to support configuring the jack detection > configurations. Each configuration needs to specify the connection of > the mic det pins, which micbias should be used and the value of the > micd polarity GPIO required to activate that configuration. > > Signed-off-by: Charles Keepax > --- > drivers/extcon/extcon-arizona.c | 53 > +++-- > 1 file changed, 51 insertions(+), 2 deletions(-) > > diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c > index 8647533..edbf2e1 100644 > --- a/drivers/extcon/extcon-arizona.c > +++ b/drivers/extcon/extcon-arizona.c > @@ -1201,7 +1201,54 @@ static void arizona_micd_set_level(struct arizona > *arizona, int index, > regmap_update_bits(arizona->regmap, reg, mask, level); > } > > -static int arizona_extcon_device_get_pdata(struct arizona *arizona) > +static int arizona_extcon_get_micd_configs(struct device *dev, > +struct arizona *arizona) > +{ > + const char * const prop = "wlf,micd-configs"; > + const int entries_per_config = 3; > + struct arizona_micd_config *micd_configs; > + int nconfs, ret; > + int i, j; > + u32 *vals; > + > + nconfs = device_property_read_u32_array(arizona->dev, prop, NULL, 0); > + if (nconfs <= 0) > + return 0; > + > + vals = kcalloc(nconfs, sizeof(u32), GFP_KERNEL); > + if (!vals) > + return -ENOMEM; > + > + ret = device_property_read_u32_array(arizona->dev, prop, vals, nconfs); > + if (ret < 0) > + goto out; > + > + nconfs /= entries_per_config; > + > + micd_configs = devm_kzalloc(dev, > + nconfs * sizeof(struct arizona_micd_range), > + GFP_KERNEL); > + if (!micd_configs) { > + ret = -ENOMEM; > + goto out; > + } > + > + for (i = 0, j = 0; i < nconfs; ++i) { > + micd_configs[i].src = vals[j++] ? ARIZONA_ACCDET_SRC : 0; > + micd_configs[i].bias = vals[j++]; > + micd_configs[i].gpio = vals[j++]; > + } > + > + arizona->pdata.micd_configs = micd_configs; > + arizona->pdata.num_micd_configs = nconfs; > + > +out: > + kfree(vals); > + return ret; > +} > + > +static int arizona_extcon_device_get_pdata(struct device *dev, > +struct arizona *arizona) > { > struct arizona_pdata *pdata = &arizona->pdata; > unsigned int val = ARIZONA_ACCDET_MODE_HPL; > @@ -1249,6 +1296,8 @@ static int arizona_extcon_device_get_pdata(struct > arizona *arizona) > pdata->jd_gpio5_nopull = device_property_read_bool(arizona->dev, > "wlf,use-jd2-nopull"); > > + arizona_extcon_get_micd_configs(dev, arizona); You need to check out the return value of arizona_extcon_get_micd_configs(). If arizona_extcon_get_micd_configs() returns the error, arizona_extcon_device_get_pdata() don't handle the error case. > + > return 0; > } > > @@ -1270,7 +1319,7 @@ static int arizona_extcon_probe(struct platform_device > *pdev) > return -ENOMEM; > > if (!dev_get_platdata(arizona->dev)) > - arizona_extcon_device_get_pdata(arizona); > + arizona_extcon_device_get_pdata(&pdev->dev, arizona); > > info->micvdd = devm_regulator_get(&pdev->dev, "MICVDD"); > if (IS_ERR(info->micvdd)) { > Except for above comment, Looks good to me. Acked-by: Chanwoo Choi Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] extcon: arizona: Update device tree binding for mic detect configurations
Hi Charles, On 2015년 12월 11일 02:08, Charles Keepax wrote: > Update the device tree binding documentation to include documentation for > the wlf,micd-configs property that is used to specify the configurations > for headset polarity detection (CTIA / OTMP). > > Signed-off-by: Charles Keepax > --- > Documentation/devicetree/bindings/extcon/extcon-arizona.txt | 8 > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > b/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > index 238e10e..fd9b898 100644 > --- a/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > +++ b/Documentation/devicetree/bindings/extcon/extcon-arizona.txt > @@ -37,5 +37,13 @@ Optional properties: > milliseconds. >- wlf,micd-force-micbias : Force MICBIAS continuously on during microphone > detection. > + - wlf,micd-configs : Headset polarity configurations (generally used for > +detection of CTIA / OMTP headsets), the field can be of variable length > +but should always be a multiple of 3 cells long, each three cell group > +represents one polarity configuration. > +The first cell defines the accessory detection pin, zero will use MICDET1 > +and all other values will use MICDET2. > +The second cell represents the MICBIAS to be used. > +The third cell represents the value of the micd-pol-gpio pin. I think that you better to add the example using the 'wlf,micd-configs' to improve the understanding of using this property. because the number of 'wlf,micd-configs' value is not fixed. Also, How about do you add the real example for all arizona properties on separate patch? Thanks, Chanwoo Choi > >- wlf,gpsw : Settings for the general purpose switch > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 20/20] ARM: dts: Add support of bus frequency for exynos4412-trats/odroidu3
On 2015년 12월 11일 16:20, Krzysztof Kozlowski wrote: > On 11.12.2015 14:07, Chanwoo Choi wrote: >> THis patch adds the bus device tree nodes for both MIF (Memory) and INT >> (Internal) block to enable the bus frequency. >> >> The DMC bus is parent device in MIF block using VDD_MIF and the LEFTBUS >> bus is parent device in INT block using VDD_INT. >> >> Signed-off-by: Chanwoo Choi >> [linux.amoon: Tested on Odroid U3] >> Tested-by: Anand Moon >> --- >> arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 47 >> >> arch/arm/boot/dts/exynos4412-trats2.dts | 48 >> + >> 2 files changed, 95 insertions(+) >> >> diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi >> b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi >> index 7bd65026761e..b6818aec7cf9 100644 >> --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi >> +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi >> @@ -501,3 +501,50 @@ >> &watchdog { >> status = "okay"; >> }; >> + >> +&bus_acp { >> +devfreq = <&bus_dmc>; >> +status = "okay"; >> +}; > > I meant put them in proper place, respecting alphabetical order. The 'b' > comes before 'w'. > > As for the new nodes (bus_XXX) your previous sorting (first parent, then > passive) was also okay - it had sense. This is up to you. Just put > everything not at the end of file. OK. I'll reorder them. Thanks for review. [snip] Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
Dear MyungJoo, Almost device tree patches in this series are reviewed by Exynos maintainer. Could you please review this series? Best Regards, Chanwoo Choi On 2015년 12월 11일 14:07, Chanwoo Choi wrote: > This patch adds the generic exynos bus frequency driver for AMBA AXI bus > of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC > have the common architecture for bus between DRAM and sub-blocks in SoC. > This driver can support the generic bus frequency driver for Exynos SoCs. > > In devicetree, Each bus block has a bus clock, regulator, operation-point > and devfreq-event devices which measure the utilization of each bus block. > > Signed-off-by: Chanwoo Choi > [linux.amoon: Tested on Odroid U3] > Tested-by: Anand Moon > --- > drivers/devfreq/Kconfig | 15 ++ > drivers/devfreq/Makefile| 1 + > drivers/devfreq/exynos/Makefile | 1 + > drivers/devfreq/exynos/exynos-bus.c | 449 > > 4 files changed, 466 insertions(+) > create mode 100644 drivers/devfreq/exynos/exynos-bus.c > > diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig > index 64281bb2f650..55ec774f794c 100644 > --- a/drivers/devfreq/Kconfig > +++ b/drivers/devfreq/Kconfig > @@ -66,6 +66,21 @@ config DEVFREQ_GOV_USERSPACE > > comment "DEVFREQ Drivers" > > +config ARM_EXYNOS_BUS_DEVFREQ > + bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" > + depends on ARCH_EXYNOS > + select DEVFREQ_GOV_SIMPLE_ONDEMAND > + select DEVFREQ_EVENT_EXYNOS_PPMU > + select PM_DEVFREQ_EVENT > + select PM_OPP > + help > + This adds the common DEVFREQ driver for Exynos Memory bus. Exynos > + Memory bus has one more group of memory bus (e.g, MIF and INT block). > + Each memory bus group could contain many memoby bus block. It reads > + PPMU counters of memory controllers by using DEVFREQ-event device > + and adjusts the operating frequencies and voltages with OPP support. > + This does not yet operate with optimal voltages. > + > config ARM_EXYNOS4_BUS_DEVFREQ > bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" > depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && > !ARCH_MULTIPLATFORM > diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile > index 5134f9ee983d..375ebbb4fcfb 100644 > --- a/drivers/devfreq/Makefile > +++ b/drivers/devfreq/Makefile > @@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o > obj-$(CONFIG_DEVFREQ_GOV_USERSPACE) += governor_userspace.o > > # DEVFREQ Drivers > +obj-$(CONFIG_ARCH_EXYNOS)+= exynos/ > obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ)+= exynos/ > obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ)+= exynos/ > obj-$(CONFIG_ARM_TEGRA_DEVFREQ) += tegra-devfreq.o > diff --git a/drivers/devfreq/exynos/Makefile b/drivers/devfreq/exynos/Makefile > index 49bc9175f923..4ec06d322996 100644 > --- a/drivers/devfreq/exynos/Makefile > +++ b/drivers/devfreq/exynos/Makefile > @@ -1,3 +1,4 @@ > # Exynos DEVFREQ Drivers > +obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o > obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ)+= exynos_ppmu.o exynos4_bus.o > obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ)+= exynos_ppmu.o exynos5_bus.o > diff --git a/drivers/devfreq/exynos/exynos-bus.c > b/drivers/devfreq/exynos/exynos-bus.c > new file mode 100644 > index 0000..f1bc20839650 > --- /dev/null > +++ b/drivers/devfreq/exynos/exynos-bus.c > @@ -0,0 +1,449 @@ > +/* > + * Generic Exynos Bus frequency driver with DEVFREQ Framework > + * > + * Copyright (c) 2015 Samsung Electronics Co., Ltd. > + * Author : Chanwoo Choi > + * > + * This driver support Exynos Bus frequency feature by using > + * DEVFREQ framework and is based on drivers/devfreq/exynos/exynos4_bus.c. > + * > + * 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 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define DEFAULT_SATURATION_RATIO 40 > + > +struct exynos_bus { > + struct device *dev; > + > + struct devfreq *devfreq; > + struct devfreq_event_dev **edev; > + unsigned int edev_count; > + struct mutex lock; > + > + struct dev_pm_opp *curr_opp; > + > + str
Re: [PATCH v3 18/20] ARM: dts: Add support of bus frequency using VDD_INT for exynos3250-rinato
On 2015년 12월 11일 16:18, Krzysztof Kozlowski wrote: > On 11.12.2015 14:07, Chanwoo Choi wrote: >> This patch adds the bus device-tree node of INT (internal) block >> to enable the bus frequency scaling. The following sub-blocks share >> the VDD_INT power source: >> - LEFTBUS (parent device) >> - RIGHTBUS >> - PERIL >> - LCD0 >> - FSYS >> - MCUISP / ISP >> - MFC >> >> The LEFTBUS is parent device with devfreq ondemand governor >> and the rest devices has the dependency on LEFTBUS bus. > > I pointed this previously. If you wish to leave the sentence in such > form then "rest of" and "have" not "has". It is my mistake. I'll modify it as following your comment: - "and the rest of devices depend on the LEFTBUS device." Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 17/20] ARM: dts: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU node
On 2015년 12월 11일 16:15, Krzysztof Kozlowski wrote: > On 11.12.2015 14:07, Chanwoo Choi wrote: >> This patch adds the exynos4412-ppmu-common.dtsi to duplicate PPMU node > > I think the goal of the patch was to remove duplication of nodes, not to > duplicate them. :) OK. I'll modify both subject and description of this patch. > > Except of that patch is okay: > > Reviewed-by: Krzysztof Kozlowski [snip] Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 00/20] PM / devferq: Add generic exynos bus frequency driver and new passive governor
devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; vdd-supply = <&buck1_reg>; /* VDD_MIF */ status = "okay"; }; 2. Add new passive governor of DEVFREQ framework (patch5-patch7) : This patch-set add the new passive governor for DEVFREQ framework. The existing governors (ondemand, performance and so on) are used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The existing governors are independently used for specific device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers. The passive governor depends on operation of parent driver with existing governors(ondemand, performance and so on) extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree: For exameple, There are one more bus device drivers in Exynos3250 which need to change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, LEFTBUS bus driver is operated as parent with ondemand governor and then the rest device driver with passive governor. The buses of Internal block in exynos3250.dtsi are listed below: When LEFTBUS bus driver (parent) changes the bus frequency with ondemand governor on runtime, the rest bus devices which sharing the same power line (VDD_INT) will change the each bus frequency according to the decision of LEFTBUS bus driver (parent). - INT (Internal) block : VDD_INT |--- LEFTBUS |--- PERIL |--- MFC |--- G3D |--- RIGHTBUS |--- FSYS |--- LCD0 |--- PERIR |--- ISP |--- CAM - The buss of INT block in exynos3250.dtsi are listed below: bus_leftbus: bus_leftbus { compatible = "samsung,exynos-bus"; clocks = <&cmu CLK_DIV_GDL>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; status = "disabled"; }; bus_rightbus: bus_rightbus { compatible = "samsung,exynos-bus"; clocks = <&cmu CLK_DIV_GDR>; clock-names = "bus"; operating-points-v2 = <&bus_leftbus_opp_table>; status = "disabled"; }; (Omit the rest bus dt node) - Usage case to handle the frequency and voltage of bus on runtime in exynos3250-rinato.dts are listed below: /* Parent bus device of VDD_INT */ &bus_leftbus { devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; vdd-supply = <&buck3_reg>; status = "okay"; }; /* Passive bus device depend on LEFTBUS bus. */ &bus_rightbus { devfreq = <&bus_leftbus>; /* 'devfreq' property indicates the phandle of parent device. */ status = "okay"; }; (Omit the rest bus dt node) Chanwoo Choi (20): PM / devfreq: exynos: Add generic exynos bus frequency driver PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver ARM: dts: Add DMC bus node for Exynos3250 ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk PM / devfreq: Add new passive governor PM / devfreq: Add devfreq_get_devfreq_by_phandle() PM / devfreq: Show the related information according to governor type PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor PM / devfreq: exynos: Update documentation for bus devices using passive governor PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver MAINTAINERS: Add samsung bus frequency driver entry ARM: dts: Add bus nodes using VDD_INT for Exynos3250 ARM: dts: Add bus nodes using VDD_MIF for Exynos4x12 ARM: dts: Add bus nodes using VDD_INT for Exynos4x12 ARM: dts: Add bus nodes using VDD_MIF for Exynos4210 ARM: dts: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU node ARM: dts: Add support of bus frequency using VDD_INT for exynos3250-rinato ARM: dts: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3 ARM: dts: Add support of bus frequency for exynos4412-trats/odroidu3 .../devicetree/bindings/devfreq/exynos-bus.txt | 388 +++ MAINTAINERS|9 +
[PATCH v3 03/20] ARM: dts: Add DMC bus node for Exynos3250
This patch adds the DMC (Dynamic Memory Controller) bus node for Exynos3250 SoC. The DMC is an AMBA AXI-compliant slave to interface external JEDEC standard SDRAM devices. The bus includes the OPP tables and the source clock for DMC block. Following list specifies the detailed relation between the clock and DMC block: - The source clock of DMC block : div_dmc Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/exynos3250.dtsi | 34 ++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi index 18e3deffbf48..262b3b1995fd 100644 --- a/arch/arm/boot/dts/exynos3250.dtsi +++ b/arch/arm/boot/dts/exynos3250.dtsi @@ -701,6 +701,40 @@ clock-names = "ppmu"; status = "disabled"; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu_dmc CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp@5000 { + opp-hz = /bits/ 64 <5000>; + opp-microvolt = <80>; + }; + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <80>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <80>; + }; + opp@2 { + opp-hz = /bits/ 64 <2>; + opp-microvolt = <825000>; + }; + opp@4 { + opp-hz = /bits/ 64 <4>; + opp-microvolt = <875000>; + }; + }; }; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 04/20] ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk
This patch adds the DMC (Dynamic Memory Controller) bus frequency node which includes the devfreq-events and regulator properties. The bus frequency support the DVFS (Dynamic Voltage Frequency Scaling) feature with ondemand governor. The devfreq-events (ppmu_dmc0*) can monitor the utilization of DMC bus on runtime and the buck1_reg (VDD_MIF power line) supplies the power to the DMC block. Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos3250-monk.dts | 6 ++ arch/arm/boot/dts/exynos3250-rinato.dts | 6 ++ 2 files changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250-monk.dts b/arch/arm/boot/dts/exynos3250-monk.dts index 443a35085846..456844a81189 100644 --- a/arch/arm/boot/dts/exynos3250-monk.dts +++ b/arch/arm/boot/dts/exynos3250-monk.dts @@ -156,6 +156,12 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; }; diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts b/arch/arm/boot/dts/exynos3250-rinato.dts index 3e64d5dcdd60..d6bb990ce931 100644 --- a/arch/arm/boot/dts/exynos3250-rinato.dts +++ b/arch/arm/boot/dts/exynos3250-rinato.dts @@ -147,6 +147,12 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 06/20] PM / devfreq: Add devfreq_get_devfreq_by_phandle()
This patch adds the new devfreq_get_devfreq_by_phandle() OF helper function which can find the instance of devfreq device by using phandle ("devfreq"). Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/devfreq.c | 44 include/linux/devfreq.h | 9 + 2 files changed, 53 insertions(+) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 15e58779e4c0..78ea4cdaa82c 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "governor.h" static struct class *devfreq_class; @@ -686,6 +687,49 @@ struct devfreq *devm_devfreq_add_device(struct device *dev, } EXPORT_SYMBOL(devm_devfreq_add_device); +#ifdef CONFIG_OF +/* + * devfreq_get_devfreq_by_phandle - Get the devfreq device from devicetree + * @dev - instance to the given device + * @index - index into list of devfreq + * + * return the instance of devfreq device + */ +struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index) +{ + struct device_node *node; + struct devfreq *devfreq; + + if (!dev) + return ERR_PTR(-EINVAL); + + if (!dev->of_node) + return ERR_PTR(-EINVAL); + + node = of_parse_phandle(dev->of_node, "devfreq", index); + if (!node) + return ERR_PTR(-ENODEV); + + mutex_lock(&devfreq_list_lock); + list_for_each_entry(devfreq, &devfreq_list, node) { + if (devfreq->dev.parent + && devfreq->dev.parent->of_node == node) { + mutex_unlock(&devfreq_list_lock); + return devfreq; + } + } + mutex_unlock(&devfreq_list_lock); + + return ERR_PTR(-EPROBE_DEFER); +} +#else +struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index) +{ + return ERR_PTR(-ENODEV); +} +#endif /* CONFIG_OF */ +EXPORT_SYMBOL_GPL(devfreq_get_devfreq_by_phandle); + /** * devm_devfreq_remove_device() - Resource-managed devfreq_remove_device() * @dev: the device to add devfreq feature. diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index 95c54578a1b4..cf972befca2b 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -211,6 +211,9 @@ extern int devm_devfreq_register_opp_notifier(struct device *dev, extern void devm_devfreq_unregister_opp_notifier(struct device *dev, struct devfreq *devfreq); +extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, + int index); + /** * devfreq_update_stats() - update the last_status pointer in struct devfreq * @df:the devfreq instance whose status needs updating @@ -322,6 +325,12 @@ static inline void devm_devfreq_unregister_opp_notifier(struct device *dev, { } +static inline struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, + int index) +{ + return ERR_PTR(-ENODEV); +} + static inline int devfreq_update_stats(struct devfreq *df) { return -EINVAL; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 07/20] PM / devfreq: Show the related information according to governor type
This patch modifies the following sysfs entry of DEVFREQ framework because the devfreq device using passive governor don't need the same information of the devfreq device using rest governor. - polling_interval: passive gov don't use the sampling rate. - available_governors : passive gov don't be changed on runtime in this version. - trans_stat : passive governor don't support trans_stat in this version. Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/devfreq.c | 31 +-- drivers/devfreq/governor.h| 7 +++ drivers/devfreq/governor_passive.c| 1 + drivers/devfreq/governor_performance.c| 1 + drivers/devfreq/governor_powersave.c | 1 + drivers/devfreq/governor_simpleondemand.c | 1 + drivers/devfreq/governor_userspace.c | 1 + include/linux/devfreq.h | 2 ++ 8 files changed, 39 insertions(+), 6 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 78ea4cdaa82c..18ad956fec93 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -597,7 +597,7 @@ struct devfreq *devfreq_add_device(struct device *dev, goto err_init; } - if (!strncmp(devfreq->governor_name, "passive", 7)) { + if (devfreq->governor->type == DEVFREQ_GOV_PASSIVE) { struct devfreq *parent_devfreq = ((struct devfreq_passive_data *)data)->parent; @@ -963,13 +963,23 @@ static ssize_t available_governors_show(struct device *d, struct device_attribute *attr, char *buf) { - struct devfreq_governor *tmp_governor; + struct devfreq *devfreq = to_devfreq(d); ssize_t count = 0; mutex_lock(&devfreq_list_lock); - list_for_each_entry(tmp_governor, &devfreq_governor_list, node) + if (devfreq->governor->type == DEVFREQ_GOV_PASSIVE) { count += scnprintf(&buf[count], (PAGE_SIZE - count - 2), - "%s ", tmp_governor->name); + "%s ", devfreq->governor->name); + } else { + struct devfreq_governor *tmp_governor; + + list_for_each_entry(tmp_governor, &devfreq_governor_list, node) { + if (tmp_governor->type == DEVFREQ_GOV_PASSIVE) + continue; + count += scnprintf(&buf[count], (PAGE_SIZE - count - 2), + "%s ", tmp_governor->name); + } + } mutex_unlock(&devfreq_list_lock); /* Truncate the trailing space */ @@ -1006,6 +1016,11 @@ static DEVICE_ATTR_RO(target_freq); static ssize_t polling_interval_show(struct device *dev, struct device_attribute *attr, char *buf) { + struct devfreq *df = to_devfreq(dev); + + if (df->governor->type == DEVFREQ_GOV_PASSIVE) + return sprintf(buf, "Not Supported.\n"); + return sprintf(buf, "%d\n", to_devfreq(dev)->profile->polling_ms); } @@ -1020,6 +1035,9 @@ static ssize_t polling_interval_store(struct device *dev, if (!df->governor) return -EINVAL; + if (df->governor->type == DEVFREQ_GOV_PASSIVE) + return -EINVAL; + ret = sscanf(buf, "%u", &value); if (ret != 1) return -EINVAL; @@ -1137,11 +1155,12 @@ static ssize_t trans_stat_show(struct device *dev, int i, j; unsigned int max_state = devfreq->profile->max_state; + if (max_state == 0 || devfreq->governor->type == DEVFREQ_GOV_PASSIVE) + return sprintf(buf, "Not Supported.\n"); + if (!devfreq->stop_polling && devfreq_update_status(devfreq, devfreq->previous_freq)) return 0; - if (max_state == 0) - return sprintf(buf, "Not Supported.\n"); len = sprintf(buf, " From : To\n"); len += sprintf(buf + len, " :"); diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index fad7d6321978..43513a58f5bf 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -18,6 +18,13 @@ #define to_devfreq(DEV)container_of((DEV), struct devfreq, dev) +/* Devfreq governor type */ +#define DEVFREQ_GOV_ONDEMAND 0x1 +#define DEVFREQ_GOV_PERFORMANCE0x2 +#define DEVFREQ_GOV_POWERSAVE 0x3 +#define DEVFREQ_GOV_USERSPACE 0x4 +#define DEVFREQ_GOV_PASSIVE0x4 + /* De
[PATCH v3 02/20] PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver
This patch adds the documentation for generic exynos bus frequency driver. Signed-off-by: Chanwoo Choi --- .../devicetree/bindings/devfreq/exynos-bus.txt | 93 ++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-bus.txt diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt new file mode 100644 index ..e32daef328da --- /dev/null +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt @@ -0,0 +1,93 @@ +* Generic Exynos Bus frequency device + +The Samsung Exynos SoC have many buses for data transfer between DRAM +and sub-blocks in SoC. Almost Exynos SoC have the common architecture +for buses. Generally, the each bus of Exynos SoC includes the source clock +and power line and then is able to change the clock according to the usage +of each buses on runtime. When gathering the usage of each buses on runtime, +the driver uses the PPMU (Platform Performance Monitoring Unit) which +is able to measure the current load of sub-blocks. + +There are a little different composition among Exynos SoC because each Exynos +SoC has the different sub-blocks. So, this difference should be specified +in devicetree file instead of each device driver. In result, this driver +is able to support the bus frequency for all Exynos SoCs. + +Required properties for bus device: +- compatible: Should be "samsung,exynos-bus". +- clock-names : the name of clock used by the bus, "bus". +- clocks : phandles for clock specified in "clock-names" property. +- operating-points-v2: the OPP table including frequency/voltage information + to support DVFS (Dynamic Voltage/Frequency Scaling) feature. +- vdd-supply: the regulator to provide the buses with the voltage. +- devfreq-events: the devfreq-event device to monitor the current utilization + of buses. + +Optional properties for bus device: +- exynos,saturation-ratio: the percentage value which is used to calibrate + the performance count against total cycle count. + +Example1: + Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to + power line (regulator). The MIF (Memory Interface) AXI bus is used to + transfer data between DRAM and CPU and uses the VDD_MIF regualtor. + + - power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block + + - MIF bus's frequency/voltage table + --- + |Lv| Freq | Voltage | + --- + |L1| 5 |80 | + |L2| 10 |80 | + |L3| 134000 |80 | + |L4| 20 |825000 | + |L5| 40 |875000 | + --- + +Example2 : + The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi + is listed below: + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu_dmc CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp@5000 { + opp-hz = /bits/ 64 <5000>; + opp-microvolt = <80>; + }; + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <80>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <80>; + }; + opp@2 { + opp-hz = /bits/ 64 <2>; + opp-microvolt = <825000>; + }; + opp@4 { + opp-hz = /bits/ 64 <4>; + opp-microvolt = <875000>; + }; + }; + + Usage case to handle the frequency and voltage of bus on runtime + in exynos3250-rinato.dts is listed below: + + &bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; /* VDD_MIF */ + status = "okay"; + }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 09/20] PM / devfreq: exynos: Update documentation for bus devices using passive governor
This patch updates the documentation for passive bus devices and adds the detailed example of Exynos3250. Signed-off-by: Chanwoo Choi --- .../devicetree/bindings/devfreq/exynos-bus.txt | 250 - 1 file changed, 247 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt index e32daef328da..a251f9120561 100644 --- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt @@ -8,22 +8,46 @@ of each buses on runtime. When gathering the usage of each buses on runtime, the driver uses the PPMU (Platform Performance Monitoring Unit) which is able to measure the current load of sub-blocks. +The Exynos SoC includes the various sub-blocks which have the each AXI bus. +The each AXI bus has the owned source clock but, has not the only owned +power line. The power line might be shared among one more sub-blocks. +So, we can divide into two type of device as the role of each sub-block. +There are two type of bus devices as following: +- parent bus device +- passive bus device + +Basically, parent and passive bus device share the same power line. +The parent bus device can only change the voltage of shared power line +and the rest bus devices (passive bus device) depend on the decision of +the parent bus device. If there are three blocks which share the VDD_xxx +power line, Only one block should be parent device and then the rest blocks +should depend on the parent device as passive device. + + VDD_xxx |--- A block (parent) + |--- B block (passive) + |--- C block (passive) + There are a little different composition among Exynos SoC because each Exynos SoC has the different sub-blocks. So, this difference should be specified in devicetree file instead of each device driver. In result, this driver is able to support the bus frequency for all Exynos SoCs. -Required properties for bus device: +Required properties for all bus devices: - compatible: Should be "samsung,exynos-bus". - clock-names : the name of clock used by the bus, "bus". - clocks : phandles for clock specified in "clock-names" property. - operating-points-v2: the OPP table including frequency/voltage information to support DVFS (Dynamic Voltage/Frequency Scaling) feature. + +Required properties only for parent bus device: - vdd-supply: the regulator to provide the buses with the voltage. - devfreq-events: the devfreq-event device to monitor the current utilization of buses. -Optional properties for bus device: +Required properties only for passive bus device: +- devfreq: the parent bus device. + +Optional properties only for parent bus device: - exynos,saturation-ratio: the percentage value which is used to calibrate the performance count against total cycle count. @@ -32,7 +56,20 @@ Example1: power line (regulator). The MIF (Memory Interface) AXI bus is used to transfer data between DRAM and CPU and uses the VDD_MIF regualtor. - - power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block + - MIF (Memory Interface) block + : VDD_MIF |--- DMC (Dynamic Memory Controller) + + - INT (Internal) block + : VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC + |--- G3D + |--- RIGHTBUS + |--- FSYS + |--- LCD0 + |--- PERIR + |--- ISP + |--- CAM - MIF bus's frequency/voltage table --- @@ -45,6 +82,24 @@ Example1: |L5| 40 |875000 | --- + - INT bus's frequency/voltage table + -- + |Block|LEFTBUS|RIGHTBUS|MCUISP |ISP|PERIL ||VDD_INT | + | name| |LCD0| | | ||| + | | |FSYS| | | ||| + | | |MFC | | | ||| + -- + |Mode |*parent|passive |passive|passive|passive||| + -- + |Lv |Frequency ||Voltage | + -- + |L1 |5 |5 |5 |5 |5 ||90 | + |L2 |8 |8 |8 |8 |8 ||90 | + |L3 |10 |10 |10 |10 |10 ||100 | + |L4 |134000 |134000 |20 |20 | ||100 | + |L5 |20 |20 |40 |30 | ||100 | + -- + Example2 : The bus
[PATCH v3 08/20] PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor
This patch adds the support of bus frequency feature for sub-blocks which share the one power line. If each bus depends on the power line, each bus is not able to change the voltage by oneself. To optimize the power-consumption on runtime, some buses using the same power line should change the source clock and regulator at the same time. So, this patch uses the passive governor to support the bus frequency for all buses which sharing the one power line. For example, Exynos3250 include the two power line for AXI buses as following: : VDD_MIF : MIF (Memory Interface) provide the DMC (Dynamic Memory Controller) with the power (regulator). : VDD_INT : INT (Internal) provide the various sub-blocks with the power (regulator). Each bus is included in as follwoing block. In the case of VDD_MIF, only DMC bus use the power line. So, there is no any depencency between buese. But, in the case of VDD_INT, various buses share the one power line of VDD_INT. We need to make the depenency between buses. When using passive governor, there is no problem to support the bus frequency as DVFS for all buses. One bus should be operated as the parent bus device which gathering the current load of INT block and then decides the new frequency with some governors except of passive governor. After deciding the new frequency by the parent bus device, the rest bus devices will change the each source clock according to new frequency of the parent bus device. - MIF (Memory Interface) block : VDD_MIF |--- DMC - INT (Internal) block : VDD_INT |--- LEFTBUS (parent) |--- PERIL |--- MFC |--- G3D |--- RIGHTBUS |--- FSYS |--- LCD0 |--- PERIR |--- ISP |--- CAM Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/Kconfig | 1 + drivers/devfreq/exynos/exynos-bus.c | 179 2 files changed, 144 insertions(+), 36 deletions(-) diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index d03f635a93e1..88f7cc4539b8 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -79,6 +79,7 @@ config ARM_EXYNOS_BUS_DEVFREQ bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" depends on ARCH_EXYNOS select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_GOV_PASSIVE select DEVFREQ_EVENT_EXYNOS_PPMU select PM_DEVFREQ_EVENT select PM_OPP diff --git a/drivers/devfreq/exynos/exynos-bus.c b/drivers/devfreq/exynos/exynos-bus.c index f1bc20839650..d1c137ea22ca 100644 --- a/drivers/devfreq/exynos/exynos-bus.c +++ b/drivers/devfreq/exynos/exynos-bus.c @@ -91,7 +91,7 @@ static int exynos_bus_get_event(struct exynos_bus *bus, } /* - * Must necessary function for devfreq governor + * Must necessary function for devfreq simple-ondemand governor */ static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags) { @@ -205,57 +205,74 @@ static void exynos_bus_exit(struct device *dev) dev_pm_opp_of_remove_table(dev); } -static int exynos_bus_parse_of(struct device_node *np, - struct exynos_bus *bus) +/* + * Must necessary function for devfreq passive governor + */ +static int exynos_bus_passive_target(struct device *dev, unsigned long *freq, + u32 flags) { - struct device *dev = bus->dev; - unsigned long rate; - int i, ret, count, size; + struct exynos_bus *bus = dev_get_drvdata(dev); + struct dev_pm_opp *new_opp; + unsigned long old_freq, new_freq; + int ret = 0; - /* Get the clock to provide each bus with source clock */ - bus->clk = devm_clk_get(dev, "bus"); - if (IS_ERR(bus->clk)) { - dev_err(dev, "failed to get bus clock\n"); - return PTR_ERR(bus->clk); + /* Get new opp-bus instance according to new bus clock */ + rcu_read_lock(); + new_opp = devfreq_recommended_opp(dev, freq, flags); + if (IS_ERR_OR_NULL(new_opp)) { + dev_err(dev, "failed to get recommed opp instance\n"); + rcu_read_unlock(); + return PTR_ERR(new_opp); } - ret = clk_prepare_enable(bus->clk); - if (ret < 0) { - dev_err(dev, "failed to get enable clock\n"); - return ret; - } + new_freq = dev_pm_opp_get_freq(new_opp); + old_freq = dev_pm_opp_get_freq(bus->curr_opp); + rcu_read_unlock(); - /* Get the freq/voltage OPP table to scale the bus frequency */ - rcu_read_lock(); - ret = dev_pm_opp_of_add_table(dev); + if (old_freq == new_freq) + return 0; + + /* Change the frequency according to new OPP level */ + mutex_lock(&bus->lock); + + ret = clk_set_rate(bus->clk, new_freq
[PATCH v3 11/20] PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver
This patch removes the unused exynos4/5 busfreq driver. Instead, generic exynos-bus frequency driver support the all Exynos SoCs. Signed-off-by: Chanwoo Choi --- drivers/devfreq/Kconfig | 22 - drivers/devfreq/exynos/Makefile |2 - drivers/devfreq/exynos/exynos4_bus.c | 1055 -- drivers/devfreq/exynos/exynos4_bus.h | 110 drivers/devfreq/exynos/exynos5_bus.c | 431 -- drivers/devfreq/exynos/exynos_ppmu.c | 119 drivers/devfreq/exynos/exynos_ppmu.h | 86 --- 7 files changed, 1825 deletions(-) delete mode 100644 drivers/devfreq/exynos/exynos4_bus.c delete mode 100644 drivers/devfreq/exynos/exynos4_bus.h delete mode 100644 drivers/devfreq/exynos/exynos5_bus.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.h diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 88f7cc4539b8..e82b1d8cd200 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -91,28 +91,6 @@ config ARM_EXYNOS_BUS_DEVFREQ and adjusts the operating frequencies and voltages with OPP support. This does not yet operate with optimal voltages. -config ARM_EXYNOS4_BUS_DEVFREQ - bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" - depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM - select DEVFREQ_GOV_SIMPLE_ONDEMAND - select PM_OPP - help - This adds the DEVFREQ driver for Exynos4210 memory bus (vdd_int) - and Exynos4212/4412 memory interface and bus (vdd_mif + vdd_int). - It reads PPMU counters of memory controllers and adjusts - the operating frequencies and voltages with OPP support. - This does not yet operate with optimal voltages. - -config ARM_EXYNOS5_BUS_DEVFREQ - tristate "ARM Exynos5250 Bus DEVFREQ Driver" - depends on SOC_EXYNOS5250 - select DEVFREQ_GOV_SIMPLE_ONDEMAND - select PM_OPP - help - This adds the DEVFREQ driver for Exynos5250 bus interface (vdd_int). - It reads PPMU counters of memory controllers and adjusts the - operating frequencies and voltages with OPP support. - config ARM_TEGRA_DEVFREQ tristate "Tegra DEVFREQ Driver" depends on ARCH_TEGRA_124_SOC diff --git a/drivers/devfreq/exynos/Makefile b/drivers/devfreq/exynos/Makefile index 4ec06d322996..bc695ad81c7d 100644 --- a/drivers/devfreq/exynos/Makefile +++ b/drivers/devfreq/exynos/Makefile @@ -1,4 +1,2 @@ # Exynos DEVFREQ Drivers obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o -obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos_ppmu.o exynos4_bus.o -obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos_ppmu.o exynos5_bus.o diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c deleted file mode 100644 index da9509205169.. --- a/drivers/devfreq/exynos/exynos4_bus.c +++ /dev/null @@ -1,1055 +0,0 @@ -/* drivers/devfreq/exynos4210_memorybus.c - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. - * http://www.samsung.com/ - * MyungJoo Ham - * - * EXYNOS4 - Memory/Bus clock frequency scaling support in DEVFREQ framework - * This version supports EXYNOS4210 only. This changes bus frequencies - * and vddint voltages. Exynos4412/4212 should be able to be supported - * with minor modifications. - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "exynos_ppmu.h" -#include "exynos4_bus.h" - -#define MAX_SAFEVOLT 120 /* 1.2V */ - -enum exynos4_busf_type { - TYPE_BUSF_EXYNOS4210, - TYPE_BUSF_EXYNOS4x12, -}; - -/* Assume that the bus is saturated if the utilization is 40% */ -#define BUS_SATURATION_RATIO 40 - -enum busclk_level_idx { - LV_0 = 0, - LV_1, - LV_2, - LV_3, - LV_4, - _LV_END -}; - -enum exynos_ppmu_idx { - PPMU_DMC0, - PPMU_DMC1, - PPMU_END, -}; - -#define EX4210_LV_MAX LV_2 -#define EX4x12_LV_MAX LV_4 -#define EX4210_LV_NUM (LV_2 + 1) -#define EX4x12_LV_NUM (LV_4 + 1) - -/** - * struct busfreq_opp_info - opp information for bus - * @rate: Frequency in hertz - * @volt: Voltage in microvolts corresponding to this OPP - */ -struct busfreq_opp_info { - unsigned long rate; - unsigned long volt; -}; - -struct busfreq_data { - enum exynos4_busf_type type; - struct device *dev; - struct devfreq *devfreq; - bool disabled; - struct regulator *vdd_int; - struct regulator *vdd_mif; /* Exynos4412/4212 only */ - struct busfreq_opp_info curr_oppinfo; -
[PATCH v3 10/20] PM / devfreq: exynos: Add the detailed correlation between sub-blocks and power line
This patch adds the detailed corrleation between sub-blocks and power line for Exynos3250, Exynos4210 and Exynos4x12. Signed-off-by: Chanwoo Choi --- .../devicetree/bindings/devfreq/exynos-bus.txt | 51 ++ 1 file changed, 51 insertions(+) diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt index a251f9120561..f3a32b310dc7 100644 --- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt @@ -51,6 +51,57 @@ Optional properties only for parent bus device: - exynos,saturation-ratio: the percentage value which is used to calibrate the performance count against total cycle count. +Detailed correlation between sub-blocks and power line according to Exynos SoC: +- In case of Exynos3250, there are two power line as following: + VDD_MIF |--- DMC + + VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC + |--- G3D + |--- RIGHTBUS + |--- PERIR + |--- FSYS + |--- LCD0 + |--- PERIR + |--- ISP + |--- CAM + +- In case of Exynos4210, there is one power line as following: + VDD_INT |--- DMC (parent device) + |--- LEFTBUS + |--- PERIL + |--- MFC(L) + |--- G3D + |--- TV + |--- LCD0 + |--- RIGHTBUS + |--- PERIR + |--- MFC(R) + |--- CAM + |--- FSYS + |--- GPS + |--- LCD0 + |--- LCD1 + +- In case of Exynos4x12, there are two power line as following: + VDD_MIF |--- DMC + + VDD_INT |--- LEFTBUS (parent device) + |--- PERIL + |--- MFC(L) + |--- G3D + |--- TV + |--- IMAGE + |--- RIGHTBUS + |--- PERIR + |--- MFC(R) + |--- CAM + |--- FSYS + |--- GPS + |--- LCD0 + |--- ISP + Example1: Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to power line (regulator). The MIF (Memory Interface) AXI bus is used to -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 12/20] MAINTAINERS: Add samsung bus frequency driver entry
This patch adds the 'SAMSUNG BUS FREQUENCY DRIVER' entry to review the patches as supporter. Patches will be picked up by DEVFREQ maintainer on devfreq git repository. Signed-off-by: Chanwoo Choi --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ff2d20173d98..89e645688a3c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3434,6 +3434,15 @@ F: drivers/devfreq/devfreq-event.c F: include/linux/devfreq-event.h F: Documentation/devicetree/bindings/devfreq/event/ +SAMSUNG BUS FREQUENCY DRIVER +M: Chanwoo Choi +L: linux...@vger.kernel.org +L: linux-samsung-...@vger.kernel.org +T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git +S: Supported +F: drivers/devfreq/exynos/exynos-bus.c +F: Documentation/devicetree/bindings/devfreq/exynos-bus.txt + DEVICE NUMBER REGISTRY M: Torben Mathiasen W: http://lanana.org/docs/device-list/index.html -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 13/20] ARM: dts: Add bus nodes using VDD_INT for Exynos3250
This patch adds the bus nodes using VDD_INT for Exynos3250 SoC. Exynos3250 has following AXI buses to translate data between DRAM and sub-blocks. Following list specifies the detailed relation between DRAM and sub-blocks: - ACLK400 clock for MCUISP - ACLK266 clock for ISP - ACLK200 clock for FSYS - ACLK160 clock for LCD0 - ACLK100 clock for PERIL - GDL clock for LEFTBUS - GDR clock for RIGHTBUS - SCLK_MFC clock for MFC Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/exynos3250.dtsi | 147 ++ 1 file changed, 147 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi index 262b3b1995fd..5cc98cf13173 100644 --- a/arch/arm/boot/dts/exynos3250.dtsi +++ b/arch/arm/boot/dts/exynos3250.dtsi @@ -735,6 +735,153 @@ opp-microvolt = <875000>; }; }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_lcd0: bus_lcd0 { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_160>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_200>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_mcuisp: bus_mcuisp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>; + clock-names = "bus"; + operating-points-v2 = <&bus_mcuisp_opp_table>; + status = "disabled"; + }; + + bus_isp: bus_isp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_266>; + clock-names = "bus"; + operating-points-v2 = <&bus_isp_opp_table>; + status = "disabled"; + }; + + bus_peril: bus_peril { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peril_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp@5000 { + opp-hz = /bits/ 64 <5000>; + opp-microvolt = <90>; + }; + opp@8000 { + opp-hz = /bits/ 64 <8000>; + opp-microvolt = <90>; + }; + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <100>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <100>; +
[PATCH v3 15/20] ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
This patch adds the bus noes using VDD_INT for Exynos4x12 SoC. Exynos4x12 has the following AXI buses to translate data between DRAM and sub-blocks. Following list specifies the detailed relation between DRAM and sub-blocks: - ACLK100 clock for PERIL/PERIR/MFC(PCLK) - ACLK160 clock for CAM/TV/LCD : The minimum clock of ACLK160 should be over 160MHz. When drop the clock under 160MHz, show the broken image. - ACLK133 clock for FSYS - GDL clock for LEFTBUS - GDR clock for RIGHTBUS - SCLK_MFC clock for MFC Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- arch/arm/boot/dts/exynos4x12.dtsi | 106 ++ 1 file changed, 106 insertions(+) diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi index 99a0f4ca3d47..e5173107ed44 100644 --- a/arch/arm/boot/dts/exynos4x12.dtsi +++ b/arch/arm/boot/dts/exynos4x12.dtsi @@ -349,6 +349,112 @@ opp-hz = /bits/ 64 <26700>; }; }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_display: bus_display { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK160>; + clock-names = "bus"; + operating-points-v2 = <&bus_display_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK133>; + clock-names = "bus"; + operating-points-v2 = <&bus_fsys_opp_table>; + status = "disabled"; + }; + + bus_peri: bus_peri { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peri_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table3 { + compatible = "operating-points-v2"; + opp-shared; + + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <90>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <925000>; + }; + opp@16000 { + opp-hz = /bits/ 64 <16000>; + opp-microvolt = <95>; + }; + opp@2 { + opp-hz = /bits/ 64 <2>; + opp-microvolt = <100>; + }; + }; + + bus_display_opp_table: opp_table4 { + compatible = "operating-points-v2"; + opp-shared; + + opp@16000 { + opp-hz = /bits/ 64 <16000>; + }; + opp@2 { + opp-hz = /bits/ 64 <2>; + }; + }; + + bus_fsys_opp_table: opp_table5 { + compatible = "operating-points-v2"; + opp-shared; + + opp@1 { + opp-hz = /bits/ 64 <1>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + }; + }; + + bus_peri_opp_table: opp_table6 { + compatible = "operating-points-v2"; + opp-shared; + + opp@5000 { + opp-hz = /bits/ 64 <5000>; + }; + opp@1 { + opp-hz = /bits/ 64 <1>; + }; + }; }; &combiner { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 14/20] ARM: dts: Add bus nodes using VDD_MIF for Exynos4x12
This patch adds the bus noes using VDD_MIF for Exynos4x12 SoC. Exynos4x12 has the following AXI buses to translate data between DRAM and DMC/ACP/C2C. Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- arch/arm/boot/dts/exynos4x12.dtsi | 68 +++ 1 file changed, 68 insertions(+) diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi index 84a23f962946..99a0f4ca3d47 100644 --- a/arch/arm/boot/dts/exynos4x12.dtsi +++ b/arch/arm/boot/dts/exynos4x12.dtsi @@ -281,6 +281,74 @@ clocks = <&clock CLK_SMMU_LITE1>, <&clock CLK_FIMC_LITE1>; #iommu-cells = <0>; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_acp: bus_acp { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_ACP>; + clock-names = "bus"; + operating-points-v2 = <&bus_acp_opp_table>; + status = "disabled"; + }; + + bus_c2c: bus_c2c { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_C2C>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp@1 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <90>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <90>; + }; + opp@16000 { + opp-hz = /bits/ 64 <16000>; + opp-microvolt = <90>; + }; + opp@26700 { + opp-hz = /bits/ 64 <26700>; + opp-microvolt = <95>; + }; + opp@4 { + opp-hz = /bits/ 64 <4>; + opp-microvolt = <105>; + }; + }; + + bus_acp_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp@1 { + opp-hz = /bits/ 64 <1>; + }; + opp@13400 { + opp-hz = /bits/ 64 <13400>; + }; + opp@16000 { + opp-hz = /bits/ 64 <16000>; + }; + opp@26700 { + opp-hz = /bits/ 64 <26700>; + }; + }; }; &combiner { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 17/20] ARM: dts: Add exynos4412-ppmu-common dtsi to delete duplicate PPMU node
This patch adds the exynos4412-ppmu-common.dtsi to duplicate PPMU node because exynos3250-rinato/monk, exynos4412-trats2/odroidu3 has the same PPMU device tree node. Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/exynos3250-monk.dts | 41 + arch/arm/boot/dts/exynos3250-rinato.dts | 41 + arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 + arch/arm/boot/dts/exynos4412-ppmu-common.dtsi | 49 + arch/arm/boot/dts/exynos4412-trats2.dts | 41 + 5 files changed, 53 insertions(+), 120 deletions(-) create mode 100644 arch/arm/boot/dts/exynos4412-ppmu-common.dtsi diff --git a/arch/arm/boot/dts/exynos3250-monk.dts b/arch/arm/boot/dts/exynos3250-monk.dts index 456844a81189..a4e525e5e6e4 100644 --- a/arch/arm/boot/dts/exynos3250-monk.dts +++ b/arch/arm/boot/dts/exynos3250-monk.dts @@ -14,6 +14,7 @@ /dts-v1/; #include "exynos3250.dtsi" +#include "exynos4412-ppmu-common.dtsi" #include #include #include @@ -464,46 +465,6 @@ status = "okay"; }; -&ppmu_dmc0 { - status = "okay"; - - events { - ppmu_dmc0_3: ppmu-event3-dmc0 { - event-name = "ppmu-event3-dmc0"; - }; - }; -}; - -&ppmu_dmc1 { - status = "okay"; - - events { - ppmu_dmc1_3: ppmu-event3-dmc1 { - event-name = "ppmu-event3-dmc1"; - }; - }; -}; - -&ppmu_leftbus { - status = "okay"; - - events { - ppmu_leftbus_3: ppmu-event3-leftbus { - event-name = "ppmu-event3-leftbus"; - }; - }; -}; - -&ppmu_rightbus { - status = "okay"; - - events { - ppmu_rightbus_3: ppmu-event3-rightbus { - event-name = "ppmu-event3-rightbus"; - }; - }; -}; - &xusbxti { clock-frequency = <2400>; }; diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts b/arch/arm/boot/dts/exynos3250-rinato.dts index d6bb990ce931..2a1c22598fdc 100644 --- a/arch/arm/boot/dts/exynos3250-rinato.dts +++ b/arch/arm/boot/dts/exynos3250-rinato.dts @@ -14,6 +14,7 @@ /dts-v1/; #include "exynos3250.dtsi" +#include "exynos4412-ppmu-common.dtsi" #include #include #include @@ -641,46 +642,6 @@ status = "okay"; }; -&ppmu_dmc0 { - status = "okay"; - - events { - ppmu_dmc0_3: ppmu-event3-dmc0 { - event-name = "ppmu-event3-dmc0"; - }; - }; -}; - -&ppmu_dmc1 { - status = "okay"; - - events { - ppmu_dmc1_3: ppmu-event3-dmc1 { - event-name = "ppmu-event3-dmc1"; - }; - }; -}; - -&ppmu_leftbus { - status = "okay"; - - events { - ppmu_leftbus_3: ppmu-event3-leftbus { - event-name = "ppmu-event3-leftbus"; - }; - }; -}; - -&ppmu_rightbus { - status = "okay"; - - events { - ppmu_rightbus_3: ppmu-event3-rightbus { - event-name = "ppmu-event3-rightbus"; - }; - }; -}; - &xusbxti { clock-frequency = <2400>; }; diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index 395c3ca9601e..cda1ec86dfba 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -11,6 +11,7 @@ #include #include #include "exynos4412.dtsi" +#include "exynos4412-ppmu-common.dtsi" #include / { diff --git a/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi b/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi new file mode 100644 index ..653904c5d479 --- /dev/null +++ b/arch/arm/boot/dts/exynos4412-ppmu-common.dtsi @@ -0,0 +1,49 @@ +/* + * Device tree sources for Exynos4412 PPMU common device tree + * + * Copyright (c) 2015 Chanwoo Choi + * + * 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. + */ + +&ppmu_dmc0 { + status = "okay"; + + events { + ppmu_dmc0_3: ppmu-event3-dmc0 { + event-name = "ppmu-event3-dmc0"; + }; + }; +}; + +&ppmu_dmc1 { + status = "okay"; + + events { + ppmu_dmc1_3: ppmu-event3-dmc1 { + event-name = "ppmu-event3-dmc1"; + }; + }; +}; + +&ppmu_leftbus { + status = &quo
[PATCH v3 16/20] ARM: dts: Add bus nodes using VDD_MIF for Exynos4210
This patch adds the bus nodes for Exynos4210 SoC. Exynos4210 SoC has one power line for all buses to translate data between DRAM and sub-blocks. Following list specifies the detailed relation between DRAM and sub-blocks: - DMC/ACP clock for DMC (Dynamic Memory Controller) - ACLK200 clock for LCD0 - ACLK100 clock for PERIL/PERIR/MFC(PCLK) - ACLK160 clock for CAM/TV/LCD0/LCD1 - ACLK133 clock for FSYS/GPS - GDL/GDR clock for LEFTBUS/RIGHTBUS - SCLK_MFC clock for MFC Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/exynos4210.dtsi | 159 ++ 1 file changed, 159 insertions(+) diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi index c1cb8df6da07..2d9b02967105 100644 --- a/arch/arm/boot/dts/exynos4210.dtsi +++ b/arch/arm/boot/dts/exynos4210.dtsi @@ -257,6 +257,165 @@ power-domains = <&pd_lcd1>; #iommu-cells = <0>; }; + + bus_dmc: bus_dmc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_DMC>; + clock-names = "bus"; + operating-points-v2 = <&bus_dmc_opp_table>; + status = "disabled"; + }; + + bus_acp: bus_acp { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_ACP>; + clock-names = "bus"; + operating-points-v2 = <&bus_acp_opp_table>; + status = "disabled"; + }; + + bus_peri: bus_peri { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peri_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK133>; + clock-names = "bus"; + operating-points-v2 = <&bus_fsys_opp_table>; + status = "disabled"; + }; + + bus_display: bus_display { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK160>; + clock-names = "bus"; + operating-points-v2 = <&bus_display_opp_table>; + status = "disabled"; + }; + + bus_lcd0: bus_lcd0 { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK200>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_dmc_opp_table: opp_table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp@13400 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <1025000>; + }; + opp@26700 { + opp-hz = /bits/ 64 <26700>; + opp-microvolt = <105>; + }; + opp@4 { + opp-hz = /bits/ 64 <4>; + opp-microvolt = <115>; + }; + }; + + bus_acp_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp@13400 { + opp-hz = /bits/ 64 <13400>; + }; + opp@16000 { + opp-hz = /bits/ 64 <16000>; + }; + opp@2 { + opp-hz = /bits/ 64
[PATCH v3 20/20] ARM: dts: Add support of bus frequency for exynos4412-trats/odroidu3
THis patch adds the bus device tree nodes for both MIF (Memory) and INT (Internal) block to enable the bus frequency. The DMC bus is parent device in MIF block using VDD_MIF and the LEFTBUS bus is parent device in INT block using VDD_INT. Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 47 arch/arm/boot/dts/exynos4412-trats2.dts | 48 + 2 files changed, 95 insertions(+) diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index 7bd65026761e..b6818aec7cf9 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -501,3 +501,50 @@ &watchdog { status = "okay"; }; + +&bus_acp { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_c2c { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + +&bus_display { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; +}; + +&bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_peri { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; +}; diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 92438eb6eec6..0b8aff3b8cb7 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts @@ -1251,3 +1251,51 @@ vtmu-supply = <&ldo10_reg>; status = "okay"; }; + +&bus_acp { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_c2c { + devfreq = <&bus_dmc>; + status = "okay"; +}; + +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + +&bus_display { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + + +&bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; +}; + +&bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_peri { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; +}; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 19/20] ARM: dts: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3
This patch expands the voltage range of buck1/3 regulator due to as following: - MIF (Memory Interface) bus frequency needs the range of '900 - 1050 mV'. - INT (Internal) bus frequency needs the range of '900 - 1000 mV'. Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi index cda1ec86dfba..7bd65026761e 100644 --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi @@ -356,8 +356,8 @@ buck1_reg: BUCK1 { regulator-name = "vdd_mif"; - regulator-min-microvolt = <100>; - regulator-max-microvolt = <100>; + regulator-min-microvolt = <90>; + regulator-max-microvolt = <105>; regulator-always-on; regulator-boot-on; }; @@ -372,7 +372,7 @@ buck3_reg: BUCK3 { regulator-name = "vdd_int"; - regulator-min-microvolt = <100>; + regulator-min-microvolt = <90>; regulator-max-microvolt = <100>; regulator-always-on; regulator-boot-on; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 18/20] ARM: dts: Add support of bus frequency using VDD_INT for exynos3250-rinato
This patch adds the bus device-tree node of INT (internal) block to enable the bus frequency scaling. The following sub-blocks share the VDD_INT power source: - LEFTBUS (parent device) - RIGHTBUS - PERIL - LCD0 - FSYS - MCUISP / ISP - MFC The LEFTBUS is parent device with devfreq ondemand governor and the rest devices has the dependency on LEFTBUS bus. Signed-off-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos3250-rinato.dts | 41 + 1 file changed, 41 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts b/arch/arm/boot/dts/exynos3250-rinato.dts index 2a1c22598fdc..37c777cad953 100644 --- a/arch/arm/boot/dts/exynos3250-rinato.dts +++ b/arch/arm/boot/dts/exynos3250-rinato.dts @@ -154,6 +154,47 @@ status = "okay"; }; +&bus_fsys { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_isp { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_lcd0 { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_leftbus { + devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; + vdd-supply = <&buck3_reg>; + status = "okay"; +}; + +&bus_mfc { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_mcuisp { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_peril { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + +&bus_rightbus { + devfreq = <&bus_leftbus>; + status = "okay"; +}; + &cpu0 { cpu0-supply = <&buck2_reg>; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 05/20] PM / devfreq: Add new passive governor
This patch adds the new passive governor for DEVFREQ framework. The following governors are already present and used for DVFS (Dynamic Voltage and Frequency Scaling) drivers. The following governors are independently used for one device driver which don't give the influence to other device drviers and also don't receive the effect from other device drivers. - ondemand / performance / powersave / userspace The passive governor depends on operation of parent driver with specific governos extremely and is not able to decide the new frequency by oneself. According to the decided new frequency of parent driver with governor, the passive governor uses it to decide the appropriate frequency for own device driver. The passive governor must need the following information from device tree: - the source clock and OPP tables - the instance of parent device For exameple, there are one more devfreq device drivers which need to change their source clock according to their utilization on runtime. But, they share the same power line (e.g., regulator). So, specific device driver is operated as parent with ondemand governor and then the rest device driver with passive governor is influenced by parent device. Suggested-by: Myungjoo Ham Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/Kconfig| 9 drivers/devfreq/Makefile | 1 + drivers/devfreq/devfreq.c | 47 drivers/devfreq/governor_passive.c | 108 + include/linux/devfreq.h| 15 ++ 5 files changed, 180 insertions(+) create mode 100644 drivers/devfreq/governor_passive.c diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 55ec774f794c..d03f635a93e1 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -64,6 +64,15 @@ config DEVFREQ_GOV_USERSPACE Otherwise, the governor does not change the frequnecy given at the initialization. +config DEVFREQ_GOV_PASSIVE + tristate "Passive" + help + Sets the frequency by other governors (simple_ondemand, performance, + powersave, usersapce) of a parent devfreq device. This governor + always has the dependency on the chosen frequency from paired + governor. This governor does not change the frequency by oneself + through sysfs entry. + comment "DEVFREQ Drivers" config ARM_EXYNOS_BUS_DEVFREQ diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile index 375ebbb4fcfb..f81c313b4b79 100644 --- a/drivers/devfreq/Makefile +++ b/drivers/devfreq/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) += governor_simpleondemand.o obj-$(CONFIG_DEVFREQ_GOV_PERFORMANCE) += governor_performance.o obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE)+= governor_powersave.o obj-$(CONFIG_DEVFREQ_GOV_USERSPACE)+= governor_userspace.o +obj-$(CONFIG_DEVFREQ_GOV_PASSIVE) += governor_passive.o # DEVFREQ Drivers obj-$(CONFIG_ARCH_EXYNOS) += exynos/ diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 984c5e9e7bdd..15e58779e4c0 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -190,6 +190,31 @@ static struct devfreq_governor *find_devfreq_governor(const char *name) /* Load monitoring helper functions for governors use */ +static int update_devfreq_passive(struct devfreq *devfreq, unsigned long freq) +{ + struct devfreq *passive; + unsigned long rate; + int ret; + + list_for_each_entry(passive, &devfreq->passive_dev_list, passive_node) { + if (!passive->governor) + continue; + rate = freq; + + ret = passive->governor->get_target_freq(passive, &rate); + if (ret) + return ret; + + ret = passive->profile->target(passive->dev.parent, &rate, 0); + if (ret) + return ret; + + passive->previous_freq = rate; + } + + return 0; +} + /** * update_devfreq() - Reevaluate the device and configure frequency. * @devfreq: the devfreq instance. @@ -233,10 +258,18 @@ int update_devfreq(struct devfreq *devfreq) flags |= DEVFREQ_FLAG_LEAST_UPPER_BOUND; /* Use LUB */ } + if (!list_empty(&devfreq->passive_dev_list) + && devfreq->previous_freq > freq) + update_devfreq_passive(devfreq, freq); + err = devfreq->profile->target(devfreq->dev.parent, &freq, flags); if (err) return err; + if (!list_empty(&devfreq->passive_dev_list) + && devfreq->previous_freq < freq) + update_devfreq_passive(devfreq, freq); + if (devfreq->profile->freq_table)
[PATCH v3 01/20] PM / devfreq: exynos: Add generic exynos bus frequency driver
This patch adds the generic exynos bus frequency driver for AMBA AXI bus of sub-blocks in exynos SoC with DEVFREQ framework. The Samsung Exynos SoC have the common architecture for bus between DRAM and sub-blocks in SoC. This driver can support the generic bus frequency driver for Exynos SoCs. In devicetree, Each bus block has a bus clock, regulator, operation-point and devfreq-event devices which measure the utilization of each bus block. Signed-off-by: Chanwoo Choi [linux.amoon: Tested on Odroid U3] Tested-by: Anand Moon --- drivers/devfreq/Kconfig | 15 ++ drivers/devfreq/Makefile| 1 + drivers/devfreq/exynos/Makefile | 1 + drivers/devfreq/exynos/exynos-bus.c | 449 4 files changed, 466 insertions(+) create mode 100644 drivers/devfreq/exynos/exynos-bus.c diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 64281bb2f650..55ec774f794c 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -66,6 +66,21 @@ config DEVFREQ_GOV_USERSPACE comment "DEVFREQ Drivers" +config ARM_EXYNOS_BUS_DEVFREQ + bool "ARM EXYNOS Generic Memory Bus DEVFREQ Driver" + depends on ARCH_EXYNOS + select DEVFREQ_GOV_SIMPLE_ONDEMAND + select DEVFREQ_EVENT_EXYNOS_PPMU + select PM_DEVFREQ_EVENT + select PM_OPP + help + This adds the common DEVFREQ driver for Exynos Memory bus. Exynos + Memory bus has one more group of memory bus (e.g, MIF and INT block). + Each memory bus group could contain many memoby bus block. It reads + PPMU counters of memory controllers by using DEVFREQ-event device + and adjusts the operating frequencies and voltages with OPP support. + This does not yet operate with optimal voltages. + config ARM_EXYNOS4_BUS_DEVFREQ bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM diff --git a/drivers/devfreq/Makefile b/drivers/devfreq/Makefile index 5134f9ee983d..375ebbb4fcfb 100644 --- a/drivers/devfreq/Makefile +++ b/drivers/devfreq/Makefile @@ -6,6 +6,7 @@ obj-$(CONFIG_DEVFREQ_GOV_POWERSAVE) += governor_powersave.o obj-$(CONFIG_DEVFREQ_GOV_USERSPACE)+= governor_userspace.o # DEVFREQ Drivers +obj-$(CONFIG_ARCH_EXYNOS) += exynos/ obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos/ obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos/ obj-$(CONFIG_ARM_TEGRA_DEVFREQ)+= tegra-devfreq.o diff --git a/drivers/devfreq/exynos/Makefile b/drivers/devfreq/exynos/Makefile index 49bc9175f923..4ec06d322996 100644 --- a/drivers/devfreq/exynos/Makefile +++ b/drivers/devfreq/exynos/Makefile @@ -1,3 +1,4 @@ # Exynos DEVFREQ Drivers +obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos_ppmu.o exynos4_bus.o obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos_ppmu.o exynos5_bus.o diff --git a/drivers/devfreq/exynos/exynos-bus.c b/drivers/devfreq/exynos/exynos-bus.c new file mode 100644 index ..f1bc20839650 --- /dev/null +++ b/drivers/devfreq/exynos/exynos-bus.c @@ -0,0 +1,449 @@ +/* + * Generic Exynos Bus frequency driver with DEVFREQ Framework + * + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Author : Chanwoo Choi + * + * This driver support Exynos Bus frequency feature by using + * DEVFREQ framework and is based on drivers/devfreq/exynos/exynos4_bus.c. + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFAULT_SATURATION_RATIO 40 + +struct exynos_bus { + struct device *dev; + + struct devfreq *devfreq; + struct devfreq_event_dev **edev; + unsigned int edev_count; + struct mutex lock; + + struct dev_pm_opp *curr_opp; + + struct regulator *regulator; + struct clk *clk; + int ratio; +}; + +/* + * Control the devfreq-event device to get the current state of bus + */ +#define exynos_bus_ops_edev(ops) \ +static int exynos_bus_##ops(struct exynos_bus *bus)\ +{ \ + int i, ret; \ + \ + for (i = 0; i < bus->edev_count; i++) { \ + if (!bus->edev[i]) \ + continue; \ + ret = devfreq_event_##ops(bus->edev[i]);\ + if (ret < 0)
Re: [PATCH] extcon-usb-gpio: add enable pin support
Hi Sergei, On 2015년 12월 11일 08:07, Sergei Shtylyov wrote: > Sometimes there's a real OTG chip behind the USB ID signal mapped to a GPIO > pin: in my case it's Maxim Integrated MAX3355E which integrates Vbus charge > pump and comparators and passes thru the ID signal from an OTG connector. s/thru/through ? > This chip also has the SHDN# pin which should be driven high for the normal > operation and low to save power; it is connected to a GPIO pin as well on, > hence we'll have to teach the driver to parse the new optional device tree > property, "enable-gpio"... This patch description includes the double space between words. Also, I think you need to write the patch description again for formal style. This patch adds the specific 'enable-gpio' pin to express the SHDN#pin for MAX3355E. I think it is not regular and standard case because maybe USB specification don't include the SHDN#pin information. I think it not appropriate way. Instead, you better to make the MAX3355 extcon driver to support this case. Thanks, Chanwoo > > Signed-off-by: Sergei Shtylyov > > --- > The patch is against the 'extcon-next' branch of the 'extcon.git' repo. > > Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt |3 +++ > drivers/extcon/extcon-usb-gpio.c |5 + > 2 files changed, 8 insertions(+) > > Index: extcon/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt > === > --- extcon.orig/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt > +++ extcon/Documentation/devicetree/bindings/extcon/extcon-usb-gpio.txt > @@ -7,6 +7,9 @@ Required properties: > - compatible: Should be "linux,extcon-usb-gpio" > - id-gpio: gpio for USB ID pin. See gpio binding. > > +Optional properties: > +- enable-gpio: gpio for the enable pin. See gpio binding. > + > Example: Examples of extcon-usb-gpio node in dra7-evm.dts as listed below: > extcon_usb1 { > compatible = "linux,extcon-usb-gpio"; > Index: extcon/drivers/extcon/extcon-usb-gpio.c > === > --- extcon.orig/drivers/extcon/extcon-usb-gpio.c > +++ extcon/drivers/extcon/extcon-usb-gpio.c > @@ -33,6 +33,7 @@ struct usb_extcon_info { > struct device *dev; > struct extcon_dev *edev; > > + struct gpio_desc *enable_gpiod; > struct gpio_desc *id_gpiod; > int id_irq; > > @@ -99,6 +100,8 @@ static int usb_extcon_probe(struct platf > return -ENOMEM; > > info->dev = dev; > + info->enable_gpiod = devm_gpiod_get_optional(&pdev->dev, "enable", > + GPIOD_OUT_HIGH); > info->id_gpiod = devm_gpiod_get(&pdev->dev, "id", GPIOD_IN); > if (IS_ERR(info->id_gpiod)) { > dev_err(dev, "failed to get ID GPIO\n"); > @@ -155,6 +158,8 @@ static int usb_extcon_remove(struct plat > > cancel_delayed_work_sync(&info->wq_detcable); > > + gpiod_set_value_cansleep(info->enable_gpiod, 0); > + > return 0; > } > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 09/19] PM / devfreq: exynos: Update documentation for bus devices using passive governor
On 2015년 12월 11일 12:24, Rob Herring wrote: > On Fri, Dec 11, 2015 at 12:10:13AM +0900, Chanwoo Choi wrote: >> On Thu, Dec 10, 2015 at 11:21 PM, Rob Herring wrote: >>> On Wed, Dec 09, 2015 at 01:08:01PM +0900, Chanwoo Choi wrote: >>>> This patch updates the documentation for passive bus devices and adds the >>>> detailed example of Exynos3250. >>>> >>>> Signed-off-by: Chanwoo Choi >>>> --- >>>> .../devicetree/bindings/devfreq/exynos-bus.txt | 244 >>>> - >>>> 1 file changed, 241 insertions(+), 3 deletions(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >>>> b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >>>> index 54a1f9c46c88..c4fdc70f8eac 100644 >>>> --- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >>>> +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >>>> @@ -13,18 +13,23 @@ SoC has the different sub-blocks. So, this difference >>>> should be specified >>>> in devicetree file instead of each device driver. In result, this driver >>>> is able to support the bus frequency for all Exynos SoCs. >>>> >>>> -Required properties for bus device: >>>> +Required properties for all bus devices: >>>> - compatible: Should be "samsung,exynos-bus". >>>> - clock-names : the name of clock used by the bus, "bus". >>>> - clocks : phandles for clock specified in "clock-names" property. >>>> - #clock-cells: should be 1. >>>> - operating-points-v2: the OPP table including frequency/voltage >>>> information >>>>to support DVFS (Dynamic Voltage/Frequency Scaling) feature. >>>> + >>>> +Required properties for only parent bus device: >>>> - vdd-supply: the regulator to provide the buses with the voltage. >>>> - devfreq-events: the devfreq-event device to monitor the curret >>>> utilization >>>>of buses. >>>> >>>> -Optional properties for bus device: >>>> +Required properties for only passive bus device: >>>> +- devfreq: the parent bus device. >>>> + >>>> +Optional properties for only parent bus device: >>>> - exynos,saturation-ratio: the percentage value which is used to calibrate >>>> the performance count againt total cycle count. >>>> >>>> @@ -33,7 +38,20 @@ Example1: >>>> power line (regulator). The MIF (Memory Interface) AXI bus is used to >>>> transfer data between DRAM and CPU and uses the VDD_MIF regualtor. >>>> >>>> - - power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) >>>> block >>>> + - MIF (Memory Interface) block >>>> + : VDD_MIF |--- DMC (Dynamic Memory Controller) >>>> + >>>> + - INT (Internal) block >>>> + : VDD_INT |--- LEFTBUS (parent device) >>>> + |--- PERIL >>>> + |--- MFC >>>> + |--- G3D >>>> + |--- RIGHTBUS >>>> + |--- FSYS >>>> + |--- LCD0 >>>> + |--- PERIR >>>> + |--- ISP >>>> + |--- CAM >>> >>> This still has the same problem as before. I would expect that the bus >>> hierarchy in the dts match the hierarchy here. You just have flat nodes >>> in the example below. So all IP blocks affected by frequency scaling >>> should be under the bus node defining the OPPs. Something like this: >> >> The each bus of sub-block has not h/w dependency among sub-blocks >> and has the owned source clock / OPP table. Just they share the same >> power line. So, I think that flat nodes in the example below is not problem. > > I'm talking about the peripherals not described here. Is the ISP block > not a child of the bus_isp node? Same for the display controller block > and bus_lcd0. And so on. >From the H/W point of view, ISP block is really not included in ISP's AXI bus >(bus_isp). Just, the bus_isp connect to between ISP block and DRAM. Thanks, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 16/19] ARM: dts: Add PPMU node for exynos4412-odroidu3
On 2015년 12월 10일 15:44, Krzysztof Kozlowski wrote: > On 09.12.2015 13:08, Chanwoo Choi wrote: >> This patch add dt node for PPMU_{DMC0|DMC1|LEFTBUS|RIGHTBUS} for >> exynos4412-odroidu3 board. Each PPMU dt node includes one event of >> 'PPMU Count3'. >> >> Signed-off-by: Chanwoo Choi >> --- >> arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 40 >> + >> 1 file changed, 40 insertions(+) >> > > The patch itself is good but now I see that it is duplicated with > Rinato, Monk and Trats2. Probably for all other Exynos4 and > one-cluster-Exynos5 boards this would be exactly the same as well. > > How about making a DTSI file with common PPMU events configuration? OK. I'll make the exynos4412-ppmu-common.dtsi. The Exynos4 series used the PPMU firstly. That is why deciding the filename of exynos4412-ppmu-common.dtsi. Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 09/19] PM / devfreq: exynos: Update documentation for bus devices using passive governor
On Thu, Dec 10, 2015 at 11:21 PM, Rob Herring wrote: > On Wed, Dec 09, 2015 at 01:08:01PM +0900, Chanwoo Choi wrote: >> This patch updates the documentation for passive bus devices and adds the >> detailed example of Exynos3250. >> >> Signed-off-by: Chanwoo Choi >> --- >> .../devicetree/bindings/devfreq/exynos-bus.txt | 244 >> - >> 1 file changed, 241 insertions(+), 3 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> index 54a1f9c46c88..c4fdc70f8eac 100644 >> --- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> @@ -13,18 +13,23 @@ SoC has the different sub-blocks. So, this difference >> should be specified >> in devicetree file instead of each device driver. In result, this driver >> is able to support the bus frequency for all Exynos SoCs. >> >> -Required properties for bus device: >> +Required properties for all bus devices: >> - compatible: Should be "samsung,exynos-bus". >> - clock-names : the name of clock used by the bus, "bus". >> - clocks : phandles for clock specified in "clock-names" property. >> - #clock-cells: should be 1. >> - operating-points-v2: the OPP table including frequency/voltage information >>to support DVFS (Dynamic Voltage/Frequency Scaling) feature. >> + >> +Required properties for only parent bus device: >> - vdd-supply: the regulator to provide the buses with the voltage. >> - devfreq-events: the devfreq-event device to monitor the curret utilization >>of buses. >> >> -Optional properties for bus device: >> +Required properties for only passive bus device: >> +- devfreq: the parent bus device. >> + >> +Optional properties for only parent bus device: >> - exynos,saturation-ratio: the percentage value which is used to calibrate >> the performance count againt total cycle count. >> >> @@ -33,7 +38,20 @@ Example1: >> power line (regulator). The MIF (Memory Interface) AXI bus is used to >> transfer data between DRAM and CPU and uses the VDD_MIF regualtor. >> >> - - power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block >> + - MIF (Memory Interface) block >> + : VDD_MIF |--- DMC (Dynamic Memory Controller) >> + >> + - INT (Internal) block >> + : VDD_INT |--- LEFTBUS (parent device) >> + |--- PERIL >> + |--- MFC >> + |--- G3D >> + |--- RIGHTBUS >> + |--- FSYS >> + |--- LCD0 >> + |--- PERIR >> + |--- ISP >> + |--- CAM > > This still has the same problem as before. I would expect that the bus > hierarchy in the dts match the hierarchy here. You just have flat nodes > in the example below. So all IP blocks affected by frequency scaling > should be under the bus node defining the OPPs. Something like this: The each bus of sub-block has not h/w dependency among sub-blocks and has the owned source clock / OPP table. Just they share the same power line. So, I think that flat nodes in the example below is not problem. Because of using the same power line, the sub-blocks would be tied by devfreq framework only for the behavior of bus frequency scaling . > > soc { > compatible = "simple-bus"; > bus { > compatible = "my-awesome-dvfs-bus"; /* simple-bus too if > no setup needed first */ > reg = <0x0 0x0>; // Bus control registers > clocks = <&ccm BUS_CLK>; > operating-points-v2 = <&opp>; > device@0 { > compatible = "my-awesome-device-1"; > }; > device@1 { > compatible = "my-awesome-device-2"; > }; > }; > }; -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 17/19] ARM: dts: Add support of bus frequency using VDD_INT for exynos3250-rinato
On 2015년 12월 10일 15:58, Krzysztof Kozlowski wrote: > On 09.12.2015 13:08, Chanwoo Choi wrote: >> This patch adds the bus device-tree node of INT (internal) block >> to enable the bus frequency. The following sub-blocks share > > "to enable the bus frequency scaling" > >> the VDD_INT power source: >> - LEFTBUS (parent device) >> - RIGHTBUS >> - PERIL >> - LCD0 >> - FSYS >> - MCUISP / ISP >> - MFC >> >> The LEFTBUS is parent device with devfreq ondemand governor >> and the rest devices has the dependency on LEFTBUS bus. > > How about: > "and the rest of devices depend on the LEFTBUS device." > ? OK, I'll modify it. > > The patch is good: > > Reviewed-by: Krzysztof Kozlowski Thanks for your review. Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 19/19] ARM: dts: Add support of bus frequency for exynos4412-trats/odroidu3
On 2015년 12월 10일 16:08, Krzysztof Kozlowski wrote: > On 09.12.2015 13:08, Chanwoo Choi wrote: >> THis patch adds the bus device tree nodes for both MIF (Memory) and INT >> (Internal) block to enable the bus frequency. >> >> The DMC bus is parent device in MIF block using VDD_MIF and the LEFTBUS >> bus is parent device in INT block using VDD_INT. >> >> Signed-off-by: Chanwoo Choi >> --- >> arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 47 >> + >> arch/arm/boot/dts/exynos4412-trats2.dts | 47 >> + >> 2 files changed, 94 insertions(+) >> >> diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi >> b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi >> index 171dea1e3e4a..12d08242a179 100644 >> --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi >> +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi >> @@ -544,3 +544,50 @@ >> }; >> }; >> }; >> + >> +&bus_dmc { >> +devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; >> +vdd-supply = <&buck1_reg>; >> +status = "okay"; >> +}; >> + >> +&bus_acp { >> +devfreq = <&bus_dmc>; >> +status = "okay"; >> +}; >> + >> +&bus_c2c { >> +devfreq = <&bus_dmc>; >> +status = "okay"; >> +}; >> + >> +&bus_leftbus { >> +devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; >> +vdd-supply = <&buck3_reg>; >> +status = "okay"; >> +}; >> + >> +&bus_rightbus { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> + >> +&bus_display { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> + >> +&bus_fsys { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> + >> +&bus_peri { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> + >> +&bus_mfc { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts >> b/arch/arm/boot/dts/exynos4412-trats2.dts >> index 40a474c4374b..aecd545803ad 100644 >> --- a/arch/arm/boot/dts/exynos4412-trats2.dts >> +++ b/arch/arm/boot/dts/exynos4412-trats2.dts >> @@ -1286,3 +1286,50 @@ >> vtmu-supply = <&ldo10_reg>; >> status = "okay"; >> }; >> + >> +&bus_dmc { >> +devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; >> +vdd-supply = <&buck1_reg>; >> +status = "okay"; >> +}; >> + >> +&bus_acp { >> +devfreq = <&bus_dmc>; >> +status = "okay"; >> +}; >> + >> +&bus_c2c { >> +devfreq = <&bus_dmc>; >> +status = "okay"; >> +}; >> + >> +&bus_leftbus { >> +devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>; >> +vdd-supply = <&buck3_reg>; >> +status = "okay"; >> +}; >> + >> +&bus_rightbus { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> + >> +&bus_display { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> + >> +&bus_fsys { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> + >> +&bus_peri { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; >> + >> +&bus_mfc { >> +devfreq = <&bus_leftbus>; >> +status = "okay"; >> +}; > > The nodes in both files are mostly sorted alphabetically. Could you > place them in such order as well? Okay. I'll sort them alphabetically. Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 18/19] ARM: dts: Expand the voltage range of buck1/3 regulator for exynos4412-odroidu3
On 2015년 12월 10일 16:02, Krzysztof Kozlowski wrote: > On 09.12.2015 13:08, Chanwoo Choi wrote: >> This patch expands the voltage range of buck1/3 regulator due to as >> following: >> - MIF (Memory Interface) bus frequency needs the 9uV ~ 105uV V. >> - INT (Internal) bus frequency needs 9uV ~ 100uV. > > 9->90 and duplicated "uV V". Maybe just: > 900 - 1050 mV > 900 - 1000 mV > ? OK. I'll modify the patch description. > >> >> Signed-off-by: Chanwoo Choi >> --- >> arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> > > For the contents of patch: > > Reviewed-by: Krzysztof Kozlowski Best Regards, Chanwoo CHoi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 14/19] ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
On 2015년 12월 10일 16:12, Krzysztof Kozlowski wrote: > On 10.12.2015 16:07, Chanwoo Choi wrote: >> On 2015년 12월 10일 15:53, Krzysztof Kozlowski wrote: >>> On 10.12.2015 15:43, Chanwoo Choi wrote: >>>> On 2015년 12월 10일 15:32, Krzysztof Kozlowski wrote: >>>>> On 10.12.2015 15:08, Chanwoo Choi wrote: >>>>>> On 2015년 12월 10일 14:57, Krzysztof Kozlowski wrote: >>>>>>> On 09.12.2015 13:08, Chanwoo Choi wrote: >>>>>>>> This patch adds the bus noes using VDD_INT for Exynos4x12 SoC. >>>>>>>> Exynos4x12 has the following AXI buses to translate data between >>>>>>>> DRAM and sub-blocks. >>>>>>>> >>>>>>>> Following list specifies the detailed relation between DRAM and >>>>>>>> sub-blocks: >>>>>>>> - ACLK100 clock for PERIL/PERIR/MFC(PCLK) >>>>>>>> - ACLK160 clock for CAM/TV/LCD >>>>>>>> : The minimum clock of ACLK160 should be over 160MHz. >>>>>>>> When drop the clock under 160MHz, show the broken image. >>>>>>>> - ACLK133 clock for FSYS >>>>>>>> - GDL clock for LEFTBUS >>>>>>>> - GDR clock for RIGHTBUS >>>>>>>> - SCLK_MFC clock for MFC >>>>>>>> >>>>>>>> Signed-off-by: Chanwoo Choi >>>>>>>> --- >>>>>>>> arch/arm/boot/dts/exynos4x12.dtsi | 112 >>>>>>>> ++ >>>>>>>> 1 file changed, 112 insertions(+) >>>>>>>> >>>>>>>> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi >>>>>>>> b/arch/arm/boot/dts/exynos4x12.dtsi >>>>>>>> index 3bcf0939755e..8bc4aee156b5 100644 >>>>>>>> --- a/arch/arm/boot/dts/exynos4x12.dtsi >>>>>>>> +++ b/arch/arm/boot/dts/exynos4x12.dtsi >>>>>>>> @@ -354,6 +354,118 @@ >>>>>>>>opp-microvolt = <95>; >>>>>>>>}; >>>>>>>>}; >>>>>>>> + >>>>>>>> + bus_leftbus: bus_leftbus { >>>>>>>> + compatible = "samsung,exynos-bus"; >>>>>>>> + clocks = <&clock CLK_DIV_GDL>; >>>>>>>> + clock-names = "bus"; >>>>>>>> + operating-points-v2 = <&bus_leftbus_opp_table>; >>>>>>>> + status = "disabled"; >>>>>>>> + }; >>>>>>>> + >>>>>>>> + bus_rightbus: bus_rightbus { >>>>>>>> + compatible = "samsung,exynos-bus"; >>>>>>>> + clocks = <&clock CLK_DIV_GDR>; >>>>>>>> + clock-names = "bus"; >>>>>>>> + operating-points-v2 = <&bus_leftbus_opp_table>; >>>>>>>> + status = "disabled"; >>>>>>>> + }; >>>>>>> >>>>>>> These two nodes are symmetrical. The MFC below and other buses in other >>>>>>> DTS share opps. How about changing the binding so multiple clocks could >>>>>>> be specified at once ("bus0", "bus1")? I think there is no need for a >>>>>>> bus device for each clock. >>>>>> >>>>>> The your commented method is possible. >>>>>> >>>>>> But, I focus on implementing the generic bus frequency driver. >>>>>> >>>>>> If specific bus device-tree node includes the one more clocks, >>>>>> when adding the new Exynos SoC, the exynos-bus.c should be added >>>>>> for new Exynos SoC. Because, each Exynos SoC has the different >>>>>> set of bus device. >>>>>> >>>>>> If we use my approach, we don't need to modify the exynos-bus.c >>>>>> driver to support for the bus frequency of new Exynos SoC. >>>>> >>>>> This won't change. The driver will just support from 1 to N clocks for >>>>> given bus device and set the same OPP to all of them. This will only >>
Re: [PATCH v2 14/19] ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
On 2015년 12월 10일 15:53, Krzysztof Kozlowski wrote: > On 10.12.2015 15:43, Chanwoo Choi wrote: >> On 2015년 12월 10일 15:32, Krzysztof Kozlowski wrote: >>> On 10.12.2015 15:08, Chanwoo Choi wrote: >>>> On 2015년 12월 10일 14:57, Krzysztof Kozlowski wrote: >>>>> On 09.12.2015 13:08, Chanwoo Choi wrote: >>>>>> This patch adds the bus noes using VDD_INT for Exynos4x12 SoC. >>>>>> Exynos4x12 has the following AXI buses to translate data between >>>>>> DRAM and sub-blocks. >>>>>> >>>>>> Following list specifies the detailed relation between DRAM and >>>>>> sub-blocks: >>>>>> - ACLK100 clock for PERIL/PERIR/MFC(PCLK) >>>>>> - ACLK160 clock for CAM/TV/LCD >>>>>> : The minimum clock of ACLK160 should be over 160MHz. >>>>>> When drop the clock under 160MHz, show the broken image. >>>>>> - ACLK133 clock for FSYS >>>>>> - GDL clock for LEFTBUS >>>>>> - GDR clock for RIGHTBUS >>>>>> - SCLK_MFC clock for MFC >>>>>> >>>>>> Signed-off-by: Chanwoo Choi >>>>>> --- >>>>>> arch/arm/boot/dts/exynos4x12.dtsi | 112 >>>>>> ++ >>>>>> 1 file changed, 112 insertions(+) >>>>>> >>>>>> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi >>>>>> b/arch/arm/boot/dts/exynos4x12.dtsi >>>>>> index 3bcf0939755e..8bc4aee156b5 100644 >>>>>> --- a/arch/arm/boot/dts/exynos4x12.dtsi >>>>>> +++ b/arch/arm/boot/dts/exynos4x12.dtsi >>>>>> @@ -354,6 +354,118 @@ >>>>>> opp-microvolt = <95>; >>>>>> }; >>>>>> }; >>>>>> + >>>>>> +bus_leftbus: bus_leftbus { >>>>>> +compatible = "samsung,exynos-bus"; >>>>>> +clocks = <&clock CLK_DIV_GDL>; >>>>>> +clock-names = "bus"; >>>>>> +operating-points-v2 = <&bus_leftbus_opp_table>; >>>>>> +status = "disabled"; >>>>>> +}; >>>>>> + >>>>>> +bus_rightbus: bus_rightbus { >>>>>> +compatible = "samsung,exynos-bus"; >>>>>> +clocks = <&clock CLK_DIV_GDR>; >>>>>> +clock-names = "bus"; >>>>>> +operating-points-v2 = <&bus_leftbus_opp_table>; >>>>>> +status = "disabled"; >>>>>> +}; >>>>> >>>>> These two nodes are symmetrical. The MFC below and other buses in other >>>>> DTS share opps. How about changing the binding so multiple clocks could >>>>> be specified at once ("bus0", "bus1")? I think there is no need for a >>>>> bus device for each clock. >>>> >>>> The your commented method is possible. >>>> >>>> But, I focus on implementing the generic bus frequency driver. >>>> >>>> If specific bus device-tree node includes the one more clocks, >>>> when adding the new Exynos SoC, the exynos-bus.c should be added >>>> for new Exynos SoC. Because, each Exynos SoC has the different >>>> set of bus device. >>>> >>>> If we use my approach, we don't need to modify the exynos-bus.c >>>> driver to support for the bus frequency of new Exynos SoC. >>> >>> This won't change. The driver will just support from 1 to N clocks for >>> given bus device and set the same OPP to all of them. This will only >>> limit the number of duplicated entries. This won't affect the generic >>> approach of driver itself. >> >> You're right aspect of only implementation of device driver. >> >> But, >> If we use your commented approach, we can show the information >> of only parent device through sysfs. We cannot see the information >> of passive device. The some information includes the current >> frequency and correlation of parent device. (But, current patchset >> don' include the topology information between parent device and >> passive device. I'll do it on
Re: [PATCH v2 14/19] ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
On 2015년 12월 10일 15:32, Krzysztof Kozlowski wrote: > On 10.12.2015 15:08, Chanwoo Choi wrote: >> On 2015년 12월 10일 14:57, Krzysztof Kozlowski wrote: >>> On 09.12.2015 13:08, Chanwoo Choi wrote: >>>> This patch adds the bus noes using VDD_INT for Exynos4x12 SoC. >>>> Exynos4x12 has the following AXI buses to translate data between >>>> DRAM and sub-blocks. >>>> >>>> Following list specifies the detailed relation between DRAM and sub-blocks: >>>> - ACLK100 clock for PERIL/PERIR/MFC(PCLK) >>>> - ACLK160 clock for CAM/TV/LCD >>>> : The minimum clock of ACLK160 should be over 160MHz. >>>> When drop the clock under 160MHz, show the broken image. >>>> - ACLK133 clock for FSYS >>>> - GDL clock for LEFTBUS >>>> - GDR clock for RIGHTBUS >>>> - SCLK_MFC clock for MFC >>>> >>>> Signed-off-by: Chanwoo Choi >>>> --- >>>> arch/arm/boot/dts/exynos4x12.dtsi | 112 >>>> ++ >>>> 1 file changed, 112 insertions(+) >>>> >>>> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi >>>> b/arch/arm/boot/dts/exynos4x12.dtsi >>>> index 3bcf0939755e..8bc4aee156b5 100644 >>>> --- a/arch/arm/boot/dts/exynos4x12.dtsi >>>> +++ b/arch/arm/boot/dts/exynos4x12.dtsi >>>> @@ -354,6 +354,118 @@ >>>>opp-microvolt = <95>; >>>>}; >>>>}; >>>> + >>>> + bus_leftbus: bus_leftbus { >>>> + compatible = "samsung,exynos-bus"; >>>> + clocks = <&clock CLK_DIV_GDL>; >>>> + clock-names = "bus"; >>>> + operating-points-v2 = <&bus_leftbus_opp_table>; >>>> + status = "disabled"; >>>> + }; >>>> + >>>> + bus_rightbus: bus_rightbus { >>>> + compatible = "samsung,exynos-bus"; >>>> + clocks = <&clock CLK_DIV_GDR>; >>>> + clock-names = "bus"; >>>> + operating-points-v2 = <&bus_leftbus_opp_table>; >>>> + status = "disabled"; >>>> + }; >>> >>> These two nodes are symmetrical. The MFC below and other buses in other >>> DTS share opps. How about changing the binding so multiple clocks could >>> be specified at once ("bus0", "bus1")? I think there is no need for a >>> bus device for each clock. >> >> The your commented method is possible. >> >> But, I focus on implementing the generic bus frequency driver. >> >> If specific bus device-tree node includes the one more clocks, >> when adding the new Exynos SoC, the exynos-bus.c should be added >> for new Exynos SoC. Because, each Exynos SoC has the different >> set of bus device. >> >> If we use my approach, we don't need to modify the exynos-bus.c >> driver to support for the bus frequency of new Exynos SoC. > > This won't change. The driver will just support from 1 to N clocks for > given bus device and set the same OPP to all of them. This will only > limit the number of duplicated entries. This won't affect the generic > approach of driver itself. You're right aspect of only implementation of device driver. But, If we use your commented approach, we can show the information of only parent device through sysfs. We cannot see the information of passive device. The some information includes the current frequency and correlation of parent device. (But, current patchset don' include the topology information between parent device and passive device. I'll do it on later patches). For example, We can see the following bus device through /sys/class/devfreq. drwxr-xr-x 2 root root 0 Dec 31 17:00 . drwxr-xr-x 44 root root 0 Dec 31 17:00 .. lrwxrwxrwx 1 root root 0 Dec 31 17:00 bus_display -> ../../devices/platform/bus_display/devfreq/bus_display lrwxrwxrwx 1 root root 0 Dec 31 17:00 bus_fsys -> ../../devices/platform/bus_fsys/devfreq/bus_fsys lrwxrwxrwx 1 root root 0 Dec 31 17:00 bus_leftbus -> ../../devices/platform/bus_leftbus/devfreq/bus_leftbus lrwxrwxrwx 1 root root 0 Dec 31 17:00 bus_peri -> ../../devices/platform/bus_peri/devfreq/bus_peri We don't see the following bus device because of following bus device has the same frequency table with bus_leftbus device. lrwxrwxrwx 1 root root 0 Dec 31 17:00 bus_mfc -> ../../devices/platform/bus_mfc/devfreq/bus_mfc lrwxrwxrwx 1 root root 0 Dec 31 17:00 bus_rightbus -> ../../devices/platform/bus_rightbus/devfreq/bus_rightbus Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 14/19] ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
On 2015년 12월 10일 14:57, Krzysztof Kozlowski wrote: > On 09.12.2015 13:08, Chanwoo Choi wrote: >> This patch adds the bus noes using VDD_INT for Exynos4x12 SoC. >> Exynos4x12 has the following AXI buses to translate data between >> DRAM and sub-blocks. >> >> Following list specifies the detailed relation between DRAM and sub-blocks: >> - ACLK100 clock for PERIL/PERIR/MFC(PCLK) >> - ACLK160 clock for CAM/TV/LCD >> : The minimum clock of ACLK160 should be over 160MHz. >> When drop the clock under 160MHz, show the broken image. >> - ACLK133 clock for FSYS >> - GDL clock for LEFTBUS >> - GDR clock for RIGHTBUS >> - SCLK_MFC clock for MFC >> >> Signed-off-by: Chanwoo Choi >> --- >> arch/arm/boot/dts/exynos4x12.dtsi | 112 >> ++ >> 1 file changed, 112 insertions(+) >> >> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi >> b/arch/arm/boot/dts/exynos4x12.dtsi >> index 3bcf0939755e..8bc4aee156b5 100644 >> --- a/arch/arm/boot/dts/exynos4x12.dtsi >> +++ b/arch/arm/boot/dts/exynos4x12.dtsi >> @@ -354,6 +354,118 @@ >> opp-microvolt = <95>; >> }; >> }; >> + >> +bus_leftbus: bus_leftbus { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_DIV_GDL>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_leftbus_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_rightbus: bus_rightbus { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_DIV_GDR>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_leftbus_opp_table>; >> +status = "disabled"; >> +}; > > These two nodes are symmetrical. The MFC below and other buses in other > DTS share opps. How about changing the binding so multiple clocks could > be specified at once ("bus0", "bus1")? I think there is no need for a > bus device for each clock. The your commented method is possible. But, I focus on implementing the generic bus frequency driver. If specific bus device-tree node includes the one more clocks, when adding the new Exynos SoC, the exynos-bus.c should be added for new Exynos SoC. Because, each Exynos SoC has the different set of bus device. If we use my approach, we don't need to modify the exynos-bus.c driver to support for the bus frequency of new Exynos SoC. Best Regards, Chanwoo Choi > > Best regards, > Krzysztof > >> + >> +bus_display: bus_display { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_ACLK160>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_display_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_fsys: bus_fsys { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_ACLK133>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_fsys_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_peri: bus_peri { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_ACLK100>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_peri_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_mfc: bus_mfc { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_SCLK_MFC>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_leftbus_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_leftbus_opp_table: opp_table3 { >> +compatible = "operating-points-v2"; >> +opp-shared; >> + >> +opp00 { >> +opp-hz = /bits/ 64 <1>; >> +opp-microvolt = <90>; >> +}; >> +opp01 { >> +opp-hz = /bits/ 64 <13400>; >> +opp-microvolt = <925000>; >> +}; >> +opp02
Re: [PATCH v2 13/19] ARM: dts: Add bus nodes using VDD_MIF for Exynos4x12
On 2015년 12월 10일 12:17, Krzysztof Kozlowski wrote: > On 09.12.2015 13:08, Chanwoo Choi wrote: >> This patch adds the bus noes using VDD_MIF for Exynos4x12 SoC. > > s/noes/nodes/ OK. > >> Exynos4x12 has the following AXI buses to translate data >> between DRAM and DMC/ACP/C2C. >> >> Signed-off-by: Chanwoo Choi >> --- >> arch/arm/boot/dts/exynos4x12.dtsi | 72 >> +++ >> 1 file changed, 72 insertions(+) >> >> diff --git a/arch/arm/boot/dts/exynos4x12.dtsi >> b/arch/arm/boot/dts/exynos4x12.dtsi >> index b77dac61ffb5..3bcf0939755e 100644 >> --- a/arch/arm/boot/dts/exynos4x12.dtsi >> +++ b/arch/arm/boot/dts/exynos4x12.dtsi >> @@ -282,6 +282,78 @@ >> clocks = <&clock CLK_SMMU_LITE1>, <&clock CLK_FIMC_LITE1>; >> #iommu-cells = <0>; >> }; >> + >> +bus_dmc: bus_dmc { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_DIV_DMC>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_dmc_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_acp: bus_acp { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_DIV_ACP>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_acp_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_c2c: bus_c2c { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&clock CLK_DIV_C2C>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_dmc_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_dmc_opp_table: opp_table1 { >> +compatible = "operating-points-v2"; >> +opp-shared; >> + >> +opp00 { >> +opp-hz = /bits/ 64 <1>; >> +opp-microvolt = <90>; >> +}; >> +opp01 { >> +opp-hz = /bits/ 64 <13400>; >> +opp-microvolt = <90>; >> +}; >> +opp02 { >> +opp-hz = /bits/ 64 <16000>; >> +opp-microvolt = <90>; >> +}; >> +opp03 { >> +opp-hz = /bits/ 64 <2>; >> +opp-microvolt = <95>; > > The exyno4_bus.c (from mainline) uses 267 MHz here. Why choosing 200 MHz? There is no special reason. I'll change it (200MHz -> 267MHz). Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 00/19] PM / devferq: Add generic exynos bus frequency driver and new passive governor
Hi Anand, On 2015년 12월 10일 13:14, Anand Moon wrote: > Hi Chanwoo Choi, > > On 10 December 2015 at 05:42, Chanwoo Choi wrote: >> Hi Anand, >> >> First of all, thanks for trying to test this series. >> >> On 2015년 12월 10일 04:05, Anand Moon wrote: >>> Hi Chanwoo Choi, >>> >>> On 9 December 2015 at 09:37, Chanwoo Choi wrote: >>>> This patch-set includes the two features as following. The generic exynos >>>> bus >>>> frequency driver is able to support almost Exynos SoCs for bus frequency >>>> scaling. And the new passive governor is able to make the dependency on >>>> between devices for frequency/voltage scaling. I had posted the >>>> patch-set[1] >>>> with the similiar concept. This is is revised version for exynos bus >>>> frequency. >>>> - Generic exynos bus frequency driver >>>> - New passive governor of DEVFREQ framework >>>> >>>> Depends on: >>>> - This patch-set is based on devfreq.git[2]. >>>> [1] https://lkml.org/lkml/2015/1/7/872 >>>>: [PATCHv3 0/8] devfreq: Add generic exynos memory-bus frequency driver >>>> [2] https://git.kernel.org/cgit/linux/kernel/git/mzx/devfreq.git/ (branch: >>>> for-rafael) >>>> >>>> Changes from v1: >>>> (https://lkml.org/lkml/2015/11/26/260) >>>> - Check whether the instance of regulator is NULL or not >>>> when executing regulator_disable() because of only parent >>>> devfreq device has the regulator instance. After fixing it, >>>> the wake-up from suspend state is well working. (patch1) >>>> - Fix bug which checks 'bus-clk' instead of 'bus->regulator' >>>> after calling devm_clk_get() (on patch1) >>>> - Update the documentation to remove the description about >>>> DEVFREQ-EVENT subsystem (on patch2) >>>> - Add the full name of DMC (Dynamic Memory Controller) (on patch2) >>>> - Modify the detailed correlation of buses for Exynos3250 >>>> on documentation (patch2) >>>> - Add the MFC bus node for Exynos3250 (on patch11, patch12) >>>> - Fix the duplicate frequency of bus_display on Exynos4x12.dtsi >>>> - Add the PPMU node for exynos4412-odroidu3 >>>> - Add the support of bus frequency for exynos4412-odroidu3 >>>> >>>> Detailed descirption for patch-set: >>>> 1. Add generic exynos bus frequency driver >>>> : This patch-set adds the generic exynos bus frequency driver for AXI bus >>>> of sub-blocks in exynos SoC. The Samsung Exynos SoC have the common >>>> architecture for bus between DRAM and sub-blocks in SoC. >>>> >>>> There are the different buses according to Exynos SoC because Exynos SoC >>>> has the differnt sub-blocks and bus speed. In spite of this difference >>>> among Exynos SoCs, this driver is able to support almost Exynos SoC by >>>> adding >>>> unique data of each bus in the devicetree file. >>>> >>>> In devicetree, each bus node has a bus clock, regulator, operation-point >>>> and devfreq-event devices which measure the utilization of each bus block. >>>> >>>> For example, >>>> - The bus of DMC block in exynos3250.dtsi are listed below: >>>> >>>> bus_dmc: bus_dmc { >>>> compatible = "samsung,exynos-bus"; >>>> clocks = <&cmu_dmc CLK_DIV_DMC>; >>>> clock-names = "bus"; >>>> operating-points-v2 = <&bus_dmc_opp_table>; >>>> status = "disabled"; >>>> }; >>>> >>>> bus_dmc_opp_table: opp_table0 { >>>> compatible = "operating-points-v2"; >>>> opp-shared; >>>> >>>> opp00 { >>>> opp-hz = /bits/ 64 <5000>; >>>> opp-microvolt = <80>; >>>> }; >>>> opp01 { >>>> opp-hz = /bits/ 64 <1>; >>>> opp-microvolt = <80>; >>>> }; >>>> opp02 { >>>> opp-hz = /bits/ 64 <13400>; >>>> opp-microvolt
Re: [PATCH v2 12/19] ARM: dts: Add bus nodes using VDD_INT for Exynos3250
On 2015년 12월 10일 11:09, Krzysztof Kozlowski wrote: > On 09.12.2015 13:08, Chanwoo Choi wrote: >> This patch adds the bus nodes using VDD_INT for Exynos3250 SoC. >> Exynos3250 has following AXI buses to translate data between >> DRAM and sub-blocks. >> >> Following list specifies the detailed relation between DRAM and sub-blocks: >> - ACLK400 clock for MCUISP >> - ACLK266 clock for ISP >> - ACLK200 clock for FSYS >> - ACLK160 clock for LCD0 >> - ACLK100 clock for PERIL >> - GDL clock for LEFTBUS >> - GDR clock for RIGHTBUS >> - SCLK_MFC clock for MFC >> >> Signed-off-by: Chanwoo Choi >> --- >> arch/arm/boot/dts/exynos3250.dtsi | 160 >> ++ >> 1 file changed, 160 insertions(+) >> >> diff --git a/arch/arm/boot/dts/exynos3250.dtsi >> b/arch/arm/boot/dts/exynos3250.dtsi >> index 7214c5e42150..46dee1951ec1 100644 >> --- a/arch/arm/boot/dts/exynos3250.dtsi >> +++ b/arch/arm/boot/dts/exynos3250.dtsi >> @@ -721,6 +721,166 @@ >> opp-microvolt = <875000>; >> }; >> }; >> + >> +bus_leftbus: bus_leftbus { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu CLK_DIV_GDL>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_leftbus_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_rightbus: bus_rightbus { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu CLK_DIV_GDR>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_leftbus_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_lcd0: bus_lcd0 { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu CLK_DIV_ACLK_160>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_leftbus_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_fsys: bus_fsys { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu CLK_DIV_ACLK_200>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_leftbus_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_mcuisp: bus_mcuisp { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_mcuisp_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_isp: bus_isp { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu CLK_DIV_ACLK_266>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_isp_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_peril: bus_peril { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu CLK_DIV_ACLK_100>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_peril_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_mfc: bus_mfc { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu CLK_SCLK_MFC>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_leftbus_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_leftbus_opp_table: opp_table2 { >> +compatible = "operating-points-v2"; >> +opp-shared; >> + >> +o
Re: [PATCH v2 00/19] PM / devferq: Add generic exynos bus frequency driver and new passive governor
On 2015년 12월 10일 10:22, Krzysztof Kozlowski wrote: > On 10.12.2015 09:57, Krzysztof Kozlowski wrote: >> On 09.12.2015 13:07, Chanwoo Choi wrote: >> >> (...) >> >>> .../devicetree/bindings/devfreq/exynos-bus.txt | 383 +++ >> >> How about adding this file to the MAINTAINERS to devfreq exynos entry? OK. I'll add new entry for 'devfreq exynos' as following: +SAMSUNG BUS DEVICE FREQUENCY SUPPORT +M: Chanwoo Choi +L: linux...@vger.kernel.org +L: linux-samsung-...@vger.kernel.org +T: git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git +S: Supported +F: drivers/devfreq/exynos/exynos-bus.c +F: Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> Unfortunately, in current linux-next, I can find the entry for devfreq > > D'oh! I meant:^ I cannot find the entry for... > > BR, > Krzysztof > >> exynos. However I saw patches adding such entries... aren't they merged >> to linux-next? Yes, it is not merged to linux-next because any git repository don't apply this patchset. To merge the devfreq patchset to linux-next, devfreq maintainer should send the request mail to Stephen Rothwell. [snip] Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 03/19] ARM: dts: Add DMC bus node for Exynos3250
On 2015년 12월 10일 11:04, Krzysztof Kozlowski wrote: > On 10.12.2015 11:00, Chanwoo Choi wrote: >> On 2015년 12월 10일 10:20, Krzysztof Kozlowski wrote: >>> On 10.12.2015 10:09, Chanwoo Choi wrote: >>>> On 2015년 12월 10일 09:44, Krzysztof Kozlowski wrote: >>>>> On 09.12.2015 13:07, Chanwoo Choi wrote: >>>>>> This patch adds the DMC (Dynamic Memory Controller) bus node for >>>>>> Exynos3250 SoC. >>>>>> The DMC is an AMBA AXI-compliant slave to interface external JEDEC >>>>>> standard >>>>>> SDRAM devices. The bus includes the OPP tables and the source clock for >>>>>> DMC >>>>>> block. >>>>>> >>>>>> Following list specifies the detailed relation between the clock and DMC >>>>>> block: >>>>>> - The source clock of DMC block : div_dmc >>>>>> >>>>>> Signed-off-by: Chanwoo Choi >>>>>> --- >>>>>> arch/arm/boot/dts/exynos3250.dtsi | 34 >>>>>> ++ >>>>>> 1 file changed, 34 insertions(+) >>>>>> >>>>>> diff --git a/arch/arm/boot/dts/exynos3250.dtsi >>>>>> b/arch/arm/boot/dts/exynos3250.dtsi >>>>>> index 2f30d632f1cc..7214c5e42150 100644 >>>>>> --- a/arch/arm/boot/dts/exynos3250.dtsi >>>>>> +++ b/arch/arm/boot/dts/exynos3250.dtsi >>>>>> @@ -687,6 +687,40 @@ >>>>>> clock-names = "ppmu"; >>>>>> status = "disabled"; >>>>>> }; >>>>>> + >>>>>> +bus_dmc: bus_dmc { >>>>>> +compatible = "samsung,exynos-bus"; >>>>>> +clocks = <&cmu_dmc CLK_DIV_DMC>; >>>>>> +clock-names = "bus"; >>>>>> +operating-points-v2 = <&bus_dmc_opp_table>; >>>>>> +status = "disabled"; >>>>>> +}; >>>>>> + >>>>>> +bus_dmc_opp_table: opp_table1 { >>>>> >>>>> This is the firsy opp_table, right? So: >>>>> s/opp_table1/opp_table0/ >>>> >>>> Right. It is first opp_table in exynos3250.dtsi. >>>> But, I'm considering the OPP table of CPU freqeuncy as opp_table0. >>>> So, I have the plan that support the operation-points-v2 for Exynos3250 >>>> CPU. >>> >>> Ok >>> >>>> >>>>> >>>>>> +compatible = "operating-points-v2"; >>>>>> +opp-shared; >>>>>> + >>>>>> +opp00 { >>>>>> +opp-hz = /bits/ 64 <5000>; >>>>>> +opp-microvolt = <80>; >>>>>> +}; >>>>>> +opp01 { >>>>>> +opp-hz = /bits/ 64 <1>; >>>>>> +opp-microvolt = <80>; >>>>>> +}; >>>>>> +opp02 { >>>>>> +opp-hz = /bits/ 64 <13400>; >>>>>> +opp-microvolt = <80>; >>>>> >>>>> Why 134, not 133 MHz? >>>> >>>> When I used the 13300, the source clock is changed to 100Mhz instead >>>> of 133MHz. >>>> I add following test result on exynos3250-rinato board. >>>> >>>> Case1. >>>> When I use the 134 MHz, the source clock is changed to 133MHz >>>> : exynos-bus soc:bus_dmc: old_freq(2) -> new_freq (13400) >>>> (real: 13334) >>>> >>>> Case2. >>>> When I use the 133 MHz, the source clock is changed to 100MHz >>>> : exynos-bus soc:bus_dmc: old_freq(2) -> new_freq (13300) >>>> (real: 1) >>> >>> Now I remember that issue. You could use here directly 13334 but >>> that also would look a little bit weird... so 134 is ok for me. Could >>> just add a comment that desired frequency is actually "133 MHz"? >> >> Do you prefer among following example? >> >> Example1. >> opp02 { >> /* The desired frequency is 133MHz because >> * clock change has the dependency on clock driver. >> * When set rate as 134MHz, the clock driver would >> * change the 133MHz actually instead of 134MHz. >> */ >> opp-hz = /bits/ 64 <13400>; >> opp-microvolt = <80>; >> }; >> >> Example2. >> opp02 { >> opp-hz = /bits/ 64 <13334>; >> opp-microvolt = <80>; >> }; > > I would prefer the second one (13334) but I don't have strong > feelings about it. If you ok, I want to maintain the original approach as following: opp02 { opp-hz = /bits/ 64 <13400>; opp-microvolt = <80>; }; Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 03/19] ARM: dts: Add DMC bus node for Exynos3250
On 2015년 12월 10일 10:20, Krzysztof Kozlowski wrote: > On 10.12.2015 10:09, Chanwoo Choi wrote: >> On 2015년 12월 10일 09:44, Krzysztof Kozlowski wrote: >>> On 09.12.2015 13:07, Chanwoo Choi wrote: >>>> This patch adds the DMC (Dynamic Memory Controller) bus node for >>>> Exynos3250 SoC. >>>> The DMC is an AMBA AXI-compliant slave to interface external JEDEC standard >>>> SDRAM devices. The bus includes the OPP tables and the source clock for DMC >>>> block. >>>> >>>> Following list specifies the detailed relation between the clock and DMC >>>> block: >>>> - The source clock of DMC block : div_dmc >>>> >>>> Signed-off-by: Chanwoo Choi >>>> --- >>>> arch/arm/boot/dts/exynos3250.dtsi | 34 ++ >>>> 1 file changed, 34 insertions(+) >>>> >>>> diff --git a/arch/arm/boot/dts/exynos3250.dtsi >>>> b/arch/arm/boot/dts/exynos3250.dtsi >>>> index 2f30d632f1cc..7214c5e42150 100644 >>>> --- a/arch/arm/boot/dts/exynos3250.dtsi >>>> +++ b/arch/arm/boot/dts/exynos3250.dtsi >>>> @@ -687,6 +687,40 @@ >>>>clock-names = "ppmu"; >>>>status = "disabled"; >>>>}; >>>> + >>>> + bus_dmc: bus_dmc { >>>> + compatible = "samsung,exynos-bus"; >>>> + clocks = <&cmu_dmc CLK_DIV_DMC>; >>>> + clock-names = "bus"; >>>> + operating-points-v2 = <&bus_dmc_opp_table>; >>>> + status = "disabled"; >>>> + }; >>>> + >>>> + bus_dmc_opp_table: opp_table1 { >>> >>> This is the firsy opp_table, right? So: >>> s/opp_table1/opp_table0/ >> >> Right. It is first opp_table in exynos3250.dtsi. >> But, I'm considering the OPP table of CPU freqeuncy as opp_table0. >> So, I have the plan that support the operation-points-v2 for Exynos3250 CPU. > > Ok > >> >>> >>>> + compatible = "operating-points-v2"; >>>> + opp-shared; >>>> + >>>> + opp00 { >>>> + opp-hz = /bits/ 64 <5000>; >>>> + opp-microvolt = <80>; >>>> + }; >>>> + opp01 { >>>> + opp-hz = /bits/ 64 <1>; >>>> + opp-microvolt = <80>; >>>> + }; >>>> + opp02 { >>>> + opp-hz = /bits/ 64 <13400>; >>>> + opp-microvolt = <80>; >>> >>> Why 134, not 133 MHz? >> >> When I used the 13300, the source clock is changed to 100Mhz instead of >> 133MHz. >> I add following test result on exynos3250-rinato board. >> >> Case1. >> When I use the 134 MHz, the source clock is changed to 133MHz >> : exynos-bus soc:bus_dmc: old_freq(2) -> new_freq (13400) (real: >> 13334) >> >> Case2. >> When I use the 133 MHz, the source clock is changed to 100MHz >> : exynos-bus soc:bus_dmc: old_freq(2) -> new_freq (13300) (real: >> 1) > > Now I remember that issue. You could use here directly 13334 but > that also would look a little bit weird... so 134 is ok for me. Could > just add a comment that desired frequency is actually "133 MHz"? Do you prefer among following example? Example1. opp02 { /* The desired frequency is 133MHz because * clock change has the dependency on clock driver. * When set rate as 134MHz, the clock driver would * change the 133MHz actually instead of 134MHz. */ opp-hz = /bits/ 64 <13400>; opp-microvolt = <80>; }; Example2. opp02 { opp-hz = /bits/ 64 <13334>; opp-microvolt = <80>; }; Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 09/19] PM / devfreq: exynos: Update documentation for bus devices using passive governor
On 2015년 12월 10일 10:31, Krzysztof Kozlowski wrote: > On 09.12.2015 13:08, Chanwoo Choi wrote: >> This patch updates the documentation for passive bus devices and adds the >> detailed example of Exynos3250. >> >> Signed-off-by: Chanwoo Choi >> --- >> .../devicetree/bindings/devfreq/exynos-bus.txt | 244 >> - >> 1 file changed, 241 insertions(+), 3 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> index 54a1f9c46c88..c4fdc70f8eac 100644 >> --- a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> @@ -13,18 +13,23 @@ SoC has the different sub-blocks. So, this difference >> should be specified >> in devicetree file instead of each device driver. In result, this driver >> is able to support the bus frequency for all Exynos SoCs. >> >> -Required properties for bus device: >> +Required properties for all bus devices: >> - compatible: Should be "samsung,exynos-bus". >> - clock-names : the name of clock used by the bus, "bus". >> - clocks : phandles for clock specified in "clock-names" property. >> - #clock-cells: should be 1. >> - operating-points-v2: the OPP table including frequency/voltage information >>to support DVFS (Dynamic Voltage/Frequency Scaling) feature. >> + >> +Required properties for only parent bus device: > > Maybe: > "Required properties only for parent bus devices:" OK. I'll modify it. > > In this binding documentation file the idea of "parent" is not > explained. I now it is related to passive devfreq governor but looking > at the binding itself it is a new idea, not covered here. OK. I'll add the detailed description of 'parent' and correlation between 'parent' and 'passive' device. > >> - vdd-supply: the regulator to provide the buses with the voltage. >> - devfreq-events: the devfreq-event device to monitor the curret utilization >>of buses. >> >> -Optional properties for bus device: >> +Required properties for only passive bus device: > > "Required properties only for passive bus devices:" OK. I'll modify it. > >> +- devfreq: the parent bus device. >> + >> +Optional properties for only parent bus device: >> - exynos,saturation-ratio: the percentage value which is used to calibrate >> the performance count againt total cycle count. >> >> @@ -33,7 +38,20 @@ Example1: >> power line (regulator). The MIF (Memory Interface) AXI bus is used to >> transfer data between DRAM and CPU and uses the VDD_MIF regualtor. >> >> -- power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block >> +- MIF (Memory Interface) block >> +: VDD_MIF |--- DMC (Dynamic Memory Controller) >> + >> +- INT (Internal) block >> +: VDD_INT |--- LEFTBUS (parent device) >> + |--- PERIL >> + |--- MFC >> + |--- G3D >> + |--- RIGHTBUS >> + |--- FSYS >> + |--- LCD0 >> + |--- PERIR >> + |--- ISP >> + |--- CAM >> >> - MIF bus's frequency/voltage table >> --- >> @@ -46,6 +64,24 @@ Example1: >> |L5| 40 |875000 | >> --- >> >> +- INT bus's frequency/voltage table >> +-- >> +|Block|LEFTBUS|RIGHTBUS|MCUISP |ISP|PERIL ||VDD_INT | >> +| name| |LCD0| | | ||| >> +| | |FSYS| | | ||| >> +| | |MFC | | | ||| >> +-- >> +|Mode |*parent|passive |passive|passive|passive||| >> +-- >> +|Lv |Frequency ||Voltage | >> +-- >> +|L1 |5 |5 |5 |5 |5 ||90 | >> +|L2 |8 |8 |8 |8 |8 ||90 | >> +|L3 |10 |10 |10 |10 |10 ||100 | >> +|L4 |134000 |134000 |20 |20 | ||100 | >> +|L5 |20
Re: [PATCH v2 02/19] PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver
On 2015년 12월 10일 10:25, Krzysztof Kozlowski wrote: > On 10.12.2015 09:49, Chanwoo Choi wrote: >> Hi, >> > (...) > >>> >>>> + >>>> + bus_dmc: bus_dmc { >>>> + compatible = "samsung,exynos-bus"; >>>> + clocks = <&cmu_dmc CLK_DIV_DMC>; >>>> + clock-names = "bus"; >>>> + operating-points-v2 = <&bus_dmc_opp_table>; >>>> + status = "disabled"; >>>> + }; >>>> + >>>> + bus_dmc_opp_table: opp_table0 { >>>> + compatible = "operating-points-v2"; >>>> + opp-shared; >>>> + >>>> + opp00 { >>> >>> Maybe use convention with frequency, like: >>> opp@5000 >>> This also used in opp.txt examples. >> >> In the Documentations/devicetree/bindings/opp/opp.txt, >> the example uses the 'opp@0x'. I check the opp.txt of Linux 4.4-rc4. > > Yes, it was changed by Viresh in "PM / OPP: Rename OPP nodes as > opp@". You can find the most actual bindings in linux-next. OK. I'll. Best Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 03/19] ARM: dts: Add DMC bus node for Exynos3250
On 2015년 12월 10일 09:44, Krzysztof Kozlowski wrote: > On 09.12.2015 13:07, Chanwoo Choi wrote: >> This patch adds the DMC (Dynamic Memory Controller) bus node for Exynos3250 >> SoC. >> The DMC is an AMBA AXI-compliant slave to interface external JEDEC standard >> SDRAM devices. The bus includes the OPP tables and the source clock for DMC >> block. >> >> Following list specifies the detailed relation between the clock and DMC >> block: >> - The source clock of DMC block : div_dmc >> >> Signed-off-by: Chanwoo Choi >> --- >> arch/arm/boot/dts/exynos3250.dtsi | 34 ++ >> 1 file changed, 34 insertions(+) >> >> diff --git a/arch/arm/boot/dts/exynos3250.dtsi >> b/arch/arm/boot/dts/exynos3250.dtsi >> index 2f30d632f1cc..7214c5e42150 100644 >> --- a/arch/arm/boot/dts/exynos3250.dtsi >> +++ b/arch/arm/boot/dts/exynos3250.dtsi >> @@ -687,6 +687,40 @@ >> clock-names = "ppmu"; >> status = "disabled"; >> }; >> + >> +bus_dmc: bus_dmc { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu_dmc CLK_DIV_DMC>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_dmc_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_dmc_opp_table: opp_table1 { > > This is the firsy opp_table, right? So: > s/opp_table1/opp_table0/ Right. It is first opp_table in exynos3250.dtsi. But, I'm considering the OPP table of CPU freqeuncy as opp_table0. So, I have the plan that support the operation-points-v2 for Exynos3250 CPU. > >> +compatible = "operating-points-v2"; >> +opp-shared; >> + >> +opp00 { >> +opp-hz = /bits/ 64 <5000>; >> +opp-microvolt = <80>; >> +}; >> +opp01 { >> +opp-hz = /bits/ 64 <1>; >> +opp-microvolt = <80>; >> +}; >> +opp02 { >> +opp-hz = /bits/ 64 <13400>; >> +opp-microvolt = <80>; > > Why 134, not 133 MHz? When I used the 13300, the source clock is changed to 100Mhz instead of 133MHz. I add following test result on exynos3250-rinato board. Case1. When I use the 134 MHz, the source clock is changed to 133MHz : exynos-bus soc:bus_dmc: old_freq(2) -> new_freq (13400) (real: 13334) Case2. When I use the 133 MHz, the source clock is changed to 100MHz : exynos-bus soc:bus_dmc: old_freq(2) -> new_freq (13300) (real: 1) > >> +}; >> +opp03 { >> +opp-hz = /bits/ 64 <2>; >> +opp-microvolt = <80>; > > Shouldn't this be 825 mV, not 800? I think we used previously that value > for our devices. OK. I'll modify it. Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 04/19] ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk
On 2015년 12월 10일 09:53, Krzysztof Kozlowski wrote: > On 09.12.2015 13:07, Chanwoo Choi wrote: >> This patch adds the DMC (Dynamic Memory Controller) bus frequency node >> which includes the devfreq-events and regulator properties. The bus >> frequency support the DVFS (Dynamic Voltage Frequency Scaling) feature >> with ondemand governor. >> >> The devfreq-events (ppmu_dmc0*) can monitor the utilization of DMC bus >> on runtime and the buck1_reg (VDD_MIF power line) supplies the power to >> the DMC block. >> >> Signed-off-by: Chanwoo Choi >> --- >> arch/arm/boot/dts/exynos3250-monk.dts | 6 ++ >> arch/arm/boot/dts/exynos3250-rinato.dts | 6 ++ >> 2 files changed, 12 insertions(+) >> >> diff --git a/arch/arm/boot/dts/exynos3250-monk.dts >> b/arch/arm/boot/dts/exynos3250-monk.dts >> index 443a35085846..d982586a6533 100644 >> --- a/arch/arm/boot/dts/exynos3250-monk.dts >> +++ b/arch/arm/boot/dts/exynos3250-monk.dts >> @@ -498,6 +498,12 @@ >> }; >> }; >> >> +&bus_dmc { >> +devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; >> +vdd-supply = <&buck1_reg>; >> +status = "okay"; >> +}; >> + >> &xusbxti { >> clock-frequency = <2400>; >> }; >> diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts >> b/arch/arm/boot/dts/exynos3250-rinato.dts >> index 3e64d5dcdd60..61477943015b 100644 >> --- a/arch/arm/boot/dts/exynos3250-rinato.dts >> +++ b/arch/arm/boot/dts/exynos3250-rinato.dts >> @@ -675,6 +675,12 @@ >> }; >> }; >> >> +&bus_dmc { >> +devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; >> + vdd-supply = <&buck1_reg>; >> +status = "okay"; >> +}; > > I would prefer to put this in alphabetical order... which could be > tricky because the nodes are not entirely sorted. Maybe after the "&adc" > node? OK. I'll move it. > > Anyway the change looks good: > > Reviewed-by: Krzysztof Kozlowski Thanks for your review. Regards, Chanwoo Choi -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 02/19] PM / devfreq: exynos: Add documentation for generic exynos bus frequency driver
Hi, On 2015년 12월 10일 09:39, Krzysztof Kozlowski wrote: > On 09.12.2015 13:07, Chanwoo Choi wrote: >> This patch adds the documentation for generic exynos bus frequency >> driver. >> >> Signed-off-by: Chanwoo Choi >> --- >> .../devicetree/bindings/devfreq/exynos-bus.txt | 94 >> ++ >> 1 file changed, 94 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> >> diff --git a/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> new file mode 100644 >> index ..54a1f9c46c88 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/devfreq/exynos-bus.txt >> @@ -0,0 +1,94 @@ >> +* Generic Exynos Bus frequency device >> + >> +The Samsung Exynos SoC have many buses for data transfer between DRAM >> +and sub-blocks in SoC. Almost Exynos SoC have the common architecture >> +for buses. Generally, the each bus of Exynos SoC includes the source clock >> +and power line and then is able to change the clock according to the usage >> +of each buses on runtime. When gathering the usage of each buses on runtime, >> +thie driver uses the PPMU (Platform Performance Monitoring Unit) which > > s/thie/the/ OK. > >> +is able to measure the current load of sub-blocks. >> + >> +There are a little different composition among Exynos SoC because each >> Exynos >> +SoC has the different sub-blocks. So, this difference should be specified >> +in devicetree file instead of each device driver. In result, this driver >> +is able to support the bus frequency for all Exynos SoCs. >> + >> +Required properties for bus device: >> +- compatible: Should be "samsung,exynos-bus". >> +- clock-names : the name of clock used by the bus, "bus". >> +- clocks : phandles for clock specified in "clock-names" property. >> +- #clock-cells: should be 1. > > This is a clock consumer, right? So the clock-cells is not valid here. You're right. I'll remove '#clock-cells'. > >> +- operating-points-v2: the OPP table including frequency/voltage information >> + to support DVFS (Dynamic Voltage/Frequency Scaling) feature. >> +- vdd-supply: the regulator to provide the buses with the voltage. >> +- devfreq-events: the devfreq-event device to monitor the curret utilization > > s/curret/current/ > >> + of buses. >> + >> +Optional properties for bus device: >> +- exynos,saturation-ratio: the percentage value which is used to calibrate >> + the performance count againt total cycle count. > > s/againt/against/ OK. > >> + >> +Example1: >> +Show the AXI buses of Exynos3250 SoC. Exynos3250 divides the buses to >> +power line (regulator). The MIF (Memory Interface) AXI bus is used to >> +transfer data between DRAM and CPU and uses the VDD_MIF regualtor. >> + >> +- power line(VDD_MIF) --> bus for DMC (Dynamic Memory Controller) block >> + >> +- MIF bus's frequency/voltage table >> +--- >> +|Lv| Freq | Voltage | >> +--- >> +|L1| 5 |80 | >> +|L2| 10 |80 | >> +|L3| 134000 |80 | >> +|L4| 20 |80 | >> +|L5| 40 |875000 | >> +--- >> + >> +Example2 : >> +The bus of DMC (Dynamic Memory Controller) block in exynos3250.dtsi >> +are listed below: > > s/are/is/ (one bus is listed) OK. > >> + >> +bus_dmc: bus_dmc { >> +compatible = "samsung,exynos-bus"; >> +clocks = <&cmu_dmc CLK_DIV_DMC>; >> +clock-names = "bus"; >> +operating-points-v2 = <&bus_dmc_opp_table>; >> +status = "disabled"; >> +}; >> + >> +bus_dmc_opp_table: opp_table0 { >> +compatible = "operating-points-v2"; >> +opp-shared; >> + >> +opp00 { > > Maybe use convention with frequency, like: > opp@5000 > This also used in opp.txt examples. In the Documentations/devicetree/bindings/opp/opp.txt, the example uses the 'opp@0x'. I check the opp.txt of Linux 4.4-rc4. > > >> +opp-hz = /bits/ 64 <5000>; >> +opp-microvolt = <80>; >> +}; >> +opp01 { >> +
Re: [PATCH v2 00/19] PM / devferq: Add generic exynos bus frequency driver and new passive governor
Hi Anand, First of all, thanks for trying to test this series. On 2015년 12월 10일 04:05, Anand Moon wrote: > Hi Chanwoo Choi, > > On 9 December 2015 at 09:37, Chanwoo Choi wrote: >> This patch-set includes the two features as following. The generic exynos bus >> frequency driver is able to support almost Exynos SoCs for bus frequency >> scaling. And the new passive governor is able to make the dependency on >> between devices for frequency/voltage scaling. I had posted the patch-set[1] >> with the similiar concept. This is is revised version for exynos bus >> frequency. >> - Generic exynos bus frequency driver >> - New passive governor of DEVFREQ framework >> >> Depends on: >> - This patch-set is based on devfreq.git[2]. >> [1] https://lkml.org/lkml/2015/1/7/872 >>: [PATCHv3 0/8] devfreq: Add generic exynos memory-bus frequency driver >> [2] https://git.kernel.org/cgit/linux/kernel/git/mzx/devfreq.git/ (branch: >> for-rafael) >> >> Changes from v1: >> (https://lkml.org/lkml/2015/11/26/260) >> - Check whether the instance of regulator is NULL or not >> when executing regulator_disable() because of only parent >> devfreq device has the regulator instance. After fixing it, >> the wake-up from suspend state is well working. (patch1) >> - Fix bug which checks 'bus-clk' instead of 'bus->regulator' >> after calling devm_clk_get() (on patch1) >> - Update the documentation to remove the description about >> DEVFREQ-EVENT subsystem (on patch2) >> - Add the full name of DMC (Dynamic Memory Controller) (on patch2) >> - Modify the detailed correlation of buses for Exynos3250 >> on documentation (patch2) >> - Add the MFC bus node for Exynos3250 (on patch11, patch12) >> - Fix the duplicate frequency of bus_display on Exynos4x12.dtsi >> - Add the PPMU node for exynos4412-odroidu3 >> - Add the support of bus frequency for exynos4412-odroidu3 >> >> Detailed descirption for patch-set: >> 1. Add generic exynos bus frequency driver >> : This patch-set adds the generic exynos bus frequency driver for AXI bus >> of sub-blocks in exynos SoC. The Samsung Exynos SoC have the common >> architecture for bus between DRAM and sub-blocks in SoC. >> >> There are the different buses according to Exynos SoC because Exynos SoC >> has the differnt sub-blocks and bus speed. In spite of this difference >> among Exynos SoCs, this driver is able to support almost Exynos SoC by adding >> unique data of each bus in the devicetree file. >> >> In devicetree, each bus node has a bus clock, regulator, operation-point >> and devfreq-event devices which measure the utilization of each bus block. >> >> For example, >> - The bus of DMC block in exynos3250.dtsi are listed below: >> >> bus_dmc: bus_dmc { >> compatible = "samsung,exynos-bus"; >> clocks = <&cmu_dmc CLK_DIV_DMC>; >> clock-names = "bus"; >> operating-points-v2 = <&bus_dmc_opp_table>; >> status = "disabled"; >> }; >> >> bus_dmc_opp_table: opp_table0 { >> compatible = "operating-points-v2"; >> opp-shared; >> >> opp00 { >> opp-hz = /bits/ 64 <5000>; >> opp-microvolt = <80>; >> }; >> opp01 { >> opp-hz = /bits/ 64 <1>; >> opp-microvolt = <80>; >> }; >> opp02 { >> opp-hz = /bits/ 64 <13400>; >> opp-microvolt = <80>; >> }; >> opp03 { >> opp-hz = /bits/ 64 <2>; >> opp-microvolt = <80>; >> }; >> opp04 { >> opp-hz = /bits/ 64 <4>; >> opp-microvolt = <875000>; >> }; >> }; >> >> - Usage case to handle the frequency and voltage of bus on runtime >> in exynos3250-rinato.dts are listed below: >> >> &bus_dmc { >> devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; >> vdd-supply = <&buck1_reg>; /* VDD_MIF */ >> status = &
[PATCH v2 06/19] PM / devfreq: Add devfreq_get_devfreq_by_phandle()
This patch adds the new devfreq_get_devfreq_by_phandle() OF helper function which can find the instance of devfreq device by using phandle ("devfreq"). Signed-off-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 44 include/linux/devfreq.h | 9 + 2 files changed, 53 insertions(+) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 15e58779e4c0..78ea4cdaa82c 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "governor.h" static struct class *devfreq_class; @@ -686,6 +687,49 @@ struct devfreq *devm_devfreq_add_device(struct device *dev, } EXPORT_SYMBOL(devm_devfreq_add_device); +#ifdef CONFIG_OF +/* + * devfreq_get_devfreq_by_phandle - Get the devfreq device from devicetree + * @dev - instance to the given device + * @index - index into list of devfreq + * + * return the instance of devfreq device + */ +struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index) +{ + struct device_node *node; + struct devfreq *devfreq; + + if (!dev) + return ERR_PTR(-EINVAL); + + if (!dev->of_node) + return ERR_PTR(-EINVAL); + + node = of_parse_phandle(dev->of_node, "devfreq", index); + if (!node) + return ERR_PTR(-ENODEV); + + mutex_lock(&devfreq_list_lock); + list_for_each_entry(devfreq, &devfreq_list, node) { + if (devfreq->dev.parent + && devfreq->dev.parent->of_node == node) { + mutex_unlock(&devfreq_list_lock); + return devfreq; + } + } + mutex_unlock(&devfreq_list_lock); + + return ERR_PTR(-EPROBE_DEFER); +} +#else +struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index) +{ + return ERR_PTR(-ENODEV); +} +#endif /* CONFIG_OF */ +EXPORT_SYMBOL_GPL(devfreq_get_devfreq_by_phandle); + /** * devm_devfreq_remove_device() - Resource-managed devfreq_remove_device() * @dev: the device to add devfreq feature. diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index f7a6e6bd716e..d648041145ba 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h @@ -211,6 +211,9 @@ extern int devm_devfreq_register_opp_notifier(struct device *dev, extern void devm_devfreq_unregister_opp_notifier(struct device *dev, struct devfreq *devfreq); +extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, + int index); + /** * devfreq_update_stats() - update the last_status pointer in struct devfreq * @df:the devfreq instance whose status needs updating @@ -324,6 +327,12 @@ static inline void devm_devfreq_unregister_opp_notifier(struct device *dev, { } +static inline struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, + int index) +{ + return ERR_PTR(-ENODEV); +} + static inline int devfreq_update_stats(struct devfreq *df) { return -EINVAL; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 11/19] PM / devfreq: exynos: Remove unused exynos4/5 busfreq driver
This patch removes the unused exynos4/5 busfreq driver. Instead, generic exynos-bus frequency driver support the all Exynos SoCs. Signed-off-by: Chanwoo Choi --- drivers/devfreq/Kconfig | 22 - drivers/devfreq/exynos/Makefile |2 - drivers/devfreq/exynos/exynos4_bus.c | 1055 -- drivers/devfreq/exynos/exynos4_bus.h | 110 drivers/devfreq/exynos/exynos5_bus.c | 431 -- drivers/devfreq/exynos/exynos_ppmu.c | 119 drivers/devfreq/exynos/exynos_ppmu.h | 86 --- 7 files changed, 1825 deletions(-) delete mode 100644 drivers/devfreq/exynos/exynos4_bus.c delete mode 100644 drivers/devfreq/exynos/exynos4_bus.h delete mode 100644 drivers/devfreq/exynos/exynos5_bus.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.c delete mode 100644 drivers/devfreq/exynos/exynos_ppmu.h diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig index 88f7cc4539b8..e82b1d8cd200 100644 --- a/drivers/devfreq/Kconfig +++ b/drivers/devfreq/Kconfig @@ -91,28 +91,6 @@ config ARM_EXYNOS_BUS_DEVFREQ and adjusts the operating frequencies and voltages with OPP support. This does not yet operate with optimal voltages. -config ARM_EXYNOS4_BUS_DEVFREQ - bool "ARM Exynos4210/4212/4412 Memory Bus DEVFREQ Driver" - depends on (CPU_EXYNOS4210 || SOC_EXYNOS4212 || SOC_EXYNOS4412) && !ARCH_MULTIPLATFORM - select DEVFREQ_GOV_SIMPLE_ONDEMAND - select PM_OPP - help - This adds the DEVFREQ driver for Exynos4210 memory bus (vdd_int) - and Exynos4212/4412 memory interface and bus (vdd_mif + vdd_int). - It reads PPMU counters of memory controllers and adjusts - the operating frequencies and voltages with OPP support. - This does not yet operate with optimal voltages. - -config ARM_EXYNOS5_BUS_DEVFREQ - tristate "ARM Exynos5250 Bus DEVFREQ Driver" - depends on SOC_EXYNOS5250 - select DEVFREQ_GOV_SIMPLE_ONDEMAND - select PM_OPP - help - This adds the DEVFREQ driver for Exynos5250 bus interface (vdd_int). - It reads PPMU counters of memory controllers and adjusts the - operating frequencies and voltages with OPP support. - config ARM_TEGRA_DEVFREQ tristate "Tegra DEVFREQ Driver" depends on ARCH_TEGRA_124_SOC diff --git a/drivers/devfreq/exynos/Makefile b/drivers/devfreq/exynos/Makefile index 4ec06d322996..bc695ad81c7d 100644 --- a/drivers/devfreq/exynos/Makefile +++ b/drivers/devfreq/exynos/Makefile @@ -1,4 +1,2 @@ # Exynos DEVFREQ Drivers obj-$(CONFIG_ARM_EXYNOS_BUS_DEVFREQ) += exynos-bus.o -obj-$(CONFIG_ARM_EXYNOS4_BUS_DEVFREQ) += exynos_ppmu.o exynos4_bus.o -obj-$(CONFIG_ARM_EXYNOS5_BUS_DEVFREQ) += exynos_ppmu.o exynos5_bus.o diff --git a/drivers/devfreq/exynos/exynos4_bus.c b/drivers/devfreq/exynos/exynos4_bus.c deleted file mode 100644 index da9509205169.. --- a/drivers/devfreq/exynos/exynos4_bus.c +++ /dev/null @@ -1,1055 +0,0 @@ -/* drivers/devfreq/exynos4210_memorybus.c - * - * Copyright (c) 2011 Samsung Electronics Co., Ltd. - * http://www.samsung.com/ - * MyungJoo Ham - * - * EXYNOS4 - Memory/Bus clock frequency scaling support in DEVFREQ framework - * This version supports EXYNOS4210 only. This changes bus frequencies - * and vddint voltages. Exynos4412/4212 should be able to be supported - * with minor modifications. - * - * 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 -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "exynos_ppmu.h" -#include "exynos4_bus.h" - -#define MAX_SAFEVOLT 120 /* 1.2V */ - -enum exynos4_busf_type { - TYPE_BUSF_EXYNOS4210, - TYPE_BUSF_EXYNOS4x12, -}; - -/* Assume that the bus is saturated if the utilization is 40% */ -#define BUS_SATURATION_RATIO 40 - -enum busclk_level_idx { - LV_0 = 0, - LV_1, - LV_2, - LV_3, - LV_4, - _LV_END -}; - -enum exynos_ppmu_idx { - PPMU_DMC0, - PPMU_DMC1, - PPMU_END, -}; - -#define EX4210_LV_MAX LV_2 -#define EX4x12_LV_MAX LV_4 -#define EX4210_LV_NUM (LV_2 + 1) -#define EX4x12_LV_NUM (LV_4 + 1) - -/** - * struct busfreq_opp_info - opp information for bus - * @rate: Frequency in hertz - * @volt: Voltage in microvolts corresponding to this OPP - */ -struct busfreq_opp_info { - unsigned long rate; - unsigned long volt; -}; - -struct busfreq_data { - enum exynos4_busf_type type; - struct device *dev; - struct devfreq *devfreq; - bool disabled; - struct regulator *vdd_int; - struct regulator *vdd_mif; /* Exynos4412/4212 only */ - struct busfreq_opp_info curr_oppinfo; -
[PATCH v2 04/19] ARM: dts: Add DMC bus frequency for exynos3250-rinato/monk
This patch adds the DMC (Dynamic Memory Controller) bus frequency node which includes the devfreq-events and regulator properties. The bus frequency support the DVFS (Dynamic Voltage Frequency Scaling) feature with ondemand governor. The devfreq-events (ppmu_dmc0*) can monitor the utilization of DMC bus on runtime and the buck1_reg (VDD_MIF power line) supplies the power to the DMC block. Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/exynos3250-monk.dts | 6 ++ arch/arm/boot/dts/exynos3250-rinato.dts | 6 ++ 2 files changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250-monk.dts b/arch/arm/boot/dts/exynos3250-monk.dts index 443a35085846..d982586a6533 100644 --- a/arch/arm/boot/dts/exynos3250-monk.dts +++ b/arch/arm/boot/dts/exynos3250-monk.dts @@ -498,6 +498,12 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + &xusbxti { clock-frequency = <2400>; }; diff --git a/arch/arm/boot/dts/exynos3250-rinato.dts b/arch/arm/boot/dts/exynos3250-rinato.dts index 3e64d5dcdd60..61477943015b 100644 --- a/arch/arm/boot/dts/exynos3250-rinato.dts +++ b/arch/arm/boot/dts/exynos3250-rinato.dts @@ -675,6 +675,12 @@ }; }; +&bus_dmc { + devfreq-events = <&ppmu_dmc0_3>, <&ppmu_dmc1_3>; + vdd-supply = <&buck1_reg>; + status = "okay"; +}; + &xusbxti { clock-frequency = <2400>; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 12/19] ARM: dts: Add bus nodes using VDD_INT for Exynos3250
This patch adds the bus nodes using VDD_INT for Exynos3250 SoC. Exynos3250 has following AXI buses to translate data between DRAM and sub-blocks. Following list specifies the detailed relation between DRAM and sub-blocks: - ACLK400 clock for MCUISP - ACLK266 clock for ISP - ACLK200 clock for FSYS - ACLK160 clock for LCD0 - ACLK100 clock for PERIL - GDL clock for LEFTBUS - GDR clock for RIGHTBUS - SCLK_MFC clock for MFC Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/exynos3250.dtsi | 160 ++ 1 file changed, 160 insertions(+) diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi index 7214c5e42150..46dee1951ec1 100644 --- a/arch/arm/boot/dts/exynos3250.dtsi +++ b/arch/arm/boot/dts/exynos3250.dtsi @@ -721,6 +721,166 @@ opp-microvolt = <875000>; }; }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_lcd0: bus_lcd0 { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_160>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_200>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_mcuisp: bus_mcuisp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_400_MCUISP>; + clock-names = "bus"; + operating-points-v2 = <&bus_mcuisp_opp_table>; + status = "disabled"; + }; + + bus_isp: bus_isp { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_266>; + clock-names = "bus"; + operating-points-v2 = <&bus_isp_opp_table>; + status = "disabled"; + }; + + bus_peril: bus_peril { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_DIV_ACLK_100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peril_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&cmu CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table2 { + compatible = "operating-points-v2"; + opp-shared; + + opp00 { + opp-hz = /bits/ 64 <5000>; + opp-microvolt = <90>; + }; + opp01 { + opp-hz = /bits/ 64 <8000>; + opp-microvolt = <90>; + }; + opp02 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <100>; + }; + opp03 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <100>; + }; + opp04 { +
[PATCH v2 07/19] PM / devfreq: Show the related information according to governor type
This patch modifies the following sysfs entry of DEVFREQ framework because the devfreq device using passive governor don't need the same information of the devfreq device using rest governor. - polling_interval: passive gov don't use the sampling rate. - available_governors : passive gov don't be changed on runtime in this version. - trans_stat : passive governor don't support trans_stat in this version. Signed-off-by: Chanwoo Choi --- drivers/devfreq/devfreq.c | 31 +-- drivers/devfreq/governor.h| 7 +++ drivers/devfreq/governor_passive.c| 1 + drivers/devfreq/governor_performance.c| 1 + drivers/devfreq/governor_powersave.c | 1 + drivers/devfreq/governor_simpleondemand.c | 1 + drivers/devfreq/governor_userspace.c | 1 + include/linux/devfreq.h | 2 ++ 8 files changed, 39 insertions(+), 6 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 78ea4cdaa82c..18ad956fec93 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -597,7 +597,7 @@ struct devfreq *devfreq_add_device(struct device *dev, goto err_init; } - if (!strncmp(devfreq->governor_name, "passive", 7)) { + if (devfreq->governor->type == DEVFREQ_GOV_PASSIVE) { struct devfreq *parent_devfreq = ((struct devfreq_passive_data *)data)->parent; @@ -963,13 +963,23 @@ static ssize_t available_governors_show(struct device *d, struct device_attribute *attr, char *buf) { - struct devfreq_governor *tmp_governor; + struct devfreq *devfreq = to_devfreq(d); ssize_t count = 0; mutex_lock(&devfreq_list_lock); - list_for_each_entry(tmp_governor, &devfreq_governor_list, node) + if (devfreq->governor->type == DEVFREQ_GOV_PASSIVE) { count += scnprintf(&buf[count], (PAGE_SIZE - count - 2), - "%s ", tmp_governor->name); + "%s ", devfreq->governor->name); + } else { + struct devfreq_governor *tmp_governor; + + list_for_each_entry(tmp_governor, &devfreq_governor_list, node) { + if (tmp_governor->type == DEVFREQ_GOV_PASSIVE) + continue; + count += scnprintf(&buf[count], (PAGE_SIZE - count - 2), + "%s ", tmp_governor->name); + } + } mutex_unlock(&devfreq_list_lock); /* Truncate the trailing space */ @@ -1006,6 +1016,11 @@ static DEVICE_ATTR_RO(target_freq); static ssize_t polling_interval_show(struct device *dev, struct device_attribute *attr, char *buf) { + struct devfreq *df = to_devfreq(dev); + + if (df->governor->type == DEVFREQ_GOV_PASSIVE) + return sprintf(buf, "Not Supported.\n"); + return sprintf(buf, "%d\n", to_devfreq(dev)->profile->polling_ms); } @@ -1020,6 +1035,9 @@ static ssize_t polling_interval_store(struct device *dev, if (!df->governor) return -EINVAL; + if (df->governor->type == DEVFREQ_GOV_PASSIVE) + return -EINVAL; + ret = sscanf(buf, "%u", &value); if (ret != 1) return -EINVAL; @@ -1137,11 +1155,12 @@ static ssize_t trans_stat_show(struct device *dev, int i, j; unsigned int max_state = devfreq->profile->max_state; + if (max_state == 0 || devfreq->governor->type == DEVFREQ_GOV_PASSIVE) + return sprintf(buf, "Not Supported.\n"); + if (!devfreq->stop_polling && devfreq_update_status(devfreq, devfreq->previous_freq)) return 0; - if (max_state == 0) - return sprintf(buf, "Not Supported.\n"); len = sprintf(buf, " From : To\n"); len += sprintf(buf + len, " :"); diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index fad7d6321978..43513a58f5bf 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h @@ -18,6 +18,13 @@ #define to_devfreq(DEV)container_of((DEV), struct devfreq, dev) +/* Devfreq governor type */ +#define DEVFREQ_GOV_ONDEMAND 0x1 +#define DEVFREQ_GOV_PERFORMANCE0x2 +#define DEVFREQ_GOV_POWERSAVE 0x3 +#define DEVFREQ_GOV_USERSPACE 0x4 +#define DEVFREQ_GOV_PASSIVE0x4 + /* Devfreq events */ #define DEVFREQ_GOV_START
[PATCH v2 14/19] ARM: dts: Add bus nodes using VDD_INT for Exynos4x12
This patch adds the bus noes using VDD_INT for Exynos4x12 SoC. Exynos4x12 has the following AXI buses to translate data between DRAM and sub-blocks. Following list specifies the detailed relation between DRAM and sub-blocks: - ACLK100 clock for PERIL/PERIR/MFC(PCLK) - ACLK160 clock for CAM/TV/LCD : The minimum clock of ACLK160 should be over 160MHz. When drop the clock under 160MHz, show the broken image. - ACLK133 clock for FSYS - GDL clock for LEFTBUS - GDR clock for RIGHTBUS - SCLK_MFC clock for MFC Signed-off-by: Chanwoo Choi --- arch/arm/boot/dts/exynos4x12.dtsi | 112 ++ 1 file changed, 112 insertions(+) diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi index 3bcf0939755e..8bc4aee156b5 100644 --- a/arch/arm/boot/dts/exynos4x12.dtsi +++ b/arch/arm/boot/dts/exynos4x12.dtsi @@ -354,6 +354,118 @@ opp-microvolt = <95>; }; }; + + bus_leftbus: bus_leftbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDL>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_rightbus: bus_rightbus { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_DIV_GDR>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_display: bus_display { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK160>; + clock-names = "bus"; + operating-points-v2 = <&bus_display_opp_table>; + status = "disabled"; + }; + + bus_fsys: bus_fsys { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK133>; + clock-names = "bus"; + operating-points-v2 = <&bus_fsys_opp_table>; + status = "disabled"; + }; + + bus_peri: bus_peri { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_ACLK100>; + clock-names = "bus"; + operating-points-v2 = <&bus_peri_opp_table>; + status = "disabled"; + }; + + bus_mfc: bus_mfc { + compatible = "samsung,exynos-bus"; + clocks = <&clock CLK_SCLK_MFC>; + clock-names = "bus"; + operating-points-v2 = <&bus_leftbus_opp_table>; + status = "disabled"; + }; + + bus_leftbus_opp_table: opp_table3 { + compatible = "operating-points-v2"; + opp-shared; + + opp00 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <90>; + }; + opp01 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <925000>; + }; + opp02 { + opp-hz = /bits/ 64 <16000>; + opp-microvolt = <95>; + }; + opp03 { + opp-hz = /bits/ 64 <2>; + opp-microvolt = <100>; + }; + }; + + bus_display_opp_table: opp_table4 { + compatible = "operating-points-v2"; + opp-shared; + + opp00 { + opp-hz = /bits/ 64 <16000>; + opp-microvolt = <95>; + }; + opp01 { + opp-hz = /bits/ 64 <2>; + opp-microvolt = <100>; + }; + }; + + bus_fsys_opp_table: opp_table5 { + compatible = "operating-points-v2"; + opp-shared; + + opp00 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <90>; + }; + opp01 { + opp-hz = /bits/ 64 <13400>; + opp-microvolt = <925000>; + }; + }; + + bus_peri_opp_table: opp_table6 { + compatible = "operating-points-v2"; + opp-shared; + + opp00 { + opp-hz = /bits/ 64 <5000>; + opp-microvolt = <90>; + }; + opp01 { + opp-hz = /bits/ 64 <1>; + opp-microvolt = <925000>; + }; + }; }; &combiner { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html