* [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus
@ 2020-11-20 14:17 Marcin Juszkiewicz
2020-11-21 17:09 ` Richard Henderson
0 siblings, 1 reply; 5+ messages in thread
From: Marcin Juszkiewicz @ 2020-11-20 14:17 UTC (permalink / raw)
To: qemu-arm
Cc: Marcin Juszkiewicz, Peter Maydell, Leif Lindholm,
Radosław Biernacki, qemu-devel
Trusted Firmware now supports A72 on sbsa-ref by default [1] so enable
it for QEMU as well. A53 was already enabled there.
1. https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7117
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
diff --git hw/arm/sbsa-ref.c hw/arm/sbsa-ref.c
index 7d9e180c0d..b9909279f1 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -143,6 +143,24 @@ static const int sbsa_ref_irqmap[] = {
[SBSA_GWDT] = 16,
};
+static const char *valid_cpus[] = {
+ ARM_CPU_TYPE_NAME("cortex-a53"),
+ ARM_CPU_TYPE_NAME("cortex-a57"),
+ ARM_CPU_TYPE_NAME("cortex-a72"),
+};
+
+static bool cpu_type_valid(const char *cpu)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(valid_cpus); i++) {
+ if (strcmp(cpu, valid_cpus[i]) == 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
{
uint8_t clustersz = ARM_DEFAULT_CPUS_PER_CLUSTER;
@@ -649,9 +667,8 @@ static void sbsa_ref_init(MachineState *machine)
const CPUArchIdList *possible_cpus;
int n, sbsa_max_cpus;
- if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a57"))) {
- error_report("sbsa-ref: CPU type other than the built-in "
- "cortex-a57 not supported");
+ if (!cpu_type_valid(machine->cpu_type)) {
+ error_report("mach-virt: CPU type %s not supported", machine->cpu_type);
exit(1);
}
--
2.28.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus
2020-11-20 14:17 [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus Marcin Juszkiewicz
@ 2020-11-21 17:09 ` Richard Henderson
2020-11-24 12:59 ` Marcin Juszkiewicz
2020-11-24 13:00 ` Marcin Juszkiewicz
0 siblings, 2 replies; 5+ messages in thread
From: Richard Henderson @ 2020-11-21 17:09 UTC (permalink / raw)
To: Marcin Juszkiewicz, qemu-arm
Cc: Peter Maydell, Leif Lindholm, qemu-devel, Radosław Biernacki
On 11/20/20 6:17 AM, Marcin Juszkiewicz wrote:
> +static const char *valid_cpus[] = {
const char * const
Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus
2020-11-21 17:09 ` Richard Henderson
@ 2020-11-24 12:59 ` Marcin Juszkiewicz
2020-11-30 11:56 ` Peter Maydell
2020-11-24 13:00 ` Marcin Juszkiewicz
1 sibling, 1 reply; 5+ messages in thread
From: Marcin Juszkiewicz @ 2020-11-24 12:59 UTC (permalink / raw)
To: qemu-arm
Cc: Marcin Juszkiewicz, Peter Maydell, Leif Lindholm,
Radosław Biernacki, qemu-devel
Trusted Firmware now supports A72 on sbsa-ref by default [1] so enable
it for QEMU as well. A53 was already enabled there.
1. https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7117
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
hw/arm/sbsa-ref.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git hw/arm/sbsa-ref.c hw/arm/sbsa-ref.c
index 7d9e180c0d..4a5ea42938 100644
--- hw/arm/sbsa-ref.c
+++ hw/arm/sbsa-ref.c
@@ -143,6 +143,24 @@ static const int sbsa_ref_irqmap[] = {
[SBSA_GWDT] = 16,
};
+static const char * const valid_cpus[] = {
+ ARM_CPU_TYPE_NAME("cortex-a53"),
+ ARM_CPU_TYPE_NAME("cortex-a57"),
+ ARM_CPU_TYPE_NAME("cortex-a72"),
+};
+
+static bool cpu_type_valid(const char *cpu)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(valid_cpus); i++) {
+ if (strcmp(cpu, valid_cpus[i]) == 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
{
uint8_t clustersz = ARM_DEFAULT_CPUS_PER_CLUSTER;
@@ -649,9 +667,8 @@ static void sbsa_ref_init(MachineState *machine)
const CPUArchIdList *possible_cpus;
int n, sbsa_max_cpus;
- if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a57"))) {
- error_report("sbsa-ref: CPU type other than the built-in "
- "cortex-a57 not supported");
+ if (!cpu_type_valid(machine->cpu_type)) {
+ error_report("mach-virt: CPU type %s not supported", machine->cpu_type);
exit(1);
}
--
2.28.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus
2020-11-21 17:09 ` Richard Henderson
2020-11-24 12:59 ` Marcin Juszkiewicz
@ 2020-11-24 13:00 ` Marcin Juszkiewicz
1 sibling, 0 replies; 5+ messages in thread
From: Marcin Juszkiewicz @ 2020-11-24 13:00 UTC (permalink / raw)
To: Richard Henderson, qemu-arm
Cc: Peter Maydell, Leif Lindholm, qemu-devel, Radosław Biernacki
W dniu 21.11.2020 o 18:09, Richard Henderson pisze:
>> +static const char *valid_cpus[] = {
> const char * const
I copied it from hw/arm/virt.c file.
> Otherwise,
> Reviewed-by: Richard Henderson<richard.henderson@linaro.org>
Thanks. Fixed patch sent in separate mail.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus
2020-11-24 12:59 ` Marcin Juszkiewicz
@ 2020-11-30 11:56 ` Peter Maydell
0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2020-11-30 11:56 UTC (permalink / raw)
To: Marcin Juszkiewicz
Cc: Leif Lindholm, qemu-arm, QEMU Developers, Radosław Biernacki
On Tue, 24 Nov 2020 at 12:59, Marcin Juszkiewicz
<marcin.juszkiewicz@linaro.org> wrote:
>
> Trusted Firmware now supports A72 on sbsa-ref by default [1] so enable
> it for QEMU as well. A53 was already enabled there.
>
> 1. https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/7117
>
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Applied to target-arm.next, thanks.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-11-30 11:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 14:17 [PATCH] sbsa-ref: allow to use Cortex-A53/57/72 cpus Marcin Juszkiewicz
2020-11-21 17:09 ` Richard Henderson
2020-11-24 12:59 ` Marcin Juszkiewicz
2020-11-30 11:56 ` Peter Maydell
2020-11-24 13:00 ` Marcin Juszkiewicz
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.