From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "Cédric Le Goater" <clg@kaod.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
"Kane Chen" <kane_chen@aspeedtech.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
"Alistair Francis" <alistair@alistair23.me>,
"Fabiano Rosas" <farosas@suse.de>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
"open list:All patches CC here" <qemu-devel@nongnu.org>
Cc: "Jamin Lin" <jamin_lin@aspeedtech.com>,
"Troy Lee" <troy_lee@aspeedtech.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Cédric Le Goater" <clg@redhat.com>
Subject: [PATCH v3 5/9] hw/arm/aspeed_ast27x0: Pass realized PSP SoC to SSP/TSP initialization
Date: Fri, 17 Jul 2026 08:18:20 +0000 [thread overview]
Message-ID: <20260717081813.3407862-6-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20260717081813.3407862-1-jamin_lin@aspeedtech.com>
Pass the realized PSP SoC to the SSP/TSP initialization helpers instead
of retrieving it from the MachineState.
This makes the dependency explicit, since the SSP and TSP coprocessors
use resources owned by the PSP SoC, including the UARTs, SRAM, SCU and
SCUIO. The PSP SoC must therefore be realized before the coprocessors
are initialized.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/arm/aspeed_ast27x0-fc.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/hw/arm/aspeed_ast27x0-fc.c b/hw/arm/aspeed_ast27x0-fc.c
index 8d49bb95d6..58d0b4d7cd 100644
--- a/hw/arm/aspeed_ast27x0-fc.c
+++ b/hw/arm/aspeed_ast27x0-fc.c
@@ -134,11 +134,9 @@ static bool ast2700fc_ca35_init(MachineState *machine, Error **errp)
return true;
}
-static bool ast2700fc_ssp_init(MachineState *machine, Error **errp)
+static bool ast2700fc_ssp_init(Ast2700FCState *s, AspeedSoCState *psp,
+ Error **errp)
{
- Ast2700FCState *s = AST2700FC(machine);
- AspeedSoCState *psp = ASPEED_SOC(&s->ca35);
-
s->ssp_sysclk = clock_new(OBJECT(s), "SSP_SYSCLK");
clock_set_hz(s->ssp_sysclk, 200000000ULL);
@@ -166,11 +164,9 @@ static bool ast2700fc_ssp_init(MachineState *machine, Error **errp)
return true;
}
-static bool ast2700fc_tsp_init(MachineState *machine, Error **errp)
+static bool ast2700fc_tsp_init(Ast2700FCState *s, AspeedSoCState *psp,
+ Error **errp)
{
- Ast2700FCState *s = AST2700FC(machine);
- AspeedSoCState *psp = ASPEED_SOC(&s->ca35);
-
s->tsp_sysclk = clock_new(OBJECT(s), "TSP_SYSCLK");
clock_set_hz(s->tsp_sysclk, 200000000ULL);
@@ -200,9 +196,19 @@ static bool ast2700fc_tsp_init(MachineState *machine, Error **errp)
static void ast2700fc_init(MachineState *machine)
{
+ Ast2700FCState *s = AST2700FC(machine);
+ AspeedSoCState *psp;
+
ast2700fc_ca35_init(machine, &error_abort);
- ast2700fc_ssp_init(machine, &error_abort);
- ast2700fc_tsp_init(machine, &error_abort);
+
+ /*
+ * SSP and TSP use resources owned by the PSP SoC, such as UART,
+ * SRAM, SCU and SCUIO. Therefore the PSP SoC must be realized
+ * before the coprocessors are initialized.
+ */
+ psp = ASPEED_SOC(&s->ca35);
+ ast2700fc_ssp_init(s, psp, &error_abort);
+ ast2700fc_tsp_init(s, psp, &error_abort);
}
static void ast2700fc_class_init(ObjectClass *oc, const void *data)
--
2.43.0
next prev parent reply other threads:[~2026-07-17 8:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 8:18 [PATCH v3 0/9] Refactor AST2700 SCU preparation for coprocessors Jamin Lin
2026-07-17 8:18 ` [PATCH v3 1/9] hw/misc/aspeed_scu: Introduce Aspeed2700SCUState Jamin Lin
2026-07-17 8:18 ` [PATCH v3 2/9] hw/arm/aspeed: Use Aspeed2700SCUState for AST2700 users Jamin Lin
2026-07-17 8:18 ` [PATCH v3 3/9] hw/arm/aspeed_ast27x0: Move SCU link into AST27x0 coprocessors Jamin Lin
2026-07-17 8:18 ` [PATCH v3 4/9] hw/misc/aspeed_scu: Add separate reset handler for AST2700 SCUIO Jamin Lin
2026-07-17 8:18 ` Jamin Lin [this message]
2026-07-17 8:18 ` [PATCH v3 6/9] hw/arm/ast27x0: Share single SCUIO instance across PSP, SSP, and TSP Jamin Lin
2026-07-17 8:18 ` [PATCH v3 7/9] hw/arm/ast27x0: Share FMC controller with SSP " Jamin Lin
2026-07-17 8:18 ` [PATCH v3 8/9] hw/ssi/aspeed_smc: Add Data FIFO-based flash access support for AST2700 Jamin Lin
2026-07-17 8:18 ` [PATCH v3 9/9] tests/qtest/ast2700-smc-test: Add Data FIFO mode test Jamin Lin
2026-07-17 8:23 ` Cédric Le Goater
2026-07-17 8:46 ` Jamin Lin
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=20260717081813.3407862-6-jamin_lin@aspeedtech.com \
--to=jamin_lin@aspeedtech.com \
--cc=alistair@alistair23.me \
--cc=andrew@codeconstruct.com.au \
--cc=clg@kaod.org \
--cc=clg@redhat.com \
--cc=farosas@suse.de \
--cc=joel@jms.id.au \
--cc=kane_chen@aspeedtech.com \
--cc=leetroy@gmail.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=steven_lee@aspeedtech.com \
--cc=troy_lee@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 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.