qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Strahinja Jankovic <strahinjapjankovic@gmail.com>
To: qianfanguijin@163.com
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Niek Linnenbank" <nieklinnenbank@gmail.com>
Subject: Re: [PATCH v1 03/11] hw: allwinner-r40: Complete uart devices
Date: Sat, 25 Mar 2023 22:15:32 +0100	[thread overview]
Message-ID: <CABtshVRmq+DK+ZUELkviJY_+8X2B0LYNazdE+4_rXMp7Xn8AzQ@mail.gmail.com> (raw)
In-Reply-To: <20230321102510.16754-4-qianfanguijin@163.com>

Hi,

On Tue, Mar 21, 2023 at 11:25 AM <qianfanguijin@163.com> wrote:
>
> From: qianfan Zhao <qianfanguijin@163.com>
>
> R40 has eight UARTs, support both 16450 and 16550 compatible modes.
>
> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> ---
>  hw/arm/allwinner-r40.c         | 32 ++++++++++++++++++++++++++++++++
>  include/hw/arm/allwinner-r40.h |  7 +++++++
>  2 files changed, 39 insertions(+)
>
> diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c
> index 3517682aed..fde01783b1 100644
> --- a/hw/arm/allwinner-r40.c
> +++ b/hw/arm/allwinner-r40.c
> @@ -45,6 +45,13 @@ const hwaddr allwinner_r40_memmap[] = {
>      [AW_R40_DEV_CCU]        = 0x01c20000,
>      [AW_R40_DEV_PIT]        = 0x01c20c00,
>      [AW_R40_DEV_UART0]      = 0x01c28000,
> +    [AW_R40_DEV_UART1]      = 0x01c28400,
> +    [AW_R40_DEV_UART2]      = 0x01c28800,
> +    [AW_R40_DEV_UART3]      = 0x01c28c00,
> +    [AW_R40_DEV_UART4]      = 0x01c29000,
> +    [AW_R40_DEV_UART5]      = 0x01c29400,
> +    [AW_R40_DEV_UART6]      = 0x01c29800,
> +    [AW_R40_DEV_UART7]      = 0x01c29c00,
>      [AW_R40_DEV_GIC_DIST]   = 0x01c81000,
>      [AW_R40_DEV_GIC_CPU]    = 0x01c82000,
>      [AW_R40_DEV_GIC_HYP]    = 0x01c84000,
> @@ -160,6 +167,10 @@ enum {
>      AW_R40_GIC_SPI_UART1     =  2,
>      AW_R40_GIC_SPI_UART2     =  3,
>      AW_R40_GIC_SPI_UART3     =  4,
> +    AW_R40_GIC_SPI_UART4     = 17,
> +    AW_R40_GIC_SPI_UART5     = 18,
> +    AW_R40_GIC_SPI_UART6     = 19,
> +    AW_R40_GIC_SPI_UART7     = 20,
>      AW_R40_GIC_SPI_TIMER0    = 22,
>      AW_R40_GIC_SPI_TIMER1    = 23,
>      AW_R40_GIC_SPI_MMC0      = 32,
> @@ -396,6 +407,27 @@ static void allwinner_r40_realize(DeviceState *dev, Error **errp)
>      serial_mm_init(get_system_memory(), s->memmap[AW_R40_DEV_UART0], 2,
>                     qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_UART0),
>                     115200, serial_hd(0), DEVICE_NATIVE_ENDIAN);
> +    serial_mm_init(get_system_memory(), s->memmap[AW_R40_DEV_UART1], 2,
> +                   qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_UART1),
> +                   115200, serial_hd(1), DEVICE_NATIVE_ENDIAN);
> +    serial_mm_init(get_system_memory(), s->memmap[AW_R40_DEV_UART2], 2,
> +                   qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_UART2),
> +                   115200, serial_hd(2), DEVICE_NATIVE_ENDIAN);
> +    serial_mm_init(get_system_memory(), s->memmap[AW_R40_DEV_UART3], 2,
> +                   qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_UART3),
> +                   115200, serial_hd(3), DEVICE_NATIVE_ENDIAN);
> +    serial_mm_init(get_system_memory(), s->memmap[AW_R40_DEV_UART4], 2,
> +                   qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_UART4),
> +                   115200, serial_hd(4), DEVICE_NATIVE_ENDIAN);
> +    serial_mm_init(get_system_memory(), s->memmap[AW_R40_DEV_UART5], 2,
> +                   qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_UART5),
> +                   115200, serial_hd(5), DEVICE_NATIVE_ENDIAN);
> +    serial_mm_init(get_system_memory(), s->memmap[AW_R40_DEV_UART6], 2,
> +                   qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_UART6),
> +                   115200, serial_hd(6), DEVICE_NATIVE_ENDIAN);
> +    serial_mm_init(get_system_memory(), s->memmap[AW_R40_DEV_UART7], 2,
> +                   qdev_get_gpio_in(DEVICE(&s->gic), AW_R40_GIC_SPI_UART7),
> +                   115200, serial_hd(7), DEVICE_NATIVE_ENDIAN);
>
>      /* Unimplemented devices */
>      for (i = 0; i < ARRAY_SIZE(r40_unimplemented); i++) {
> diff --git a/include/hw/arm/allwinner-r40.h b/include/hw/arm/allwinner-r40.h
> index b355af2c4f..dfb5eb609c 100644
> --- a/include/hw/arm/allwinner-r40.h
> +++ b/include/hw/arm/allwinner-r40.h
> @@ -41,6 +41,13 @@ enum {
>      AW_R40_DEV_CCU,
>      AW_R40_DEV_PIT,
>      AW_R40_DEV_UART0,
> +    AW_R40_DEV_UART1,
> +    AW_R40_DEV_UART2,
> +    AW_R40_DEV_UART3,
> +    AW_R40_DEV_UART4,
> +    AW_R40_DEV_UART5,
> +    AW_R40_DEV_UART6,
> +    AW_R40_DEV_UART7,
>      AW_R40_DEV_GIC_DIST,
>      AW_R40_DEV_GIC_CPU,
>      AW_R40_DEV_GIC_HYP,
> --
> 2.25.1
>

Reviewed-by: Strahinja Jankovic <strahinja.p.jankovic@gmail.com>


Best regards,
Strahinja


  reply	other threads:[~2023-03-25 21:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 10:24 [PATCH v1 00/11] *** add allwinner-r40 support *** qianfanguijin
2023-03-21 10:25 ` [PATCH v1 01/11] hw: arm: Add bananapi M2-Ultra and allwinner-r40 support qianfanguijin
2023-03-25 20:59   ` Strahinja Jankovic
2023-03-21 10:25 ` [PATCH v1 02/11] hw/arm/allwinner-r40: add Clock Control Unit qianfanguijin
2023-03-25 21:12   ` Strahinja Jankovic
2023-03-21 10:25 ` [PATCH v1 03/11] hw: allwinner-r40: Complete uart devices qianfanguijin
2023-03-25 21:15   ` Strahinja Jankovic [this message]
2023-03-21 10:25 ` [PATCH v1 04/11] hw: arm: allwinner-r40: Add 5 TWI controllers qianfanguijin
2023-03-25 21:21   ` Strahinja Jankovic
2023-03-21 10:25 ` [PATCH v1 05/11] hw/misc: AXP221 PMU Emulation qianfanguijin
2023-03-25 21:25   ` Strahinja Jankovic
2023-03-21 10:25 ` [PATCH v1 06/11] hw/arm/allwinner-r40: add SDRAM controller device qianfanguijin
2023-03-21 10:25 ` [PATCH v1 07/11] hw: sd: allwinner-sdhost: Add sun50i-a64 SoC support qianfanguijin
2023-03-21 10:25 ` [PATCH v1 08/11] hw: arm: allwinner-r40: Fix the mmc controller's type qianfanguijin
2023-03-21 10:25 ` [PATCH v1 09/11] hw: arm: allwinner-r40: Add emac and gmac support qianfanguijin
2023-03-21 10:25 ` [PATCH v1 10/11] tests: avocado: boot_linux_console: Add test case for bpim2u qianfanguijin
2023-03-25 14:36 ` [PATCH v1 00/11] *** add allwinner-r40 support *** Strahinja Jankovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABtshVRmq+DK+ZUELkviJY_+8X2B0LYNazdE+4_rXMp7Xn8AzQ@mail.gmail.com \
    --to=strahinjapjankovic@gmail.com \
    --cc=b.galvani@gmail.com \
    --cc=nieklinnenbank@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qianfanguijin@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).