Skip to content

Commit fd17b86

Browse files
IRISZZWnashif
authored andcommitted
arc: hsdk: add lvgl support for hsdk board
The ARC HSDK board provides an Arduino shield interface, we can use it for TFT TOUCH SHIELD. Signed-off-by: Watson Zeng <[email protected]>
1 parent 75a65a0 commit fd17b86

File tree

5 files changed

+119
-0
lines changed

5 files changed

+119
-0
lines changed

boards/arc/hsdk/Kconfig.defconfig

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,47 @@ if BOARD_HSDK
88
config BOARD
99
default "hsdk"
1010

11+
if GPIO
12+
13+
config GPIO_DW
14+
default y
15+
16+
if GPIO_DW
17+
18+
config GPIO_DW_0
19+
default y
20+
21+
endif # GPIO_DW
22+
23+
endif # GPIO
24+
25+
if SPI
26+
27+
config SPI_DW
28+
default y
29+
30+
if SPI_DW
31+
32+
config SPI_DW_FIFO_DEPTH
33+
default 32
34+
35+
config SPI_DW_ARC_AUX_REGS
36+
default n
37+
38+
config SPI_DW_ACCESS_WORD_ONLY
39+
default y
40+
41+
config SPI_0
42+
default y
43+
44+
config SPI_1
45+
default y
46+
47+
config SPI_2
48+
default y
49+
50+
endif # SPI_DW
51+
52+
endif # SPI
53+
1154
endif # BOARD_HSDK

boards/arc/hsdk/hsdk.dts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,23 @@
2727
status = "okay";
2828
current-speed = <115200>;
2929
};
30+
31+
&gpio0 {
32+
status = "okay";
33+
interrupts = <56 1>;
34+
};
35+
36+
&spi0 {
37+
status = "okay";
38+
clock-frequency = <33333333>;
39+
};
40+
41+
&spi1 {
42+
status = "okay";
43+
clock-frequency = <33333333>;
44+
};
45+
46+
&spi2 {
47+
status = "okay";
48+
clock-frequency = <33333333>;
49+
};

boards/arc/hsdk/hsdk_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ CONFIG_UART_CONSOLE=y
1515
CONFIG_SERIAL=y
1616
CONFIG_PINMUX=y
1717
CONFIG_PINMUX_HSDK=y
18+
CONFIG_GPIO=y
19+
CONFIG_SPI=y

samples/gui/lvgl/boards/hsdk.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_ILI9340=y
2+
CONFIG_ILI9340_LCD_SEEED_TFTV2=y
3+
4+
CONFIG_LVGL=y

soc/arc/snps_arc_hsdk/dts_fixup.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,54 @@
1616
#define DT_UART_NS16550_PORT_0_NAME DT_NS16550_F0005000_LABEL
1717
#define DT_UART_NS16550_PORT_0_IRQ_PRI DT_NS16550_F0005000_IRQ_0_PRIORITY
1818

19+
/*
20+
* GPIO configuration
21+
*/
22+
#define DT_GPIO_DW_0_BASE_ADDR DT_SNPS_DESIGNWARE_GPIO_F0003000_BASE_ADDRESS
23+
#define DT_GPIO_DW_0_BITS DT_SNPS_DESIGNWARE_GPIO_F0003000_BITS
24+
#define CONFIG_GPIO_DW_0_NAME DT_SNPS_DESIGNWARE_GPIO_F0003000_LABEL
25+
#define DT_GPIO_DW_0_IRQ DT_SNPS_DESIGNWARE_GPIO_F0003000_IRQ_0
26+
#define CONFIG_GPIO_DW_0_IRQ_PRI DT_SNPS_DESIGNWARE_GPIO_F0003000_IRQ_0_PRIORITY
27+
#define DT_GPIO_DW_0_IRQ_FLAGS 0
28+
29+
/*
30+
* SPI configuration
31+
*/
32+
33+
#define DT_SPI_0_BASE_ADDRESS DT_SNPS_DESIGNWARE_SPI_F0020000_BASE_ADDRESS
34+
#define DT_SPI_0_CLOCK_FREQUENCY DT_SNPS_DESIGNWARE_SPI_F0020000_CLOCK_FREQUENCY
35+
#define DT_SPI_0_NAME DT_SNPS_DESIGNWARE_SPI_F0020000_LABEL
36+
#define DT_SPI_0_IRQ DT_SNPS_DESIGNWARE_SPI_F0020000_IRQ_0
37+
#define DT_SPI_0_IRQ_PRI DT_SNPS_DESIGNWARE_SPI_F0020000_IRQ_0_PRIORITY
38+
39+
#define DT_SPI_1_BASE_ADDRESS DT_SNPS_DESIGNWARE_SPI_F0021000_BASE_ADDRESS
40+
#define DT_SPI_1_CLOCK_FREQUENCY DT_SNPS_DESIGNWARE_SPI_F0021000_CLOCK_FREQUENCY
41+
#define DT_SPI_1_NAME DT_SNPS_DESIGNWARE_SPI_F0021000_LABEL
42+
#define DT_SPI_1_IRQ DT_SNPS_DESIGNWARE_SPI_F0021000_IRQ_0
43+
#define DT_SPI_1_IRQ_PRI DT_SNPS_DESIGNWARE_SPI_F0021000_IRQ_0_PRIORITY
44+
45+
#define DT_SPI_2_BASE_ADDRESS DT_SNPS_DESIGNWARE_SPI_F0022000_BASE_ADDRESS
46+
#define DT_SPI_2_CLOCK_FREQUENCY DT_SNPS_DESIGNWARE_SPI_F0022000_CLOCK_FREQUENCY
47+
#define DT_SPI_2_NAME DT_SNPS_DESIGNWARE_SPI_F0022000_LABEL
48+
#define DT_SPI_2_IRQ DT_SNPS_DESIGNWARE_SPI_F0022000_IRQ_0
49+
#define DT_SPI_2_IRQ_PRI DT_SNPS_DESIGNWARE_SPI_F0022000_IRQ_0_PRIORITY
50+
51+
#define DT_SPI_DW_IRQ_FLAGS 0
52+
53+
/*
54+
* seeed TFT TOUCH SHIELD configuration
55+
*/
56+
57+
#define DT_INST_0_ILITEK_ILI9340_BUS_NAME DT_SPI_2_NAME
58+
#define DT_INST_0_ILITEK_ILI9340_SPI_MAX_FREQUENCY 12000000
59+
#define DT_INST_0_ILITEK_ILI9340_BASE_ADDRESS 1
60+
61+
#define DT_INST_0_ILITEK_ILI9340_CS_GPIOS_CONTROLLER CONFIG_GPIO_DW_0_NAME
62+
#define DT_INST_0_ILITEK_ILI9340_CS_GPIOS_PIN 9
63+
64+
#define DT_INST_0_ILITEK_ILI9340_CMD_DATA_GPIOS_CONTROLLER CONFIG_GPIO_DW_0_NAME
65+
#define DT_INST_0_ILITEK_ILI9340_CMD_DATA_GPIOS_PIN 21
66+
67+
#define DT_INST_0_ILITEK_ILI9340_LABEL "DISPLAY"
68+
1969
/* End of SoC Level DTS fixup file */

0 commit comments

Comments
 (0)