Skip to contentSkip to conversation

Amlogic: GXBB: Add reset controller

PATCH Superseded Neil Armstrong 4 participants 23 messages May 20, 2016 – May 23, 2016

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Amlogic: GXBB: Add reset controller

Patchset to add and enable the reset controller driver on GXBB platforms.

This reset controller has up to 256 reset lines with reset pulse generation only, so the assert and deassert calls are not available.

Changes since the RFC at http://lkml.kernel.org/r/1463148012-25988-1-git-send-email-narmstrong at baylibre.com :
- Fix register mapping and bit defines in bindings header
- Remove assert and unassert calls
- Fix missing __iomem

Neil Armstrong (3):
reset: Add support for the Amlogic Meson GXBB Reset Controller
dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller
ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms

 .../bindings/reset/amlogic,meson-gxbb-reset.txt    |  18 ++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |   6 +
 drivers/reset/Kconfig                              |   6 +
 drivers/reset/Makefile                             |   1 +
 drivers/reset/reset-meson-gxbb.c                   | 129 +++++++++++++
 .../dt-bindings/reset/amlogic,meson-gxbb-reset.h   | 199 +++++++++++++++++++++
 6 files changed, 359 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/amlogic,meson-gxbb-reset.txt
 create mode 100644 drivers/reset/reset-meson-gxbb.c
 create mode 100644 include/dt-bindings/reset/amlogic,meson-gxbb-reset.h
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/3 reset: Add support for the Amlogic Meson GXBB Reset Controller

This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.

---
 drivers/reset/Kconfig            |   6 ++
 drivers/reset/Makefile           |   1 +
 drivers/reset/reset-meson-gxbb.c | 129 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 drivers/reset/reset-meson-gxbb.c
drivers/reset/Kconfig +6 -0
index df37212..4ac5c4d 100644
@@ -12,5 +12,11 @@ menuconfig RESET_CONTROLLER
 
 	  If unsure, say no.
 
+config MESON_GXBB_RESET
+	tristate "Amlogic Meson GXBB Reset Driver"
+	depends on (ARCH_MESON && RESET_CONTROLLER)
+	help
+	  Build the Amlogic Meson GxBB reset driver.
+
 source "drivers/reset/sti/Kconfig"
 source "drivers/reset/hisilicon/Kconfig"
drivers/reset/Makefile +1 -0
index a1fc8ed..5ff83a1 100644
@@ -3,6 +3,7 @@ obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o
 obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
 obj-$(CONFIG_MACH_PISTACHIO) += reset-pistachio.o
+obj-$(CONFIG_MESON_GXBB_RESET) += reset-meson-gxbb.o
 obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_ARCH_STI) += sti/
 obj-$(CONFIG_ARCH_HISI) += hisilicon/
drivers/reset/reset-meson-gxbb.c new file +129 -0

129 lines not on this page · raw message

Signature · 1 line
2.7.0
#2 lore raw

Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller

Quoted 10 lines · Neil Armstrong

This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.

---
 drivers/reset/Kconfig            |   6 ++
 drivers/reset/Makefile           |   1 +
 drivers/reset/reset-meson-gxbb.c | 129 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 drivers/reset/reset-meson-gxbb.c

Do we really need to be that specific (-gxbb)? This driver looks generic and simple enough to be used for several Amlogic families. You are already differentiating between them with the include file defining the reset indexes for the SoC.

Quoted 21 lines
drivers/reset/Kconfig +6 -0
index df37212..4ac5c4d 100644
@@ -12,5 +12,11 @@ menuconfig RESET_CONTROLLER
 
 	  If unsure, say no.
 
+config MESON_GXBB_RESET
+	tristate "Amlogic Meson GXBB Reset Driver"
+	depends on (ARCH_MESON && RESET_CONTROLLER)
+	help
+	  Build the Amlogic Meson GxBB reset driver.
+
 source "drivers/reset/sti/Kconfig"
 source "drivers/reset/hisilicon/Kconfig"
drivers/reset/Makefile +0 -0
index a1fc8ed..5ff83a1 100644

drivers/reset/Makefile obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o · line 6

Quoted 4 lines
drivers/reset/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o
 obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
 obj-$(CONFIG_MACH_PISTACHIO) += reset-pistachio.o
+obj-$(CONFIG_MESON_GXBB_RESET) += reset-meson-gxbb.o

obj-$(CONFIG_ARCH_MESON) ?

[...]

drivers/reset/Makefile obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o · line 9

Quoted 3 lines
drivers/reset/Makefile +3 -0
+static const struct reset_control_ops meson_gxbb_reset_ops = {
+	.reset		= meson_gxbb_reset_reset,
+};

nit: unfortunate name :)

Any reason to not have also .assert / .deassert?

[...]

drivers/reset/Makefile obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o

Quoted 10 lines
drivers/reset/Makefile +10 -0
+static struct platform_driver meson_gxbb_reset_driver = {
+	.probe	= meson_gxbb_reset_probe,
+	.remove	= meson_gxbb_reset_remove,
+	.driver = {
+		.name		= "meson_gxbb_reset",
+		.of_match_table	= meson_gxbb_reset_dt_ids,
+	},
+};
+
+module_platform_driver(meson_gxbb_reset_driver);

No MODULE_AUTHOR, MODULE_LICENSE, etc... ?

Signature · 1 line
Carlo Caione
#3 lore raw

Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller

Quoted 12 lines · Carlo Caione
Quoted 10 lines · Neil Armstrong

This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.

---
 drivers/reset/Kconfig            |   6 ++
 drivers/reset/Makefile           |   1 +
 drivers/reset/reset-meson-gxbb.c | 129 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 drivers/reset/reset-meson-gxbb.c
Quoted 4 lines

Do we really need to be that specific (-gxbb)? This driver looks generic and simple enough to be used for several Amlogic families. You are already differentiating between them with the include file defining the reset indexes for the SoC.

This is a good question, do the S805 have similar registers ? Same count and width ? I no, it should need a rework to add a data structure per-SoC.

Quoted 29 lines
Quoted 22 lines
drivers/reset/Kconfig +6 -0
index df37212..4ac5c4d 100644
@@ -12,5 +12,11 @@ menuconfig RESET_CONTROLLER
 
 	  If unsure, say no.
 
+config MESON_GXBB_RESET
+	tristate "Amlogic Meson GXBB Reset Driver"
+	depends on (ARCH_MESON && RESET_CONTROLLER)
+	help
+	  Build the Amlogic Meson GxBB reset driver.
+
 source "drivers/reset/sti/Kconfig"
 source "drivers/reset/hisilicon/Kconfig"
drivers/reset/Makefile +0 -0
index a1fc8ed..5ff83a1 100644

drivers/reset/Makefile obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o · line 6

Quoted 4 lines
drivers/reset/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o
 obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
 obj-$(CONFIG_MACH_PISTACHIO) += reset-pistachio.o
+obj-$(CONFIG_MESON_GXBB_RESET) += reset-meson-gxbb.o

obj-$(CONFIG_ARCH_MESON) ?

Quoted 8 lines

[...]

drivers/reset/Makefile

Quoted 3 lines
drivers/reset/Makefile +3 -0
+static const struct reset_control_ops meson_gxbb_reset_ops = {
+	.reset		= meson_gxbb_reset_reset,
+};

nit: unfortunate name :)

Any reason to not have also .assert / .deassert?

The registers seems write-only and does no retain the bit written, assert and deassert makes no sense in this case.

Quoted 14 lines

[...]

drivers/reset/Makefile

Quoted 10 lines
drivers/reset/Makefile +10 -0
+static struct platform_driver meson_gxbb_reset_driver = {
+	.probe	= meson_gxbb_reset_probe,
+	.remove	= meson_gxbb_reset_remove,
+	.driver = {
+		.name		= "meson_gxbb_reset",
+		.of_match_table	= meson_gxbb_reset_dt_ids,
+	},
+};
+
+module_platform_driver(meson_gxbb_reset_driver);

No MODULE_AUTHOR, MODULE_LICENSE, etc... ?

What is the MODULE_LICENCE format for dual licensing ?

Thanks,
Neil

maintainer
#4 lore raw

Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller

Am Freitag, den 20.05.2016, 11:10 +0200 schrieb Neil Armstrong:
[...]

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+module_platform_driver(meson_gxbb_reset_driver);

No MODULE_AUTHOR, MODULE_LICENSE, etc... ?

What is the MODULE_LICENCE format for dual licensing ?

"Dual BSD/GPL"

regards
Philipp

#5 lore raw

Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller

In reply to Neil Armstrong
Quoted 13 lines · Neil Armstrong
Quoted 12 lines · Carlo Caione
Quoted 10 lines · Neil Armstrong

This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.

---
 drivers/reset/Kconfig            |   6 ++
 drivers/reset/Makefile           |   1 +
 drivers/reset/reset-meson-gxbb.c | 129 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 drivers/reset/reset-meson-gxbb.c
Quoted 7 lines
Quoted 4 lines

Do we really need to be that specific (-gxbb)? This driver looks generic and simple enough to be used for several Amlogic families. You are already differentiating between them with the include file defining the reset indexes for the SoC.

This is a good question, do the S805 have similar registers ? Same count and width ? I no, it should need a rework to add a data structure per-SoC.

According to the datasheet on S805 we have 7 registers with 16 reset bits per register.

[...]

Quoted 15 lines
Quoted 14 lines

[...]

drivers/reset/reset-meson-gxbb.c line 129

Quoted 10 lines
drivers/reset/reset-meson-gxbb.c new file +10 -0
+static struct platform_driver meson_gxbb_reset_driver = {
+	.probe	= meson_gxbb_reset_probe,
+	.remove	= meson_gxbb_reset_remove,
+	.driver = {
+		.name		= "meson_gxbb_reset",
+		.of_match_table	= meson_gxbb_reset_dt_ids,
+	},
+};
+
+module_platform_driver(meson_gxbb_reset_driver);

No MODULE_AUTHOR, MODULE_LICENSE, etc... ?

Quoted 1 line

What is the MODULE_LICENCE format for dual licensing ?

Dual BSD/GPL ?

Cheers,

Signature · 1 line
Carlo Caione
#6 lore raw

Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller

Quoted 19 lines · Carlo Caione
Quoted 18 lines · Neil Armstrong
Quoted 16 lines · Carlo Caione
Quoted 10 lines · Neil Armstrong

This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.

---
 drivers/reset/Kconfig            |   6 ++
 drivers/reset/Makefile           |   1 +
 drivers/reset/reset-meson-gxbb.c | 129 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 drivers/reset/reset-meson-gxbb.c

Do we really need to be that specific (-gxbb)? This driver looks generic and simple enough to be used for several Amlogic families. You are already differentiating between them with the include file defining the reset indexes for the SoC.

Quoted 5 lines
Quoted 2 lines

This is a good question, do the S805 have similar registers ? Same count and width ? I no, it should need a rework to add a data structure per-SoC.

According to the datasheet on S805 we have 7 registers with 16 reset bits per register.

It will fit, I made the change to be generic. Do you know if the meson8 and previous meson6 has these registers ?

Neil

#7 lore raw

Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller

Quoted 20 lines · Neil Armstrong
Quoted 19 lines · Carlo Caione
Quoted 18 lines · Neil Armstrong
Quoted 16 lines · Carlo Caione
Quoted 10 lines · Neil Armstrong

This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.

---
 drivers/reset/Kconfig            |   6 ++
 drivers/reset/Makefile           |   1 +
 drivers/reset/reset-meson-gxbb.c | 129 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 drivers/reset/reset-meson-gxbb.c

Do we really need to be that specific (-gxbb)? This driver looks generic and simple enough to be used for several Amlogic families. You are already differentiating between them with the include file defining the reset indexes for the SoC.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

This is a good question, do the S805 have similar registers ? Same count and width ? I no, it should need a rework to add a data structure per-SoC.

According to the datasheet on S805 we have 7 registers with 16 reset bits per register.

It will fit, I made the change to be generic. Do you know if the meson8 and previous meson6 has these registers ?

No idea. No datasheet for those.

Cheers,

Signature · 1 line
Carlo Caione
maintainer
#8 lore raw

Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller

In reply to Neil Armstrong

Hi Neil,

Am Freitag, den 20.05.2016, 10:27 +0200 schrieb Neil Armstrong:

Quoted 16 lines

This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.

---
 drivers/reset/Kconfig            |   6 ++
 drivers/reset/Makefile           |   1 +
 drivers/reset/reset-meson-gxbb.c | 129 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 136 insertions(+)
 create mode 100644 drivers/reset/reset-meson-gxbb.c
drivers/reset/Kconfig +0 -0
index df37212..4ac5c4d 100644

drivers/reset/Kconfig menuconfig RESET_CONTROLLER · line 17

Quoted 6 lines
drivers/reset/Kconfig +3 -0
@@ -12,5 +12,11 @@ menuconfig RESET_CONTROLLER
 
 	  If unsure, say no.
 
+config MESON_GXBB_RESET
+	tristate "Amlogic Meson GXBB Reset Driver"
+	depends on (ARCH_MESON && RESET_CONTROLLER)

With the "reset: fix Kconfig menu to include reset drivers in sub-menu" patch [1] applied this is wrapped in "if RESET_CONTROLLER ... endif", so no need to depend on RESET_CONTROLLER.
Is there a reason to have this configurable at all, though?

[1] https://patchwork.kernel.org/patch/9000591/

Quoted 10 lines
drivers/reset/Kconfig +3 -0
+	help
+	  Build the Amlogic Meson GxBB reset driver.
+
 source "drivers/reset/sti/Kconfig"
 source "drivers/reset/hisilicon/Kconfig"
drivers/reset/Makefile +0 -0
index a1fc8ed..5ff83a1 100644

drivers/reset/Makefile obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o · line 6

Quoted 4 lines
drivers/reset/Makefile +1 -0
@@ -3,6 +3,7 @@ obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o
 obj-$(CONFIG_ARCH_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_ARCH_BERLIN) += reset-berlin.o
 obj-$(CONFIG_MACH_PISTACHIO) += reset-pistachio.o
+obj-$(CONFIG_MESON_GXBB_RESET) += reset-meson-gxbb.o

Or drop CONFIG_MESON_GXBB_RESET and use CONFIG_ARCH_MESON directly.

[...]

Quoted 12 lines
drivers/reset/Makefile +12 -0
+static int meson_gxbb_reset_probe(struct platform_device *pdev)
+{
+	struct meson_gxbb_reset *data;
+	struct resource *res;
+
+	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+	if (!data)
+		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	data->reg_base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(data->reg_base))

drivers/reset/Makefile obj-$(CONFIG_ARCH_LPC18XX) += reset-lpc18xx.o

Quoted 10 lines
drivers/reset/Makefile +10 -0
+		return PTR_ERR(data->reg_base);
+
+	platform_set_drvdata(pdev, data);
+
+	data->rcdev.owner = THIS_MODULE;
+	data->rcdev.nr_resets = REG_COUNT * BITS_PER_REG;
+	data->rcdev.ops = &meson_gxbb_reset_ops;
+	data->rcdev.of_node = pdev->dev.of_node;
+
+	return reset_controller_register(&data->rcdev);

With the "reset: add devm_reset_controller_register API" patch [2] applied you can use devm_reset_controller_register() here and remove the meson_gxbb_reset_remove() function below.

[2] https://patchwork.kernel.org/patch/8988471/

drivers/reset/Makefile

Quoted 10 lines
drivers/reset/Makefile +10 -0
+}
+
+static int meson_gxbb_reset_remove(struct platform_device *pdev)
+{
+	struct meson_gxbb_reset *data = platform_get_drvdata(pdev);
+
+	reset_controller_unregister(&data->rcdev);
+
+	return 0;
+}

Could be removed, then.

regards
Philipp

#9 lore raw

Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller

Hi Philipp,

Quoted 12 lines · Philipp Zabel

Hi Neil,

Am Freitag, den 20.05.2016, 10:27 +0200 schrieb Neil Armstrong:

drivers/reset/Kconfig menuconfig RESET_CONTROLLER · line 17

Quoted 3 lines
drivers/reset/Kconfig +3 -0
+config MESON_GXBB_RESET
+	tristate "Amlogic Meson GXBB Reset Driver"
+	depends on (ARCH_MESON && RESET_CONTROLLER)

With the "reset: fix Kconfig menu to include reset drivers in sub-menu" patch [1] applied this is wrapped in "if RESET_CONTROLLER ... endif", so no need to depend on RESET_CONTROLLER.
Is there a reason to have this configurable at all, though?

Quoted 3 lines

[1] https://patchwork.kernel.org/patch/9000591/

Or drop CONFIG_MESON_GXBB_RESET and use CONFIG_ARCH_MESON directly.

No strong reason, I will switch to CONFIG_ARCH_MESON.

Quoted 21 lines

[...]

With the "reset: add devm_reset_controller_register API" patch [2] applied you can use devm_reset_controller_register() here and remove the meson_gxbb_reset_remove() function below.

[2] https://patchwork.kernel.org/patch/8988471/

drivers/reset/reset-meson-gxbb.c line 118

Quoted 10 lines
drivers/reset/reset-meson-gxbb.c new file +10 -0
+}
+
+static int meson_gxbb_reset_remove(struct platform_device *pdev)
+{
+	struct meson_gxbb_reset *data = platform_get_drvdata(pdev);
+
+	reset_controller_unregister(&data->rcdev);
+
+	return 0;
+}

Could be removed, then.

Quoted 2 lines

regards
Philipp

It will be for sure !

Neil

#10 lore raw

PATCH 2/3 dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller

In reply to Neil Armstrong

Add DT bindings for the Meson GXBB SoC Reset Controller documentation and the associated include file.

---
 .../bindings/reset/amlogic,meson-gxbb-reset.txt    |  18 ++
 .../dt-bindings/reset/amlogic,meson-gxbb-reset.h   | 199 +++++++++++++++++++++
 2 files changed, 217 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/amlogic,meson-gxbb-reset.txt
 create mode 100644 include/dt-bindings/reset/amlogic,meson-gxbb-reset.h
Documentation/devicetree/bindings/reset/amlogic,meson-gxbb-reset.txt new file +18 -0
new file mode 100644
index 0000000..0758259
@@ -0,0 +1,18 @@
+Amlogic Meson GXBB SoC Reset Controller
+=======================================
+
+Please also refer to reset.txt in this directory for common reset
+controller binding usage.
+
+Required properties:
+- compatible: Should be "amlogic,meson-gxbb-reset"
+- reg: should contain the register address base
+- #reset-cells: 1, see below
+
+example:
+
+reset: reset-controller {
+	compatible = "amlogic,meson-gxbb-reset";
+	reg = <0x0 0x04404 0x0 0x20>;
+	#reset-cells = <1>;
+};
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +199 -0

199 lines not on this page · raw message

Signature · 1 line
2.7.0
#11 lore raw

Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller

Quoted 2 lines · Neil Armstrong

Add DT bindings for the Meson GXBB SoC Reset Controller documentation and the associated include file.

[...]

Quoted 26 lines
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +26 -0
+#define RESET_I2C_MASTER_2	142
+#define RESET_I2C_MASTER_1	143
+/*				144-159	*/
+/*	RESET5				*/
+/*				160-191	*/
+/*	RESET6				*/
+#define RESET_PERIPHS_GENERAL	192
+#define RESET_PERIPHS_SPICC	193
+#define RESET_PERIPHS_SMART_CARD	194
+#define RESET_PERIPHS_SAR_ADC	195
+#define RESET_PERIPHS_I2C_MASTER_0	196
+#define RESET_SANA		197
+/*				198	*/
+#define RESET_PERIPHS_STREAM_INTERFACE	199
+#define RESET_PERIPHS_SDIO	200
+#define RESET_PERIPHS_UART_0	201
+#define RESET_PERIPHS_UART_1_2	202
+#define RESET_PERIPHS_ASYNC_0	203
+#define RESET_PERIPHS_ASYNC_1	204
+#define RESET_PERIPHS_SPI_0	205
+#define RESET_PERIPHS_SDHC	206
+#define RESET_UART_SLIP		207
+/*				208-223	*/
+/*	RESET7				*/
+#define RESET_USB_DDR_0		224
+#define RESET_USB_DDR_1		225

include/dt-bindings/reset/amlogic,meson-gxbb-reset.h line 199

Quoted 10 lines
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +10 -0
+#define RESET_USB_DDR_2		226
+#define RESET_USB_DDR_3		227
+/*				228	*/
+#define RESET_DEVICE_MMC_ARB	229
+/*				230	*/
+#define RESET_VID_LOCK		231
+#define RESET_A9_DMC_PIPEL	232
+/*				233-255	*/
+
+#endif

Indentation looks really messy. Can you just shift the numbers to the right so that they are on the same column?

Signature · 1 line
Carlo Caione
#12 lore raw

Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller

Quoted 37 lines · Carlo Caione
Quoted 2 lines · Neil Armstrong

Add DT bindings for the Meson GXBB SoC Reset Controller documentation and the associated include file.

[...]

Quoted 31 lines
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +31 -0
+#define RESET_I2C_MASTER_2	142
+#define RESET_I2C_MASTER_1	143
+/*				144-159	*/
+/*	RESET5				*/
+/*				160-191	*/
+/*	RESET6				*/
+#define RESET_PERIPHS_GENERAL	192
+#define RESET_PERIPHS_SPICC	193
+#define RESET_PERIPHS_SMART_CARD	194
+#define RESET_PERIPHS_SAR_ADC	195
+#define RESET_PERIPHS_I2C_MASTER_0	196
+#define RESET_SANA		197
+/*				198	*/
+#define RESET_PERIPHS_STREAM_INTERFACE	199
+#define RESET_PERIPHS_SDIO	200
+#define RESET_PERIPHS_UART_0	201
+#define RESET_PERIPHS_UART_1_2	202
+#define RESET_PERIPHS_ASYNC_0	203
+#define RESET_PERIPHS_ASYNC_1	204
+#define RESET_PERIPHS_SPI_0	205
+#define RESET_PERIPHS_SDHC	206
+#define RESET_UART_SLIP		207
+/*				208-223	*/
+/*	RESET7				*/
+#define RESET_USB_DDR_0		224
+#define RESET_USB_DDR_1		225
+#define RESET_USB_DDR_2		226
+#define RESET_USB_DDR_3		227
+/*				228	*/
+#define RESET_DEVICE_MMC_ARB	229
+/*				230	*/
Quoted 9 lines

include/dt-bindings/reset/amlogic,meson-gxbb-reset.h line 199

Quoted 5 lines
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +5 -0
+#define RESET_VID_LOCK		231
+#define RESET_A9_DMC_PIPEL	232
+/*				233-255	*/
+
+#endif

Indentation looks really messy. Can you just shift the numbers to the right so that they are on the same column?

Hi Carlo,

The patch format makes it very messy, not as in the original format :
https://github.com/superna9999/linux/blob/6163f8742454bb7ff962956b4e286d110ec0fb79/include/dt-bindings/reset/amlogic%2Cmeson-gxbb-reset.h

Neil

#13 lore raw

Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller

Quoted 47 lines · Neil Armstrong
Quoted 37 lines · Carlo Caione
Quoted 2 lines · Neil Armstrong

Add DT bindings for the Meson GXBB SoC Reset Controller documentation and the associated include file.

[...]

Quoted 31 lines
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +31 -0
+#define RESET_I2C_MASTER_2	142
+#define RESET_I2C_MASTER_1	143
+/*				144-159	*/
+/*	RESET5				*/
+/*				160-191	*/
+/*	RESET6				*/
+#define RESET_PERIPHS_GENERAL	192
+#define RESET_PERIPHS_SPICC	193
+#define RESET_PERIPHS_SMART_CARD	194
+#define RESET_PERIPHS_SAR_ADC	195
+#define RESET_PERIPHS_I2C_MASTER_0	196
+#define RESET_SANA		197
+/*				198	*/
+#define RESET_PERIPHS_STREAM_INTERFACE	199
+#define RESET_PERIPHS_SDIO	200
+#define RESET_PERIPHS_UART_0	201
+#define RESET_PERIPHS_UART_1_2	202
+#define RESET_PERIPHS_ASYNC_0	203
+#define RESET_PERIPHS_ASYNC_1	204
+#define RESET_PERIPHS_SPI_0	205
+#define RESET_PERIPHS_SDHC	206
+#define RESET_UART_SLIP		207
+/*				208-223	*/
+/*	RESET7				*/
+#define RESET_USB_DDR_0		224
+#define RESET_USB_DDR_1		225
+#define RESET_USB_DDR_2		226
+#define RESET_USB_DDR_3		227
+/*				228	*/
+#define RESET_DEVICE_MMC_ARB	229
+/*				230	*/
Quoted 9 lines

include/dt-bindings/reset/amlogic,meson-gxbb-reset.h line 199

Quoted 5 lines
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +5 -0
+#define RESET_VID_LOCK		231
+#define RESET_A9_DMC_PIPEL	232
+/*				233-255	*/
+
+#endif

Indentation looks really messy. Can you just shift the numbers to the right so that they are on the same column?

Quoted 4 lines

Hi Carlo,

The patch format makes it very messy, not as in the original format :
https://github.com/superna9999/linux/blob/6163f8742454bb7ff962956b4e286d110ec0fb79/include/dt-bindings/reset/amlogic%2Cmeson-gxbb-reset.h

https://raw.githubusercontent.com/superna9999/linux/6163f8742454bb7ff962956b4e286d110ec0fb79/include/dt-bindings/reset/amlogic%2Cmeson-gxbb-reset.h

yes, but 192 -> 200 are not nicely indented to me :)

Signature · 1 line
Carlo Caione
#14 lore raw

Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller

Quoted 48 lines · Carlo Caione
Quoted 47 lines · Neil Armstrong
Quoted 46 lines · Carlo Caione
Quoted 2 lines · Neil Armstrong

Add DT bindings for the Meson GXBB SoC Reset Controller documentation and the associated include file.

[...]

Quoted 26 lines
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +26 -0
+#define RESET_I2C_MASTER_2	142
+#define RESET_I2C_MASTER_1	143
+/*				144-159	*/
+/*	RESET5				*/
+/*				160-191	*/
+/*	RESET6				*/
+#define RESET_PERIPHS_GENERAL	192
+#define RESET_PERIPHS_SPICC	193
+#define RESET_PERIPHS_SMART_CARD	194
+#define RESET_PERIPHS_SAR_ADC	195
+#define RESET_PERIPHS_I2C_MASTER_0	196
+#define RESET_SANA		197
+/*				198	*/
+#define RESET_PERIPHS_STREAM_INTERFACE	199
+#define RESET_PERIPHS_SDIO	200
+#define RESET_PERIPHS_UART_0	201
+#define RESET_PERIPHS_UART_1_2	202
+#define RESET_PERIPHS_ASYNC_0	203
+#define RESET_PERIPHS_ASYNC_1	204
+#define RESET_PERIPHS_SPI_0	205
+#define RESET_PERIPHS_SDHC	206
+#define RESET_UART_SLIP		207
+/*				208-223	*/
+/*	RESET7				*/
+#define RESET_USB_DDR_0		224
+#define RESET_USB_DDR_1		225

include/dt-bindings/reset/amlogic,meson-gxbb-reset.h line 199

Quoted 10 lines
include/dt-bindings/reset/amlogic,meson-gxbb-reset.h new file +10 -0
+#define RESET_USB_DDR_2		226
+#define RESET_USB_DDR_3		227
+/*				228	*/
+#define RESET_DEVICE_MMC_ARB	229
+/*				230	*/
+#define RESET_VID_LOCK		231
+#define RESET_A9_DMC_PIPEL	232
+/*				233-255	*/
+
+#endif

Indentation looks really messy. Can you just shift the numbers to the right so that they are on the same column?

Quoted 9 lines
Quoted 4 lines

Hi Carlo,

The patch format makes it very messy, not as in the original format :
https://github.com/superna9999/linux/blob/6163f8742454bb7ff962956b4e286d110ec0fb79/include/dt-bindings/reset/amlogic%2Cmeson-gxbb-reset.h

https://raw.githubusercontent.com/superna9999/linux/6163f8742454bb7ff962956b4e286d110ec0fb79/include/dt-bindings/reset/amlogic%2Cmeson-gxbb-reset.h

yes, but 192 -> 200 are not nicely indented to me :)

Aw, you got me !

I will add a shift and add a separate meson8b version of this file.

Neil

maintainer Acked-by on v1 2/3
#15 lore raw

Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller

In reply to Neil Armstrong
Quoted 10 lines · Neil Armstrong

Add DT bindings for the Meson GXBB SoC Reset Controller documentation and the associated include file.

---
 .../bindings/reset/amlogic,meson-gxbb-reset.txt    |  18 ++
 .../dt-bindings/reset/amlogic,meson-gxbb-reset.h   | 199 +++++++++++++++++++++
 2 files changed, 217 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/reset/amlogic,meson-gxbb-reset.txt
 create mode 100644 include/dt-bindings/reset/amlogic,meson-gxbb-reset.h

Other than the whitespace comments,

#16 lore raw

PATCH 3/3 ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms

In reply to Neil Armstrong

Update DTSI file to add the reset controller node.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +6 -0
index 832815d..2463e04 100644
@@ -129,6 +129,12 @@
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xc1100000 0x0 0x100000>;
 
+			reset: reset-controller at 4404 {
+				compatible = "amlogic,meson-gxbb-reset";
+				reg = <0x0 0x04404 0x0 0x20>;
+				#reset-cells = <1>;
+			};
+
 			uart_A: serial at 84c0 {
 				compatible = "amlogic,meson-uart";
 				reg = <0x0 0x084c0 0x0 0x14>;
Signature · 1 line
2.7.0
#17 lore raw

Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms

Quoted 14 lines · Neil Armstrong

Update DTSI file to add the reset controller node.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +0 -0
index 832815d..2463e04 100644
@@ -129,6 +129,12 @@
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xc1100000 0x0 0x100000>;

arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi line 140

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +6 -0
 
+			reset: reset-controller at 4404 {
+				compatible = "amlogic,meson-gxbb-reset";
+				reg = <0x0 0x04404 0x0 0x20>;
+				#reset-cells = <1>;
+			};
+
 			uart_A: serial at 84c0 {
 				compatible = "amlogic,meson-uart";
 				reg = <0x0 0x084c0 0x0 0x14>;

Missing #include <dt-bindings/reset/amlogic,meson-gxbb-reset.h> ?

Thanks,

Signature · 1 line
Carlo Caione
#18 lore raw

Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms

Quoted 28 lines · Carlo Caione
Quoted 14 lines · Neil Armstrong

Update DTSI file to add the reset controller node.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +0 -0
index 832815d..2463e04 100644
@@ -129,6 +129,12 @@
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xc1100000 0x0 0x100000>;

arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi line 140

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +6 -0
 
+			reset: reset-controller at 4404 {
+				compatible = "amlogic,meson-gxbb-reset";
+				reg = <0x0 0x04404 0x0 0x20>;
+				#reset-cells = <1>;
+			};
+
 			uart_A: serial at 84c0 {
 				compatible = "amlogic,meson-uart";
 				reg = <0x0 0x084c0 0x0 0x14>;

Missing #include <dt-bindings/reset/amlogic,meson-gxbb-reset.h> ?

Quoted 2 lines

Thanks,

Shouldn't we wait until the reset bindings are actually used in the dtsi ? I'm quite sure kevin will post it with the Ethernet nodes.

Neil

#19 lore raw

Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms

Quoted 29 lines · Neil Armstrong
Quoted 28 lines · Carlo Caione
Quoted 14 lines · Neil Armstrong

Update DTSI file to add the reset controller node.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +0 -0
index 832815d..2463e04 100644
@@ -129,6 +129,12 @@
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xc1100000 0x0 0x100000>;

arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi line 140

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +6 -0
 
+			reset: reset-controller at 4404 {
+				compatible = "amlogic,meson-gxbb-reset";
+				reg = <0x0 0x04404 0x0 0x20>;
+				#reset-cells = <1>;
+			};
+
 			uart_A: serial at 84c0 {
 				compatible = "amlogic,meson-uart";
 				reg = <0x0 0x084c0 0x0 0x14>;

Missing #include <dt-bindings/reset/amlogic,meson-gxbb-reset.h> ?

Quoted 5 lines
Quoted 2 lines

Thanks,

Shouldn't we wait until the reset bindings are actually used in the dtsi ? I'm quite sure kevin will post it with the Ethernet nodes.

Why? The header file is related to the reset controller. Better add it now with this patchset.

Cheers,

Signature · 1 line
Carlo Caione
#20 lore raw

Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms

Quoted 33 lines · Carlo Caione
Quoted 32 lines · Neil Armstrong
Quoted 30 lines · Carlo Caione
Quoted 14 lines · Neil Armstrong

Update DTSI file to add the reset controller node.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +0 -0
index 832815d..2463e04 100644
@@ -129,6 +129,12 @@
 			#size-cells = <2>;
 			ranges = <0x0 0x0 0x0 0xc1100000 0x0 0x100000>;

arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi line 140

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +6 -0
 
+			reset: reset-controller at 4404 {
+				compatible = "amlogic,meson-gxbb-reset";
+				reg = <0x0 0x04404 0x0 0x20>;
+				#reset-cells = <1>;
+			};
+
 			uart_A: serial at 84c0 {
 				compatible = "amlogic,meson-uart";
 				reg = <0x0 0x084c0 0x0 0x14>;

Missing #include <dt-bindings/reset/amlogic,meson-gxbb-reset.h> ?

Thanks,

Quoted 8 lines
Quoted 2 lines

Shouldn't we wait until the reset bindings are actually used in the dtsi ? I'm quite sure kevin will post it with the Ethernet nodes.

Why? The header file is related to the reset controller. Better add it now with this patchset.

Cheers,

OK, I will add it in gxbb and meson8b dtsi files.

Neil

#21 lore raw

Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms

On 20/05/16 14:19, Neil Armstrong wrote:

[...]

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

Missing #include <dt-bindings/reset/amlogic,meson-gxbb-reset.h> ?

Thanks,

Shouldn't we wait until the reset bindings are actually used in the dtsi ? I'm quite sure kevin will post it with the Ethernet nodes.

Quoted 7 lines
Quoted 5 lines

Why? The header file is related to the reset controller. Better add it now with this patchset.

Cheers,

OK, I will add it in gxbb and meson8b dtsi files.

Why also meson8b DTSI?

Signature · 1 line
Carlo Caione
#22 lore raw

Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms

Quoted 14 lines · Carlo Caione

On 20/05/16 14:19, Neil Armstrong wrote:

[...]

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines

Missing #include <dt-bindings/reset/amlogic,meson-gxbb-reset.h> ?

Thanks,

Shouldn't we wait until the reset bindings are actually used in the dtsi ? I'm quite sure kevin will post it with the Ethernet nodes.

Why? The header file is related to the reset controller. Better add it now with this patchset.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Cheers,

OK, I will add it in gxbb and meson8b dtsi files.

Why also meson8b DTSI?

Sorry, I'll add the meson8b specific header of course.

Neil