Skip to contentSkip to conversation

reset driver for NXP LPC18xx family

PATCH New Joachim Eastwood 3 participants 5 messages May 5, 2015 – Jun 6, 2015

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

v3 cover reset driver for NXP LPC18xx family

This patch set adds a reset driver for NXP LPC18xx/43xx devices.

Changes in v3:
* add patch descriptions
* change parameter name in to_rgu_data macro to avoid a potential issue if code is changed.

Changes in v2:
* clean up header includes
* prefix M0 reset defines with LPC43XX
* fix comment about M0 reset lines
* reorganize reset call chains
* add reset number table to dt doc

There are no dependencies in this patch set. The DTS changes will be sent separately to arm-soc once this patch set goes upstream.

Base support for the NXP LPC18xx family can be found here:
http://marc.info/?l=linux-arm-kernel&m=143016894704253&w=2

Joachim Eastwood (2):
reset: add driver for lpc18xx rgu
doc: dt: add documentation for lpc1850-rgu reset driver

 .../devicetree/bindings/reset/nxp,lpc1850-rgu.txt  |  84 +++++++
 drivers/reset/Makefile                             |   1 +
 drivers/reset/reset-lpc18xx.c                      | 258 +++++++++++++++++++++
 3 files changed, 343 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/nxp,lpc1850-rgu.txt
 create mode 100644 drivers/reset/reset-lpc18xx.c
Signature · 1 line
1.8.0
#1 lore raw

PATCH v3 1/2 reset: add driver for lpc18xx rgu

Add reset driver for the Reset Generation Unit (RGU) found on NXP LPC18xx and LPC43xx devies. This reset controller features up to 64 reset lines connected to different blocks and peripheral in the SoC. Most reset lines on the controller are self clearing except for those dealing with the Cortex-M0 cores on LPC43xx devices.

This driver also registers a restart handler that can be used to reset the entire device.

---
 drivers/reset/Makefile        |   1 +
 drivers/reset/reset-lpc18xx.c | 258 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 259 insertions(+)
 create mode 100644 drivers/reset/reset-lpc18xx.c
drivers/reset/Makefile +1 -0
index 157d421f755b..1d41feeb2dce 100644
@@ -1,4 +1,5 @@
 obj-$(CONFIG_RESET_CONTROLLER) += core.o
+obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o
 obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
 obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
drivers/reset/reset-lpc18xx.c new file +258 -0

258 lines not on this page · raw message

Signature · 1 line
1.8.0
#2 lore raw

PATCH v3 2/2 doc: dt: add documentation for lpc1850-rgu reset driver

In reply to Joachim Eastwood

Add device tree binding documentation for the Reset Generation Unit (RGU) found on NXP LPC18xx and LPC43xx devies.

This documentation also includes a table which shows the RGU reset number and the connected peripheral.

---
 .../devicetree/bindings/reset/nxp,lpc1850-rgu.txt  | 84 ++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/nxp,lpc1850-rgu.txt
Documentation/devicetree/bindings/reset/nxp,lpc1850-rgu.txt new file +84 -0
new file mode 100644
index 000000000000..b4e96a278445
@@ -0,0 +1,84 @@
+NXP LPC1850  Reset Generation Unit (RGU)
+========================================
+
+Please also refer to reset.txt in this directory for common reset
+controller binding usage.
+
+Required properties:
+- compatible: Should be "nxp,lpc1850-rgu"
+- reg: register base and length
+- clocks: phandle and clock specifier to RGU clocks
+- clock-names: should contain "delay" and "reg"
+- #reset-cells: should be 1
+
+See table below for valid peripheral reset numbers. Numbers not
+in the table below are either reserved or not applicable for
+normal operation.
+
+Reset	Peripheral
+  9	System control unit (SCU)
+ 12	ARM Cortex-M0 subsystem core (LPC43xx only)
+ 13	CPU core
+ 16	LCD controller
+ 17	USB0
+ 18	USB1
+ 19	DMA
+ 20	SDIO
+ 21	External memory controller (EMC)
+ 22	Ethernet
+ 25	Flash bank A
+ 27	EEPROM
+ 28	GPIO
+ 29	Flash bank B
+ 32	Timer0
+ 33	Timer1
+ 34	Timer2
+ 35	Timer3
+ 36	Repetitive Interrupt timer (RIT)
+ 37	State Configurable Timer (SCT)
+ 38	Motor control PWM (MCPWM)
+ 39	QEI
+ 40	ADC0
+ 41	ADC1
+ 42	DAC
+ 44	USART0
+ 45	UART1
+ 46	USART2
+ 47	USART3
+ 48	I2C0
+ 49	I2C1
+ 50	SSP0
+ 51	SSP1
+ 52	I2S0 and I2S1
+ 53	Serial Flash Interface (SPIFI)
+ 54	C_CAN1
+ 55	C_CAN0
+ 56	ARM Cortex-M0 application core (LPC4370 only)
+ 57	SGPIO (LPC43xx only)
+ 58	SPI (LPC43xx only)
+ 60	ADCHS (12-bit ADC) (LPC4370 only)
+
+Refer to NXP LPC18xx or LPC43xx user manual for more details about
+the reset signals and the connected block/peripheral.
+
+Reset provider example:
+rgu: reset-controller at 40053000 {
+	compatible = "nxp,lpc1850-rgu";
+	reg = <0x40053000 0x1000>;
+	clocks = <&cgu BASE_SAFE_CLK>, <&ccu1 CLK_CPU_BUS>;
+	clock-names = "delay", "reg";
+	#reset-cells = <1>;
+};
+
+Reset consumer example:
+mac: ethernet at 40010000 {
+	compatible = "nxp,lpc1850-dwmac", "snps,dwmac-3.611", "snps,dwmac";
+	reg = <0x40010000 0x2000>;
+	interrupts = <5>;
+	interrupt-names = "macirq";
+	clocks = <&ccu1 CLK_CPU_ETHERNET>;
+	clock-names = "stmmaceth";
+	resets = <&rgu 22>;
+	reset-names = "stmmaceth";
+	status = "disabled";
+};
Signature · 1 line
1.8.0
maintainer Applied
#3 lore raw

v3 cover reset driver for NXP LPC18xx family

In reply to Joachim Eastwood

Am Mittwoch, den 06.05.2015, 00:10 +0200 schrieb Joachim Eastwood:

Quoted 17 lines

This patch set adds a reset driver for NXP LPC18xx/43xx devices.

Changes in v3:
* add patch descriptions
* change parameter name in to_rgu_data macro to avoid a potential issue if code is changed.

Changes in v2:
* clean up header includes
* prefix M0 reset defines with LPC43XX
* fix comment about M0 reset lines
* reorganize reset call chains
* add reset number table to dt doc

There are no dependencies in this patch set. The DTS changes will be sent separately to arm-soc once this patch set goes upstream.

Quoted 6 lines

Base support for the NXP LPC18xx family can be found here:
http://marc.info/?l=linux-arm-kernel&m=143016894704253&w=2

Joachim Eastwood (2):
reset: add driver for lpc18xx rgu
doc: dt: add documentation for lpc1850-rgu reset driver

Applied both, thanks.

regards
Philipp

#4 lore raw

v3 cover reset driver for NXP LPC18xx family

Quoted 18 lines · Philipp Zabel

Am Mittwoch, den 06.05.2015, 00:10 +0200 schrieb Joachim Eastwood:

Quoted 17 lines

This patch set adds a reset driver for NXP LPC18xx/43xx devices.

Changes in v3:
* add patch descriptions
* change parameter name in to_rgu_data macro to avoid a potential issue if code is changed.

Changes in v2:
* clean up header includes
* prefix M0 reset defines with LPC43XX
* fix comment about M0 reset lines
* reorganize reset call chains
* add reset number table to dt doc

There are no dependencies in this patch set. The DTS changes will be sent separately to arm-soc once this patch set goes upstream.

Quoted 9 lines
Quoted 6 lines

Base support for the NXP LPC18xx family can be found here:
http://marc.info/?l=linux-arm-kernel&m=143016894704253&w=2

Joachim Eastwood (2):
reset: add driver for lpc18xx rgu
doc: dt: add documentation for lpc1850-rgu reset driver

Applied both, thanks.

Philipp,

Any chance we can have the reset controllers' tree to linux-next?

Thanks!

Signature · 2 lines
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar