[PATCH v5 06/11] hw/arm/allwinner-r40: add SDRAM controller device

2023-05-23 Thread qianfanguijin
From: qianfan Zhao Types of memory that the SDRAM controller supports are DDR2/DDR3 and capacities of up to 2GiB. This commit adds emulation support of the Allwinner R40 SDRAM controller. This driver only support 256M, 512M and 1024M memory now. Signed-off-by: qianfan Zhao --- hw/arm/allwinne

[PATCH v5 08/11] hw: arm: allwinner-r40: Add emac and gmac support

2023-05-23 Thread qianfanguijin
From: qianfan Zhao R40 has two ethernet controllers named as emac and gmac. The emac is compatibled with A10, and the GMAC is compatibled with H3. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 50 -- hw/arm/bananapi_m2u.c | 3 ++ inc

[PATCH v5 10/11] tests: avocado: boot_linux_console: Add test case for bpim2u

2023-05-23 Thread qianfanguijin
From: qianfan Zhao Add test case for booting from initrd and sd card. Signed-off-by: qianfan Zhao Reviewed-by: Niek Linnenbank Tested-by: Niek Linnenbank --- tests/avocado/boot_linux_console.py | 176 1 file changed, 176 insertions(+) diff --git a/tests/avocado/

[PATCH v5 04/11] hw: arm: allwinner-r40: Add i2c0 device

2023-05-23 Thread qianfanguijin
From: qianfan Zhao TWI(i2c) is designed to be used as an interface between CPU host and the serial 2-Wire bus. It can support all standard 2-Wire transfer, can be operated in standard mode(100kbit/s) or fast-mode, supporting data rate up to 400kbit/s. Signed-off-by: qianfan Zhao Reviewed-by: Ni

[PATCH v5 05/11] hw/misc: Rename axp209 to axp22x and add support AXP221 PMU

2023-05-23 Thread qianfanguijin
From: qianfan Zhao This patch adds minimal support for AXP-221 PMU and connect it to bananapi M2U board. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 3 +- hw/arm/bananapi_m2u.c | 6 + hw/misc/Kconfig | 2 +- hw/misc/axp209.c | 238 --

[PATCH v5 11/11] docs: system: arm: Introduce bananapi_m2u

2023-05-23 Thread qianfanguijin
From: qianfan Zhao Add documents for Banana Pi M2U Signed-off-by: qianfan Zhao Reviewed-by: Niek Linnenbank --- docs/system/arm/bananapi_m2u.rst | 138 +++ 1 file changed, 138 insertions(+) create mode 100644 docs/system/arm/bananapi_m2u.rst diff --git a/docs/sys

[PATCH v5 03/11] hw: allwinner-r40: Complete uart devices

2023-05-23 Thread qianfanguijin
From: qianfan Zhao R40 has eight UARTs, support both 16450 and 16550 compatible modes. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 34 +++--- include/hw/arm/allwinner-r40.h | 8 2 files changed, 39 insertions(+), 3 deletions(-) diff -

[PATCH v5 00/11] *** Add allwinner-r40 support ***

2023-05-23 Thread qianfanguijin
From: qianfan Zhao ***History*** # v1: 2023-03-21 The first version which add allwinner-r40 support, supported features: + ccu + dram controller + uart + i2c and pmic(axp221) + sdcard + emac/gmac Also provide a test case under avocado, running quickly test: $ AVOCADO_ALLOW_LARGE_STORAGE=yes t

[PATCH v5 01/11] hw: arm: Add bananapi M2-Ultra and allwinner-r40 support

2023-05-23 Thread qianfanguijin
From: qianfan Zhao Allwinner R40 (sun8i) SoC features a Quad-Core Cortex-A7 ARM CPU, and a Mali400 MP2 GPU from ARM. It's also known as the Allwinner T3 for In-Car Entertainment usage, A40i and A40pro are variants that differ in applicable temperatures range (industrial and military). Signed-off

[PATCH v5 07/11] hw: sd: allwinner-sdhost: Add sun50i-a64 SoC support

2023-05-23 Thread qianfanguijin
From: qianfan Zhao A64's sd register was similar to H3, and it introduced a new register named SAMP_DL_REG location at 0x144. The dma descriptor buffer size of mmc2 is only 8K and the other mmc controllers has 64K. Also fix allwinner-r40's mmc controller type. Signed-off-by: qianfan Zhao ---

[PATCH v5 09/11] hw: arm: allwinner-sramc: Add SRAM Controller support for R40

2023-05-23 Thread qianfanguijin
From: qianfan Zhao Only a few important registers are added, especially the SRAM_VER register. Signed-off-by: qianfan Zhao Reviewed-by: Niek Linnenbank --- hw/arm/Kconfig| 1 + hw/arm/allwinner-r40.c| 7 +- hw/misc/Kconfig | 3 + hw/misc

[PATCH v5 02/11] hw/arm/allwinner-r40: add Clock Control Unit

2023-05-23 Thread qianfanguijin
From: qianfan Zhao The CCU provides the registers to program the PLLs and the controls most of the clock generation, division, distribution, synchronization and gating. This commit adds support for the Clock Control Unit which emulates a simple read/write register interface. Signed-off-by: qian

[PATCH v4 04/11] hw: arm: allwinner-r40: Add i2c0 device

2023-05-10 Thread qianfanguijin
From: qianfan Zhao TWI(i2c) is designed to be used as an interface between CPU host and the serial 2-Wire bus. It can support all standard 2-Wire transfer, can be operated in standard mode(100kbit/s) or fast-mode, supporting data rate up to 400kbit/s. Signed-off-by: qianfan Zhao --- hw/arm/all

[PATCH v4 01/11] hw: arm: Add bananapi M2-Ultra and allwinner-r40 support

2023-05-10 Thread qianfanguijin
From: qianfan Zhao Allwinner R40 (sun8i) SoC features a Quad-Core Cortex-A7 ARM CPU, and a Mali400 MP2 GPU from ARM. It's also known as the Allwinner T3 for In-Car Entertainment usage, A40i and A40pro are variants that differ in applicable temperatures range (industrial and military). Signed-off

[PATCH v4 07/11] hw: sd: allwinner-sdhost: Add sun50i-a64 SoC support

2023-05-10 Thread qianfanguijin
From: qianfan Zhao A64's sd register was similar to H3, and it introduced a new register named SAMP_DL_REG location at 0x144. The dma descriptor buffer size of mmc2 is only 8K and the other mmc controllers has 64K. Also fix allwinner-r40's mmc controller type. Signed-off-by: qianfan Zhao ---

[PATCH v4 06/11] hw/arm/allwinner-r40: add SDRAM controller device

2023-05-10 Thread qianfanguijin
From: qianfan Zhao Types of memory that the SDRAM controller supports are DDR2/DDR3 and capacities of up to 2GiB. This commit adds emulation support of the Allwinner R40 SDRAM controller. This driver only support 256M, 512M and 1024M memory now. Signed-off-by: qianfan Zhao --- hw/arm/allwinne

[PATCH v4 00/11] *** Add allwinner r40 support ***

2023-05-10 Thread qianfanguijin
From: qianfan Zhao *** history *** # v1: 2023-03-21 The first version which add allwinner-r40 support, supported features: + ccu + dram controller + uart + i2c and pmic(axp221) + sdcard + emac/gmac Also provide a test case under avocado, running quickly test: $ AVOCADO_ALLOW_LARGE_STORAGE=y

[PATCH v4 05/11] hw/misc: Rename axp209 to axp22x and add support AXP221 PMU

2023-05-10 Thread qianfanguijin
From: qianfan Zhao This patch adds minimal support for AXP-221 PMU and connect it to bananapi M2U board. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 3 +- hw/arm/bananapi_m2u.c | 6 + hw/misc/Kconfig | 2 +- hw/misc/axp209.c | 238 --

[PATCH v4 11/11] docs: system: arm: Introduce bananapi_m2u

2023-05-10 Thread qianfanguijin
From: qianfan Zhao Add documents for Banana Pi M2U Signed-off-by: qianfan Zhao --- docs/system/arm/bananapi_m2u.rst | 138 +++ 1 file changed, 138 insertions(+) create mode 100644 docs/system/arm/bananapi_m2u.rst diff --git a/docs/system/arm/bananapi_m2u.rst b/doc

[PATCH v4 02/11] hw/arm/allwinner-r40: add Clock Control Unit

2023-05-10 Thread qianfanguijin
From: qianfan Zhao The CCU provides the registers to program the PLLs and the controls most of the clock generation, division, distribution, synchronization and gating. This commit adds support for the Clock Control Unit which emulates a simple read/write register interface. Signed-off-by: qian

[PATCH v4 10/11] tests: avocado: boot_linux_console: Add test case for bpim2u

2023-05-10 Thread qianfanguijin
From: qianfan Zhao Add test case for booting from initrd and sd card. Signed-off-by: qianfan Zhao --- tests/avocado/boot_linux_console.py | 176 1 file changed, 176 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.

[PATCH v4 03/11] hw: allwinner-r40: Complete uart devices

2023-05-10 Thread qianfanguijin
From: qianfan Zhao R40 has eight UARTs, support both 16450 and 16550 compatible modes. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 31 --- include/hw/arm/allwinner-r40.h | 8 2 files changed, 36 insertions(+), 3 deletions(-) diff --gi

[PATCH v4 09/11] hw: arm: allwinner-sramc: Add SRAM Controller support for R40

2023-05-10 Thread qianfanguijin
From: qianfan Zhao Only a few important registers are added, especially the SRAM_VER register. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 1 + hw/arm/allwinner-r40.c| 7 +- hw/misc/Kconfig | 3 + hw/misc/allwinner-sramc.c | 1

[PATCH v4 08/11] hw: arm: allwinner-r40: Add emac and gmac support

2023-05-10 Thread qianfanguijin
From: qianfan Zhao R40 has two ethernet controllers named as emac and gmac. The emac is compatibled with A10, and the GMAC is compatibled with H3. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 50 -- hw/arm/bananapi_m2u.c | 3 ++ inc

[PATCH v3 11/11] docs: system: arm: Introduce bananapi_m2u

2023-04-18 Thread qianfanguijin
From: qianfan Zhao Add documents for Banana Pi M2U Signed-off-by: qianfan Zhao --- docs/system/arm/bananapi_m2u.rst | 138 +++ 1 file changed, 138 insertions(+) create mode 100644 docs/system/arm/bananapi_m2u.rst diff --git a/docs/system/arm/bananapi_m2u.rst b/doc

[PATCH v3 00/11] *** Add allwinner-r40 support ***

2023-04-18 Thread qianfanguijin
From: qianfan Zhao *** history *** # v1: 2023-03-21 The first version which add allwinner-r40 support, supported features: + ccu + dram controller + uart + i2c and pmic(axp221) + sdcard + emac/gmac Also provide a test case under avocado, running quickly test: $ AVOCADO_ALLOW_LARGE_STORAGE=ye

[PATCH v3 09/11] hw: arm: allwinner-sramc: Add SRAM Controller support for R40

2023-04-18 Thread qianfanguijin
From: qianfan Zhao Only a few important registers are added, especially the SRAM_VER register. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 1 + hw/arm/allwinner-r40.c| 7 +- hw/misc/Kconfig | 3 + hw/misc/allwinner-sramc.c | 1

[PATCH v3 07/11] hw: sd: allwinner-sdhost: Add sun50i-a64 SoC support

2023-04-18 Thread qianfanguijin
From: qianfan Zhao A64's sd register was similar to H3, and it introduced a new register named SAMP_DL_REG location at 0x144. The dma descriptor buffer size of mmc2 is only 8K and the other mmc controllers has 64K. Also fix allwinner-r40's mmc controller type. Signed-off-by: qianfan Zhao ---

[PATCH v3 10/11] tests: avocado: boot_linux_console: Add test case for bpim2u

2023-04-18 Thread qianfanguijin
From: qianfan Zhao Add test case for booting from initrd and sd card. Signed-off-by: qianfan Zhao --- tests/avocado/boot_linux_console.py | 176 1 file changed, 176 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.

[PATCH v3 04/11] hw: arm: allwinner-r40: Add i2c0 device

2023-04-18 Thread qianfanguijin
From: qianfan Zhao TWI(i2c) is designed to be used as an interface between CPU host and the serial 2-Wire bus. It can support all standard 2-Wire transfer, can be operated in standard mode(100kbit/s) or fast-mode, supporting data rate up to 400kbit/s. Signed-off-by: qianfan Zhao --- hw/arm/all

[PATCH v3 06/11] hw/arm/allwinner-r40: add SDRAM controller device

2023-04-18 Thread qianfanguijin
From: qianfan Zhao Types of memory that the SDRAM controller supports are DDR2/DDR3 and capacities of up to 2GiB. This commit adds emulation support of the Allwinner R40 SDRAM controller. This driver only support 256M, 512M and 1024M memory now. Signed-off-by: qianfan Zhao --- hw/arm/allwinne

[PATCH v3 05/11] hw/misc: Rename axp209 to axp22x and add support AXP221 PMU

2023-04-18 Thread qianfanguijin
From: qianfan Zhao This patch adds minimal support for AXP-221 PMU and connect it to bananapi M2U board. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 3 +- hw/arm/bananapi_m2u.c | 6 + hw/misc/Kconfig | 2 +- hw/misc/axp209.c | 238 --

[PATCH v3 08/11] hw: arm: allwinner-r40: Add emac and gmac support

2023-04-18 Thread qianfanguijin
From: qianfan Zhao R40 has two ethernet controllers named as emac and gmac. The emac is compatibled with A10, and the GMAC is compatibled with H3. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 50 -- hw/arm/bananapi_m2u.c | 3 ++ inc

[PATCH v3 03/11] hw: allwinner-r40: Complete uart devices

2023-04-18 Thread qianfanguijin
From: qianfan Zhao R40 has eight UARTs, support both 16450 and 16550 compatible modes. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 31 --- include/hw/arm/allwinner-r40.h | 8 2 files changed, 36 insertions(+), 3 deletions(-) diff --gi

[PATCH v3 01/11] hw: arm: Add bananapi M2-Ultra and allwinner-r40 support

2023-04-18 Thread qianfanguijin
From: qianfan Zhao Allwinner R40 (sun8i) SoC features a Quad-Core Cortex-A7 ARM CPU, and a Mali400 MP2 GPU from ARM. It's also known as the Allwinner T3 for In-Car Entertainment usage, A40i and A40pro are variants that differ in applicable temperatures range (industrial and military). Signed-off

[PATCH v3 02/11] hw/arm/allwinner-r40: add Clock Control Unit

2023-04-18 Thread qianfanguijin
From: qianfan Zhao The CCU provides the registers to program the PLLs and the controls most of the clock generation, division, distribution, synchronization and gating. This commit adds support for the Clock Control Unit which emulates a simple read/write register interface. Signed-off-by: qian

[PATCH v2 11/11] docs: system: arm: Introduce bananapi_m2u

2023-03-27 Thread qianfanguijin
From: qianfan Zhao Add documents for Banana Pi M2U Signed-off-by: qianfan Zhao --- docs/system/arm/bananapi_m2u.rst | 138 +++ 1 file changed, 138 insertions(+) create mode 100644 docs/system/arm/bananapi_m2u.rst diff --git a/docs/system/arm/bananapi_m2u.rst b/doc

[PATCH v2 01/12] hw: arm: Add bananapi M2-Ultra and allwinner-r40 support

2023-03-27 Thread qianfanguijin
From: qianfan Zhao Allwinner R40 (sun8i) SoC features a Quad-Core Cortex-A7 ARM CPU, and a Mali400 MP2 GPU from ARM. It's also known as the Allwinner T3 for In-Car Entertainment usage, A40i and A40pro are variants that differ in applicable temperatures range (industrial and military). This patch

[PATCH v2 12/12] docs: system: arm: Introduce bananapi_m2u

2023-03-27 Thread qianfanguijin
From: qianfan Zhao Add documents for Banana Pi M2U Signed-off-by: qianfan Zhao --- docs/system/arm/bananapi_m2u.rst | 138 +++ 1 file changed, 138 insertions(+) create mode 100644 docs/system/arm/bananapi_m2u.rst diff --git a/docs/system/arm/bananapi_m2u.rst b/doc

[PATCH v2 08/12] hw: arm: allwinner-r40: Fix the mmc controller's type

2023-03-27 Thread qianfanguijin
From: qianfan Zhao R40 has SAMP_DL_REG register and mmc2 controller has only 8K dma buffer. Fix it's compatible string. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c ind

[PATCH v2 05/12] hw/misc: Rename axp209 to axp22x and add support AXP221 PMU

2023-03-27 Thread qianfanguijin
From: qianfan Zhao This patch adds minimal support for AXP-221 PMU and connect it to bananapi M2U board. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 3 +- hw/arm/bananapi_m2u.c | 6 + hw/misc/Kconfig | 2 +- hw/misc/axp209.c | 238 --

[PATCH v2 11/12] tests: avocado: boot_linux_console: Add test case for bpim2u

2023-03-27 Thread qianfanguijin
From: qianfan Zhao Add test case for booting from initrd and sd card. Signed-off-by: qianfan Zhao --- tests/avocado/boot_linux_console.py | 176 1 file changed, 176 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.

[PATCH v2 06/12] hw/arm/allwinner-r40: add SDRAM controller device

2023-03-27 Thread qianfanguijin
From: qianfan Zhao Types of memory that the SDRAM controller supports are DDR2/DDR3 and capacities of up to 2GiB. This commit adds emulation support of the Allwinner R40 SDRAM controller. This driver only support 256M, 512M and 1024M memory now. Signed-off-by: qianfan Zhao --- hw/arm/allwinne

[PATCH v2 09/12] hw: arm: allwinner-r40: Add emac and gmac support

2023-03-27 Thread qianfanguijin
From: qianfan Zhao R40 has two ethernet controllers named as emac and gmac. The emac is compatibled with A10, and the GMAC is compatibled with H3. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 50 -- hw/arm/bananapi_m2u.c | 3 ++ inc

[PATCH v2 00/12] *** add allwinner-r40 support ***

2023-03-27 Thread qianfanguijin
From: qianfan Zhao *** history *** # v1: 2023-03-21 The first version which add allwinner-r40 support, supported features: + ccu + dram controller + uart + i2c and pmic(axp221) + sdcard + emac/gmac Also provide a test case under avocado, running quickly test: $ AVOCADO_ALLOW_LARGE_STORAGE=ye

[PATCH v2 03/12] hw: allwinner-r40: Complete uart devices

2023-03-27 Thread qianfanguijin
From: qianfan Zhao R40 has eight UARTs, support both 16450 and 16550 compatible modes. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 31 --- include/hw/arm/allwinner-r40.h | 8 2 files changed, 36 insertions(+), 3 deletions(-) diff --gi

[PATCH v2 04/12] hw: arm: allwinner-r40: Add i2c0 device

2023-03-27 Thread qianfanguijin
From: qianfan Zhao TWI(i2c) is designed to be used as an interface between CPU host and the serial 2-Wire bus. It can support all standard 2-Wire transfer, can be operated in standard mode(100kbit/s) or fast-mode, supporting data rate up to 400kbit/s. Signed-off-by: qianfan Zhao --- hw/arm/all

[PATCH v2 10/12] hw: arm: allwinner-sramc: Add SRAM Controller support for R40

2023-03-27 Thread qianfanguijin
From: qianfan Zhao Only a few important registers are added, especially the SRAM_VER register. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 1 + hw/arm/allwinner-r40.c| 7 +- hw/misc/Kconfig | 3 + hw/misc/allwinner-sramc.c | 1

[PATCH v2 07/12] hw: sd: allwinner-sdhost: Add sun50i-a64 SoC support

2023-03-27 Thread qianfanguijin
From: qianfan Zhao A64's sd register was similar to H3, and it introduced a new register named SAMP_DL_REG location at 0x144. The dma descriptor buffer size of mmc2 is only 8K and the other mmc controllers has 64K. Signed-off-by: qianfan Zhao --- hw/sd/allwinner-sdhost.c | 70 +

[PATCH v2 02/12] hw/arm/allwinner-r40: add Clock Control Unit

2023-03-27 Thread qianfanguijin
From: qianfan Zhao The CCU provides the registers to program the PLLs and the controls most of the clock generation, division, distribution, synchronization and gating. This commit adds support for the Clock Control Unit which emulates a simple read/write register interface. Signed-off-by: qian

[PATCH v1 09/11] hw: arm: allwinner-r40: Add emac and gmac support

2023-03-21 Thread qianfanguijin
From: qianfan Zhao R40 has two ethernet controllers named as emac and gmac. The emac is compatibled with A10, and the GMAC is compatibled with H3. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 48 -- hw/arm/bananapi_m2u.c | 3 +++ in

[PATCH v1 05/11] hw/misc: AXP221 PMU Emulation

2023-03-21 Thread qianfanguijin
From: qianfan Zhao This patch adds minimal support for AXP-221 PMU and connect it to bananapi M2U board. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 1 + hw/arm/bananapi_m2u.c | 5 ++ hw/misc/Kconfig | 4 + hw/misc/axp221.c | 196 +++

[PATCH v1 11/11] docs: system: arm: Introduce bananapi_m2u

2023-03-21 Thread qianfanguijin
From: qianfan Zhao Add documents for Banana Pi M2U Signed-off-by: qianfan Zhao --- docs/system/arm/bananapi_m2u.rst | 138 +++ 1 file changed, 138 insertions(+) create mode 100644 docs/system/arm/bananapi_m2u.rst diff --git a/docs/system/arm/bananapi_m2u.rst b/doc

[PATCH v1 08/11] hw: arm: allwinner-r40: Fix the mmc controller's type

2023-03-21 Thread qianfanguijin
From: qianfan Zhao R40 has SAMP_DL_REG register and mmc2 controller has only 8K dma buffer. Fix it's compatible string. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-

[PATCH v1 04/11] hw: arm: allwinner-r40: Add 5 TWI controllers

2023-03-21 Thread qianfanguijin
From: qianfan Zhao TWI(i2c) is designed to be used as an interface between CPU host and the serial 2-Wire bus. It can support all standard 2-Wire transfer, can be operated in standard mode(100kbit/s) or fast-mode, supporting data rate up to 400kbit/s. Signed-off-by: qianfan Zhao --- hw/arm/all

[PATCH v1 10/11] tests: avocado: boot_linux_console: Add test case for bpim2u

2023-03-21 Thread qianfanguijin
From: qianfan Zhao Add test case for booting from initrd and sd card. Signed-off-by: qianfan Zhao --- tests/avocado/boot_linux_console.py | 173 1 file changed, 173 insertions(+) diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.

[PATCH v1 02/11] hw/arm/allwinner-r40: add Clock Control Unit

2023-03-21 Thread qianfanguijin
From: qianfan Zhao The CCU provides the registers to program the PLLs and the controls most of the clock generation, division, distribution, synchronization and gating. This commit adds support for the Clock Control Unit which emulates a simple read/write register interface. Signed-off-by: qian

[PATCH v1 07/11] hw: sd: allwinner-sdhost: Add sun50i-a64 SoC support

2023-03-21 Thread qianfanguijin
From: qianfan Zhao A64's sd register was similar to H3, and it introduced a new register named SAMP_DL_REG location at 0x144. The dma descriptor buffer size of mmc2 is only 8K and the other mmc controllers has 64K. Signed-off-by: qianfan Zhao --- hw/sd/allwinner-sdhost.c | 70 +

[PATCH v1 06/11] hw/arm/allwinner-r40: add SDRAM controller device

2023-03-21 Thread qianfanguijin
From: qianfan Zhao Types of memory that the SDRAM controller supports are DDR2/DDR3 and capacities of up to 2GiB. This commit adds emulation support of the Allwinner R40 SDRAM controller. This driver only support 256M, 512M and 1024M memory now. Signed-off-by: qianfan Zhao --- hw/arm/allwinne

[PATCH v1 01/11] hw: arm: Add bananapi M2-Ultra and allwinner-r40 support

2023-03-21 Thread qianfanguijin
From: qianfan Zhao Allwinner R40 (sun8i) SoC features a Quad-Core Cortex-A7 ARM CPU, and a Mali400 MP2 GPU from ARM. It's also known as the Allwinner T3 for In-Car Entertainment usage, A40i and A40pro are variants that differ in applicable temperatures range (industrial and military). This patch

[PATCH v1 00/11] *** add allwinner-r40 support ***

2023-03-21 Thread qianfanguijin
From: qianfan Zhao *** history *** # v1: 2023-03-21 The first version which add allwinner-r40 support, supported features: + ccu + dram controller + uart + i2c and pmic(axp221) + sdcard + emac/gmac Also provide a test case under avocado, running quickly test: $ AVOCADO_ALLOW_LARGE_STORAGE=ye

[PATCH v1 03/11] hw: allwinner-r40: Complete uart devices

2023-03-21 Thread qianfanguijin
From: qianfan Zhao R40 has eight UARTs, support both 16450 and 16550 compatible modes. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 32 include/hw/arm/allwinner-r40.h | 7 +++ 2 files changed, 39 insertions(+) diff --git a/hw/arm/allwi

[RFC PATCH v1 07/12] hw: arm: allwinner-r40: Add 5 TWI controllers

2023-03-02 Thread qianfanguijin
From: qianfan Zhao TWI(i2c) is designed to be used as an interface between CPU host and the serial 2-Wire bus. It can support all standard 2-Wire transfer, can be operated in standard mode(100kbit/s) or fast-mode, supporting data rate up to 400kbit/s. Signed-off-by: qianfan Zhao --- hw/arm/all

[RFC PATCH v1 08/12] hw/misc: AXP221 PMU Emulation

2023-03-02 Thread qianfanguijin
From: qianfan Zhao This patch adds minimal support for AXP-221 PMU and connect it to bananapi M2U board. Signed-off-by: qianfan Zhao --- hw/arm/Kconfig| 1 + hw/arm/bananapi_m2u.c | 5 ++ hw/misc/Kconfig | 4 + hw/misc/axp221.c | 196 +++

[RFC PATCH v1 05/12] hw/arm/allwinner-r40: add Clock Control Unit

2023-03-02 Thread qianfanguijin
From: qianfan Zhao The CCU provides the registers to program the PLLs and the controls most of the clock generation, division, distribution, synchronization and gating. This commit adds support for the Clock Control Unit which emulates a simple read/write register interface. Signed-off-by: qian

[RFC PATCH v1 11/12] hw: arm: allwinner-r40: Fix the mmc controller's type

2023-03-02 Thread qianfanguijin
From: qianfan Zhao R40 has SAMP_DL_REG register and mmc2 controller has only 8K dma buffer. Fix it's compatible string. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-

[RFC PATCH v1 12/12] hw: arm: allwinner-r40: Add emac and gmac support

2023-03-02 Thread qianfanguijin
From: qianfan Zhao R40 has two ethernet controllers named as emac and gmac. The emac is compatibled with A10, and the GMAC is compatibled with H3. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 46 -- include/hw/arm/allwinner-r40.h | 6 +

[RFC PATCH v1 09/12] hw/arm/allwinner-r40: add SDRAM controller device

2023-03-02 Thread qianfanguijin
From: qianfan Zhao Types of memory that the SDRAM controller supports are DDR2/DDR3 and capacities of up to 2GiB. This commit adds emulation support of the Allwinner R40 SDRAM controller. This driver only support 256M, 512M and 1024M memory now. Signed-off-by: qianfan Zhao --- hw/arm/allwinne

[RFC PATCH v1 00/12] *** Add allwinner R40 device support ***

2023-03-02 Thread qianfanguijin
From: qianfan Zhao v1: 2023-03-02 The first three patches try fix allwinner i2c driver and I already send them as a standalone PR and can read it from: https://patchwork.kernel.org/project/qemu-devel/patch/20230220081252.25348-3-qianfangui...@163.com/ Hope that patch can merged first before t

[RFC PATCH v1 02/12] hw: allwinner-i2c: Fix TWI_CNTR_INT_FLAG on SUN6i SoCs

2023-03-02 Thread qianfanguijin
From: qianfan Zhao TWI_CNTR_INT_FLAG is W1C(write 1 to clear and write 0 has non-effect) register on SUN6i based SoCs, we should lower interrupt when the guest set this bit. The linux kernel will hang in irq handler(mv64xxx_i2c_intr) if no device connected on the i2c bus, next is the trace log:

[RFC PATCH v1 10/12] hw: sd: allwinner-sdhost: Add sun50i-a64 SoC support

2023-03-02 Thread qianfanguijin
From: qianfan Zhao A64's sd register was similar to H3, and it introduced a new register named SAMP_DL_REG location at 0x144. The dma descriptor buffer size of mmc2 is only 8K and the other mmc controllers has 64K. Signed-off-by: qianfan Zhao --- hw/sd/allwinner-sdhost.c | 70 +

[RFC PATCH v1 04/12] hw: arm: Add bananapi M2-Ultra and allwinner-r40 support

2023-03-02 Thread qianfanguijin
From: qianfan Zhao Allwinner R40 (sun8i) SoC features a Quad-Core Cortex-A7 ARM CPU, and a Mali400 MP2 GPU from ARM. It's also known as the Allwinner T3 for In-Car Entertainment usage, A40i and A40pro are variants that differ in applicable temperatures range (industrial and military). This patch

[RFC PATCH v1 01/12] hw: allwinner-i2c: Make the trace message more readable

2023-03-02 Thread qianfanguijin
From: qianfan Zhao Next is an example when read/write trace enabled: allwinner_i2c_write write XADDR(0x04): 0x00 allwinner_i2c_write write CNTR(0x0c): 0x50 M_STP BUS_EN allwinner_i2c_write write CNTR(0x0c): 0xe4 A_ACK M_STA BUS_EN INT_EN allwinner_i2c_read readCNTR(0x0c): 0xcc A_ACK IN

[RFC PATCH v1 03/12] hw: arm: allwinner-h3: Fix and complete H3 i2c devices

2023-03-02 Thread qianfanguijin
From: qianfan Zhao Allwinner h3 has 4 twi(i2c) devices named twi0, twi1, twi2 and r_twi. The registers are compatible with TYPE_AW_I2C_SUN6I, write 1 to clear control register's INT_FLAG bit. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-h3.c | 29 + incl

[RFC PATCH v1 06/12] hw: allwinner-r40: Complete uart devices

2023-03-02 Thread qianfanguijin
From: qianfan Zhao R40 has eight UARTs, support both 16450 and 16550 compatible modes. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-r40.c | 32 include/hw/arm/allwinner-r40.h | 7 +++ 2 files changed, 39 insertions(+) diff --git a/hw/arm/allwi

[PATCH v2 3/3] hw: arm: allwinner-h3: Fix and complete H3 i2c devices

2023-02-20 Thread qianfanguijin
From: qianfan Zhao Allwinner h3 has 4 twi(i2c) devices named twi0, twi1, twi2 and r_twi. The registers are compatible with TYPE_AW_I2C_SUN6I, write 1 to clear control register's INT_FLAG bit. Signed-off-by: qianfan Zhao --- hw/arm/allwinner-h3.c | 29 + incl

[PATCH v2 1/3] hw: allwinner-i2c: Make the trace message more readable

2023-02-20 Thread qianfanguijin
From: qianfan Zhao Next is an example when read/write trace enabled: allwinner_i2c_write write XADDR(0x04): 0x00 allwinner_i2c_write write CNTR(0x0c): 0x50 M_STP BUS_EN allwinner_i2c_write write CNTR(0x0c): 0xe4 A_ACK M_STA BUS_EN INT_EN allwinner_i2c_read readCNTR(0x0c): 0xcc A_ACK IN

[PATCH v2 2/3] hw: allwinner-i2c: Fix TWI_CNTR_INT_FLAG on SUN6i SoCs

2023-02-20 Thread qianfanguijin
From: qianfan Zhao TWI_CNTR_INT_FLAG is W1C(write 1 to clear and write 0 has non-effect) register on SUN6i based SoCs, we should lower interrupt when the guest set this bit. The linux kernel will hang in irq handler(mv64xxx_i2c_intr) if no device connected on the i2c bus, next is the trace log:

[PATCH v1 1/2] hw: allwinner-i2c: Make the trace message more readable

2023-02-17 Thread qianfanguijin
From: qianfan Zhao Next is an example when allwinner_i2c_rw enabled: allwinner_i2c_rw write CNTR[0x0c]: 50 { M_STP BUS_EN } allwinner_i2c_rw write CNTR[0x0c]: e4 { A_ACK M_STA BUS_EN INT_EN } allwinner_i2c_rw read CNTR[0x0c]: cc { A_ACK INT_FLAG BUS_EN INT_EN } allwinner_i2c_rw read

[PATCH v1 2/2] hw: allwinner-i2c: Fix TWI_CNTR_INT_FLAG

2023-02-17 Thread qianfanguijin
From: qianfan Zhao TWI_CNTR_INT_FLAG is W1C(write 1 to clear and write 0 has non-effect) register, we should lower interrupt when the guest write this bit. The linux kernel will hang in irq handler(mv64xxx_i2c_intr) if no device connected on the i2c bus, next is the trace log: [7.004130] ax