mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Revert "Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging"
This reverts commit8ef9ea85a2
, reversing changes made to444dc48298
. From Avi: Please revert the entire pull (git revert8ef9ea85a2
) while I work this out - it isn't trivial. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
f065aa0a00
commit
01e0451a08
49 changed files with 657 additions and 637 deletions
|
@ -17,7 +17,6 @@
|
|||
#include "flash.h"
|
||||
#include "blockdev.h"
|
||||
#include "sysbus.h"
|
||||
#include "exec-memory.h"
|
||||
|
||||
/* Device addresses */
|
||||
#define MST_FPGA_PHYS 0x08000000
|
||||
|
@ -91,8 +90,7 @@ static struct arm_boot_info mainstone_binfo = {
|
|||
.ram_size = 0x04000000,
|
||||
};
|
||||
|
||||
static void mainstone_common_init(MemoryRegion *address_space_mem,
|
||||
ram_addr_t ram_size,
|
||||
static void mainstone_common_init(ram_addr_t ram_size,
|
||||
const char *kernel_filename,
|
||||
const char *kernel_cmdline, const char *initrd_filename,
|
||||
const char *cpu_model, enum mainstone_model_e model, int arm_id)
|
||||
|
@ -103,23 +101,21 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,
|
|||
DeviceState *mst_irq;
|
||||
DriveInfo *dinfo;
|
||||
int i;
|
||||
MemoryRegion *rom = g_new(MemoryRegion, 1);
|
||||
MemoryRegion *flashes = g_new(MemoryRegion, 2);
|
||||
const MemoryRegionOps *flash_ops;
|
||||
int be;
|
||||
|
||||
if (!cpu_model)
|
||||
cpu_model = "pxa270-c5";
|
||||
|
||||
/* Setup CPU & memory */
|
||||
cpu = pxa270_init(mainstone_binfo.ram_size, cpu_model);
|
||||
memory_region_init_ram(rom, NULL, "mainstone.rom", MAINSTONE_ROM);
|
||||
memory_region_set_readonly(rom, true);
|
||||
memory_region_add_subregion(address_space_mem, 0, rom);
|
||||
cpu_register_physical_memory(0, MAINSTONE_ROM,
|
||||
qemu_ram_alloc(NULL, "mainstone.rom",
|
||||
MAINSTONE_ROM) | IO_MEM_ROM);
|
||||
|
||||
#ifdef TARGET_WORDS_BIGENDIAN
|
||||
flash_ops = &pflash_cfi01_ops_be;
|
||||
be = 1;
|
||||
#else
|
||||
flash_ops = &pflash_cfi01_ops_le;
|
||||
be = 0;
|
||||
#endif
|
||||
/* There are two 32MiB flash devices on the board */
|
||||
for (i = 0; i < 2; i ++) {
|
||||
|
@ -130,14 +126,13 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,
|
|||
exit(1);
|
||||
}
|
||||
|
||||
memory_region_init_rom_device(&flashes[i], flash_ops,
|
||||
NULL, (i ? "mainstone.flash1"
|
||||
: "mainstone.flash0"),
|
||||
MAINSTONE_FLASH);
|
||||
if (!pflash_cfi01_register(mainstone_flash_base[i],
|
||||
&flashes[i], dinfo->bdrv, sector_len,
|
||||
MAINSTONE_FLASH / sector_len, 4, 0, 0, 0,
|
||||
0)) {
|
||||
qemu_ram_alloc(NULL, i ? "mainstone.flash1" :
|
||||
"mainstone.flash0",
|
||||
MAINSTONE_FLASH),
|
||||
dinfo->bdrv, sector_len,
|
||||
MAINSTONE_FLASH / sector_len, 4, 0, 0, 0, 0,
|
||||
be)) {
|
||||
fprintf(stderr, "qemu: Error registering flash memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -175,7 +170,7 @@ static void mainstone_init(ram_addr_t ram_size,
|
|||
const char *kernel_filename, const char *kernel_cmdline,
|
||||
const char *initrd_filename, const char *cpu_model)
|
||||
{
|
||||
mainstone_common_init(get_system_memory(), ram_size, kernel_filename,
|
||||
mainstone_common_init(ram_size, kernel_filename,
|
||||
kernel_cmdline, initrd_filename, cpu_model, mainstone, 0x196);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue