Commit c8623c02 authored by Dirk Müller's avatar Dirk Müller Committed by Peter Maydell
Browse files

arm: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory



Commit 0b183fc8:"memory: move mem_path handling to
memory_region_allocate_system_memory" split memory_region_init_ram and
memory_region_init_ram_from_file. Also it moved mem-path handling a step
up from memory_region_init_ram to memory_region_allocate_system_memory.

Therefore for any board that uses memory_region_init_ram directly,
-mem-path is not supported.

Fix this by replacing memory_region_init_ram with
memory_region_allocate_system_memory.

Signed-off-by: default avatarDirk Mueller <dmueller@suse.com>
Message-id: CAL5wTH4UHYKpJF=dLJfFzxpufjY189chnCow47-ySuLf8GLbug@mail.gmail.com
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 5a24f20a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -63,9 +63,8 @@ static void cubieboard_init(MachineState *machine)
        exit(1);
    }

    memory_region_init_ram(&s->sdram, NULL, "cubieboard.ram",
                           machine->ram_size, &error_abort);
    vmstate_register_ram_global(&s->sdram);
    memory_region_allocate_system_memory(&s->sdram, NULL, "cubieboard.ram",
                                         machine->ram_size);
    memory_region_add_subregion(get_system_memory(), AW_A10_SDRAM_BASE,
                                &s->sdram);

+1 −2
Original line number Diff line number Diff line
@@ -51,9 +51,8 @@ typedef struct DigicBoard {

static void digic4_board_setup_ram(DigicBoardState *s, hwaddr ram_size)
{
    memory_region_init_ram(&s->ram, NULL, "ram", ram_size, &error_abort);
    memory_region_allocate_system_memory(&s->ram, NULL, "ram", ram_size);
    memory_region_add_subregion(get_system_memory(), 0, &s->ram);
    vmstate_register_ram_global(&s->ram);
}

static void digic4_board_init(DigicBoard *board)
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)

    sysmem = get_system_memory();
    dram = g_new(MemoryRegion, 1);
    memory_region_init_ram(dram, NULL, "highbank.dram", ram_size, &error_abort);
    memory_region_allocate_system_memory(dram, NULL, "highbank.dram", ram_size);
    /* SDRAM at address zero.  */
    memory_region_add_subregion(sysmem, 0, dram);

+2 −2
Original line number Diff line number Diff line
@@ -567,8 +567,8 @@ static void integratorcp_init(MachineState *machine)

    cpu = ARM_CPU(cpuobj);

    memory_region_init_ram(ram, NULL, "integrator.ram", ram_size, &error_abort);
    vmstate_register_ram_global(ram);
    memory_region_allocate_system_memory(ram, NULL, "integrator.ram",
                                         ram_size);
    /* ??? On a real system the first 1Mb is mapped as SSRAM or boot flash.  */
    /* ??? RAM should repeat to fill physical memory space.  */
    /* SDRAM at address zero*/
+1 −2
Original line number Diff line number Diff line
@@ -97,8 +97,7 @@ static void kzm_init(MachineState *machine)

    /* On a real system, the first 16k is a `secure boot rom' */

    memory_region_init_ram(ram, NULL, "kzm.ram", ram_size, &error_abort);
    vmstate_register_ram_global(ram);
    memory_region_allocate_system_memory(ram, NULL, "kzm.ram", ram_size);
    memory_region_add_subregion(address_space_mem, KZM_RAMADDRESS, ram);

    memory_region_init_alias(ram_alias, NULL, "ram.alias", ram, 0, ram_size);
Loading