Skip to contentSkip to conversation

LPC18xx dts for 4.7

PATCH New Joachim Eastwood 1 participant 8 messages Mar 29, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover LPC18xx dts for 4.7

These patches add support for the RTC and analog peripherals (ADC/DAC) found on LPC18xx SoCs. It also adds a CREG clock controller which is needed to enable the 1 kHz clock for the RTC. Note that the IIO drivers and dt doc hasn't yet hit next but they are queued in the IIO tree and should hit next anytime now.

There are also a few board updates to enable the analog peripherals on the two LPC435x development boards.

These patches represent the bulk of dts additions on lpc18xx platform for 4.7. There is also a bulk with warning fixes that is upcoming.

Joachim Eastwood (7):
ARM: dts: lpc18xx: add creg-clk node
ARM: dts: lpc18xx: add rtc node
ARM: dts: lpc18xx: add adc nodes
ARM: dts: lpc18xx: add dac node
ARM: dts: lpc4357-ea4357: add adc0
ARM: dts: lpc4357-ea4357: add dac
ARM: dts: lpc4350-hitex-eval: add adc1

 arch/arm/boot/dts/lpc18xx.dtsi              | 43 ++++++++++++++++++++++++++++-
 arch/arm/boot/dts/lpc4350-hitex-eval.dts    | 23 +++++++++++++++
 arch/arm/boot/dts/lpc4357-ea4357-devkit.dts | 17 ++++++++++++
 3 files changed, 82 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/7 ARM: dts: lpc18xx: add creg-clk node

Add node for the creg clock controller and change the input clock on cgu to use it.

---
 arch/arm/boot/dts/lpc18xx.dtsi | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm/boot/dts/lpc18xx.dtsi +7 -1
index 053a1f5..0b59eae1 100644
@@ -195,6 +195,12 @@
 			clocks = <&ccu1 CLK_CPU_CREG>;
 			resets = <&rgu 5>;
 
+			creg_clk: clock-controller {
+				compatible = "nxp,lpc1850-creg-clk";
+				clocks = <&xtal32>;
+				#clock-cells = <1>;
+			};
+
 			usb0_otg_phy: phy at 004 {
 				compatible = "nxp,lpc1850-usb-otg-phy";
 				clocks = <&ccu1 CLK_USB0>;
@@ -213,7 +219,7 @@
 			compatible = "nxp,lpc1850-cgu";
 			reg = <0x40050000 0x1000>;
 			#clock-cells = <1>;
-			clocks = <&xtal>, <&xtal32>, <&enet_rx_clk>, <&enet_tx_clk>, <&gp_clkin>;
+			clocks = <&xtal>, <&creg_clk 1>, <&enet_rx_clk>, <&enet_tx_clk>, <&gp_clkin>;
 		};
 
 		ccu1: clock-controller at 40051000 {
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/7 ARM: dts: lpc18xx: add rtc node

In reply to Joachim Eastwood

Add node for the internal RTC found on all lpc18xx SoCs.

---
 arch/arm/boot/dts/lpc18xx.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/lpc18xx.dtsi +8 -0
index 0b59eae1..e270294 100644
@@ -215,6 +215,14 @@
 			};
 		};
 
+		rtc: rtc at 40046000 {
+			compatible = "nxp,lpc1850-rtc", "nxp,lpc1788-rtc";
+			reg = <0x40046000 0x1000>;
+			interrupts = <47>;
+			clocks = <&creg_clk 0>, <&ccu1 CLK_CPU_BUS>;
+			clock-names = "rtc", "reg";
+		};
+
 		cgu: clock-controller at 40050000 {
 			compatible = "nxp,lpc1850-cgu";
 			reg = <0x40050000 0x1000>;
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/7 ARM: dts: lpc18xx: add adc nodes

In reply to Joachim Eastwood

Add nodes for the two 10-bit ADCs found on all lpc18xx SoCs.

---
 arch/arm/boot/dts/lpc18xx.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm/boot/dts/lpc18xx.dtsi +18 -0
index e270294..88d27ae 100644
@@ -453,6 +453,24 @@
 			status = "disabled";
 		};
 
+		adc0: adc at 400e3000 {
+			compatible = "nxp,lpc1850-adc";
+			reg = <0x400e3000 0x1000>;
+			interrupts = <17>;
+			clocks = <&ccu1 CLK_APB3_ADC0>;
+			resets = <&rgu 40>;
+			status = "disabled";
+		};
+
+		adc1: adc at 400e4000 {
+			compatible = "nxp,lpc1850-adc";
+			reg = <0x400e4000 0x1000>;
+			interrupts = <21>;
+			clocks = <&ccu1 CLK_APB3_ADC1>;
+			resets = <&rgu 41>;
+			status = "disabled";
+		};
+
 		gpio: gpio at 400f4000 {
 			compatible = "nxp,lpc1850-gpio";
 			reg = <0x400f4000 0x4000>;
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/7 ARM: dts: lpc18xx: add dac node

In reply to Joachim Eastwood

Add node for the 10-bit DAC found on all lpc18xx SoCs.

---
 arch/arm/boot/dts/lpc18xx.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/lpc18xx.dtsi +9 -0
index 88d27ae..fdc991b 100644
@@ -444,6 +444,15 @@
 			status = "disabled";
 		};
 
+		dac: dac at 400e1000 {
+			compatible = "nxp,lpc1850-dac";
+			reg = <0x400e1000 0x1000>;
+			interrupts = <0>;
+			clocks = <&ccu1 CLK_APB3_DAC>;
+			resets = <&rgu 42>;
+			status = "disabled";
+		};
+
 		can0: can at 400e2000 {
 			compatible = "bosch,c_can";
 			reg = <0x400e2000 0x1000>;
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/7 ARM: dts: lpc4357-ea4357: add adc0

In reply to Joachim Eastwood

Enable adc0 on EA4357 dev kit. This kit has a 22k
potentiometer (R94) connected on ADC0 channel 3.

---
 arch/arm/boot/dts/lpc4357-ea4357-devkit.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/lpc4357-ea4357-devkit.dts +12 -0
index 079d3cf..bbc70b9 100644
@@ -38,6 +38,13 @@
 		reg = <0x28000000 0x2000000>; /* 32 MB */
 	};
 
+	vcc: vcc_fixed {
+		compatible = "regulator-fixed";
+		regulator-name = "3v3-supply";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
 	/* vmmc is controlled by sdmmc host internally */
 	vmmc: vmmc_fixed {
 		compatible = "regulator-fixed";
@@ -461,6 +468,11 @@
 	};
 };
 
+&adc0 {
+	status = "okay";
+	vref-supply = <&vcc>;
+};
+
 &i2c0 {
 	status = "okay";
 	pinctrl-names = "default";
Signature · 1 line
2.7.4
#6 lore raw

PATCH 6/7 ARM: dts: lpc4357-ea4357: add dac

In reply to Joachim Eastwood

Enable the DAC on the EA4357 dev kit.

---
 arch/arm/boot/dts/lpc4357-ea4357-devkit.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/lpc4357-ea4357-devkit.dts +5 -0
index bbc70b9..a211b6e 100644
@@ -495,6 +495,11 @@
 	};
 };
 
+&dac {
+	status = "okay";
+	vref-supply = <&vcc>;
+};
+
 &emc {
 	status = "okay";
 	pinctrl-names = "default";
Signature · 1 line
2.7.4
#7 lore raw

PATCH 7/7 ARM: dts: lpc4350-hitex-eval: add adc1

In reply to Joachim Eastwood

Enable adc1 on LPC4350 Hitex Evalution board. This board has a 10k potensiometer (R26) connected to ADC1 channel 2.

---
 arch/arm/boot/dts/lpc4350-hitex-eval.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm/boot/dts/lpc4350-hitex-eval.dts +23 -0
index 022d495..6d0c698 100644
@@ -119,9 +119,25 @@
 			gpios = <&pca_gpio 3 GPIO_ACTIVE_LOW>;
 		};
 	};
+
+	vcc: vcc_fixed {
+		compatible = "regulator-fixed";
+		regulator-name = "3v3io";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
 };
 
 &pinctrl {
+	adc1_pins: adc1-pins {
+		adc1_pins_cfg {
+			pins = "pf_9";
+			function = "adc";
+			input-disable;
+			bias-disable;
+		};
+	};
+
 	emc_pins: emc-pins {
 		emc_addr0_23_cfg {
 			pins =	"p2_9",  "p2_10", "p2_11", "p2_12",
@@ -325,6 +341,13 @@
 	};
 };
 
+&adc1 {
+	status = "okay";
+	vref-supply = <&vcc>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&adc1_pins>;
+};
+
 &emc {
 	status = "okay";
 	pinctrl-names = "default";
Signature · 1 line
2.7.4