Skip to contentSkip to conversation

hw/rx: rx-gdbsim: DTB load address fix.

PATCH Superseded Yoshinori Sato 2 participants 2 messages Jan 31, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/rx: rx-gdbsim: DTB load address fix.

Linux kernel required alined address of DTB.
But missing align in dtb load function.
Fixed to load to the correct address.

---
 hw/rx/rx-gdbsim.c | 1 +
 1 file changed, 1 insertion(+)
hw/rx/rx-gdbsim.c +1 -0
index 75d1fec6ca..f70472aeaf 100644
@@ -143,6 +143,7 @@ static void rx_gdbsim_init(MachineState *machine)
             }
             /* DTB is located at the end of SDRAM space. */
             dtb_offset = machine->ram_size - dtb_size;
+            dtb_offset &= ~0x0f;
             rom_add_blob_fixed("dtb", dtb, dtb_size,
                                SDRAM_BASE + dtb_offset);
             /* Set dtb address to R1 */
Signature · 1 line
2.30.2
Reviewed-by Philippe Mathieu-Daudé on v1 1/1
#1 lore raw

Cc'ing qemu-trivial@

Quoted 14 lines · Yoshinori Sato

Linux kernel required alined address of DTB.
But missing align in dtb load function.
Fixed to load to the correct address.

---
  hw/rx/rx-gdbsim.c | 1 +
  1 file changed, 1 insertion(+)
hw/rx/rx-gdbsim.c +0 -0
index 75d1fec6ca..f70472aeaf 100644

hw/rx/rx-gdbsim.c static void rx_gdbsim_init(MachineState *machine) · line 146

Quoted 4 lines
hw/rx/rx-gdbsim.c +1 -0
@@ -143,6 +143,7 @@ static void rx_gdbsim_init(MachineState *machine)
              }
              /* DTB is located at the end of SDRAM space. */
              dtb_offset = machine->ram_size - dtb_size;
+            dtb_offset &= ~0x0f;

Alternatively (more explicit):

          dtb_offset = ROUND_DOWN(machine->ram_size - dtb_size, 16);

For any option: