Add GPIO support for MStar/SigmaStar ARMv7
Subsystems (3)
v2 cover Add GPIO support for MStar/SigmaStar ARMv7
At the moment the MStar/SigmaStar support is only really capable of shell from an initramfs and not much else.
Most of the interesting drivers are blocked on clock and pinctrl drivers and those are going to take me a little while to get cleaned up.
Clock and pinctrl aren't needed for basic GPIO to work (all pins start off as GPIOs..) and it makes it possible to actually do something so this series adds everything that is needed for the main GPIO block in these chips.
Changes since v1:
- Moves the binding header commit before the yaml commit
- Fixes the license on the binding header to include BSD-2-Clause
- The driver has been reworked to use the gpiolib irqchip functionality as suggested by Linus[0]. I think I got this right. The gpio controller doesn't actually do anything with interrupts itself.. It just happens to have 4 lines that are also wired to lines on one of the interrupt controllers.
- Now that the driver is an interrupt controller in it's own right for the gpio lines that have associated interrupts the binding description has been updated to add the interrupt-controller bits and remove the description of the interrupt-names that described how the interrupts used to be passed in.
Daniel Palmer (5):
dt-bindings: gpio: Add a binding header for the MSC313 GPIO driver
dt-bindings: gpio: Binding for MStar MSC313 GPIO controller
gpio: msc313: MStar MSC313 GPIO driver
ARM: mstar: Add gpio controller to MStar base dtsi
ARM: mstar: Fill in GPIO controller properties for infinity
.../bindings/gpio/mstar,msc313-gpio.yaml | 61 +++ MAINTAINERS | 3 + arch/arm/boot/dts/mstar-infinity.dtsi | 7 + arch/arm/boot/dts/mstar-v7.dtsi | 10 + drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-msc313.c | 406 ++++++++++++++++++ include/dt-bindings/gpio/msc313-gpio.h | 95 ++++ 8 files changed, 592 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml create mode 100644 drivers/gpio/gpio-msc313.c create mode 100644 include/dt-bindings/gpio/msc313-gpio.h
Signature · 1 line
2.28.0
PATCH v2 1/5 dt-bindings: gpio: Add a binding header for the MSC313 GPIO driver
Header adds defines for the gpio number of each pin from the driver view. The gpio block seems to support 128 lines but what line is mapped to a physical pin depends on the chip. The driver itself uses the index of a pin's offset in an array of the possible offsets for a chip as the gpio number.
The defines remove the need to work out that index to consume a pin in the device tree.
--- MAINTAINERS | 1 + include/dt-bindings/gpio/msc313-gpio.h | 95 ++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 include/dt-bindings/gpio/msc313-gpio.h
MAINTAINERS +1 -0
@@ -2132,6 +2132,7 @@ W: http://linux-chenxing.org/ F: Documentation/devicetree/bindings/arm/mstar/* F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ +F: include/dt-bindings/gpio/msc313-gpio.h ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT M: Michael Petchkovsky <[email protected]>
include/dt-bindings/gpio/msc313-gpio.h new file +95 -0
95 lines not on this page · raw message
Signature · 1 line
2.28.0
Rob Herring
maintainerRe: [PATCH v2 1/5] dt-bindings: gpio: Add a binding header for the MSC313 GPIO driver
Quoted 8 lines · Daniel Palmer
Header adds defines for the gpio number of each pin from the driver view. The gpio block seems to support 128 lines but what line is mapped to a physical pin depends on the chip. The driver itself uses the index of a pin's offset in an array of the possible offsets for a chip as the gpio number.
The defines remove the need to work out that index to consume a pin in the device tree.
I'd expect the DT to have 0-127 numbering... If you need to map that to another number, then an array property in DT could handle that.
Quoted 31 lines
Signed-off-by Daniel Palmer <[email protected]>--- MAINTAINERS | 1 + include/dt-bindings/gpio/msc313-gpio.h | 95 ++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 include/dt-bindings/gpio/msc313-gpio.hMAINTAINERS +1
-0@@ -2132,6 +2132,7 @@ W: http://linux-chenxing.org/ F: Documentation/devicetree/bindings/arm/mstar/* F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ +F: include/dt-bindings/gpio/msc313-gpio.h ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT M: Michael Petchkovsky <[email protected]>include/dt-bindings/gpio/msc313-gpio.h new file +5
-0@@ -0,0 +1,95 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* +* GPIO definitions for MStar/SigmaStar MSC313 and later SoCs +* +* Copyright (C) 2020 Daniel Palmer <[email protected]>
include/dt-bindings/gpio/msc313-gpio.h line 15
Quoted 10 lines
include/dt-bindings/gpio/msc313-gpio.h new file +10
-0+*/ + +#ifndef _DT_BINDINGS_MSC313_GPIO_H +#define _DT_BINDINGS_MSC313_GPIO_H + +/* pin names for fuart, same for all SoCs so far */ +#define MSC313_PINNAME_FUART_RX "fuart_rx" +#define MSC313_PINNAME_FUART_TX "fuart_tx" +#define MSC313_PINNAME_FUART_CTS "fuart_cts" +#define MSC313_PINNAME_FUART_RTS "fuart_rts"
Defines for strings serves no purpose.
Quoted 32 lines
include/dt-bindings/gpio/msc313-gpio.h new file +32
-0+ +/* pin names for sr, mercury5 is different */ +#define MSC313_PINNAME_SR_IO2 "sr_io2" +#define MSC313_PINNAME_SR_IO3 "sr_io3" +#define MSC313_PINNAME_SR_IO4 "sr_io4" +#define MSC313_PINNAME_SR_IO5 "sr_io5" +#define MSC313_PINNAME_SR_IO6 "sr_io6" +#define MSC313_PINNAME_SR_IO7 "sr_io7" +#define MSC313_PINNAME_SR_IO8 "sr_io8" +#define MSC313_PINNAME_SR_IO9 "sr_io9" +#define MSC313_PINNAME_SR_IO10 "sr_io10" +#define MSC313_PINNAME_SR_IO11 "sr_io11" +#define MSC313_PINNAME_SR_IO12 "sr_io12" +#define MSC313_PINNAME_SR_IO13 "sr_io13" +#define MSC313_PINNAME_SR_IO14 "sr_io14" +#define MSC313_PINNAME_SR_IO15 "sr_io15" +#define MSC313_PINNAME_SR_IO16 "sr_io16" +#define MSC313_PINNAME_SR_IO17 "sr_io17" + +/* pin names for sd, same for all SoCs so far */ +#define MSC313_PINNAME_SD_CLK "sd_clk" +#define MSC313_PINNAME_SD_CMD "sd_cmd" +#define MSC313_PINNAME_SD_D0 "sd_d0" +#define MSC313_PINNAME_SD_D1 "sd_d1" +#define MSC313_PINNAME_SD_D2 "sd_d2" +#define MSC313_PINNAME_SD_D3 "sd_d3" + +/* pin names for i2c1, same for all SoCs so for */ +#define MSC313_PINNAME_I2C1_SCL "i2c1_scl" +#define MSC313_PINNAME_I2C1_SCA "i2c1_sda" + +/* pin names for spi0, same for all SoCs so far */
include/dt-bindings/gpio/msc313-gpio.h line 57
Quoted 10 lines
include/dt-bindings/gpio/msc313-gpio.h new file +10
-0+#define MSC313_PINNAME_SPI0_CZ "spi0_cz" +#define MSC313_PINNAME_SPI0_CK "spi0_ck" +#define MSC313_PINNAME_SPI0_DI "spi0_di" +#define MSC313_PINNAME_SPI0_DO "spi0_do" + +#define MSC313_GPIO_FUART 0 +#define MSC313_GPIO_FUART_RX (MSC313_GPIO_FUART + 0) +#define MSC313_GPIO_FUART_TX (MSC313_GPIO_FUART + 1) +#define MSC313_GPIO_FUART_CTS (MSC313_GPIO_FUART + 2) +#define MSC313_GPIO_FUART_RTS (MSC313_GPIO_FUART + 3)
We don't normally have defines for GPIO numbers either.
Quoted 41 lines
include/dt-bindings/gpio/msc313-gpio.h new file +38
-0+ +#define MSC313_GPIO_SR (MSC313_GPIO_FUART_RTS + 1) +#define MSC313_GPIO_SR_IO2 (MSC313_GPIO_SR + 0) +#define MSC313_GPIO_SR_IO3 (MSC313_GPIO_SR + 1) +#define MSC313_GPIO_SR_IO4 (MSC313_GPIO_SR + 2) +#define MSC313_GPIO_SR_IO5 (MSC313_GPIO_SR + 3) +#define MSC313_GPIO_SR_IO6 (MSC313_GPIO_SR + 4) +#define MSC313_GPIO_SR_IO7 (MSC313_GPIO_SR + 5) +#define MSC313_GPIO_SR_IO8 (MSC313_GPIO_SR + 6) +#define MSC313_GPIO_SR_IO9 (MSC313_GPIO_SR + 7) +#define MSC313_GPIO_SR_IO10 (MSC313_GPIO_SR + 8) +#define MSC313_GPIO_SR_IO11 (MSC313_GPIO_SR + 9) +#define MSC313_GPIO_SR_IO12 (MSC313_GPIO_SR + 10) +#define MSC313_GPIO_SR_IO13 (MSC313_GPIO_SR + 11) +#define MSC313_GPIO_SR_IO14 (MSC313_GPIO_SR + 12) +#define MSC313_GPIO_SR_IO15 (MSC313_GPIO_SR + 13) +#define MSC313_GPIO_SR_IO16 (MSC313_GPIO_SR + 14) +#define MSC313_GPIO_SR_IO17 (MSC313_GPIO_SR + 15) + +#define MSC313_GPIO_SD (MSC313_GPIO_SR_IO17 + 1) +#define MSC313_GPIO_SD_CLK (MSC313_GPIO_SD + 0) +#define MSC313_GPIO_SD_CMD (MSC313_GPIO_SD + 1) +#define MSC313_GPIO_SD_D0 (MSC313_GPIO_SD + 2) +#define MSC313_GPIO_SD_D1 (MSC313_GPIO_SD + 3) +#define MSC313_GPIO_SD_D2 (MSC313_GPIO_SD + 4) +#define MSC313_GPIO_SD_D3 (MSC313_GPIO_SD + 5) + +#define MSC313_GPIO_I2C1 (MSC313_GPIO_SD_D3 + 1) +#define MSC313_GPIO_I2C1_SCL (MSC313_GPIO_I2C1 + 0) +#define MSC313_GPIO_I2C1_SDA (MSC313_GPIO_I2C1 + 1) + +#define MSC313_GPIO_SPI0 (MSC313_GPIO_I2C1_SDA + 1) +#define MSC313_GPIO_SPI0_CZ (MSC313_GPIO_SPI0 + 0) +#define MSC313_GPIO_SPI0_CK (MSC313_GPIO_SPI0 + 1) +#define MSC313_GPIO_SPI0_DI (MSC313_GPIO_SPI0 + 2) +#define MSC313_GPIO_SPI0_DO (MSC313_GPIO_SPI0 + 3) + +#endif /* _DT_BINDINGS_MSC313_GPIO_H */ Signature · 1 line
2.28.0
Re: [PATCH v2 1/5] dt-bindings: gpio: Add a binding header for the MSC313 GPIO driver
Hi Rob,
Quoted 8 lines · Rob Herring
Quoted 6 lines · Daniel Palmer
Header adds defines for the gpio number of each pin from the driver view. The gpio block seems to support 128 lines but what line is mapped to a physical pin depends on the chip. The driver itself uses the index of a pin's offset in an array of the possible offsets for a chip as the gpio number.
Quoted 6 lines
Quoted 2 lines
The defines remove the need to work out that index to consume a pin in the device tree.
I'd expect the DT to have 0-127 numbering... If you need to map that to another number, then an array property in DT could handle that.
Thank you for the comments on this header and the binding description.
Thinking about this again I'm thinking about having the GPIO numbers be 0-127 like you say but supplying the valid offsets for that specific chip and the pad/pin names to make visible to the user via an array/arrays that contains the pin register offsets and the pin names. Basically my per-chip table moves out of the driver and into the DT. Does that sound acceptable? The main thing I want to avoid is presenting the user with 128 gpios when the actually chip only has <10 of them wired up.
Thanks,
Daniel
PATCH v2 2/5 dt-bindings: gpio: Binding for MStar MSC313 GPIO controller
In reply to Daniel PalmerAdd a binding description for the MStar/SigmaStar GPIO controller found in the MSC313 and later ARMv7 SoCs.
--- .../bindings/gpio/mstar,msc313-gpio.yaml | 61 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml new file +61 -0
@@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/mstar,msc313-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MStar/SigmaStar GPIO controller + +maintainers: + - Daniel Palmer <[email protected]> + +properties: + $nodename: + pattern: "^gpio@[0-9a-f]+$" + + compatible: + const: mstar,msc313-gpio + + reg: + maxItems: 1 + + gpio-controller: true + + "#gpio-cells": + const: 2 + + gpio-ranges: true + + gpio-ranges-group-names: + $ref: /schemas/types.yaml#/definitions/string-array + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + +required: + - compatible + - reg + - gpio-controller + - "#gpio-cells" + - interrupt-controller + - "#interrupt-cells" + +examples: + - | + #include <dt-bindings/gpio/msc313-gpio.h> + + gpio: gpio@207800 { + compatible = "mstar,msc313e-gpio"; + #gpio-cells = <2>; + reg = <0x207800 0x200>; + gpio-controller; + gpio-ranges = <&pinctrl 0 36 22>, + <&pinctrl 22 63 4>, + <&pinctrl 26 68 6>; + #interrupt-cells = <2>; + interrupt-controller; + interrupt-parent = <&intc_fiq>; + status = "okay"; + };
MAINTAINERS +1 -0
@@ -2130,6 +2130,7 @@ L: [email protected] (moderated for non-subscribers) S: Maintained W: http://linux-chenxing.org/ F: Documentation/devicetree/bindings/arm/mstar/* +F: Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ F: include/dt-bindings/gpio/msc313-gpio.h
Signature · 1 line
2.28.0
Rob Herring
maintainerRe: [PATCH v2 2/5] dt-bindings: gpio: Binding for MStar MSC313 GPIO controller
Quoted 36 lines · Daniel Palmer
Add a binding description for the MStar/SigmaStar GPIO controller found in the MSC313 and later ARMv7 SoCs.
Signed-off-by Daniel Palmer <[email protected]>--- .../bindings/gpio/mstar,msc313-gpio.yaml | 61 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yamlDocumentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml new file +20
-0@@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/mstar,msc313-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MStar/SigmaStar GPIO controller + +maintainers: + - Daniel Palmer <[email protected]> + +properties: + $nodename: + pattern: "^gpio@[0-9a-f]+$" + + compatible: + const: mstar,msc313-gpio + + reg: + maxItems: 1
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml line 30
Quoted 10 lines
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml new file +10
-0+ + gpio-controller: true + + "#gpio-cells": + const: 2 + + gpio-ranges: true + + gpio-ranges-group-names: + $ref: /schemas/types.yaml#/definitions/string-array
The strings in your header should be defined here.
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml line 43
Quoted 13 lines
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml new file +13
-0+ + interrupt-controller: true + + "#interrupt-cells": + const: 2 + +required: + - compatible + - reg + - gpio-controller + - "#gpio-cells" + - interrupt-controller + - "#interrupt-cells"
additionalProperties: false
Quoted 7 lines
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml new file +7
-0+ +examples: + - | + #include <dt-bindings/gpio/msc313-gpio.h> + + gpio: gpio@207800 { + compatible = "mstar,msc313e-gpio";
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml line 60
Quoted 10 lines
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml new file +10
-0+ #gpio-cells = <2>; + reg = <0x207800 0x200>; + gpio-controller; + gpio-ranges = <&pinctrl 0 36 22>, + <&pinctrl 22 63 4>, + <&pinctrl 26 68 6>; + #interrupt-cells = <2>; + interrupt-controller; + interrupt-parent = <&intc_fiq>; + status = "okay";
Don't show status in examples.
Quoted 16 lines
Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml new file +1
-0+ };MAINTAINERS +1
-0@@ -2130,6 +2130,7 @@ L: [email protected] (moderated for non-subscribers) S: Maintained W: http://linux-chenxing.org/ F: Documentation/devicetree/bindings/arm/mstar/* +F: Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ F: include/dt-bindings/gpio/msc313-gpio.hSignature · 1 line
2.28.0
PATCH v2 3/5 gpio: msc313: MStar MSC313 GPIO driver
In reply to Daniel PalmerThis adds a driver that supports the GPIO block found in MStar/SigmaStar ARMv7 SoCs.
The controller seems to support 128 lines but where they are wired up differs between chips and no currently known chip uses anywhere near 128 lines so there needs to be some per-chip data to collect together what lines actually have physical pins attached and map the right names to them.
The core peripherals seem to use the same lines on the currently known chips but the lines used for the sensor interface, lcd controller etc pins seem to be totally different between the infinity and mercury chips
The code tries to collect all of the re-usable names, offsets etc together so that it's easy to build the extra per-chip data for other chips in the future.
So far this only supports the MSC313 and MSC313E chips.
Support for the SSC8336N (mercury5) is trivial to add once all of the lines have been mapped out.
--- MAINTAINERS | 1 + drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-msc313.c | 406 +++++++++++++++++++++++++++++++++++++ 4 files changed, 417 insertions(+) create mode 100644 drivers/gpio/gpio-msc313.c
MAINTAINERS +1 -0
@@ -2133,6 +2133,7 @@ F: Documentation/devicetree/bindings/arm/mstar/* F: Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml F: arch/arm/boot/dts/mstar-* F: arch/arm/mach-mstar/ +F: drivers/gpio/gpio-msc313.c F: include/dt-bindings/gpio/msc313-gpio.h ARM/NEC MOBILEPRO 900/c MACHINE SUPPORT
drivers/gpio/Kconfig +9 -0
@@ -737,6 +737,15 @@ config GPIO_AMD_FCH Note: This driver doesn't registers itself automatically, as it needs to be provided with platform specific configuration. (See eg. CONFIG_PCENGINES_APU2.) + +config GPIO_MSC313 + bool "MStar MSC313 GPIO support" + default y if ARCH_MSTARV7 + depends on ARCH_MSTARV7 + select GPIOLIB_IRQCHIP + help + Say Y here to support GPIO on MStar MSC313 and later SoCs. + endmenu menu "Port-mapped I/O GPIO drivers"
drivers/gpio/Makefile +1 -0
@@ -101,6 +101,7 @@ obj-$(CONFIG_GPIO_MOCKUP) += gpio-mockup.o obj-$(CONFIG_GPIO_MOXTET) += gpio-moxtet.o obj-$(CONFIG_GPIO_MPC5200) += gpio-mpc5200.o obj-$(CONFIG_GPIO_MPC8XXX) += gpio-mpc8xxx.o +obj-$(CONFIG_GPIO_MSC313) += gpio-msc313.o obj-$(CONFIG_GPIO_MSIC) += gpio-msic.o obj-$(CONFIG_GPIO_MT7621) += gpio-mt7621.o obj-$(CONFIG_GPIO_MVEBU) += gpio-mvebu.o
drivers/gpio/gpio-msc313.c new file +406 -0
406 lines not on this page · raw message
Signature · 1 line
2.28.0
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Quoted 23 lines · Daniel Palmer
This adds a driver that supports the GPIO block found in MStar/SigmaStar ARMv7 SoCs.
The controller seems to support 128 lines but where they are wired up differs between chips and no currently known chip uses anywhere near 128 lines so there needs to be some per-chip data to collect together what lines actually have physical pins attached and map the right names to them.
The core peripherals seem to use the same lines on the currently known chips but the lines used for the sensor interface, lcd controller etc pins seem to be totally different between the infinity and mercury chips
The code tries to collect all of the re-usable names, offsets etc together so that it's easy to build the extra per-chip data for other chips in the future.
So far this only supports the MSC313 and MSC313E chips.
Support for the SSC8336N (mercury5) is trivial to add once all of the lines have been mapped out.
...
drivers/gpio/Kconfig config GPIO_AMD_FCH · line 742
Quoted 2 lines
drivers/gpio/Kconfig +2
-0+config GPIO_MSC313 + bool "MStar MSC313 GPIO support"
Why boolean?
Quoted 1 line
+ default y if
ARCH_MSTARV7
Simply
default ARCH_MSTARV7
should work as well.
Are you planning to extend this to other boards?
drivers/gpio/Kconfig config GPIO_AMD_FCH · line 747
Quoted 4 lines
drivers/gpio/Kconfig +4
-0+ depends on ARCH_MSTARV7 + select GPIOLIB_IRQCHIP + help + Say Y here to support GPIO on MStar MSC313 and later SoCs.
Please, be more specific. Also it's recommended to have a module name to be included (but let's understand first why it's not a module)
...
Quoted 3 lines
+/*
+ * Copyright (C) 2020 Daniel Palmer<[email protected]>
+ */
One line.
...
drivers/gpio/gpio-msc313.c line 8
Quoted 3 lines
drivers/gpio/gpio-msc313.c new file +3
-0+#include <linux/of_device.h> +#include <linux/of_irq.h> +#include <linux/gpio/driver.h>
I believe this should be reworked.
For example, it misses mod_devicetable.h, bits.h, io.h, types.h, etc, but has
...
Quoted 3 lines
+/* These bits need to be saved to correctly restore the
+ * gpio state when resuming from suspend to memory.
+ */
/*
* For this subsystem the comment style for multi-line
* like this.
*/
...
Quoted 1 line
+#ifdef
CONFIG_MACH_INFINITY
Does it make any sense?
Quoted 1 line
+#endif
...
drivers/gpio/gpio-msc313.c line 202
Quoted 2 lines
drivers/gpio/gpio-msc313.c new file +2
-0+return readb_relaxed (gpio->base + gpio->gpio_data->offsets[offset]) + &MSC313_GPIO_IN ;
Usual pattern is to leave operators on the previous line.
...
drivers/gpio/gpio-msc313.c line 236
Quoted 2 lines
drivers/gpio/gpio-msc313.c new file +2
-0+static struct irq_chip msc313_gpio_irqchip = { + .name ="GPIO" ,
Is this name good enough?
Quoted 5 lines
drivers/gpio/gpio-msc313.c new file +5
-0+ .irq_eoi = irq_chip_eoi_parent, + .irq_mask = irq_chip_mask_parent, + .irq_unmask = irq_chip_unmask_parent, + .irq_set_type = irq_chip_set_type_parent, +};
...
Quoted 4 lines
drivers/gpio/gpio-msc313.c new file +4
-0+static int msc313e_gpio_child_to_parent_hwirq(struct gpio_chip *chip, + unsigned int child, + unsigned int child_type, + unsigned int *parent,
drivers/gpio/gpio-msc313.c line 279
Quoted 10 lines
drivers/gpio/gpio-msc313.c new file +10
-0+ unsigned int *parent_type) +{ +struct msc313_gpio *priv =gpiochip_get_data (chip); +unsigned int offset = priv->gpio_data->offsets[child]; +int ret = -EINVAL ; + +/* only the spi0 pins have interrupts on the parent +* on all of the known chips and so far they are all +* mapped to the same place +*/
Comment style!
drivers/gpio/gpio-msc313.c line 286
Quoted 7 lines
drivers/gpio/gpio-msc313.c new file +7
-0+if (offset >=OFF_SPI0_CZ && offset <=OFF_SPI0_DO ) { + *parent_type = child_type; + *parent = ((offset -OFF_SPI0_CZ ) >>2 ) +28 ; + ret =0 ; + } + +return ret;
Oh, can, for a starter, we use a regular (not-so-twisted) pattern
if (...)
return -EINVAL;
...
return 0;
?
Quoted 1 line
+}
...
Quoted 1 line
+
gpio->saved=devm_kzalloc(&pdev->dev, gpio->gpio_data->num * sizeof(*gpio->saved), GFP_KERNEL);
devm_kcalloc()
Quoted 2 lines
(quoted diff) +2
-0+ if (!gpio->saved) + return -ENOMEM;
...
drivers/gpio/gpio-msc313.c line 325
Quoted 2 lines
drivers/gpio/gpio-msc313.c new file +2
-0+ res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); + gpio->base =devm_ioremap_resource (&pdev->dev, res);
devm_platform_ioremap_resource()
Quoted 2 lines
drivers/gpio/gpio-msc313.c new file +2
-0+if (IS_ERR (gpio->base)) +return PTR_ERR (gpio->base);
...
Quoted 1 line
+
gpiochip->label=DRIVER_NAME;
Not good. When you use user space how do you distinguish if more than one chip appears in the system?
...
drivers/gpio/gpio-msc313.c line 355
Quoted 2 lines
drivers/gpio/gpio-msc313.c new file +2
-0+ ret =gpiochip_add_data (gpiochip, gpio); +return ret;
return ...(...);
Why not devm_gpiochip_add_data() ?
...
drivers/gpio/gpio-msc313.c line 359
Quoted 3 lines
drivers/gpio/gpio-msc313.c new file +2
-0+static const struct of_device_id msc313_gpio_of_match[] = { +#ifdef CONFIG_MACH_INFINITY
To me this makes no sense.
Quoted 7 lines
drivers/gpio/gpio-msc313.c new file +7
-0+ { + .compatible = "mstar,msc313-gpio", + .data = &msc313_data, + }, +#endif + { } +};
...
Quoted 4 lines
+/* The GPIO controller loses the state of the registers when the
+ * SoC goes into suspend to memory mode so we need to save some
+ * of the register bits before suspending and put it back when resuming
+ */
Comment style!
Quoted 1 line
+
Redundant blank line.
...
drivers/gpio/gpio-msc313.c line 394
Quoted 6 lines
drivers/gpio/gpio-msc313.c new file +4
-0+static int __maybe_unused msc313_gpio_resume (struct device *dev) +{ +} +
Redundant blank line.
Quoted 1 line
+static
SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume);
...
drivers/gpio/gpio-msc313.c line 401
Quoted 5 lines
drivers/gpio/gpio-msc313.c new file +5
-0+static struct platform_driver msc313_gpio_driver = { + .driver = { + .name =DRIVER_NAME , + .of_match_table = msc313_gpio_of_match, + .pm = &msc313_gpio_ops,
You still allow to unbind.
drivers/gpio/gpio-msc313.c line 405
Quoted 5 lines
drivers/gpio/gpio-msc313.c new file +4
-0+ }, + .probe = msc313_gpio_probe, +}; +
Redundant blank line.
Quoted 1 line
+builtin_platform_driver(msc313_gpio_driver);
Why?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Hi Andy,
Quoted 4 lines · Andy Shevchenko
drivers/gpio/Kconfig config GPIO_AMD_FCH · line 742
Quoted 2 lines
drivers/gpio/Kconfig +2
-0+config GPIO_MSC313 + bool "MStar MSC313 GPIO support"Why boolean?
Because it's a built in driver. I could change it to tristate/a module but I didn't think it needed to be one.
The machines this is used on generally only have 64 or 128MB of RAM so the kernel is usually built without modules and only the totally required stuff built in.
Quoted 7 lines
Quoted 1 line
+ default y if
ARCH_MSTARV7Simply
defaultARCH_MSTARV7
should work as well.Are you planning to extend this to other boards?
I think I copy/pasted the block above there. I'll fix this up.
As for other boards. I think this GPIO controller is only present in MStar's SoCs and some MediaTek SoCs that inherited parts from MStar after MediaTek bought them. Like the MStar interrupt controller is present in some MediaTek TV chips.
Quoted 8 lines
drivers/gpio/Kconfig config GPIO_AMD_FCH · line 747
Quoted 5 lines
drivers/gpio/Kconfig +4
-0+ depends on ARCH_MSTARV7 + select GPIOLIB_IRQCHIP + help + Say Y here to support GPIO on MStar MSC313 and later SoCs.Please, be more specific. Also it's recommended to have a module name to be included (but let's understand first why it's not a module)
Ok. I'll rework that. As for it not being a module. I can make it possible to build it
as a module. I just didn't really think it needed to be one.
Quoted 6 lines
drivers/gpio/gpio-msc313.c line 8
Quoted 3 lines
drivers/gpio/gpio-msc313.c new file +3
-0+#include <linux/of_device.h> +#include <linux/of_irq.h> +#include <linux/gpio/driver.h> I believe this should be reworked.
For example, it missesmod_devicetable.h,bits.h,io.h,types.h, etc, but has
I'll look at this again.
Quoted 8 lines
Quoted 3 lines
+/* These bits need to be saved to correctly restore the
+ * gpio state when resuming from suspend to memory.
+ *//*
* For this subsystem the comment style for multi-line
* like this.
*/
Sorry, I'll fix these up.
Quoted 5 lines
Quoted 1 line
+#ifdef
CONFIG_MACH_INFINITYDoes it make any sense?
Quoted 1 line
+#endif
It doesn't make a lot of sense right now but it makes a bit more sense when the support for the mercury chips is added. They have their own set of offsets
for the used pins. I cut that out of this series because I haven't fully reverse engineered all of the pins for those chips yet so the support for them has a lot of guesses and notes in the code.
Anyhow, with only 64MB of RAM I thought it made sense to not compile in the mercury tables when support for those machines isn't enabled. I'll drop the if/defs for the next version.
Quoted 5 lines
drivers/gpio/gpio-msc313.c line 236
Quoted 2 lines
drivers/gpio/gpio-msc313.c new file +2
-0+static struct irq_chip msc313_gpio_irqchip = { + .name ="GPIO" ,Is this name good enough?
There is only one GPIO block in the chips this is for so I think it's unique at least.
Quoted 4 lines
Quoted 1 line
+
gpiochip->label=DRIVER_NAME;Not good. When you use user space how do you distinguish if more than one chip appears in the system?
So far there is only ever one of these GPIO controller for the whole system. There is another GPIO block in the system but it uses another driver as the register layout is totally different.
Thank you for all of the comments. Sorry about the multiple style issues. I thought checkpatch had my back on that.
Thanks,
Daniel
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
In reply to Andy ShevchenkoQuoted 6 lines · Andy Shevchenko
drivers/gpio/Kconfig config GPIO_AMD_FCH
Quoted 4 lines · Daniel Palmer
drivers/gpio/Kconfig +3
-0+config GPIO_MSC313 + bool "MStar MSC313 GPIO support" + default y if ARCH_MSTARV7
I think it is possible to write:
default ARCH_MSTARV7
For this.
Quoted 1 line
Why boolean?
I answered this question in some other mail but there is usually somewhat a good reason for this but let's discuss it a bit.
The following usecase:
- You have a generic distribution such as Android
- The generic distribution does not use initramfs to support basic drivers (does Android? Nowadays?)
- So all modules would need to load from actual storage media.
- The storage media is an SD card.
- The SD card reader has a card detect line connected to one of the GPIO lines.
- Now we have catch-22 because there is no way to load the GPIO driver modules from the storage media because the driver is needed to mount the storage media.
I do not know if this "never happens" because every generic distribution "should" be using initramfs for their drivers. But it provides a convenient way for users to shoot themselves in the foot and be frustrated about that their root filesystem is not mounting.
I do not think this is limited to GPIO card detects but it is a very immediate example.
What is the consensus here?
Yours,
Linus Walleij
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
In reply to Daniel PalmerQuoted 18 lines · Daniel Palmer
This adds a driver that supports the GPIO block found in MStar/SigmaStar ARMv7 SoCs.
The controller seems to support 128 lines but where they are wired up differs between chips and no currently known chip uses anywhere near 128 lines so there needs to be some per-chip data to collect together what lines actually have physical pins attached and map the right names to them.
The core peripherals seem to use the same lines on the currently known chips but the lines used for the sensor interface, lcd controller etc pins seem to be totally different between the infinity and mercury chips
The code tries to collect all of the re-usable names, offsets etc together so that it's easy to build the extra per-chip data for other chips in the future.
Quoted 6 lines
So far this only supports the MSC313 and MSC313E chips.
Support for the SSC8336N (mercury5) is trivial to add once all of the lines have been mapped out.
Signed-off-by Daniel Palmer <[email protected]>
This looks really nice, the generic hierarchical IRQchip does its job very well here.
I saw you would send another version but this already looks like merge material.
Certainly any remaining issues can be ironed out in-tree.
drivers/gpio/Kconfig config GPIO_AMD_FCH · line 745
Quoted 5 lines
drivers/gpio/Kconfig +5
-0+config GPIO_MSC313 + bool "MStar MSC313 GPIO support" + default y if ARCH_MSTARV7 + depends on ARCH_MSTARV7 + select GPIOLIB_IRQCHIP
select IRQ_DOMAIN_HIERARCHY
since you are dependent on this.
(Else people will soon report problems with randconfig...)
Quoted 12 lines
drivers/gpio/gpio-msc313.c new file +12
-0+/* The parent interrupt controller needs the GIC interrupt type set to GIC_SPI +* so we need to provide the fwspec. Essentially gpiochip_populate_parent_fwspec_twocell +* that puts GIC_SPI into the first cell. +*/ +static void *msc313_gpio_populate_parent_fwspec (struct gpio_chip *gc, +unsigned int parent_hwirq, +unsigned int parent_type) +{ +struct irq_fwspec *fwspec; + + fwspec =kmalloc (sizeof (*fwspec),GFP_KERNEL ); +if (!fwspec)
drivers/gpio/gpio-msc313.c line 264
Quoted 10 lines
drivers/gpio/gpio-msc313.c new file +10
-0+return NULL ; + + fwspec->fwnode = gc->irq.parent_domain->fwnode; + fwspec->param_count =3 ; + fwspec->param[0 ] =GIC_SPI ; + fwspec->param[1 ] = parent_hwirq; + fwspec->param[2 ] = parent_type; + +return fwspec; +}
Clever. Looping in Marc Z so he can say if this looks allright to him.
Quoted 12 lines
drivers/gpio/gpio-msc313.c new file +12
-0+static int msc313e_gpio_child_to_parent_hwirq (struct gpio_chip *chip, +unsigned int child, +unsigned int child_type, +unsigned int *parent, +unsigned int *parent_type) +{ +struct msc313_gpio *priv =gpiochip_get_data (chip); +unsigned int offset = priv->gpio_data->offsets[child]; +int ret = -EINVAL ; + +/* only the spi0 pins have interrupts on the parent +* on all of the known chips and so far they are all
drivers/gpio/gpio-msc313.c line 287
Quoted 10 lines
drivers/gpio/gpio-msc313.c new file +10
-0+* mapped to the same place +*/ +if (offset >=OFF_SPI0_CZ && offset <=OFF_SPI0_DO ) { + *parent_type = child_type; + *parent = ((offset -OFF_SPI0_CZ ) >>2 ) +28 ; + ret =0 ; + } + +return ret; +}
Neat!
drivers/gpio/gpio-msc313.c line 300
Quoted 12 lines
drivers/gpio/gpio-msc313.c new file +12
-0+static int msc313_gpio_probe (struct platform_device *pdev) +{ +const struct msc313_gpio_data *match_data; +struct msc313_gpio *gpio; +struct gpio_chip *gpiochip; +struct gpio_irq_chip *gpioirqchip; +struct resource *res; +struct irq_domain *parent_domain; +struct device_node *parent_node; +int ret; + + match_data =of_device_get_match_data (&pdev->dev);
There is a lot of referencing &pdev->dev.
I would add a local variable like this:
struct device *dev = &pdev->dev
and replace all &pdev->dev with that. It will make the code more compact and easier to read.
Yours,
Linus Walleij
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Quoted 1 line · Linus Walleij
On Mon, Oct 19, 2020 at 4:10 PM Daniel Palmer <[email protected]> wrote:
[...]
Quoted 6 lines
Quoted 6 lines
+/* The parent interrupt controller needs the GIC interrupt type set to
GIC_SPI
+ * so we need to provide the fwspec. Essentiallygpiochip_populate_parent_fwspec_twocell
+ * that putsGIC_SPIinto the first cell.
+ */
nit: comment style.
Quoted 13 lines
Quoted 13 lines
(quoted diff) +2
-0+static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc, + unsigned int
parent_hwirq,drivers/gpio/gpio-msc313.c new file +10
-0+ unsigned int parent_type) +{ +struct irq_fwspec *fwspec; + + fwspec =kmalloc (sizeof (*fwspec),GFP_KERNEL ); +if (!fwspec) +return NULL ; + + fwspec->fwnode = gc->irq.parent_domain->fwnode; + fwspec->param_count =3 ;
Quoted 8 lines
drivers/gpio/gpio-msc313.c line 264
Quoted 6 lines
drivers/gpio/gpio-msc313.c new file +6
-0+ fwspec->param[0 ] =GIC_SPI ; + fwspec->param[1 ] = parent_hwirq; + fwspec->param[2 ] = parent_type; + +return fwspec; +}Clever. Looping in Marc Z so he can say if this looks allright to him.
Yup, this looks correct. However, looking at the bit of the patch that isn't quoted here, I see that msc313_gpio_irqchip doesn't have a .irq_set_affinity callback. Is this system UP only?
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Hi Marc,
Quoted 6 lines · Marc Zyngier
Quoted 1 line · Linus Walleij
On Mon, Oct 19, 2020 at 4:10 PM Daniel Palmer <[email protected]> wrote:
[...]
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
+/* The parent interrupt controller needs the GIC interrupt type set to
GIC_SPI
+ * so we need to provide the fwspec. Essentiallygpiochip_populate_parent_fwspec_twocell
+ * that putsGIC_SPIinto the first cell.
+ */nit: comment style.
I've fixed these and some other bits for the v3.
I've held off on pushing that until the rest of it seemed right.
Quoted 22 lines
Quoted 13 lines
Quoted 13 lines
(quoted diff) +2
-0+static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc, + unsigned int
parent_hwirq,drivers/gpio/gpio-msc313.c new file +10
-0+ unsigned int parent_type) +{ +struct irq_fwspec *fwspec; + + fwspec =kmalloc (sizeof (*fwspec),GFP_KERNEL ); +if (!fwspec) +return NULL ; + + fwspec->fwnode = gc->irq.parent_domain->fwnode; + fwspec->param_count =3 ;Quoted 8 lines
drivers/gpio/gpio-msc313.c line 264
Quoted 6 lines
drivers/gpio/gpio-msc313.c new file +6
-0+ fwspec->param[0 ] =GIC_SPI ; + fwspec->param[1 ] = parent_hwirq; + fwspec->param[2 ] = parent_type; + +return fwspec; +}Clever. Looping in Marc Z so he can say if this looks allright to him.
Quoted 3 lines
Yup, this looks correct. However, looking at the bit of the patch that isn't quoted here, I see that
msc313_gpio_irqchipdoesn't have a .irq_set_affinity callback. Is this system UP only?
What is in mainline right now is UP only but there are chips with a second cortex A7 that I have working in my tree.
So I will add that in for v3 if I can work out what I should actually do there. :)
Thanks,
Daniel
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Quoted 43 lines · Daniel Palmer
Hi Marc,
Quoted 6 lines · Marc Zyngier
Quoted 1 line · Linus Walleij
On Mon, Oct 19, 2020 at 4:10 PM Daniel Palmer <[email protected]> wrote:
[...]
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
+/* The parent interrupt controller needs the GIC interrupt type set to
GIC_SPI
+ * so we need to provide the fwspec. Essentiallygpiochip_populate_parent_fwspec_twocell
+ * that putsGIC_SPIinto the first cell.
+ */nit: comment style.
I've fixed these and some other bits for the v3.
I've held off on pushing that until the rest of it seemed right.Quoted 22 lines
Quoted 21 lines
Quoted 9 lines
(quoted diff) +2
-0+static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc, + unsigned int
parent_hwirq,drivers/gpio/gpio-msc313.c new file +6
-0+ unsigned int parent_type) +{ +struct irq_fwspec *fwspec; + + fwspec =kmalloc (sizeof (*fwspec),GFP_KERNEL ); +if (!fwspec)drivers/gpio/gpio-msc313.c line 264
Quoted 10 lines
drivers/gpio/gpio-msc313.c new file +10
-0+return NULL ; + + fwspec->fwnode = gc->irq.parent_domain->fwnode; + fwspec->param_count =3 ; + fwspec->param[0 ] =GIC_SPI ; + fwspec->param[1 ] = parent_hwirq; + fwspec->param[2 ] = parent_type; + +return fwspec; +}Clever. Looping in Marc Z so he can say if this looks allright to him.
Quoted 8 lines
Quoted 3 lines
Yup, this looks correct. However, looking at the bit of the patch that isn't quoted here, I see that
msc313_gpio_irqchipdoesn't have a .irq_set_affinity callback. Is this system UP only?What is in mainline right now is UP only but there are chips with a second cortex A7 that I have working in my tree.
So I will add that in for v3 if I can work out what I should actually do there. :)
Probably nothing more than setting the callback to irq_chip_set_affinity_parent, I'd expect.
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Quoted 6 lines · Marc Zyngier
Quoted 5 lines · Daniel Palmer
Quoted 2 lines · Marc Zyngier
I see that
msc313_gpio_irqchipdoesn't have a
.irq_set_affinity callback. Is this system UP only?
Quoted 7 lines
Quoted 4 lines
What is in mainline right now is UP only but there are chips with a second cortex A7 that I have working in my tree.
So I will add that in for v3 if I can work out what I should actually do there. :)Probably nothing more than setting the callback to
irq_chip_set_affinity_parent,
Hm, is this something all GPIO irqchips used on SMP systems should be doing? Or just hierarchical ones?
Yours,
Linus Walleij
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Quoted 12 lines · Linus Walleij
Quoted 11 lines · Marc Zyngier
Quoted 9 lines · Daniel Palmer
Quoted 2 lines · Marc Zyngier
I see that
msc313_gpio_irqchipdoesn't have a
.irq_set_affinity callback. Is this system UP only?What is in mainline right now is UP only but there are chips with a second cortex A7 that I have working in my tree.
So I will add that in for v3 if I can work out what I should actually do there. :)
Quoted 5 lines
Quoted 2 lines
Probably nothing more than setting the callback to
irq_chip_set_affinity_parent,Hm, is this something all GPIO irqchips used on SMP systems should be doing? Or just hierarchical ones?
Probably only the hierarchical ones. I'd expect the non-hierarchical GPIOs to be muxed behind a single interrupt, which makes it impossible to move a single GPIO around, and moving the mux interrupt would break userspace's expectations that interrupts move independently of each others.
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Quoted 5 lines · Marc Zyngier
Quoted 3 lines · Linus Walleij
Quoted 2 lines
Probably nothing more than setting the callback to
irq_chip_set_affinity_parent,
Quoted 8 lines
Quoted 2 lines
Hm, is this something all GPIO irqchips used on SMP systems should be doing? Or just hierarchical ones?
Probably only the hierarchical ones. I'd expect the non-hierarchical GPIOs to be muxed behind a single interrupt, which makes it impossible to move a single GPIO around, and moving the mux interrupt would break userspace's expectations that interrupts move independently of each others.
I found two suspects and sent patches. I think I might have some more candidates down in pinctrl. I do have some hierarchical IRQ that is on UP systems, I suppose these are not affected.
Yours,
Linus Walleij
Re: [PATCH v2 3/5] gpio: msc313: MStar MSC313 GPIO driver
Quoted 15 lines · Linus Walleij
Quoted 5 lines · Marc Zyngier
Quoted 3 lines · Linus Walleij
Quoted 2 lines
Probably nothing more than setting the callback to
irq_chip_set_affinity_parent,Quoted 8 lines
Quoted 2 lines
Hm, is this something all GPIO irqchips used on SMP systems should be doing? Or just hierarchical ones?
Probably only the hierarchical ones. I'd expect the non-hierarchical GPIOs to be muxed behind a single interrupt, which makes it impossible to move a single GPIO around, and moving the mux interrupt would break userspace's expectations that interrupts move independently of each others.
Quoted 3 lines
I found two suspects and sent patches. I think I might have some more candidates down in pinctrl. I do have some hierarchical IRQ that is on UP systems, I suppose these are not affected.
Yup, they look good. Feel free to add my Ack to them. And yes, UP systems are naturally oblivious of interrupt affinity.
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
PATCH v2 4/5 ARM: mstar: Add gpio controller to MStar base dtsi
In reply to Daniel PalmerThe GPIO controller is at the same address in all of the currently known chips so create a node for it in the base dtsi.
Some extra properties are needed to actually use it so disable it by default.
--- arch/arm/boot/dts/mstar-v7.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/mstar-v7.dtsi +10 -0
@@ -109,6 +109,16 @@ l3bridge: l3bridge@204400 { reg = <0x204400 0x200>; }; + gpio: gpio@207800 { + #gpio-cells = <2>; + reg = <0x207800 0x200>; + gpio-controller; + #interrupt-cells = <2>; + interrupt-controller; + interrupt-parent = <&intc_fiq>; + status = "disabled"; + }; + pm_uart: uart@221000 { compatible = "ns16550a"; reg = <0x221000 0x100>;
Signature · 1 line
2.28.0
Re: [PATCH v2 4/5] ARM: mstar: Add gpio controller to MStar base dtsi
Quoted 8 lines · Daniel Palmer
The GPIO controller is at the same address in all of the currently known chips so create a node for it in the base dtsi.
Some extra properties are needed to actually use it so disable it by default.
Signed-off-by Daniel Palmer <[email protected]>
Eventually this should go through the ARM SoC tree, but it is fine to send with the rest of the patches, I will simply just apply 1-3.
Yours,
Linus Walleij
PATCH v2 5/5 ARM: mstar: Fill in GPIO controller properties for infinity
In reply to Daniel PalmerFill in the properties needed to use the GPIO controller in the infinity and infinity3 chips.
--- arch/arm/boot/dts/mstar-infinity.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/mstar-infinity.dtsi +7 -0
@@ -6,6 +6,13 @@ #include "mstar-v7.dtsi" +#include <dt-bindings/gpio/msc313-gpio.h> + &imi { reg = <0xa0000000 0x16000>; }; + +&gpio { + compatible = "mstar,msc313-gpio"; + status = "okay"; +};
Signature · 1 line
2.28.0
Re: [PATCH v2 5/5] ARM: mstar: Fill in GPIO controller properties for infinity
Quoted 4 lines · Daniel Palmer
Fill in the properties needed to use the GPIO controller in the infinity and infinity3 chips.
Signed-off-by Daniel Palmer <[email protected]>
Yours,
Linus Walleij