This patchset tries to add DVFS support for Allwinner H3 SoC,
considering two kinds of adjustable regulators used on H3 boards:
SY8106A I2C-controlled regulator and SY8113B regulator (controllable
by GPIO with some special designs on the board), and also taking the
uncontrollable boards into consider.
PATCH 1 and PATCH 2 are for the SY8106A regulator, then PATCH 3 and
PATCH 4 are for the r_i2c bus, which is used by boards with SY8106A
to communicate with the regulator.
PATCH 5 adds the operating points v2 table to the H3 SoC, but with
OPPs higher than 1008MHz temporarily dropped.
Then there's patches for several tested boards: Orange Pi PC (with
SY8106A), Orange Pi One/Zero (with GPIO-adjustable SY8113B) and
ALL-H3-CC (unadjustable).
Icenowy Zheng (5):
ARM: sun8i: h3: add operating-points-v2 table for CPU
ARM: sun8i: h2+: add SY8113B regulator used by Orange Pi Zero board
ARM: sun8i: h3: add SY8113B regulator used by Orange Pi One board
ARM: sun8i: h3: fix ALL-H3-CC H3 ver VDD-CPUX voltage
ARM: sun8i: h3: set the cpu-supply to VDD-CPUX on ALL-H3-CC H3 ver
Ondrej Jirman (5):
dt-bindings: add binding for the SY8106A voltage regulator
regulator: add support for SY8106A regulator
ARM: sunxi: h3/h5: Add r_i2c pinmux node
ARM: sunxi: h3/h5: Add r_i2c I2C controller
ARM: sun8i: h3: Add SY8106A regulator to Orange Pi PC
.../bindings/regulator/sy8106a-regulator.txt | 20 +++
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 21 +++
arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dts | 8 +-
arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 21 +++
arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 27 ++++
arch/arm/boot/dts/sun8i-h3.dtsi | 32 +++-
arch/arm/boot/dts/sunxi-h3-h5.dtsi | 18 +++
drivers/regulator/Kconfig | 8 +-
drivers/regulator/Makefile | 2 +-
drivers/regulator/sy8106a-regulator.c | 168 +++++++++++++++++++++
10 files changed, 320 insertions(+), 5 deletions(-)
create mode 100644 Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
create mode 100644 drivers/regulator/sy8106a-regulator.c
--
2.15.1
@@ -0,0 +1,20 @@+SY8106A Voltage regulator++Required properties:+- compatible: Must be "silergy,sy8106a"+- reg: I2C slave address - must be <0x65>++Any property defined as part of the core regulator binding, defined in+./regulator.txt, can also be used.++Example:++ sy8106a {+ compatible = "silergy,sy8106a";+ reg = <0x65>;+ regulator-name = "sy8106a-vdd";+ regulator-min-microvolt = <1000000>;+ regulator-max-microvolt = <1400000>;+ regulator-boot-on;+ regulator-always-on;+ };
From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
SY8106A is an I2C attached single output regulator made by Silergy Corp,
which is used on several Allwinner H3/H5 SBCs to control the power
supply of the ARM cores.
Add a driver for it.
Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
[Icenowy: Change commit message, remove enable/disable code, add default
ramp_delay, add comment for go bit]
Signed-off-by: Icenowy Zheng <redacted>
---
Changes in v2:
- Dropped the enable/disable code.
- Added default ramp_delay value.
- Added comment for the "go bit".
drivers/regulator/Kconfig | 8 +-
drivers/regulator/Makefile | 2 +-
drivers/regulator/sy8106a-regulator.c | 168 ++++++++++++++++++++++++++++++++++
3 files changed, 176 insertions(+), 2 deletions(-)
create mode 100644 drivers/regulator/sy8106a-regulator.c
@@ -0,0 +1,168 @@+/*+*sy8106a-regulator.c-RegulatordevicedriverforSY8106A+*+*Copyright(C)2016OndřejJirman<megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>+*+*Thisprogramisfreesoftware;youcanredistributeitand/or+*modifyitunderthetermsoftheGNULibraryGeneralPublic+*LicenseaspublishedbytheFreeSoftwareFoundation;either+*version2oftheLicense,or(atyouroption)anylaterversion.+*+*Thisprogramisdistributedinthehopethatitwillbeuseful,+*butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof+*MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.SeetheGNU+*LibraryGeneralPublicLicenseformoredetails.+*/++#include<linux/err.h>+#include<linux/i2c.h>+#include<linux/module.h>+#include<linux/regmap.h>+#include<linux/regulator/driver.h>+#include<linux/regulator/of_regulator.h>++#define SY8106A_REG_VOUT1_SEL 0x01+#define SY8106A_REG_VOUT_COM 0x02+#define SY8106A_REG_VOUT1_SEL_MASK 0x7f+#define SY8106A_DISABLE_REG BIT(0)+/*+*TheI2Ccontrolledvoltagewillonlyworkwhenthisbitisset;otherwise+*itwillbehavelikeafixedregulator.+*/+#define SY8106A_GO_BIT BIT(7)++structsy8106a{+structregulator_dev*rdev;+structregmap*regmap;+};++staticconststructregmap_configsy8106a_regmap_config={+.reg_bits=8,+.val_bits=8,+};++staticintsy8106a_set_voltage_sel(structregulator_dev*rdev,unsignedintsel)+{+/* We use our set_voltage_sel in order to avoid unnecessary I2C+*chatter,becausetheregulator_get_voltage_sel_regmapusing+*apply_bitwouldperform4unnecessarytransfersinsteadofone,+*increasingthechanceoferror.+*/+returnregmap_write(rdev->regmap,rdev->desc->vsel_reg,+sel|SY8106A_GO_BIT);+}++staticconststructregulator_opssy8106a_ops={+.set_voltage_sel=sy8106a_set_voltage_sel,+.set_voltage_time_sel=regulator_set_voltage_time_sel,+.get_voltage_sel=regulator_get_voltage_sel_regmap,+.list_voltage=regulator_list_voltage_linear,+/* Enabling/disabling the regulator is not yet implemented */+};++/* Default limits measured in millivolts and milliamps */+#define SY8106A_MIN_MV 680+#define SY8106A_MAX_MV 1950+#define SY8106A_STEP_MV 10++staticconststructregulator_descsy8106a_reg={+.name="SY8106A",+.id=0,+.ops=&sy8106a_ops,+.type=REGULATOR_VOLTAGE,+.n_voltages=((SY8106A_MAX_MV-SY8106A_MIN_MV)/SY8106A_STEP_MV)+1,+.min_uV=(SY8106A_MIN_MV*1000),+.uV_step=(SY8106A_STEP_MV*1000),+.vsel_reg=SY8106A_REG_VOUT1_SEL,+.vsel_mask=SY8106A_REG_VOUT1_SEL_MASK,+/*+*Thisramp_delayisaconservativedefaultvaluewhichworkson+*H3/H5boardsVDD-CPUXsituations.+*/+.ramp_delay=200,+.owner=THIS_MODULE,+};++/*+*I2Cdriverinterfacefunctions+*/+staticintsy8106a_i2c_probe(structi2c_client*i2c,+conststructi2c_device_id*id)+{+structsy8106a*chip;+structdevice*dev=&i2c->dev;+structregulator_dev*rdev=NULL;+structregulator_configconfig={};+unsignedintselector;+interror;++chip=devm_kzalloc(&i2c->dev,sizeof(structsy8106a),GFP_KERNEL);+if(!chip)+return-ENOMEM;++chip->regmap=devm_regmap_init_i2c(i2c,&sy8106a_regmap_config);+if(IS_ERR(chip->regmap)){+error=PTR_ERR(chip->regmap);+dev_err(&i2c->dev,"Failed to allocate register map: %d\n",+error);+returnerror;+}++config.dev=&i2c->dev;+config.regmap=chip->regmap;+config.driver_data=chip;++config.of_node=dev->of_node;+config.init_data=of_get_regulator_init_data(dev,dev->of_node,+&sy8106a_reg);++if(!config.init_data)+return-ENOMEM;++/* Probe regulator */+error=regmap_read(chip->regmap,SY8106A_REG_VOUT1_SEL,&selector);+if(error){+dev_err(&i2c->dev,"Failed to read voltage at probe time: %d\n",error);+returnerror;+}++rdev=devm_regulator_register(&i2c->dev,&sy8106a_reg,&config);+if(IS_ERR(rdev)){+error=PTR_ERR(rdev);+dev_err(&i2c->dev,"Failed to register SY8106A regulator: %d\n",error);+returnerror;+}++chip->rdev=rdev;++i2c_set_clientdata(i2c,chip);++return0;+}++staticconststructof_device_idsy8106a_i2c_of_match[]={+{.compatible="silergy,sy8106a"},+{},+};+MODULE_DEVICE_TABLE(of,sy8106a_i2c_of_match);++staticconststructi2c_device_idsy8106a_i2c_id[]={+{"sy8106a",0},+{},+};+MODULE_DEVICE_TABLE(i2c,sy8106a_i2c_id);++staticstructi2c_driversy8106a_regulator_driver={+.driver={+.name="sy8106a",+.of_match_table=of_match_ptr(sy8106a_i2c_of_match),+},+.probe=sy8106a_i2c_probe,+.id_table=sy8106a_i2c_id,+};++module_i2c_driver(sy8106a_regulator_driver);++MODULE_AUTHOR("Ondřej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>");+MODULE_DESCRIPTION("Regulator device driver for Silergy SY8106A");+MODULE_LICENSE("GPL");
--
2.15.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
H3/H5 SoCs contain an I2C controller optionally available
on the PL0 and PL1 pins. This patch adds pinmux configuration
for this controller.
Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
[Icenowy: change commit message, node name and function name]
Signed-off-by: Icenowy Zheng <redacted>
Reviewed-by: Chen-Yu Tsai <redacted>
---
Changes in v2:
- Added Chen-Yu's Review tag.
arch/arm/boot/dts/sunxi-h3-h5.dtsi | 5 +++++
1 file changed, 5 insertions(+)
From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
Allwinner H3/H5 SoCs have an I2C controller at PL GPIO bank.
Add support for it in the device tree.
Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
[Icenowy: Change to use r_ccu and change pinmux node name]
Signed-off-by: Icenowy Zheng <redacted>
Reviewed-by: Chen-Yu Tsai <redacted>
---
Changes in v2:
- Added Chen-Yu's Review tag.
arch/arm/boot/dts/sunxi-h3-h5.dtsi | 13 +++++++++++++
1 file changed, 13 insertions(+)
The CPU on Allwinner H3 can do dynamic frequency scaling.
Add a DVFS table based on the one shipped with Allwinner's H3 SDK. The
voltage-frequency relationship seems to be conservative, and Armbian has
another DVFS table which uses lower voltage at a certain frequency.
However, the official one is chosen for safety.
Frequencies higher than 1008MHz are temporarily dropped in the table, as
they may lead to over voltage on boards without proper regulator
settings or over temperature on boards with proper regulator settings.
They will be added back once regulator settings are ready and thermal
sensor driver is merged.
In order to satisfy all different regulators (SY8106A which is 50mV per
level, SY8113B which have two states: 1.1V and 1.3V, and some board with
non-tweakable regulators), all the OPPs are defined with a range which has
the target value as the minimum allowed value, and 1.3V (the highest
VDD-CPUX voltage suggested by the datasheet) as the maximum allowed value.
It's proven to work well with a board with SY8113B.
Signed-off-by: Icenowy Zheng <redacted>
---
Changes in v2:
- Switch to BSP OPP table, which is more conservative.
arch/arm/boot/dts/sun8i-h3.dtsi | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
Orange Pi Zero board has a SY8113B regulator, which is controlled via
GPIO and capable of outputing 1.1V when the PL6 GPIO is set to output 0
or 1.3V when the PL6 GPIO is set to input or output 1, and the output is
the power supply of the ARM cores in H2+ SoC.
Add the device tree node of this regulator and set the cpu's cpu-supply
property to it.
Signed-off-by: Icenowy Zheng <redacted>
---
No changes in v2.
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
The VDD-CPUX voltage of ALL-H3-CC H3 ver should be 1.2V, not the 3.3V
currently defined in the device tree.
Fix the voltage in the device tree.
Fixes: 6ca358645d4d ("ARM: dts: sun8i: h3: Add dts file for Libre Computer Board ALL-H3-CC H3 ver.")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
New patch in v2.
arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
The ALL-H3-CC has a fixed VDD-CPUX voltage at 1.2V, which is supplied
by a regulator.
Set the CPU's cpu-supply property to the VDD-CPUX regulator.
Signed-off-by: Icenowy Zheng <redacted>
---
New patch in v2.
arch/arm/boot/dts/sun8i-h3-libretech-all-h3-cc.dts | 4 ++++
1 file changed, 4 insertions(+)
From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
Add SY8106A regulator to r_i2c bus and enable the r_i2c bus on
Orange Pi PC, then set the power supply of the ARM cores to this
regulator, in order to enable DVFS.
Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
[Icenowy: Enable DVFS in this patch, slight changes and change commit
message]
Signed-off-by: Icenowy Zheng <redacted>
---
Changes in v2:
- Reduce maximum voltage to 1.3V.
- Slightly changed the comment at 1.0V minimum voltage for taking BSP
DVFS table instead of Armbian one.
arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
Orange Pi One board has a SY8113B regulator, which is controlled via
GPIO and capable of outputing 1.1V when the PL6 GPIO is set to output 0
or 1.3V when the PL6 GPIO is set to input or output 1, and the output is
the power supply of the ARM cores in H3 SoC.
Add the device tree node of this regulator and set the cpu's cpu-supply
property to it.
Signed-off-by: Icenowy Zheng <redacted>
---
New patch in v2.
arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
From: Maxime Ripard <hidden> Date: 2018-02-06 09:07:25
On Tue, Feb 06, 2018 at 12:49:00PM +0800, Icenowy Zheng wrote:
quoted hunk
The CPU on Allwinner H3 can do dynamic frequency scaling.
Add a DVFS table based on the one shipped with Allwinner's H3 SDK. The
voltage-frequency relationship seems to be conservative, and Armbian has
another DVFS table which uses lower voltage at a certain frequency.
However, the official one is chosen for safety.
Frequencies higher than 1008MHz are temporarily dropped in the table, as
they may lead to over voltage on boards without proper regulator
settings or over temperature on boards with proper regulator settings.
They will be added back once regulator settings are ready and thermal
sensor driver is merged.
In order to satisfy all different regulators (SY8106A which is 50mV per
level, SY8113B which have two states: 1.1V and 1.3V, and some board with
non-tweakable regulators), all the OPPs are defined with a range which has
the target value as the minimum allowed value, and 1.3V (the highest
VDD-CPUX voltage suggested by the datasheet) as the maximum allowed value.
It's proven to work well with a board with SY8113B.
Signed-off-by: Icenowy Zheng <redacted>
---
Changes in v2:
- Switch to BSP OPP table, which is more conservative.
arch/arm/boot/dts/sun8i-h3.dtsi | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
@@ -43,32 +43,62 @@#include"sunxi-h3-h5.dtsi"/{+cpu0_opp_table:opp_table0{+compatible="operating-points-v2";+opp-shared;++opp@648000000{+opp-hz=/bits/64<648000000>;+opp-microvolt=<104000010400001300000>;+clock-latency-ns=<244144>;/* 8 32k periods */+};++opp@816000000{+opp-hz=/bits/64<816000000>;+opp-microvolt=<110000011000001300000>;+clock-latency-ns=<244144>;/* 8 32k periods */+};++opp@1008000000{+opp-hz=/bits/64<1008000000>;+opp-microvolt=<120000012000001300000>;+clock-latency-ns=<244144>;/* 8 32k periods */+};+};+cpus{#address-cells=<1>;#size-cells=<0>;-cpu@0{+cpu0:cpu@0{compatible="arm,cortex-a7";device_type="cpu";reg=<0>;+clocks=<&ccuCLK_CPUX>;+clock-names="cpu";+operating-points-v2=<&cpu0_opp_table>;+#cooling-cells=<0x2>;
So, that would be 2?
There's this pattern on pretty much all the other patches following
this one as well, you should address them too.
Maxime
--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
于 2018年2月6日 GMT+08:00 下午5:06:56, Maxime Ripard [off-list ref] 写到:
On Tue, Feb 06, 2018 at 12:49:00PM +0800, Icenowy Zheng wrote:
quoted
The CPU on Allwinner H3 can do dynamic frequency scaling.
Add a DVFS table based on the one shipped with Allwinner's H3 SDK.
The
quoted
voltage-frequency relationship seems to be conservative, and Armbian
has
quoted
another DVFS table which uses lower voltage at a certain frequency.
However, the official one is chosen for safety.
Frequencies higher than 1008MHz are temporarily dropped in the table,
as
quoted
they may lead to over voltage on boards without proper regulator
settings or over temperature on boards with proper regulator
settings.
quoted
They will be added back once regulator settings are ready and thermal
sensor driver is merged.
In order to satisfy all different regulators (SY8106A which is 50mV
per
quoted
level, SY8113B which have two states: 1.1V and 1.3V, and some board
with
quoted
non-tweakable regulators), all the OPPs are defined with a range
which has
quoted
the target value as the minimum allowed value, and 1.3V (the highest
VDD-CPUX voltage suggested by the datasheet) as the maximum allowed
value.
quoted
It's proven to work well with a board with SY8113B.
Signed-off-by: Icenowy Zheng <redacted>
---
Changes in v2:
- Switch to BSP OPP table, which is more conservative.
arch/arm/boot/dts/sun8i-h3.dtsi | 32
@@ -43,32 +43,62 @@#include"sunxi-h3-h5.dtsi"/{+cpu0_opp_table:opp_table0{+compatible="operating-points-v2";+opp-shared;++opp@648000000{+opp-hz=/bits/64<648000000>;+opp-microvolt=<104000010400001300000>;+clock-latency-ns=<244144>;/* 8 32k periods */+};++opp@816000000{+opp-hz=/bits/64<816000000>;+opp-microvolt=<110000011000001300000>;+clock-latency-ns=<244144>;/* 8 32k periods */+};++opp@1008000000{+opp-hz=/bits/64<1008000000>;+opp-microvolt=<120000012000001300000>;+clock-latency-ns=<244144>;/* 8 32k periods */+};+};+cpus{#address-cells=<1>;#size-cells=<0>;-cpu@0{+cpu0:cpu@0{compatible="arm,cortex-a7";device_type="cpu";reg=<0>;+clocks=<&ccuCLK_CPUX>;+clock-names="cpu";+operating-points-v2=<&cpu0_opp_table>;+#cooling-cells=<0x2>;
So, that would be 2?
Okay.
There's this pattern on pretty much all the other patches following
this one as well, you should address them too.
Maxime
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
From: Maxime Ripard <hidden> Date: 2018-02-06 09:11:30
On Tue, Feb 06, 2018 at 12:49:02PM +0800, Icenowy Zheng wrote:
quoted hunk
Orange Pi One board has a SY8113B regulator, which is controlled via
GPIO and capable of outputing 1.1V when the PL6 GPIO is set to output 0
or 1.3V when the PL6 GPIO is set to input or output 1, and the output is
the power supply of the ARM cores in H3 SoC.
Add the device tree node of this regulator and set the cpu's cpu-supply
property to it.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
New patch in v2.
arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
There's multiple of them on those boards, so the name and label should
avoid conflicting names (this also applies to your other patches).
Maxime
--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
On Tue, Feb 6, 2018 at 12:49 PM, Icenowy Zheng [off-list ref] wrote:
The VDD-CPUX voltage of ALL-H3-CC H3 ver should be 1.2V, not the 3.3V
currently defined in the device tree.
Fix the voltage in the device tree.
Fixes: 6ca358645d4d ("ARM: dts: sun8i: h3: Add dts file for Libre Computer Board ALL-H3-CC H3 ver.")
Signed-off-by: Icenowy Zheng <redacted>
On Tue, Feb 6, 2018 at 12:49 PM, Icenowy Zheng [off-list ref] wrote:
Orange Pi Zero board has a SY8113B regulator, which is controlled via
GPIO and capable of outputing 1.1V when the PL6 GPIO is set to output 0
or 1.3V when the PL6 GPIO is set to input or output 1, and the output is
the power supply of the ARM cores in H2+ SoC.
Add the device tree node of this regulator and set the cpu's cpu-supply
property to it.
Signed-off-by: Icenowy Zheng <redacted>
Reviewed-by: Chen-Yu Tsai <redacted>
However,
quoted hunk
---
No changes in v2.
arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
You might want to change the node name to something a bit more specific,
like vdd-cpux-regulator. This would decrease the chance of name collisions,
either from other additions or device tree overlays.
ChenYu
+ compatible = "regulator-gpio";
+ regulator-name = "vdd-cpux";
+ regulator-type = "voltage";
+ regulator-boot-on;
+ regulator-always-on;
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1300000>;
+ regulator-ramp-delay = <50>; /* 4ms */
+
+ gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
+ enable-active-high;
+ gpios-states = <0x1>;
+ states = <1100000 0x0
+ 1300000 0x1>;
+ };
+};
+
+&cpu0 {
+ cpu-supply = <®_sy8113b>;
};
&ehci0 {
--
2.15.1
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
On Tue, Feb 6, 2018 at 12:48 PM, Icenowy Zheng [off-list ref] wrote:
quoted hunk
From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
SY8106A is an I2C attached single output regulator made by Silergy Corp,
which is used on several Allwinner H3/H5 SBCs to control the power
supply of the ARM cores.
Add a driver for it.
Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
[Icenowy: Change commit message, remove enable/disable code, add default
ramp_delay, add comment for go bit]
Signed-off-by: Icenowy Zheng <redacted>
---
Changes in v2:
- Dropped the enable/disable code.
- Added default ramp_delay value.
- Added comment for the "go bit".
drivers/regulator/Kconfig | 8 +-
drivers/regulator/Makefile | 2 +-
drivers/regulator/sy8106a-regulator.c | 168 ++++++++++++++++++++++++++++++++++
3 files changed, 176 insertions(+), 2 deletions(-)
create mode 100644 drivers/regulator/sy8106a-regulator.c
On Tue, Feb 6, 2018 at 12:49 PM, Icenowy Zheng [off-list ref] wrote:
From: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
Add SY8106A regulator to r_i2c bus and enable the r_i2c bus on
Orange Pi PC, then set the power supply of the ARM cores to this
regulator, in order to enable DVFS.
Signed-off-by: Ondrej Jirman <megous-5qf/QAjKc83QT0dZR+AlfA@public.gmane.org>
[Icenowy: Enable DVFS in this patch, slight changes and change commit
message]
Signed-off-by: Icenowy Zheng <redacted>
Hi,
On Tue, Feb 6, 2018 at 12:48 PM, Icenowy Zheng [off-list ref] wrote:
This patchset tries to add DVFS support for Allwinner H3 SoC,
considering two kinds of adjustable regulators used on H3 boards:
SY8106A I2C-controlled regulator and SY8113B regulator (controllable
by GPIO with some special designs on the board), and also taking the
uncontrollable boards into consider.
PATCH 1 and PATCH 2 are for the SY8106A regulator, then PATCH 3 and
PATCH 4 are for the r_i2c bus, which is used by boards with SY8106A
to communicate with the regulator.
PATCH 5 adds the operating points v2 table to the H3 SoC, but with
OPPs higher than 1008MHz temporarily dropped.
Then there's patches for several tested boards: Orange Pi PC (with
SY8106A), Orange Pi One/Zero (with GPIO-adjustable SY8113B) and
ALL-H3-CC (unadjustable).
Icenowy Zheng (5):
ARM: sun8i: h3: add operating-points-v2 table for CPU
ARM: sun8i: h2+: add SY8113B regulator used by Orange Pi Zero board
ARM: sun8i: h3: add SY8113B regulator used by Orange Pi One board
ARM: sun8i: h3: fix ALL-H3-CC H3 ver VDD-CPUX voltage
ARM: sun8i: h3: set the cpu-supply to VDD-CPUX on ALL-H3-CC H3 ver
Ondrej Jirman (5):
dt-bindings: add binding for the SY8106A voltage regulator
regulator: add support for SY8106A regulator
ARM: sunxi: h3/h5: Add r_i2c pinmux node
ARM: sunxi: h3/h5: Add r_i2c I2C controller
ARM: sun8i: h3: Add SY8106A regulator to Orange Pi PC
I've applied all the device tree patches for 4.18, taking into account
comments from Maxime. See
https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git/log/?h=sunxi/h3-h5-for-4.17
Mostly it's just renaming the regulator node names and labels.
Please resend the first two patches to Mark Brown, the regulator
subsystem maintainer. And you might want to mention the branch
above in case he needs a use case reference.
Regards
ChenYu
On Mon, Apr 16, 2018 at 12:41 PM, Chen-Yu Tsai [off-list ref] wrote:
Hi,
On Tue, Feb 6, 2018 at 12:48 PM, Icenowy Zheng [off-list ref] wrote:
quoted
This patchset tries to add DVFS support for Allwinner H3 SoC,
considering two kinds of adjustable regulators used on H3 boards:
SY8106A I2C-controlled regulator and SY8113B regulator (controllable
by GPIO with some special designs on the board), and also taking the
uncontrollable boards into consider.
PATCH 1 and PATCH 2 are for the SY8106A regulator, then PATCH 3 and
PATCH 4 are for the r_i2c bus, which is used by boards with SY8106A
to communicate with the regulator.
PATCH 5 adds the operating points v2 table to the H3 SoC, but with
OPPs higher than 1008MHz temporarily dropped.
Then there's patches for several tested boards: Orange Pi PC (with
SY8106A), Orange Pi One/Zero (with GPIO-adjustable SY8113B) and
ALL-H3-CC (unadjustable).
Icenowy Zheng (5):
ARM: sun8i: h3: add operating-points-v2 table for CPU
ARM: sun8i: h2+: add SY8113B regulator used by Orange Pi Zero board
ARM: sun8i: h3: add SY8113B regulator used by Orange Pi One board
ARM: sun8i: h3: fix ALL-H3-CC H3 ver VDD-CPUX voltage
ARM: sun8i: h3: set the cpu-supply to VDD-CPUX on ALL-H3-CC H3 ver
Ondrej Jirman (5):
dt-bindings: add binding for the SY8106A voltage regulator
regulator: add support for SY8106A regulator
ARM: sunxi: h3/h5: Add r_i2c pinmux node
ARM: sunxi: h3/h5: Add r_i2c I2C controller
ARM: sun8i: h3: Add SY8106A regulator to Orange Pi PC
Mostly it's just renaming the regulator node names and labels.
Please resend the first two patches to Mark Brown, the regulator
subsystem maintainer. And you might want to mention the branch
above in case he needs a use case reference.
Regards
ChenYu
On Mon, Apr 16, 2018 at 12:41 PM, Chen-Yu Tsai [off-list ref] wrote:
Hi,
On Tue, Feb 6, 2018 at 12:48 PM, Icenowy Zheng [off-list ref] wrote:
quoted
This patchset tries to add DVFS support for Allwinner H3 SoC,
considering two kinds of adjustable regulators used on H3 boards:
SY8106A I2C-controlled regulator and SY8113B regulator (controllable
by GPIO with some special designs on the board), and also taking the
uncontrollable boards into consider.
PATCH 1 and PATCH 2 are for the SY8106A regulator, then PATCH 3 and
PATCH 4 are for the r_i2c bus, which is used by boards with SY8106A
to communicate with the regulator.
PATCH 5 adds the operating points v2 table to the H3 SoC, but with
OPPs higher than 1008MHz temporarily dropped.
Then there's patches for several tested boards: Orange Pi PC (with
SY8106A), Orange Pi One/Zero (with GPIO-adjustable SY8113B) and
ALL-H3-CC (unadjustable).
Icenowy Zheng (5):
ARM: sun8i: h3: add operating-points-v2 table for CPU
ARM: sun8i: h2+: add SY8113B regulator used by Orange Pi Zero board
ARM: sun8i: h3: add SY8113B regulator used by Orange Pi One board
ARM: sun8i: h3: fix ALL-H3-CC H3 ver VDD-CPUX voltage
ARM: sun8i: h3: set the cpu-supply to VDD-CPUX on ALL-H3-CC H3 ver
Ondrej Jirman (5):
dt-bindings: add binding for the SY8106A voltage regulator
regulator: add support for SY8106A regulator
ARM: sunxi: h3/h5: Add r_i2c pinmux node
ARM: sunxi: h3/h5: Add r_i2c I2C controller
ARM: sun8i: h3: Add SY8106A regulator to Orange Pi PC
Dropped this patch at your request. The rest will be in -next.
ChenYu
I've applied all the device tree patches for 4.18, taking into account
comments from Maxime. See
https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git/log/?h=sunxi/h3-h5-for-4.17
Mostly it's just renaming the regulator node names and labels.
Please resend the first two patches to Mark Brown, the regulator
subsystem maintainer. And you might want to mention the branch
above in case he needs a use case reference.
Regards
ChenYu