From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Jamin Lin" <jamin_lin@aspeedtech.com>,
"Cédric Le Goater" <clg@kaod.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
"Alistair Francis" <alistair@alistair23.me>,
"Cleber Rosa" <crosa@redhat.com>,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Beraldo Leal" <bleal@redhat.com>,
"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
"open list:All patches CC here" <qemu-devel@nongnu.org>,
"Jinjie Ruan" <ruanjinjie@huawei.com>
Cc: troy_lee@aspeedtech.com, yunlin.tang@aspeedtech.com
Subject: Re: [PATCH v5 13/17] aspeed/soc: Add AST2700 support
Date: Thu, 30 Jan 2025 16:13:30 +0100 [thread overview]
Message-ID: <ffafbec0-db25-478b-8eba-39162f9bce0d@linaro.org> (raw)
In-Reply-To: <20240604054438.3424349-14-jamin_lin@aspeedtech.com>
Hi Jamin,
On 4/6/24 07:44, Jamin Lin wrote:
> Initial definitions for a simple machine using an AST2700 SOC (Cortex-a35 CPU).
>
> AST2700 SOC and its interrupt controller are too complex to handle
> in the common Aspeed SoC framework. We introduce a new ast2700
> class with instance_init and realize handlers.
>
> AST2700 is a 64 bits quad core cpus and support 8 watchdog.
> Update maximum ASPEED_CPUS_NUM to 4 and ASPEED_WDTS_NUM to 8.
> In addition, update AspeedSocState to support scuio, sli, sliio and intc.
>
> Add TYPE_ASPEED27X0_SOC machine type.
>
> The SDMC controller is unlocked at SPL stage.
> At present, only supports to emulate booting
> start from u-boot stage. Set SDMC controller
> unlocked by default.
>
> In INTC, each interrupt of INT 128 to INT 136 combines 32 interrupts.
> It connect GICINT IRQ GPIO-OUTPUT pins to GIC device with irq 128 to 136.
> And, if a device irq is 128 to 136, its irq GPIO-OUTPUT pin is connected to
> GICINT or-gates instead of GIC device.
>
> Signed-off-by: Troy Lee <troy_lee@aspeedtech.com>
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
> hw/arm/aspeed_ast27x0.c | 563 ++++++++++++++++++++++++++++++++++++
> hw/arm/meson.build | 1 +
> include/hw/arm/aspeed_soc.h | 28 +-
> 3 files changed, 590 insertions(+), 2 deletions(-)
> create mode 100644 hw/arm/aspeed_ast27x0.c
> +static bool aspeed_soc_ast2700_gic_realize(DeviceState *dev, Error **errp)
> +{
> + Aspeed27x0SoCState *a = ASPEED27X0_SOC(dev);
> + AspeedSoCState *s = ASPEED_SOC(dev);
> + AspeedSoCClass *sc = ASPEED_SOC_GET_CLASS(s);
> + SysBusDevice *gicbusdev;
> + DeviceState *gicdev;
> + QList *redist_region_count;
> + int i;
> +
> + gicbusdev = SYS_BUS_DEVICE(&a->gic);
> + gicdev = DEVICE(&a->gic);
> + qdev_prop_set_uint32(gicdev, "revision", 3);
> + qdev_prop_set_uint32(gicdev, "num-cpu", sc->num_cpus);
> + qdev_prop_set_uint32(gicdev, "num-irq", AST2700_MAX_IRQ);
> +
> + redist_region_count = qlist_new();
> + qlist_append_int(redist_region_count, sc->num_cpus);
> + qdev_prop_set_array(gicdev, "redist-region-count", redist_region_count);
> +
> + if (!sysbus_realize(gicbusdev, errp)) {
> + return false;
> + }
> + sysbus_mmio_map(gicbusdev, 0, sc->memmap[ASPEED_GIC_DIST]);
> + sysbus_mmio_map(gicbusdev, 1, sc->memmap[ASPEED_GIC_REDIST]);
> +
> + for (i = 0; i < sc->num_cpus; i++) {
> + DeviceState *cpudev = DEVICE(&a->cpu[i]);
> + int NUM_IRQS = 256, ARCH_GIC_MAINT_IRQ = 9, VIRTUAL_PMU_IRQ = 7;
> + int ppibase = NUM_IRQS + i * GIC_INTERNAL + GIC_NR_SGIS;
> +
> + const int timer_irq[] = {
> + [GTIMER_PHYS] = 14,
> + [GTIMER_VIRT] = 11,
> + [GTIMER_HYP] = 10,
> + [GTIMER_SEC] = 13,
> + };
> + int j;
> +
> + for (j = 0; j < ARRAY_SIZE(timer_irq); j++) {
> + qdev_connect_gpio_out(cpudev, j,
> + qdev_get_gpio_in(gicdev, ppibase + timer_irq[j]));
> + }
> +
> + qemu_irq irq = qdev_get_gpio_in(gicdev,
> + ppibase + ARCH_GIC_MAINT_IRQ);
> + qdev_connect_gpio_out_named(cpudev, "gicv3-maintenance-interrupt",
> + 0, irq);
> + qdev_connect_gpio_out_named(cpudev, "pmu-interrupt", 0,
> + qdev_get_gpio_in(gicdev, ppibase + VIRTUAL_PMU_IRQ));
> +
> + sysbus_connect_irq(gicbusdev, i, qdev_get_gpio_in(cpudev, ARM_CPU_IRQ));
> + sysbus_connect_irq(gicbusdev, i + sc->num_cpus,
> + qdev_get_gpio_in(cpudev, ARM_CPU_FIQ));
> + sysbus_connect_irq(gicbusdev, i + 2 * sc->num_cpus,
> + qdev_get_gpio_in(cpudev, ARM_CPU_VIRQ));
> + sysbus_connect_irq(gicbusdev, i + 3 * sc->num_cpus,
> + qdev_get_gpio_in(cpudev, ARM_CPU_VFIQ));
Your patch was merged around the same time Jinjie added NMI support (see
commit b36a32ead1 "target/arm: Add support for Non-maskable Interrupt").
Should we add them now?
> + }
> +
> + return true;
> +}
next prev parent reply other threads:[~2025-01-30 15:14 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 5:44 [PATCH v5 00/17] Add AST2700 support Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 01/17] aspeed/wdt: " Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 02/17] aspeed/sli: " Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 03/17] aspeed/sdmc: remove redundant macros Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 04/17] aspeed/sdmc: fix coding style Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 05/17] aspeed/sdmc: Add AST2700 support Jamin Lin via
2024-06-04 6:10 ` Cédric Le Goater
2024-06-04 5:44 ` [PATCH v5 06/17] aspeed/smc: correct device description Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 07/17] aspeed/smc: support dma start length and 1 byte length unit Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 08/17] aspeed/smc: support 64 bits dma dram address Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 09/17] aspeed/smc: support different memory region ops for SMC flash region Jamin Lin via
2024-06-04 6:11 ` Cédric Le Goater
2024-06-04 5:44 ` [PATCH v5 10/17] aspeed/smc: Add AST2700 support Jamin Lin via
2024-06-04 6:12 ` Cédric Le Goater
2024-06-04 5:44 ` [PATCH v5 11/17] aspeed/scu: " Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 12/17] aspeed/intc: " Jamin Lin via
2024-06-04 7:18 ` Cédric Le Goater
2024-06-04 5:44 ` [PATCH v5 13/17] aspeed/soc: " Jamin Lin via
2024-06-04 6:17 ` Cédric Le Goater
2025-01-30 15:13 ` Philippe Mathieu-Daudé [this message]
2025-02-03 7:28 ` Jamin Lin
2025-02-03 7:43 ` Jamin Lin
2025-02-03 16:40 ` Philippe Mathieu-Daudé
2025-02-04 3:22 ` Jamin Lin
2024-06-04 5:44 ` [PATCH v5 14/17] aspeed: Add an AST2700 eval board Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 15/17] aspeed/soc: fix incorrect dram size for AST2700 Jamin Lin via
2024-06-04 6:13 ` Cédric Le Goater
2024-06-04 5:44 ` [PATCH v5 16/17] test/avocado/machine_aspeed.py: Add AST2700 test case Jamin Lin via
2024-06-04 5:44 ` [PATCH v5 17/17] docs:aspeed: Add AST2700 Evaluation board Jamin Lin via
2024-06-04 11:51 ` [PATCH v5 00/17] Add AST2700 support Cédric Le Goater
2024-06-05 0:40 ` Jamin Lin
2024-06-10 9:23 ` Cédric Le Goater
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=ffafbec0-db25-478b-8eba-39162f9bce0d@linaro.org \
--to=philmd@linaro.org \
--cc=alistair@alistair23.me \
--cc=andrew@codeconstruct.com.au \
--cc=bleal@redhat.com \
--cc=clg@kaod.org \
--cc=crosa@redhat.com \
--cc=jamin_lin@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=ruanjinjie@huawei.com \
--cc=troy_lee@aspeedtech.com \
--cc=wainersm@redhat.com \
--cc=yunlin.tang@aspeedtech.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).