hw/arm/raspi: Use RaspiProcessorId to set the firmware load address
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 24 Sep 2020 11:18:07 +0000 (13:18 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 1 Oct 2020 14:31:01 +0000 (15:31 +0100)
The firmware load address depends on the SoC ("processor id") used,
not on the version of the board.

Suggested-by: Luc Michel <luc.michel@greensocs.com>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200924111808.77168-8-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/raspi.c

index 0d8e5a34c7833a3cafad25a5657b6d8142e3ca8c..ae98a2fbfca0aba36ab86158b2c088362467472c 100644 (file)
@@ -238,7 +238,8 @@ static void setup_boot(MachineState *machine, int version, size_t ram_size)
      * the normal Linux boot process
      */
     if (machine->firmware) {
-        hwaddr firmware_addr = version == 3 ? FIRMWARE_ADDR_3 : FIRMWARE_ADDR_2;
+        hwaddr firmware_addr = processor_id <= PROCESSOR_ID_BCM2836
+                             ? FIRMWARE_ADDR_2 : FIRMWARE_ADDR_3;
         /* load the firmware image (typically kernel.img) */
         r = load_image_targphys(machine->firmware, firmware_addr,
                                 ram_size - firmware_addr);