riscv: add GPIO support for the LicheePi4A
cover riscv: add GPIO support for the LicheePi4A
From: Maksim Kiselev <[email protected]>
This series adds GPIO support for the LicheePi4A board.
It's based on Alibaba TH1520 SoC that has DesignWare APB GPIO controller.
Best regards,
Maksim
Maksim Kiselev (2):
gpio: dw: Add ngpios DT-property support
configs: th1520_lpi4a: Enable CMD_GPIO, DM_GPIO and DWAPB_GPIO driver
configs/th1520_lpi4a_defconfig | 4 +++- drivers/gpio/dwapb_gpio.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
2.45.2
PATCH 1/2 gpio: dw: Add ngpios DT-property support
From: Maksim Kiselev <[email protected]>
Starting with Linux commit 7569486d79ae ("gpio: dwapb: Add ngpios DT-property support") the "snps,nr-gpios" property was marked as deprecated.
And since all newly added dw-apb-gpio nodes are described using generic "ngpios" property, it's time to add support for it.
--- drivers/gpio/dwapb_gpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/dwapb_gpio.c +3 -1
@@ -177,7 +177,9 @@ static int gpio_dwapb_bind(struct udevice *dev) plat->base = (void *)base; plat->bank = bank; - plat->pins =ofnode_read_u32_default (node,"snps,nr-gpios" ,0 ); + +if (ofnode_read_u32 (node,"ngpios" , &plat->pins)) + plat->pins =ofnode_read_u32_default (node,"snps,nr-gpios" ,0 );if (ofnode_read_string_index (node,"bank-name" ,0 , &plat->name)) {
Signature · 1 line
2.45.2
PATCH 2/2 configs: th1520_lpi4a: Enable CMD_GPIO, DM_GPIO and DWAPB_GPIO driver
In reply to [email protected]From: Maksim Kiselev <[email protected]>
Enable GPIO command and DWAPB_GPIO driver for LicheePi4A board.
--- configs/th1520_lpi4a_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
configs/th1520_lpi4a_defconfig +3 -1
@@ -4,6 +4,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x3000 CONFIG_NR_DRAM_BANKS=1 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000 +CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="th1520-lichee-pi-4a" CONFIG_SYS_LOAD_ADDR=0x80200000 # CONFIG_SMP is not set
@@ -49,6 +50,7 @@ CONFIG_CMD_BOOTMENU=y # CONFIG_CMD_LZMADEC is not set # CONFIG_CMD_UNLZ4 is not set # CONFIG_CMD_UNZIP is not set +CONFIG_CMD_GPIO=y # CONFIG_CMD_LOADB is not set # CONFIG_CMD_LOADS is not set # CONFIG_CMD_ITEST is not set
@@ -60,7 +62,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_VERSION_VARIABLE=y # CONFIG_NET is not set # CONFIG_BLOCK_CACHE is not set -# CONFIG_GPIO is not set +CONFIG_DWAPB_GPIO=y # CONFIG_I2C is not set # CONFIG_INPUT is not set # CONFIG_DM_MMC is not set
Signature · 1 line
2.45.2
Re: [PATCH v1 1/2] gpio: dw: Add ngpios DT-property support
In reply to [email protected]Quoted 6 lines · On Fri, Sep 20, 2024 at 12:05:23PM +0300, [email protected] wrote:
From: Maksim Kiselev <[email protected]>
Starting with Linux commit
7569486d79ae("gpio: dwapb: Add ngpios DT-property support") the "snps,nr-gpios" property was marked as deprecated.
Quoted 7 lines
And since all newly added dw-apb-gpio nodes are described using generic "ngpios" property, it's time to add support for it.
Signed-off-by Maksim Kiselev <[email protected]>--- drivers/gpio/dwapb_gpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Re: [PATCH v1 2/2] configs: th1520_lpi4a: Enable CMD_GPIO, DM_GPIO and DWAPB_GPIO driver
In reply to [email protected]Quoted 8 lines · On Fri, Sep 20, 2024 at 12:05:24PM +0300, [email protected] wrote:
From: Maksim Kiselev <[email protected]>
Enable GPIO command and
DWAPB_GPIOdriver for LicheePi4A board.Signed-off-by Maksim Kiselev <[email protected]>--- configs/th1520_lpi4a_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)