From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: mrolnik@gmail.com, philmd@linaro.org
Subject: Re: [PATCH 16/17] hw/avr: Move AtmegaMcuClass to atmega.h
Date: Mon, 24 Mar 2025 18:22:53 -0700 [thread overview]
Message-ID: <a4f03a8b-4bfa-4039-97c8-11f1a04d4c94@linaro.org> (raw)
In-Reply-To: <20250323173730.3213964-17-richard.henderson@linaro.org>
On 3/23/25 10:37, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> hw/avr/atmega.h | 20 ++++++++++++++++++++
> hw/avr/atmega.c | 22 +---------------------
> 2 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/hw/avr/atmega.h b/hw/avr/atmega.h
> index a99ee15c7e..f031e6c10a 100644
> --- a/hw/avr/atmega.h
> +++ b/hw/avr/atmega.h
> @@ -23,6 +23,10 @@
> #define TYPE_ATMEGA1280_MCU "ATmega1280"
> #define TYPE_ATMEGA2560_MCU "ATmega2560"
>
> +typedef struct AtmegaMcuClass AtmegaMcuClass;
> +DECLARE_CLASS_CHECKERS(AtmegaMcuClass, ATMEGA_MCU,
> + TYPE_ATMEGA_MCU)
> +
> typedef struct AtmegaMcuState AtmegaMcuState;
> DECLARE_INSTANCE_CHECKER(AtmegaMcuState, ATMEGA_MCU,
> TYPE_ATMEGA_MCU)
> @@ -32,6 +36,22 @@ DECLARE_INSTANCE_CHECKER(AtmegaMcuState, ATMEGA_MCU,
> #define TIMER_MAX 6
> #define GPIO_MAX 12
>
> +struct AtmegaMcuClass {
> + /*< private >*/
> + SysBusDeviceClass parent_class;
> + /*< public >*/
> + const char *uc_name;
> + const char *cpu_type;
> + size_t flash_size;
> + size_t eeprom_size;
> + size_t sram_size;
> + size_t io_size;
> + size_t gpio_count;
> + size_t adc_count;
> + const uint8_t *irq;
> + const struct peripheral_cfg *dev;
> +};
> +
> struct AtmegaMcuState {
> /*< private >*/
> SysBusDevice parent_obj;
> diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c
> index d4fc9c4aee..96e36743bc 100644
> --- a/hw/avr/atmega.c
> +++ b/hw/avr/atmega.c
> @@ -36,7 +36,7 @@ enum AtmegaPeripheral {
> #define TIMER(n) (n + TIMER0)
> #define POWER(n) (n + POWER0)
>
> -typedef struct {
> +typedef struct peripheral_cfg {
> uint16_t addr;
> enum AtmegaPeripheral power_index;
> uint8_t power_bit;
> @@ -46,26 +46,6 @@ typedef struct {
> bool is_timer16;
> } peripheral_cfg;
>
> -struct AtmegaMcuClass {
> - /*< private >*/
> - SysBusDeviceClass parent_class;
> - /*< public >*/
> - const char *uc_name;
> - const char *cpu_type;
> - size_t flash_size;
> - size_t eeprom_size;
> - size_t sram_size;
> - size_t io_size;
> - size_t gpio_count;
> - size_t adc_count;
> - const uint8_t *irq;
> - const peripheral_cfg *dev;
> -};
> -typedef struct AtmegaMcuClass AtmegaMcuClass;
> -
> -DECLARE_CLASS_CHECKERS(AtmegaMcuClass, ATMEGA_MCU,
> - TYPE_ATMEGA_MCU)
> -
> static const peripheral_cfg dev168_328[PERIFMAX] = {
> [USART0] = { 0xc0, POWER0, 1 },
> [TIMER2] = { 0xb0, POWER0, 6, 0x70, 0x37, false },
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
next prev parent reply other threads:[~2025-03-25 1:39 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-23 17:37 [PATCH 00/17] target/avr: Increase page size Richard Henderson
2025-03-23 17:37 ` [PATCH 01/17] hw/core/cpu: Use size_t for memory_rw_debug len argument Richard Henderson
2025-03-23 21:25 ` Philippe Mathieu-Daudé
2025-03-25 0:43 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 02/17] target/avr: Fix buffer read in avr_print_insn Richard Henderson
2025-03-25 0:52 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 03/17] target/avr: Improve decode of LDS, STS Richard Henderson
2025-03-25 0:53 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 04/17] target/avr: Remove OFFSET_CPU_REGISTERS Richard Henderson
2025-03-23 21:27 ` Philippe Mathieu-Daudé
2025-03-25 0:55 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 05/17] target/avr: Move cpu register accesses into system memory Richard Henderson
2025-03-25 1:07 ` Pierrick Bouvier
2025-03-25 13:48 ` Richard Henderson
2025-03-25 14:34 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 06/17] target/avr: Use cpu_stb_mmuidx_ra in helper_fullwr Richard Henderson
2025-03-25 1:08 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 07/17] target/avr: Use do_stb in avr_cpu_do_interrupt Richard Henderson
2025-03-23 21:31 ` Philippe Mathieu-Daudé
2025-03-25 1:09 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 08/17] target/avr: Add offset-io cpu property Richard Henderson
2025-03-25 1:10 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 09/17] target/avr: Introduce gen_data_{load,store}_raw Richard Henderson
2025-03-25 1:12 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 10/17] target/avr: Update cpu_sp after push and pop Richard Henderson
2025-03-25 1:36 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 11/17] target/avr: Implement CPUState.memory_rw_debug Richard Henderson
2025-03-23 21:33 ` Philippe Mathieu-Daudé
2025-03-25 1:19 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 12/17] target/avr: Handle offset_io in helper.c Richard Henderson
2025-03-23 21:34 ` Philippe Mathieu-Daudé
2025-03-25 1:20 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 13/17] target/avr: Handle offset_io in avr_cpu_realizefn Richard Henderson
2025-03-23 21:35 ` Philippe Mathieu-Daudé
2025-03-23 21:38 ` Philippe Mathieu-Daudé
2025-03-25 1:20 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 14/17] hw/avr: Set offset_io and increase page size to 1k Richard Henderson
2025-03-25 1:21 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 15/17] hw/avr: Pass mcu_type to class_base_init via .class_data Richard Henderson
2025-03-23 21:38 ` Philippe Mathieu-Daudé
2025-03-25 1:25 ` Pierrick Bouvier
2025-03-23 17:37 ` [PATCH 16/17] hw/avr: Move AtmegaMcuClass to atmega.h Richard Henderson
2025-03-25 1:22 ` Pierrick Bouvier [this message]
2025-03-23 17:37 ` [PATCH 17/17] target/avr: Enable TARGET_PAGE_BITS_VARY Richard Henderson
2025-03-25 1:24 ` Pierrick Bouvier
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=a4f03a8b-4bfa-4039-97c8-11f1a04d4c94@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=mrolnik@gmail.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 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).