mirror of
https://git.proxmox.com/git/qemu
synced 2025-07-03 08:38:46 +00:00
PL110 qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
This commit is contained in:
parent
6f68ecb2c1
commit
2e9bdce56f
@ -7,7 +7,7 @@
|
|||||||
* This code is licenced under the GPL
|
* This code is licenced under the GPL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "hw.h"
|
#include "sysbus.h"
|
||||||
#include "primecell.h"
|
#include "primecell.h"
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
#include "sysemu.h"
|
#include "sysemu.h"
|
||||||
@ -495,7 +495,8 @@ static void integratorcp_init(ram_addr_t ram_size,
|
|||||||
pl181_init(0x1c000000, drives_table[sd].bdrv, pic[23], pic[24]);
|
pl181_init(0x1c000000, drives_table[sd].bdrv, pic[23], pic[24]);
|
||||||
if (nd_table[0].vlan)
|
if (nd_table[0].vlan)
|
||||||
smc91c111_init(&nd_table[0], 0xc8000000, pic[27]);
|
smc91c111_init(&nd_table[0], 0xc8000000, pic[27]);
|
||||||
pl110_init(0xc0000000, pic[22], 0);
|
|
||||||
|
sysbus_create_simple("pl110", 0xc0000000, pic[22]);
|
||||||
|
|
||||||
integrator_binfo.ram_size = ram_size;
|
integrator_binfo.ram_size = ram_size;
|
||||||
integrator_binfo.kernel_filename = kernel_filename;
|
integrator_binfo.kernel_filename = kernel_filename;
|
||||||
|
33
hw/pl110.c
33
hw/pl110.c
@ -1,14 +1,13 @@
|
|||||||
/*
|
/*
|
||||||
* Arm PrimeCell PL110 Color LCD Controller
|
* Arm PrimeCell PL110 Color LCD Controller
|
||||||
*
|
*
|
||||||
* Copyright (c) 2005-2006 CodeSourcery.
|
* Copyright (c) 2005-2009 CodeSourcery.
|
||||||
* Written by Paul Brook
|
* Written by Paul Brook
|
||||||
*
|
*
|
||||||
* This code is licenced under the GNU LGPL
|
* This code is licenced under the GNU LGPL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "hw.h"
|
#include "sysbus.h"
|
||||||
#include "primecell.h"
|
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "framebuffer.h"
|
#include "framebuffer.h"
|
||||||
|
|
||||||
@ -29,6 +28,7 @@ enum pl110_bppmode
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
SysBusDevice busdev;
|
||||||
DisplayState *ds;
|
DisplayState *ds;
|
||||||
|
|
||||||
/* The Versatile/PB uses a slightly modified PL110 controller. */
|
/* The Versatile/PB uses a slightly modified PL110 controller. */
|
||||||
@ -349,20 +349,33 @@ static CPUWriteMemoryFunc *pl110_writefn[] = {
|
|||||||
pl110_write
|
pl110_write
|
||||||
};
|
};
|
||||||
|
|
||||||
void *pl110_init(uint32_t base, qemu_irq irq, int versatile)
|
static void pl110_init(SysBusDevice *dev)
|
||||||
{
|
{
|
||||||
pl110_state *s;
|
pl110_state *s = FROM_SYSBUS(pl110_state, dev);
|
||||||
int iomemtype;
|
int iomemtype;
|
||||||
|
|
||||||
s = (pl110_state *)qemu_mallocz(sizeof(pl110_state));
|
|
||||||
iomemtype = cpu_register_io_memory(0, pl110_readfn,
|
iomemtype = cpu_register_io_memory(0, pl110_readfn,
|
||||||
pl110_writefn, s);
|
pl110_writefn, s);
|
||||||
cpu_register_physical_memory(base, 0x00001000, iomemtype);
|
sysbus_init_mmio(dev, 0x1000, iomemtype);
|
||||||
s->versatile = versatile;
|
sysbus_init_irq(dev, &s->irq);
|
||||||
s->irq = irq;
|
|
||||||
s->ds = graphic_console_init(pl110_update_display,
|
s->ds = graphic_console_init(pl110_update_display,
|
||||||
pl110_invalidate_display,
|
pl110_invalidate_display,
|
||||||
NULL, NULL, s);
|
NULL, NULL, s);
|
||||||
/* ??? Save/restore. */
|
/* ??? Save/restore. */
|
||||||
return s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void pl110_versatile_init(SysBusDevice *dev)
|
||||||
|
{
|
||||||
|
pl110_state *s = FROM_SYSBUS(pl110_state, dev);
|
||||||
|
s->versatile = 1;
|
||||||
|
pl110_init(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void pl110_register_devices(void)
|
||||||
|
{
|
||||||
|
sysbus_register_dev("pl110", sizeof(pl110_state), pl110_init);
|
||||||
|
sysbus_register_dev("pl110_versatile", sizeof(pl110_state),
|
||||||
|
pl110_versatile_init);
|
||||||
|
}
|
||||||
|
|
||||||
|
device_init(pl110_register_devices)
|
||||||
|
@ -8,9 +8,6 @@
|
|||||||
/* pl031.c */
|
/* pl031.c */
|
||||||
void pl031_init(uint32_t base, qemu_irq irq);
|
void pl031_init(uint32_t base, qemu_irq irq);
|
||||||
|
|
||||||
/* pl110.c */
|
|
||||||
void *pl110_init(uint32_t base, qemu_irq irq, int);
|
|
||||||
|
|
||||||
/* pl011.c */
|
/* pl011.c */
|
||||||
enum pl011_type {
|
enum pl011_type {
|
||||||
PL011_ARM,
|
PL011_ARM,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* This code is licenced under the GPL.
|
* This code is licenced under the GPL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "hw.h"
|
#include "sysbus.h"
|
||||||
#include "arm-misc.h"
|
#include "arm-misc.h"
|
||||||
#include "primecell.h"
|
#include "primecell.h"
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
@ -96,7 +96,7 @@ static void realview_init(ram_addr_t ram_size,
|
|||||||
sp804_init(0x10011000, pic[4]);
|
sp804_init(0x10011000, pic[4]);
|
||||||
sp804_init(0x10012000, pic[5]);
|
sp804_init(0x10012000, pic[5]);
|
||||||
|
|
||||||
pl110_init(0x10020000, pic[23], 1);
|
sysbus_create_simple("pl110_versatile", 0x10020000, pic[23]);
|
||||||
|
|
||||||
index = drive_get_index(IF_SD, 0, 0);
|
index = drive_get_index(IF_SD, 0, 0);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* This code is licenced under the GPL.
|
* This code is licenced under the GPL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "hw.h"
|
#include "sysbus.h"
|
||||||
#include "arm-misc.h"
|
#include "arm-misc.h"
|
||||||
#include "primecell.h"
|
#include "primecell.h"
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
@ -228,7 +228,7 @@ static void versatile_init(ram_addr_t ram_size,
|
|||||||
|
|
||||||
/* The versatile/PB actually has a modified Color LCD controller
|
/* The versatile/PB actually has a modified Color LCD controller
|
||||||
that includes hardware cursor support from the PL111. */
|
that includes hardware cursor support from the PL111. */
|
||||||
pl110_init(0x10120000, pic[16], 1);
|
sysbus_create_simple("pl110_versatile", 0x10120000, pic[16]);
|
||||||
|
|
||||||
index = drive_get_index(IF_SD, 0, 0);
|
index = drive_get_index(IF_SD, 0, 0);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user