]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
hw/xtensa/xtfpga: fix FLASH mapping to boot region for KC705
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 20 Jun 2014 14:02:10 +0000 (18:02 +0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 5 Aug 2014 19:05:20 +0000 (14:05 -0500)
On KC705 bootloader area is located at FLASH offset 0x06000000, not 0 as
on older xtfpga boards.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
(cherry picked from commit 37ed7c4b24f265c2a8c7248666544c9755514ec2)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/xtensa/xtensa_lx60.c

index 49c58d11a339f30ab1f06622ff714c2d24c6ba4a..fc6a513db120060e56781fb0f2996e736f7448e2 100644 (file)
@@ -42,6 +42,7 @@
 typedef struct LxBoardDesc {
     hwaddr flash_base;
     size_t flash_size;
+    size_t flash_boot_base;
     size_t flash_sector_size;
     size_t sram_size;
 } LxBoardDesc;
@@ -266,9 +267,9 @@ static void lx_init(const LxBoardDesc *board, QEMUMachineInitArgs *args)
             MemoryRegion *flash_io = g_malloc(sizeof(*flash_io));
 
             memory_region_init_alias(flash_io, NULL, "lx60.flash",
-                    flash_mr, 0,
-                    board->flash_size < 0x02000000 ?
-                    board->flash_size : 0x02000000);
+                    flash_mr, board->flash_boot_base,
+                    board->flash_size - board->flash_boot_base < 0x02000000 ?
+                    board->flash_size - board->flash_boot_base : 0x02000000);
             memory_region_add_subregion(system_memory, 0xfe000000,
                     flash_io);
         }
@@ -313,6 +314,7 @@ static void xtensa_kc705_init(QEMUMachineInitArgs *args)
     static const LxBoardDesc kc705_board = {
         .flash_base = 0xf0000000,
         .flash_size = 0x08000000,
+        .flash_boot_base = 0x06000000,
         .flash_sector_size = 0x20000,
         .sram_size = 0x2000000,
     };