Re: [U-Boot] [RFC PATCH v2 05/13] tegra: dts: Bring in GPIO bindings from linux
On 05/09/2014 11:28 AM, Simon Glass wrote: These files are taken from Linux 3.14. diff --git a/arch/arm/dts/tegra124.dtsi b/arch/arm/dts/tegra124.dtsi - gpio: gpio@6000d000 { + gpio: gpio@0,6000d000 { compatible = nvidia,tegra124-gpio, nvidia,tegra30-gpio; - reg = 0x6000d000 0x1000; ... + reg = 0x0 0x6000d000 0x0 0x1000; That reg value and node name are for #address-cells=2, #size-cells=2. However, those properties are both =1 in the U-Boot tegra124.dtsi, and I'm not sure whether U-Boot even supports 64-bit DT address values yet? It'd probably be simplest to just use 32-bit address/size values in tegra124.dtsi now, and import the conversion to 64-bit later? Aside from that, this patch looks, so assuming the change to those two lines above is reverted: Acked-by: Stephen Warren swar...@nvidia.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC PATCH v2 05/13] tegra: dts: Bring in GPIO bindings from linux
These files are taken from Linux 3.14. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v3: - Bring in GPIO bindings for tegra{30,114,124} also Changes in v2: - Add new patch to bring in Tegra device tree files from linux arch/arm/dts/tegra114.dtsi | 21 + arch/arm/dts/tegra124.dtsi | 23 +- arch/arm/dts/tegra20.dtsi | 15 ++- arch/arm/dts/tegra30.dtsi | 21 + include/dt-bindings/gpio/gpio.h| 15 +++ include/dt-bindings/gpio/tegra-gpio.h | 51 ++ include/dt-bindings/interrupt-controller/arm-gic.h | 22 ++ include/dt-bindings/interrupt-controller/irq.h | 19 8 files changed, 157 insertions(+), 30 deletions(-) create mode 100644 include/dt-bindings/gpio/gpio.h create mode 100644 include/dt-bindings/gpio/tegra-gpio.h create mode 100644 include/dt-bindings/interrupt-controller/arm-gic.h create mode 100644 include/dt-bindings/interrupt-controller/irq.h diff --git a/arch/arm/dts/tegra114.dtsi b/arch/arm/dts/tegra114.dtsi index f52fcf1..59434e0 100644 --- a/arch/arm/dts/tegra114.dtsi +++ b/arch/arm/dts/tegra114.dtsi @@ -1,3 +1,6 @@ +#include dt-bindings/gpio/tegra-gpio.h +#include dt-bindings/interrupt-controller/arm-gic.h + #include skeleton.dtsi / { @@ -46,17 +49,17 @@ 0 143 0x04; }; - gpio: gpio { + gpio: gpio@6000d000 { compatible = nvidia,tegra114-gpio, nvidia,tegra30-gpio; reg = 0x6000d000 0x1000; - interrupts = 0 32 0x04 - 0 33 0x04 - 0 34 0x04 - 0 35 0x04 - 0 55 0x04 - 0 87 0x04 - 0 89 0x04 - 0 125 0x04; + interrupts = GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH; #gpio-cells = 2; gpio-controller; #interrupt-cells = 2; diff --git a/arch/arm/dts/tegra124.dtsi b/arch/arm/dts/tegra124.dtsi index 18a8b24..a13cfe4 100644 --- a/arch/arm/dts/tegra124.dtsi +++ b/arch/arm/dts/tegra124.dtsi @@ -1,3 +1,6 @@ +#include dt-bindings/gpio/tegra-gpio.h +#include dt-bindings/interrupt-controller/arm-gic.h + #include skeleton.dtsi / { @@ -46,17 +49,17 @@ 0 143 0x04; }; - gpio: gpio@6000d000 { + gpio: gpio@0,6000d000 { compatible = nvidia,tegra124-gpio, nvidia,tegra30-gpio; - reg = 0x6000d000 0x1000; - interrupts = 0 32 0x04 - 0 33 0x04 - 0 34 0x04 - 0 35 0x04 - 0 55 0x04 - 0 87 0x04 - 0 89 0x04 - 0 125 0x04; + reg = 0x0 0x6000d000 0x0 0x1000; + interrupts = GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH; #gpio-cells = 2; gpio-controller; #interrupt-cells = 2; diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi index 3805750..a524f6e 100644 --- a/arch/arm/dts/tegra20.dtsi +++ b/arch/arm/dts/tegra20.dtsi @@ -1,3 +1,6 @@ +#include dt-bindings/gpio/tegra-gpio.h +#include dt-bindings/interrupt-controller/arm-gic.h + #include skeleton.dtsi / { @@ -139,10 +142,18 @@ gpio: gpio@6000d000 { compatible = nvidia,tegra20-gpio; - reg = 0x6000d000 0x1000 ; - interrupts = 64 65 66 67 87 119 121 ; + reg = 0x6000d000 0x1000; + interrupts = GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH, +
Re: [U-Boot] [RFC PATCH v2 05/13] tegra: dts: Bring in GPIO bindings from linux
Hi Stephen, On 5 May 2014 10:57, Stephen Warren swar...@wwwdotorg.org wrote: On 05/05/2014 10:09 AM, Simon Glass wrote: These files are taken from Linux 3.14. diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi This looks good. Can the patch be extended to all tegra*.dtsi too, so they are all consistent? Will do. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC PATCH v2 05/13] tegra: dts: Bring in GPIO bindings from linux
These files are taken from Linux 3.14. Signed-off-by: Simon Glass s...@chromium.org --- Changes in v2: - Add new patch to bring in Tegra device tree files from linux arch/arm/dts/tegra20.dtsi | 15 ++- include/dt-bindings/gpio/gpio.h| 15 +++ include/dt-bindings/gpio/tegra-gpio.h | 51 ++ include/dt-bindings/interrupt-controller/arm-gic.h | 22 ++ include/dt-bindings/interrupt-controller/irq.h | 19 5 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 include/dt-bindings/gpio/gpio.h create mode 100644 include/dt-bindings/gpio/tegra-gpio.h create mode 100644 include/dt-bindings/interrupt-controller/arm-gic.h create mode 100644 include/dt-bindings/interrupt-controller/irq.h diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi index 3805750..a524f6e 100644 --- a/arch/arm/dts/tegra20.dtsi +++ b/arch/arm/dts/tegra20.dtsi @@ -1,3 +1,6 @@ +#include dt-bindings/gpio/tegra-gpio.h +#include dt-bindings/interrupt-controller/arm-gic.h + #include skeleton.dtsi / { @@ -139,10 +142,18 @@ gpio: gpio@6000d000 { compatible = nvidia,tegra20-gpio; - reg = 0x6000d000 0x1000 ; - interrupts = 64 65 66 67 87 119 121 ; + reg = 0x6000d000 0x1000; + interrupts = GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH, +GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH; #gpio-cells = 2; gpio-controller; + #interrupt-cells = 2; + interrupt-controller; }; pinmux: pinmux@7000 { diff --git a/include/dt-bindings/gpio/gpio.h b/include/dt-bindings/gpio/gpio.h new file mode 100644 index 000..e6b1e0a --- /dev/null +++ b/include/dt-bindings/gpio/gpio.h @@ -0,0 +1,15 @@ +/* + * This header provides constants for most GPIO bindings. + * + * Most GPIO bindings include a flags cell as part of the GPIO specifier. + * In most cases, the format of the flags cell uses the standard values + * defined in this header. + */ + +#ifndef _DT_BINDINGS_GPIO_GPIO_H +#define _DT_BINDINGS_GPIO_GPIO_H + +#define GPIO_ACTIVE_HIGH 0 +#define GPIO_ACTIVE_LOW 1 + +#endif diff --git a/include/dt-bindings/gpio/tegra-gpio.h b/include/dt-bindings/gpio/tegra-gpio.h new file mode 100644 index 000..197dc28 --- /dev/null +++ b/include/dt-bindings/gpio/tegra-gpio.h @@ -0,0 +1,51 @@ +/* + * This header provides constants for binding nvidia,tegra*-gpio. + * + * The first cell in Tegra's GPIO specifier is the GPIO ID. The macros below + * provide names for this. + * + * The second cell contains standard flag values specified in gpio.h. + */ + +#ifndef _DT_BINDINGS_GPIO_TEGRA_GPIO_H +#define _DT_BINDINGS_GPIO_TEGRA_GPIO_H + +#include dt-bindings/gpio/gpio.h + +#define TEGRA_GPIO_BANK_ID_A 0 +#define TEGRA_GPIO_BANK_ID_B 1 +#define TEGRA_GPIO_BANK_ID_C 2 +#define TEGRA_GPIO_BANK_ID_D 3 +#define TEGRA_GPIO_BANK_ID_E 4 +#define TEGRA_GPIO_BANK_ID_F 5 +#define TEGRA_GPIO_BANK_ID_G 6 +#define TEGRA_GPIO_BANK_ID_H 7 +#define TEGRA_GPIO_BANK_ID_I 8 +#define TEGRA_GPIO_BANK_ID_J 9 +#define TEGRA_GPIO_BANK_ID_K 10 +#define TEGRA_GPIO_BANK_ID_L 11 +#define TEGRA_GPIO_BANK_ID_M 12 +#define TEGRA_GPIO_BANK_ID_N 13 +#define TEGRA_GPIO_BANK_ID_O 14 +#define TEGRA_GPIO_BANK_ID_P 15 +#define TEGRA_GPIO_BANK_ID_Q 16 +#define TEGRA_GPIO_BANK_ID_R 17 +#define TEGRA_GPIO_BANK_ID_S 18 +#define TEGRA_GPIO_BANK_ID_T 19 +#define TEGRA_GPIO_BANK_ID_U 20 +#define TEGRA_GPIO_BANK_ID_V 21 +#define TEGRA_GPIO_BANK_ID_W 22 +#define TEGRA_GPIO_BANK_ID_X 23 +#define TEGRA_GPIO_BANK_ID_Y 24 +#define TEGRA_GPIO_BANK_ID_Z 25 +#define TEGRA_GPIO_BANK_ID_AA 26 +#define TEGRA_GPIO_BANK_ID_BB 27 +#define TEGRA_GPIO_BANK_ID_CC 28 +#define TEGRA_GPIO_BANK_ID_DD 29 +#define TEGRA_GPIO_BANK_ID_EE 30 +#define TEGRA_GPIO_BANK_ID_FF 31 + +#define TEGRA_GPIO(bank, offset) \ + ((TEGRA_GPIO_BANK_ID_##bank * 8) + offset) + +#endif diff --git a/include/dt-bindings/interrupt-controller/arm-gic.h b/include/dt-bindings/interrupt-controller/arm-gic.h new file mode 100644 index 000..1ea1b70 --- /dev/null +++ b/include/dt-bindings/interrupt-controller/arm-gic.h @@ -0,0 +1,22 @@ +/* + * This header provides constants for the ARM GIC. + */ + +#ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_ARM_GIC_H +#define _DT_BINDINGS_INTERRUPT_CONTROLLER_ARM_GIC_H + +#include dt-bindings/interrupt-controller/irq.h + +/* interrupt specific cell 0 */ + +#define GIC_SPI 0 +#define GIC_PPI 1 + +/* + * Interrupt specifier cell 2. + * The flaggs in irq.h are valid, plus those below. + */ +#define GIC_CPU_MASK_RAW(x) ((x) 8) +#define
Re: [U-Boot] [RFC PATCH v2 05/13] tegra: dts: Bring in GPIO bindings from linux
On 05/05/2014 10:09 AM, Simon Glass wrote: These files are taken from Linux 3.14. diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi This looks good. Can the patch be extended to all tegra*.dtsi too, so they are all consistent? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot