imx: Use memory_region_init_rom() for ROMs
The imx boards were all incorrectly creating ROMs using memory_region_init_rom_device() with a NULL ops pointer. This will cause QEMU to abort if the guest tries to write to the ROM. Switch to the new memory_region_init_rom() instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1467122287-24974-3-git-send-email-peter.maydell@linaro.org
This commit is contained in:
parent
a1777f7f64
commit
a7aeb5f7b2
|
@ -249,16 +249,16 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize 2 x 16 KB ROM */
|
/* initialize 2 x 16 KB ROM */
|
||||||
memory_region_init_rom_device(&s->rom[0], NULL, NULL, NULL,
|
memory_region_init_rom(&s->rom[0], NULL,
|
||||||
"imx25.rom0", FSL_IMX25_ROM0_SIZE, &err);
|
"imx25.rom0", FSL_IMX25_ROM0_SIZE, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
error_propagate(errp, err);
|
error_propagate(errp, err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memory_region_add_subregion(get_system_memory(), FSL_IMX25_ROM0_ADDR,
|
memory_region_add_subregion(get_system_memory(), FSL_IMX25_ROM0_ADDR,
|
||||||
&s->rom[0]);
|
&s->rom[0]);
|
||||||
memory_region_init_rom_device(&s->rom[1], NULL, NULL, NULL,
|
memory_region_init_rom(&s->rom[1], NULL,
|
||||||
"imx25.rom1", FSL_IMX25_ROM1_SIZE, &err);
|
"imx25.rom1", FSL_IMX25_ROM1_SIZE, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
error_propagate(errp, err);
|
error_propagate(errp, err);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -219,9 +219,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On a real system, the first 16k is a `secure boot rom' */
|
/* On a real system, the first 16k is a `secure boot rom' */
|
||||||
memory_region_init_rom_device(&s->secure_rom, NULL, NULL, NULL,
|
memory_region_init_rom(&s->secure_rom, NULL, "imx31.secure_rom",
|
||||||
"imx31.secure_rom",
|
FSL_IMX31_SECURE_ROM_SIZE, &err);
|
||||||
FSL_IMX31_SECURE_ROM_SIZE, &err);
|
|
||||||
if (err) {
|
if (err) {
|
||||||
error_propagate(errp, err);
|
error_propagate(errp, err);
|
||||||
return;
|
return;
|
||||||
|
@ -230,8 +229,8 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
||||||
&s->secure_rom);
|
&s->secure_rom);
|
||||||
|
|
||||||
/* There is also a 16k ROM */
|
/* There is also a 16k ROM */
|
||||||
memory_region_init_rom_device(&s->rom, NULL, NULL, NULL, "imx31.rom",
|
memory_region_init_rom(&s->rom, NULL, "imx31.rom",
|
||||||
FSL_IMX31_ROM_SIZE, &err);
|
FSL_IMX31_ROM_SIZE, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
error_propagate(errp, err);
|
error_propagate(errp, err);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -399,8 +399,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
||||||
FSL_IMX6_ENET_MAC_1588_IRQ));
|
FSL_IMX6_ENET_MAC_1588_IRQ));
|
||||||
|
|
||||||
/* ROM memory */
|
/* ROM memory */
|
||||||
memory_region_init_rom_device(&s->rom, NULL, NULL, NULL, "imx6.rom",
|
memory_region_init_rom(&s->rom, NULL, "imx6.rom",
|
||||||
FSL_IMX6_ROM_SIZE, &err);
|
FSL_IMX6_ROM_SIZE, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
error_propagate(errp, err);
|
error_propagate(errp, err);
|
||||||
return;
|
return;
|
||||||
|
@ -409,8 +409,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
|
||||||
&s->rom);
|
&s->rom);
|
||||||
|
|
||||||
/* CAAM memory */
|
/* CAAM memory */
|
||||||
memory_region_init_rom_device(&s->caam, NULL, NULL, NULL, "imx6.caam",
|
memory_region_init_rom(&s->caam, NULL, "imx6.caam",
|
||||||
FSL_IMX6_CAAM_MEM_SIZE, &err);
|
FSL_IMX6_CAAM_MEM_SIZE, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
error_propagate(errp, err);
|
error_propagate(errp, err);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue