[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 06/12] hw/arm/raspi: Consider network interface for B models
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 06/12] hw/arm/raspi: Consider network interface for B models |
Date: |
Tue, 4 Feb 2025 01:22:34 +0100 |
Raspberry Pi 'B' models have an ethernet chipset (the LAN9512).
Since we don't yet model it, add a /* TODO */ comment.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/raspi.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index 1a6a1f8ff22..68332fba027 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -143,6 +143,16 @@ static const char *board_type(uint32_t board_rev)
return types[bt].model;
}
+static bool is_model_b(uint32_t board_rev)
+{
+ return !!strchr(board_type(board_rev), 'B');
+}
+
+static bool has_enet(uint32_t board_rev)
+{
+ return is_model_b(board_rev);
+}
+
static void write_smpboot(ARMCPU *cpu, const struct arm_boot_info *info)
{
static const ARMInsnFixup smpboot[] = {
@@ -304,6 +314,10 @@ void raspi_base_machine_init(MachineState *machine,
machine->kernel_cmdline, &error_abort);
qdev_realize(DEVICE(soc), NULL, &error_fatal);
+ if (has_enet(board_rev)) {
+ /* TODO: model LAN9512 and wire over USB2 */
+ }
+
/* Create and plug in the SD cards */
di = drive_get(IF_SD, 0, 0);
blk = di ? blk_by_legacy_dinfo(di) : NULL;
--
2.47.1
- [PATCH v2 00/12] hw/arm/raspi: Allow creating any Raspberry Pi machine, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 01/12] hw/arm/raspi: Access SoC parent object using BCM283X_BASE() macro, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 02/12] hw/arm/raspi: Merge model 4B with other models, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 03/12] hw/arm/raspi: Unify RASPI_MACHINE types, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 04/12] hw/arm/raspi: Pass board_rev as argument to raspi_base_machine_init(), Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 05/12] hw/arm/raspi: Consider processor id in types[] array, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 06/12] hw/arm/raspi: Consider network interface for B models,
Philippe Mathieu-Daudé <=
- [PATCH v2 07/12] hw/arm/raspi: Check ramsize is within chipset aperture, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 08/12] hw/arm/raspi: Introduce generic Raspberry Pi machine, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 09/12] hw/arm/raspi: Have the generic machine take a 'revision' property, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 10/12] hw/arm/raspi: List models creatable by the generic 'raspi' machine, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 12/12] hw/arm/raspi: Support more models, Philippe Mathieu-Daudé, 2025/02/03
- [PATCH v2 11/12] hw/arm/raspi: Deprecate old raspiX machine names, Philippe Mathieu-Daudé, 2025/02/03