All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 15/22] hw/ssi/pl022: Allow use as embedded-struct device
Date: Tue, 21 Aug 2018 03:48:52 -0300	[thread overview]
Message-ID: <b5eaab49-ca93-37b9-a0e7-31ac60cace58@amsat.org> (raw)
In-Reply-To: <20180820141116.9118-16-peter.maydell@linaro.org>

On 08/20/2018 11:11 AM, Peter Maydell wrote:
> Create a new include file for the pl022's device struct,
> type macros, etc, so that it can be instantiated using
> the "embedded struct" coding style.
> 
> While we're adding the new file to MAINTAINERS, add
> also the .c file, which was missing an entry.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  include/hw/ssi/pl022.h | 51 ++++++++++++++++++++++++++++++++++++++++++
>  hw/ssi/pl022.c         | 26 +--------------------
>  MAINTAINERS            |  2 ++
>  3 files changed, 54 insertions(+), 25 deletions(-)
>  create mode 100644 include/hw/ssi/pl022.h
> 
> diff --git a/include/hw/ssi/pl022.h b/include/hw/ssi/pl022.h
> new file mode 100644
> index 00000000000..a080519366d
> --- /dev/null
> +++ b/include/hw/ssi/pl022.h
> @@ -0,0 +1,51 @@
> +/*
> + * ARM PrimeCell PL022 Synchronous Serial Port
> + *
> + * Copyright (c) 2007 CodeSourcery.
> + * Written by Paul Brook
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 or
> + * (at your option) any later version.
> + */
> +
> +/* This is a model of the Arm PrimeCell PL022 synchronous serial port.
> + * The PL022 TRM is:
> + * http://infocenter.arm.com/help/topic/com.arm.doc.ddi0194h/DDI0194H_ssp_pl022_trm.pdf
> + *
> + * QEMU interface:
> + * + sysbus IRQ: SSPINTR combined interrupt line
> + * + sysbus MMIO region 0: MemoryRegion for the device's registers
> + */
> +
> +#ifndef HW_SSI_PL022_H
> +#define HW_SSI_PL022_H
> +
> +#include "hw/sysbus.h"
> +
> +#define TYPE_PL022 "pl022"
> +#define PL022(obj) OBJECT_CHECK(PL022State, (obj), TYPE_PL022)
> +
> +typedef struct PL022State {
> +    SysBusDevice parent_obj;
> +
> +    MemoryRegion iomem;
> +    uint32_t cr0;
> +    uint32_t cr1;
> +    uint32_t bitmask;
> +    uint32_t sr;
> +    uint32_t cpsr;
> +    uint32_t is;
> +    uint32_t im;
> +    /* The FIFO head points to the next empty entry.  */
> +    int tx_fifo_head;
> +    int rx_fifo_head;
> +    int tx_fifo_len;
> +    int rx_fifo_len;
> +    uint16_t tx_fifo[8];
> +    uint16_t rx_fifo[8];
> +    qemu_irq irq;
> +    SSIBus *ssi;
> +} PL022State;
> +
> +#endif
> diff --git a/hw/ssi/pl022.c b/hw/ssi/pl022.c
> index c1368018ee3..379d3093987 100644
> --- a/hw/ssi/pl022.c
> +++ b/hw/ssi/pl022.c
> @@ -9,6 +9,7 @@
>  
>  #include "qemu/osdep.h"
>  #include "hw/sysbus.h"
> +#include "hw/ssi/pl022.h"
>  #include "hw/ssi/ssi.h"
>  #include "qemu/log.h"
>  
> @@ -41,31 +42,6 @@ do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0)
>  #define PL022_INT_RX  0x04
>  #define PL022_INT_TX  0x08
>  
> -#define TYPE_PL022 "pl022"
> -#define PL022(obj) OBJECT_CHECK(PL022State, (obj), TYPE_PL022)
> -
> -typedef struct PL022State {
> -    SysBusDevice parent_obj;
> -
> -    MemoryRegion iomem;
> -    uint32_t cr0;
> -    uint32_t cr1;
> -    uint32_t bitmask;
> -    uint32_t sr;
> -    uint32_t cpsr;
> -    uint32_t is;
> -    uint32_t im;
> -    /* The FIFO head points to the next empty entry.  */
> -    int tx_fifo_head;
> -    int rx_fifo_head;
> -    int tx_fifo_len;
> -    int rx_fifo_len;
> -    uint16_t tx_fifo[8];
> -    uint16_t rx_fifo[8];
> -    qemu_irq irq;
> -    SSIBus *ssi;
> -} PL022State;
> -
>  static const unsigned char pl022_id[8] =
>    { 0x22, 0x10, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1 };
>  
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b2f8b562dc5..1e81ad8d4b1 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -451,6 +451,8 @@ F: hw/gpio/pl061.c
>  F: hw/input/pl050.c
>  F: hw/intc/pl190.c
>  F: hw/sd/pl181.c
> +F: hw/ssi/pl022.c
> +F: include/hw/ssi/pl022.h
>  F: hw/timer/pl031.c
>  F: include/hw/arm/primecell.h
>  F: hw/timer/cmsdk-apb-timer.c
> 

  reply	other threads:[~2018-08-21  6:48 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 14:10 [Qemu-devel] [PATCH 00/22] MPS devices: FPGAIO, timer, watchdogs, MSC, DMA, SPI Peter Maydell
2018-08-20 14:10 ` [Qemu-devel] [PATCH 01/22] hw/misc/mps2-fpgaio: Implement 1Hz and 100Hz counters Peter Maydell
2018-08-21 18:34   ` Richard Henderson
2018-08-20 14:10 ` [Qemu-devel] [PATCH 02/22] hw/misc/mps2-fpgaio: Implement PSCNTR and COUNTER Peter Maydell
2018-08-23 13:31   ` Richard Henderson
2018-08-20 14:10 ` [Qemu-devel] [PATCH 03/22] hw/timer/cmsdk-apb-dualtimer: Implement CMSDK dual timer module Peter Maydell
2018-08-23 14:08   ` Richard Henderson
2018-08-20 14:10 ` [Qemu-devel] [PATCH 04/22] hw/arm/iotkit: Wire up the dualtimer Peter Maydell
2018-08-21  6:41   ` Philippe Mathieu-Daudé
2018-08-23 14:09   ` Richard Henderson
2018-08-20 14:10 ` [Qemu-devel] [PATCH 05/22] hw/arm/mps2: Wire up dual-timer in mps2-an385 and mps2-an511 Peter Maydell
2018-08-21  6:43   ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2018-08-23 14:11   ` [Qemu-devel] " Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 06/22] hw/arm/iotkit: Wire up the watchdogs Peter Maydell
2018-08-23 14:17   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 07/22] hw/arm/iotkit: Wire up the S32KTIMER Peter Maydell
2018-08-23 14:18   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 08/22] hw/misc/iotkit-sysctl: Implement IoTKit system control element Peter Maydell
2018-08-23 14:24   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 09/22] hw/misc/iotkit-sysinfo: Implement IoTKit system information block Peter Maydell
2018-08-21  6:45   ` Philippe Mathieu-Daudé
2018-08-23 14:28   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 10/22] hw/misc/iotkit: Wire up the sysctl and sysinfo register blocks Peter Maydell
2018-08-21  6:47   ` Philippe Mathieu-Daudé
2018-08-23 14:29   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 11/22] hw/misc/tz-msc: Model TrustZone Master Security Controller Peter Maydell
2018-08-23 17:18   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 12/22] hw/misc/iotkit-secctl: Wire up registers for controlling MSCs Peter Maydell
2018-08-23 17:21   ` Richard Henderson
2018-08-23 17:25     ` Peter Maydell
2018-08-20 14:11 ` [Qemu-devel] [PATCH 13/22] hw/arm/iotkit: Wire up the lines for MSCs Peter Maydell
2018-08-23 17:23   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 14/22] hw/arm/mps2-tz: Create PL081s and MSCs Peter Maydell
2018-08-23 17:27   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 15/22] hw/ssi/pl022: Allow use as embedded-struct device Peter Maydell
2018-08-21  6:48   ` Philippe Mathieu-Daudé [this message]
2018-08-23 17:29   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 16/22] hw/ssi/pl022: Set up reset function in class init Peter Maydell
2018-08-21  6:49   ` Philippe Mathieu-Daudé
2018-08-23 17:29   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 17/22] hw/ssi/pl022: Don't directly call vmstate_register() Peter Maydell
2018-08-23 17:30   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 18/22] hw/ssi/pl022: Use DeviceState::realize rather than SysBusDevice::init Peter Maydell
2018-08-21  6:53   ` Philippe Mathieu-Daudé
2018-08-23 10:11     ` Peter Maydell
2018-08-23 17:31   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 19/22] hw/ssi/pl022: Correct wrong value for PL022_INT_RT Peter Maydell
2018-08-23 17:33   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 20/22] hw/ssi/pl022: Correct wrong DMACR and ICR handling Peter Maydell
2018-08-23 17:38   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 21/22] hw/arm/mps2-tz: Instantiate SPI controllers Peter Maydell
2018-08-23 17:39   ` Richard Henderson
2018-08-20 14:11 ` [Qemu-devel] [PATCH 22/22] hw/arm/mps2-tz: Fix MPS2 SCC config register values Peter Maydell
2018-08-23 17:42   ` Richard Henderson
2018-08-23 17:45     ` Peter Maydell
2018-08-23 17:46       ` Peter Maydell

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=b5eaab49-ca93-37b9-a0e7-31ac60cace58@amsat.org \
    --to=f4bug@amsat.org \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.