Skip to contentSkip to conversation

arm: allow machine IDs > 0xffff

PATCH In review Grant Likely 2 participants 3 messages Jan 20, 2012 – Jan 21, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: allow machine IDs > 0xffff

From: Jeremy Kerr <[email protected]>

Cc Paul Brook <[email protected]>
Cc Peter Maydell <[email protected]>
Cc Rob Herring <[email protected]>
---
 hw/arm_boot.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
hw/arm_boot.c +5 -6
index de8f1a4..f2b7332 100644
@@ -26,10 +26,10 @@
 /* The worlds second smallest bootloader.  Set r0-r2, then jump to kernel.  */
 static uint32_t bootloader[] = {
   0xe3a00000, /* mov     r0, #0 */
-  0xe3a01000, /* mov     r1, #0x?? */
-  0xe3811c00, /* orr     r1, r1, #0x??00 */
-  0xe59f2000, /* ldr     r2, [pc, #0] */
-  0xe59ff000, /* ldr     pc, [pc, #0] */
+  0xe59f1004, /* ldr     r1, [pc, #4] */
+  0xe59f2004, /* ldr     r2, [pc, #4] */
+  0xe59ff004, /* ldr     pc, [pc, #4] */
+  0, /* Machine ID */
   0, /* Address of kernel args.  Set by integratorcp_init.  */
   0  /* Kernel entry point.  Set by integratorcp_init.  */
 };
@@ -327,8 +327,7 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
         } else {
             initrd_size = 0;
         }
-        bootloader[1] |= info->board_id & 0xff;
-        bootloader[2] |= (info->board_id >> 8) & 0xff;
+        bootloader[4] = info->board_id;
         /* for device tree boot, we pass the DTB directly in r2. Otherwise
          * we point to the kernel args */
         if (info->dtb_filename)
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 7 lines · Grant Likely

From: Jeremy Kerr <[email protected]>

Cc Paul Brook <[email protected]>
Cc Peter Maydell <[email protected]>
Cc Rob Herring <[email protected]>

Oops, this one won't apply directly since it's build on top of another patch. I'll repost a clean version soon.

g.

Quoted 36 lines

---
 hw/arm_boot.c |   11 +++++------

 1 files changed, 5 insertions(+), 6 deletions(-)
hw/arm_boot.c +0 -0
index de8f1a4..f2b7332 100644
@@ -26,10 +26,10 @@
  /* The worlds second smallest bootloader.  Set r0-r2, then jump to kernel.  */
  static uint32_t bootloader[] = {

  0xe3a00000, /* mov     r0, #0 */
-  0xe3a01000, /* mov     r1, #0x?? */
-  0xe3811c00, /* orr     r1, r1, #0x??00 */
-  0xe59f2000, /* ldr     r2, [pc, #0] */
-  0xe59ff000, /* ldr     pc, [pc, #0] */
+  0xe59f1004, /* ldr     r1, [pc, #4] */
+  0xe59f2004, /* ldr     r2, [pc, #4] */
+  0xe59ff004, /* ldr     pc, [pc, #4] */
+  0, /* Machine ID */
  0, /* Address of kernel args.  Set by integratorcp_init.  */ 0  /* Kernel entry point.  Set by integratorcp_init.  */ };

hw/arm_boot.c +1 -3
@@ -327,8 +327,7 @@ void arm_load_kernel(CPUState *env, struct arm_boot_info *info)
         } else {
             initrd_size = 0;
         }
-        bootloader[1] |= info->board_id & 0xff;
-        bootloader[2] |= (info->board_id >> 8) & 0xff;
+        bootloader[4] = info->board_id;
         /* for device tree boot, we pass the DTB directly in r2. Otherwise
          * we point to the kernel args */
         if (info->dtb_filename)
--

1.7.5.4

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#2 lore raw
Quoted 4 lines · Grant Likely
Quoted 2 lines · Grant Likely

From: Jeremy Kerr <[email protected]>

Quoted 8 lines
Quoted 5 lines
Cc Paul Brook <[email protected]>
Cc Peter Maydell <[email protected]>
Cc Rob Herring <[email protected]>

Oops, this one won't apply directly since it's build on top of another patch.  I'll repost a clean version soon.

I already sent basically exactly this patch to the list, so don't worry about it :-)

-- PMM