From 29a7219aed4a5641027f1a5d3b07f5593192f6f0 Mon Sep 17 00:00:00 2001 From: "eunwoo.nam" Date: Fri, 10 May 2024 21:16:59 +0900 Subject: [PATCH] amebasmart: Add board revision 5th Add the revised 5th board. The pin of UART1 has been changed. The ALC1019 I2C port has been changed. Signed-off-by: eunwoo.nam --- build/configs/rtl8730e/audio/defconfig | 1 + build/configs/rtl8730e/flat_apps/defconfig | 1 + build/configs/rtl8730e/flat_dev/defconfig | 1 + build/configs/rtl8730e/loadable_apps/defconfig | 1 + build/configs/rtl8730e/loadable_apps_xip/defconfig | 1 + build/configs/rtl8730e/loadable_ext/defconfig | 1 + os/arch/arm/src/amebasmart/amebasmart_serial.c | 6 ++++++ os/board/rtl8730e/src/rtl8730e_alc1019.c | 5 +++++ os/board/rtl8730e/src/rtl8730e_st7789.c | 4 ++++ 9 files changed, 21 insertions(+) diff --git a/build/configs/rtl8730e/audio/defconfig b/build/configs/rtl8730e/audio/defconfig index 6b7b531cd9..bd9dca5569 100644 --- a/build/configs/rtl8730e/audio/defconfig +++ b/build/configs/rtl8730e/audio/defconfig @@ -291,6 +291,7 @@ CONFIG_FLASH_SIZE=16777216 CONFIG_FLASH_VSTART=0x8000000 # CONFIG_BOARD_FLASH_8M is not set CONFIG_BOARD_FLASH_16M=y +CONFIG_RTL8730E_REVISION=0 # # SPI Flash driver diff --git a/build/configs/rtl8730e/flat_apps/defconfig b/build/configs/rtl8730e/flat_apps/defconfig index 1270aa0354..b554dd9354 100644 --- a/build/configs/rtl8730e/flat_apps/defconfig +++ b/build/configs/rtl8730e/flat_apps/defconfig @@ -289,6 +289,7 @@ CONFIG_FLASH_SIZE=16777216 CONFIG_FLASH_VSTART=0x8000000 # CONFIG_BOARD_FLASH_8M is not set CONFIG_BOARD_FLASH_16M=y +CONFIG_RTL8730E_REVISION=0 # # SPI Flash driver diff --git a/build/configs/rtl8730e/flat_dev/defconfig b/build/configs/rtl8730e/flat_dev/defconfig index 131c9b5d80..7f5d6742e3 100644 --- a/build/configs/rtl8730e/flat_dev/defconfig +++ b/build/configs/rtl8730e/flat_dev/defconfig @@ -284,6 +284,7 @@ CONFIG_FLASH_SIZE=16777216 CONFIG_FLASH_VSTART=0x8000000 # CONFIG_BOARD_FLASH_8M is not set CONFIG_BOARD_FLASH_16M=y +CONFIG_RTL8730E_REVISION=0 # # SPI Flash driver diff --git a/build/configs/rtl8730e/loadable_apps/defconfig b/build/configs/rtl8730e/loadable_apps/defconfig index 23d977f5dc..17fd00ea6f 100644 --- a/build/configs/rtl8730e/loadable_apps/defconfig +++ b/build/configs/rtl8730e/loadable_apps/defconfig @@ -293,6 +293,7 @@ CONFIG_FLASH_SIZE=16777216 CONFIG_FLASH_VSTART=0x8000000 # CONFIG_BOARD_FLASH_8M is not set CONFIG_BOARD_FLASH_16M=y +CONFIG_RTL8730E_REVISION=0 # # SPI Flash driver diff --git a/build/configs/rtl8730e/loadable_apps_xip/defconfig b/build/configs/rtl8730e/loadable_apps_xip/defconfig index 10d1028e74..c1f72d3e9c 100644 --- a/build/configs/rtl8730e/loadable_apps_xip/defconfig +++ b/build/configs/rtl8730e/loadable_apps_xip/defconfig @@ -293,6 +293,7 @@ CONFIG_FLASH_SIZE=16777216 CONFIG_FLASH_VSTART=0x8000000 # CONFIG_BOARD_FLASH_8M is not set CONFIG_BOARD_FLASH_16M=y +CONFIG_RTL8730E_REVISION=0 # # SPI Flash driver diff --git a/build/configs/rtl8730e/loadable_ext/defconfig b/build/configs/rtl8730e/loadable_ext/defconfig index 64d191b1a7..eb62f65003 100644 --- a/build/configs/rtl8730e/loadable_ext/defconfig +++ b/build/configs/rtl8730e/loadable_ext/defconfig @@ -297,6 +297,7 @@ CONFIG_FLASH_SIZE=16777216 CONFIG_FLASH_VSTART=0x8000000 # CONFIG_BOARD_FLASH_8M is not set CONFIG_BOARD_FLASH_16M=y +CONFIG_RTL8730E_REVISION=0 # # SPI Flash driver diff --git a/os/arch/arm/src/amebasmart/amebasmart_serial.c b/os/arch/arm/src/amebasmart/amebasmart_serial.c index 5f4b4f8bb0..b7c8a526e7 100644 --- a/os/arch/arm/src/amebasmart/amebasmart_serial.c +++ b/os/arch/arm/src/amebasmart/amebasmart_serial.c @@ -390,8 +390,14 @@ static struct rtl8730e_up_dev_s g_uart1priv = { #endif .baud = CONFIG_UART1_BAUD, .irq = RTL8730E_UART1_IRQ, + +#if CONFIG_RTL8730E_REVISION >= 5 + .tx = PA_10, + .rx = PA_9, +#else .tx = PA_5, .rx = PA_4, +#endif .FlowControl = FlowControlNone, .txint_enable = false, .rxint_enable = false, diff --git a/os/board/rtl8730e/src/rtl8730e_alc1019.c b/os/board/rtl8730e/src/rtl8730e_alc1019.c index 4bbd626b96..d19be09250 100644 --- a/os/board/rtl8730e/src/rtl8730e_alc1019.c +++ b/os/board/rtl8730e/src/rtl8730e_alc1019.c @@ -43,7 +43,12 @@ extern FAR struct i2s_dev_s *amebasmart_i2s_initialize(uint16_t port); * Pre-processor Definitions ****************************************************************************/ /* i2c config */ +#if CONFIG_RTL8730E_REVISION >= 5 +#define ALC1019_I2C_PORT 2 +#else #define ALC1019_I2C_PORT 1 +#endif + #define ALC1019_I2C_FREQ 100000 #define ALC1019_I2C_ADDRLEN 7 diff --git a/os/board/rtl8730e/src/rtl8730e_st7789.c b/os/board/rtl8730e/src/rtl8730e_st7789.c index f7e2318eed..28b141bbfe 100644 --- a/os/board/rtl8730e/src/rtl8730e_st7789.c +++ b/os/board/rtl8730e/src/rtl8730e_st7789.c @@ -31,9 +31,13 @@ #define CONFIG_LCD_ST7789_SPI_PORT 1 #endif +#if CONFIG_RTL8730E_REVISION >= 5 +#error "ERROR, Not supported this revision" +#else #define GPIO_PIN_RESET PB_11 #define GPIO_PIN_BACKLIGHT PA_9 #define GPIO_PIN_CMDDATA PA_10 +#endif /**************************************************************************** * Private Types