Skip to content

Commit

Permalink
arc: hsdk: add lvgl support for hsdk board
Browse files Browse the repository at this point in the history
The ARC HSDK board provides an Arduino shield interface,
we can use it for TFT TOUCH SHIELD.

Signed-off-by: Watson Zeng <[email protected]>
  • Loading branch information
IRISZZW authored and nashif committed Sep 17, 2019
1 parent 75a65a0 commit fd17b86
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 0 deletions.
43 changes: 43 additions & 0 deletions boards/arc/hsdk/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,47 @@ if BOARD_HSDK
config BOARD
default "hsdk"

if GPIO

config GPIO_DW
default y

if GPIO_DW

config GPIO_DW_0
default y

endif # GPIO_DW

endif # GPIO

if SPI

config SPI_DW
default y

if SPI_DW

config SPI_DW_FIFO_DEPTH
default 32

config SPI_DW_ARC_AUX_REGS
default n

config SPI_DW_ACCESS_WORD_ONLY
default y

config SPI_0
default y

config SPI_1
default y

config SPI_2
default y

endif # SPI_DW

endif # SPI

endif # BOARD_HSDK
20 changes: 20 additions & 0 deletions boards/arc/hsdk/hsdk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,23 @@
status = "okay";
current-speed = <115200>;
};

&gpio0 {
status = "okay";
interrupts = <56 1>;
};

&spi0 {
status = "okay";
clock-frequency = <33333333>;
};

&spi1 {
status = "okay";
clock-frequency = <33333333>;
};

&spi2 {
status = "okay";
clock-frequency = <33333333>;
};
2 changes: 2 additions & 0 deletions boards/arc/hsdk/hsdk_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_PINMUX=y
CONFIG_PINMUX_HSDK=y
CONFIG_GPIO=y
CONFIG_SPI=y
4 changes: 4 additions & 0 deletions samples/gui/lvgl/boards/hsdk.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_ILI9340=y
CONFIG_ILI9340_LCD_SEEED_TFTV2=y

CONFIG_LVGL=y
50 changes: 50 additions & 0 deletions soc/arc/snps_arc_hsdk/dts_fixup.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,54 @@
#define DT_UART_NS16550_PORT_0_NAME DT_NS16550_F0005000_LABEL
#define DT_UART_NS16550_PORT_0_IRQ_PRI DT_NS16550_F0005000_IRQ_0_PRIORITY

/*
* GPIO configuration
*/
#define DT_GPIO_DW_0_BASE_ADDR DT_SNPS_DESIGNWARE_GPIO_F0003000_BASE_ADDRESS
#define DT_GPIO_DW_0_BITS DT_SNPS_DESIGNWARE_GPIO_F0003000_BITS
#define CONFIG_GPIO_DW_0_NAME DT_SNPS_DESIGNWARE_GPIO_F0003000_LABEL
#define DT_GPIO_DW_0_IRQ DT_SNPS_DESIGNWARE_GPIO_F0003000_IRQ_0
#define CONFIG_GPIO_DW_0_IRQ_PRI DT_SNPS_DESIGNWARE_GPIO_F0003000_IRQ_0_PRIORITY
#define DT_GPIO_DW_0_IRQ_FLAGS 0

/*
* SPI configuration
*/

#define DT_SPI_0_BASE_ADDRESS DT_SNPS_DESIGNWARE_SPI_F0020000_BASE_ADDRESS
#define DT_SPI_0_CLOCK_FREQUENCY DT_SNPS_DESIGNWARE_SPI_F0020000_CLOCK_FREQUENCY
#define DT_SPI_0_NAME DT_SNPS_DESIGNWARE_SPI_F0020000_LABEL
#define DT_SPI_0_IRQ DT_SNPS_DESIGNWARE_SPI_F0020000_IRQ_0
#define DT_SPI_0_IRQ_PRI DT_SNPS_DESIGNWARE_SPI_F0020000_IRQ_0_PRIORITY

#define DT_SPI_1_BASE_ADDRESS DT_SNPS_DESIGNWARE_SPI_F0021000_BASE_ADDRESS
#define DT_SPI_1_CLOCK_FREQUENCY DT_SNPS_DESIGNWARE_SPI_F0021000_CLOCK_FREQUENCY
#define DT_SPI_1_NAME DT_SNPS_DESIGNWARE_SPI_F0021000_LABEL
#define DT_SPI_1_IRQ DT_SNPS_DESIGNWARE_SPI_F0021000_IRQ_0
#define DT_SPI_1_IRQ_PRI DT_SNPS_DESIGNWARE_SPI_F0021000_IRQ_0_PRIORITY

#define DT_SPI_2_BASE_ADDRESS DT_SNPS_DESIGNWARE_SPI_F0022000_BASE_ADDRESS
#define DT_SPI_2_CLOCK_FREQUENCY DT_SNPS_DESIGNWARE_SPI_F0022000_CLOCK_FREQUENCY
#define DT_SPI_2_NAME DT_SNPS_DESIGNWARE_SPI_F0022000_LABEL
#define DT_SPI_2_IRQ DT_SNPS_DESIGNWARE_SPI_F0022000_IRQ_0
#define DT_SPI_2_IRQ_PRI DT_SNPS_DESIGNWARE_SPI_F0022000_IRQ_0_PRIORITY

#define DT_SPI_DW_IRQ_FLAGS 0

/*
* seeed TFT TOUCH SHIELD configuration
*/

#define DT_INST_0_ILITEK_ILI9340_BUS_NAME DT_SPI_2_NAME
#define DT_INST_0_ILITEK_ILI9340_SPI_MAX_FREQUENCY 12000000
#define DT_INST_0_ILITEK_ILI9340_BASE_ADDRESS 1

#define DT_INST_0_ILITEK_ILI9340_CS_GPIOS_CONTROLLER CONFIG_GPIO_DW_0_NAME
#define DT_INST_0_ILITEK_ILI9340_CS_GPIOS_PIN 9

#define DT_INST_0_ILITEK_ILI9340_CMD_DATA_GPIOS_CONTROLLER CONFIG_GPIO_DW_0_NAME
#define DT_INST_0_ILITEK_ILI9340_CMD_DATA_GPIOS_PIN 21

#define DT_INST_0_ILITEK_ILI9340_LABEL "DISPLAY"

/* End of SoC Level DTS fixup file */

0 comments on commit fd17b86

Please sign in to comment.