Skip to content

Commit 23f1193

Browse files
Sathish Kuttannashif
Sathish Kuttan
authored andcommitted
dts: intel_s1000: enable DTS for GPIO
Added GPIO to SoC device tree Updated SoC DTS fixup Removed Kconfig variables now replaced by DT Signed-off-by: Sathish Kuttan <[email protected]>
1 parent 212b218 commit 23f1193

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

boards/xtensa/intel_s1000_crb/Kconfig.defconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ config CAVS_ISR_TBL_OFFSET
4646
config DW_ISR_TBL_OFFSET
4747
default 3RD_LVL_ISR_TBL_OFFSET
4848

49-
config GPIO_DW_0_NAME
50-
default "GPIO_PORTA"
51-
config GPIO_DW_0_IRQ_PRI
52-
default 1
53-
5449
config I2C_0_DEFAULT_CFG
5550
default 0x12
5651
if DMA_CAVS

dts/xtensa/intel_s1000.dtsi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "skeleton.dtsi"
22
#include <dt-bindings/i2c/i2c.h>
3+
#include <dt-bindings/gpio/gpio.h>
34

45
/ {
56
cpus {
@@ -84,6 +85,17 @@
8485
interrupt-parent = <&cavs0>;
8586
};
8687

88+
gpio0: gpio@80c00 {
89+
compatible = "snps,designware-gpio";
90+
reg = <0x00080c00 0x400>;
91+
bits = <32>;
92+
label = "GPIO";
93+
interrupts = <4 1 0>;
94+
interrupt-parent = <&dw_intc>;
95+
96+
gpio-controller;
97+
#gpio-cells = <2>;
98+
};
8799

88100
uart0: uart@80800 {
89101
compatible = "ns16550";

soc/xtensa/intel_s1000/dts_fixup.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,23 @@
5858
#define DT_SPI_DW_IRQ_FLAGS DT_SNPS_DESIGNWARE_SPI_E000_IRQ_0_SENSE
5959

6060
#define DT_SPI_0_IRQ_PRI DT_SNPS_DESIGNWARE_SPI_E000_IRQ_0_PRIORITY
61+
62+
#define DT_GPIO_DW_0_BASE_ADDR \
63+
DT_SNPS_DESIGNWARE_GPIO_80C00_BASE_ADDRESS
64+
#define DT_GPIO_DW_0_BITS \
65+
DT_SNPS_DESIGNWARE_GPIO_80C00_BITS
66+
#define DT_GPIO_INTC_IRQ \
67+
(DT_SNPS_DESIGNWARE_GPIO_80C00_IRQ_0 << INTR_CNTL_IRQ_NUM_SHIFT)
68+
#define DT_GPIO_CAVS_IRQ \
69+
(DT_SNPS_DESIGNWARE_INTC_81800_IRQ_0 << CAVS_IRQ_NUM_SHIFT)
70+
#define DT_GPIO_XTENSA_IRQ \
71+
(DT_INTEL_CAVS_INTC_78800_IRQ_0 << XTENSA_IRQ_NUM_SHIFT)
72+
#define DT_GPIO_DW_0_IRQ \
73+
(DT_GPIO_INTC_IRQ | DT_GPIO_CAVS_IRQ | DT_GPIO_XTENSA_IRQ)
74+
#define CONFIG_GPIO_DW_0_IRQ_PRI \
75+
DT_SNPS_DESIGNWARE_GPIO_80C00_IRQ_0_PRIORITY
76+
#define DT_GPIO_DW_0_IRQ_FLAGS 0
77+
#define CONFIG_GPIO_DW_0_NAME \
78+
DT_SNPS_DESIGNWARE_GPIO_80C00_LABEL
79+
6180
/* End of SoC Level DTS fixup file */

soc/xtensa/intel_s1000/soc.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@
3636
#define DW_ICTL_NUM_IRQS 9
3737

3838
/* GPIO */
39-
#define DT_GPIO_DW_0_BASE_ADDR 0x00080C00
40-
#define DT_GPIO_DW_0_BITS 32
4139
#define GPIO_DW_PORT_0_INT_MASK 0
42-
#define DT_GPIO_DW_0_IRQ_FLAGS 0
43-
#define DT_GPIO_DW_0_IRQ 0x00040706
44-
#define GPIO_DW_0_IRQ_ICTL_OFFSET INTR_CNTL_IRQ_NUM(DT_GPIO_DW_0_IRQ)
4540

4641
/* low power DMACs */
4742
#define LP_GP_DMA_SIZE 0x00001000

0 commit comments

Comments
 (0)