Meson8b: Odroid-C1 improvements
Subsystems (2)
Martin Blumenstingl
reviewercover Meson8b: Odroid-C1 improvements
This is a small collection of improvements for the Odroid-C1 board. My main goal is to prepare the CPU voltage regulator as I'm using the Odroid-C1 to test my changes which will enable CPU frequency scaling on Meson8/Meson8b/Meson8m2.
While I was going through the schematics anyways I added more regulators, enabled the SAR ADC and added the /chosen/stdout-path property to make debugging with "earlycon" easier.
schematics for the board are published by Hardkernel and can be found
here: [0]
NOTE: This series depends on my patch "ARM: dts: meson8b: add the I2C_A, PWM_C and UART_B pins" [1] from my other series called "Meson8b: add support for the Endless Mini EC-100" as this defines the "pwm_c1_pins" for the CPU voltage regulator (which is controlled via PWM).
[0] https://dn.odroid.com/S805/Schematics/odroid-c1+_rev0.4_20150615.pdf
[1] https://patchwork.kernel.org/patch/10600043/
[2] https://patchwork.kernel.org/cover/10600031/
Martin Blumenstingl (4):
ARM: dts: meson8b: odroidc1: add the CPU voltage regulator
ARM: dts: meson8b: odroidc1: add the fixed voltage regulators
ARM: dts: meson8b: odroidc1: enable the SAR ADC
ARM: dts: meson8b: odroidc1: add stdout-path property
arch/arm/boot/dts/meson8b-odroidc1.dts | 109 +++++++++++++++++++++++++ 1 file changed, 109 insertions(+)
Signature · 1 line
2.19.0
Martin Blumenstingl
reviewerPATCH 1/4 ARM: dts: meson8b: odroidc1: add the CPU voltage regulator
The CPU voltage regulator is a "Monolithic Power Systems MP2161" (according to the Odroid-C1+'s schematics). It is driven by PWM_C on GPIODV_9.
Hardkernel's 3.10 kernel (based on the Amlogic GPL kernel sources) defines a PWM voltage table with the following values:
- 0.86 volts = PWM register value 0x10f001b
- (more values in 0.1 volt increments)
- 1.14 volts = PWM register value 0x000012a
When using the XTAL (24MHz) as input this translates into a PWM period of 12218ns with 0.86V using a duty cycle of 91% and 1.14V using a duty cycle of 0%.
--- arch/arm/boot/dts/meson8b-odroidc1.dts | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm/boot/dts/meson8b-odroidc1.dts +27 -0
@@ -101,6 +101,25 @@ states = <3300000 0 1800000 1>; }; + + vcck: regulator-vcck { + /* Monolithic Power Systems MP2161 */ + compatible = "pwm-regulator"; + + regulator-name = "VCCK"; + regulator-min-microvolt = <860000>; + regulator-max-microvolt = <1140000>; + + pwms = <&pwm_cd 0 12218 0>; + pwm-dutycycle-range = <91 0>; + + regulator-boot-on; + regulator-always-on; + }; +}; + +&cpu0 { + cpu-supply = <&vcck>; }; ðmac {
@@ -180,6 +199,14 @@ }; }; +&pwm_cd { + status = "okay"; + pinctrl-0 = <&pwm_c1_pins>; + pinctrl-names = "default"; + clocks = <&clkc CLKID_XTAL>; + clock-names = "clkin0"; +}; + &uart_AO { status = "okay"; pinctrl-0 = <&uart_ao_a_pins>;
Signature · 1 line
2.19.0
Martin Blumenstingl
reviewerPATCH 2/4 ARM: dts: meson8b: odroidc1: add the fixed voltage regulators
In reply to Martin BlumenstinglThere are multiple fixed regulators on the Odroid-C1 board. Add them so they can be used when we add the devices that need them (SAR ADC needs the 1.8V IOREF, RTC needs VDD_RTC).
These are:
- P5V0 is the main 5V power input
- VCC3V3 / VDDIO_AO3V3 / VDD3V3: fixed regulator with 3.3V output which is supplied by P5V0
- IOREF_1V8 / VCC1V8 / VDD1V8: fixed regulator with 1.8V output which is supplied by P5V0
- VDD_RTC: fixed voltage regulator with 0.9V output which is supplied by VDDIO_AO3V3
- DDR_VDDC / DDR3_1V5: fixed voltage regulator with 1.5V output which is supplied by P5V0
- the existing TF_IO and RFLASH_VDD_EN regulators are supplied by VDDIO_AO3V3
- the existing VCCK regulator is supplied by P5V0
This does not add the missing VDDEE regulator (controlled by PWM_D) because it's not clear yet how to configure the voltage of that regulator.
--- arch/arm/boot/dts/meson8b-odroidc1.dts | 73 ++++++++++++++++++++++++++ 1 file changed, 73 insertions(+)
arch/arm/boot/dts/meson8b-odroidc1.dts +73 -0
@@ -71,6 +71,14 @@ }; }; + p5v0: regulator-p5v0 { + compatible = "regulator-fixed"; + + regulator-name = "P5V0"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + tflash_vdd: regulator-tflash_vdd { /* * signal name from schematics: TFLASH_VDD_EN
@@ -81,6 +89,8 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; + vin-supply = <&vcc_3v3>; + gpio = <&gpio GPIOY_12 GPIO_ACTIVE_HIGH>; enable-active-high; };
@@ -92,6 +102,8 @@ regulator-min-microvolt = <1800000>; regulator-max-microvolt = <3300000>; + vin-supply = <&vcc_3v3>; + /* * signal name from schematics: TF_3V3N_1V8_EN */
@@ -102,6 +114,36 @@ 1800000 1>; }; + vcc_1v8: regulator-vcc-1v8 { + /* + * RICHTEK RT9179 configured for a fixed output voltage of + * 1.8V. This supplies not only VCC1V8 but also IOREF_1V8 and + * VDD1V8 according to the schematics. + */ + compatible = "regulator-fixed"; + + regulator-name = "VCC1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + vin-supply = <&p5v0>; + }; + + vcc_3v3: regulator-vcc-3v3 { + /* + * Monolithic Power Systems MP2161 configured for a fixed + * output voltage of 3.3V. This supplies not only VCC3V3 but + * also VDD3V3 and VDDIO_AO3V3 according to the schematics. + */ + compatible = "regulator-fixed"; + + regulator-name = "VCC3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + vin-supply = <&p5v0>; + }; + vcck: regulator-vcck { /* Monolithic Power Systems MP2161 */ compatible = "pwm-regulator";
@@ -110,12 +152,43 @@ regulator-min-microvolt = <860000>; regulator-max-microvolt = <1140000>; + vin-supply = <&p5v0>; + pwms = <&pwm_cd 0 12218 0>; pwm-dutycycle-range = <91 0>; regulator-boot-on; regulator-always-on; }; + + vddc_ddr: regulator-vddc-ddr { + /* + * Monolithic Power Systems MP2161 configured for a fixed + * output voltage of 1.5V. This supplies not only DDR_VDDC but + * also DDR3_1V5 according to the schematics. + */ + compatible = "regulator-fixed"; + + regulator-name = "DDR_VDDC"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + + vin-supply = <&p5v0>; + }; + + vdd_rtc: regulator-vdd-rtc { + /* + * Torex Semiconductor XC6215 configured for a fixed output of + * 0.9V. + */ + compatible = "regulator-fixed"; + + regulator-name = "VDD_RTC"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + + vin-supply = <&vcc_3v3>; + }; }; &cpu0 {
Signature · 1 line
2.19.0
Martin Blumenstingl
reviewerPATCH 3/4 ARM: dts: meson8b: odroidc1: enable the SAR ADC
In reply to Martin BlumenstinglOdroid-C1 exposes ADC channels 0 and 1 on the GPIO headers. NOTE: Due to the SoC design these are limited to 1.8V (instead of 3.3V like all other pins).
Enable the SAR ADC to enable voltage measurements on these pins.
--- arch/arm/boot/dts/meson8b-odroidc1.dts | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/meson8b-odroidc1.dts +5 -0
@@ -246,6 +246,11 @@ pinctrl-names = "default"; }; +&saradc { + status = "okay"; + vref-supply = <&vcc_1v8>; +}; + &sdio { status = "okay";
Signature · 1 line
2.19.0
Martin Blumenstingl
reviewerPATCH 4/4 ARM: dts: meson8b: odroidc1: add stdout-path property
In reply to Martin BlumenstinglTo use the "earlycon" kernel command line parameter (without arguments) we need a stdout-path property under the /chosen node. Add this to make it easier to spot errors early in the boot process when looking for them.
--- arch/arm/boot/dts/meson8b-odroidc1.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/meson8b-odroidc1.dts +4 -0
@@ -57,6 +57,10 @@ mmc0 = &sd_card_slot; }; + chosen { + stdout-path = "serial0:115200n8"; + }; + memory { reg = <0x40000000 0x40000000>; };
Signature · 1 line
2.19.0
Kevin Hilman
maintainercover Meson8b: Odroid-C1 improvements
In reply to Martin BlumenstinglQuoted 9 lines · Martin Blumenstingl
This is a small collection of improvements for the Odroid-C1 board. My main goal is to prepare the CPU voltage regulator as I'm using the Odroid-C1 to test my changes which will enable CPU frequency scaling on Meson8/Meson8b/Meson8m2.
While I was going through the schematics anyways I added more regulators, enabled the SAR ADC and added the /chosen/stdout-path property to make debugging with "earlycon" easier.
Quoted 8 lines
schematics for the board are published by Hardkernel and can be found
here: [0]NOTE: This series depends on my patch "ARM: dts: meson8b: add the
I2C_A,PWM_CandUART_Bpins" [1] from my other series called "Meson8b: add support for the Endless Mini EC-100" as this defines the "pwm_c1_pins" for the CPU voltage regulator (which is controlled via PWM).
Applied to v4.20/dt (on top of the Endless series)
Thanks for pointing out the dependencies,
Kevin