Amlogic: GXBB: Add reset controller
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
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
@@ -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
@@ -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
PATCH 2/3 dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller
In reply to Neil ArmstrongAdd 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
@@ -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
PATCH 3/3 ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms
In reply to Neil ArmstrongUpdate 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
@@ -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
Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller
In reply to Neil ArmstrongQuoted 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
Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms
In reply to Neil ArmstrongQuoted 14 lines · Neil Armstrong
Update DTSI file to add the reset controller node.
Signed-off-by Neil Armstrong <[email protected]>--- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +0
-0@@ -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
Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller
In reply to Carlo CaioneQuoted 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
Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms
In reply to Carlo CaioneQuoted 28 lines · Carlo Caione
Quoted 14 lines · Neil Armstrong
Update DTSI file to add the reset controller node.
Signed-off-by Neil Armstrong <[email protected]>--- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +0
-0@@ -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
Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
In reply to Neil ArmstrongQuoted 10 lines · Neil Armstrong
This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.
Signed-off-by Neil Armstrong <[email protected]>--- 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@@ -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
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
Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller
In reply to Neil ArmstrongQuoted 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
yes, but 192 -> 200 are not nicely indented to me :)
Signature · 1 line
Carlo Caione
Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
In reply to Carlo CaioneQuoted 12 lines · Carlo Caione
Quoted 10 lines · Neil Armstrong
This patch adds the platform driver for the Amlogic Meson GXBB Reset Controller.
Signed-off-by Neil Armstrong <[email protected]>--- 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@@ -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
-0drivers/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.oobj-$(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
Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms
In reply to Neil ArmstrongQuoted 29 lines · Neil Armstrong
Quoted 28 lines · Carlo Caione
Quoted 14 lines · Neil Armstrong
Update DTSI file to add the reset controller node.
Signed-off-by Neil Armstrong <[email protected]>--- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +0
-0@@ -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
Philipp Zabel
maintainerRe: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
In reply to Neil ArmstrongHi 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.
Signed-off-by Neil Armstrong <[email protected]>--- 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.cdrivers/reset/Kconfig +0
-0
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?
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
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.
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
Philipp Zabel
maintainerRe: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
In reply to Neil ArmstrongAm 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_LICENCEformat for dual licensing ?
"Dual BSD/GPL"
regards
Philipp
Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
In reply to Neil ArmstrongQuoted 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.
Signed-off-by Neil Armstrong <[email protected]>--- 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_LICENCEformat for dual licensing ?
Dual BSD/GPL ?
Cheers,
Signature · 1 line
Carlo Caione
Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
In reply to Philipp ZabelHi 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
Kconfigmenu to include reset drivers in sub-menu" patch [1] applied this is wrapped in "ifRESET_CONTROLLER... endif", so no need to depend onRESET_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_RESETand useCONFIG_ARCH_MESONdirectly.
No strong reason, I will switch to CONFIG_ARCH_MESON.
Quoted 21 lines
[...]
With the "reset: add
devm_reset_controller_registerAPI" patch [2] applied you can usedevm_reset_controller_register()here and remove themeson_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
Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller
In reply to Carlo CaioneQuoted 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 225include/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.hyes, 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
Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms
In reply to Carlo CaioneQuoted 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.
Signed-off-by Neil Armstrong <[email protected]>--- arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +0
-0@@ -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
Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
In reply to Carlo CaioneQuoted 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.
Signed-off-by Neil Armstrong <[email protected]>--- 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.cDo 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
Re: [PATCH 3/3] ARM64: dts: amlogic: Enable Reset Controller on GXBB-based platforms
In reply to Neil ArmstrongOn 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
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
Re: [PATCH 1/3] reset: Add support for the Amlogic Meson GXBB Reset Controller
In reply to Neil ArmstrongQuoted 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.
Signed-off-by Neil Armstrong <[email protected]>--- 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.cDo 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
Re: [PATCH 2/3] dt-bindings: reset: Add bindings for the Meson GXBB Reset Controller
In reply to Neil ArmstrongQuoted 10 lines · Neil Armstrong
Add DT bindings for the Meson GXBB SoC Reset Controller documentation and the associated include file.
Signed-off-by Neil Armstrong <[email protected]>--- .../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,