mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
ARMv7 support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3572 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
ee4e83ed8d
commit
9ee6e8bb85
35 changed files with 11799 additions and 653 deletions
15
hw/pl011.c
15
hw/pl011.c
|
@ -28,6 +28,7 @@ typedef struct {
|
|||
int read_trigger;
|
||||
CharDriverState *chr;
|
||||
qemu_irq irq;
|
||||
enum pl011_type type;
|
||||
} pl011_state;
|
||||
|
||||
#define PL011_INT_TX 0x20
|
||||
|
@ -38,8 +39,10 @@ typedef struct {
|
|||
#define PL011_FLAG_TXFF 0x20
|
||||
#define PL011_FLAG_RXFE 0x10
|
||||
|
||||
static const unsigned char pl011_id[] =
|
||||
{ 0x11, 0x10, 0x14, 0x00, 0x0d, 0xf0, 0x05, 0xb1 };
|
||||
static const unsigned char pl011_id[2][8] = {
|
||||
{ 0x11, 0x10, 0x14, 0x00, 0x0d, 0xf0, 0x05, 0xb1 }, /* PL011_ARM */
|
||||
{ 0x11, 0x00, 0x18, 0x01, 0x0d, 0xf0, 0x05, 0xb1 }, /* PL011_LUMINARY */
|
||||
};
|
||||
|
||||
static void pl011_update(pl011_state *s)
|
||||
{
|
||||
|
@ -56,7 +59,7 @@ static uint32_t pl011_read(void *opaque, target_phys_addr_t offset)
|
|||
|
||||
offset -= s->base;
|
||||
if (offset >= 0xfe0 && offset < 0x1000) {
|
||||
return pl011_id[(offset - 0xfe0) >> 2];
|
||||
return pl011_id[s->type][(offset - 0xfe0) >> 2];
|
||||
}
|
||||
switch (offset >> 2) {
|
||||
case 0: /* UARTDR */
|
||||
|
@ -137,6 +140,9 @@ static void pl011_write(void *opaque, target_phys_addr_t offset,
|
|||
case 1: /* UARTCR */
|
||||
s->cr = value;
|
||||
break;
|
||||
case 6: /* UARTFR */
|
||||
/* Writes to Flag register are ignored. */
|
||||
break;
|
||||
case 8: /* UARTUARTILPR */
|
||||
s->ilpr = value;
|
||||
break;
|
||||
|
@ -224,7 +230,7 @@ static CPUWriteMemoryFunc *pl011_writefn[] = {
|
|||
};
|
||||
|
||||
void pl011_init(uint32_t base, qemu_irq irq,
|
||||
CharDriverState *chr)
|
||||
CharDriverState *chr, enum pl011_type type)
|
||||
{
|
||||
int iomemtype;
|
||||
pl011_state *s;
|
||||
|
@ -235,6 +241,7 @@ void pl011_init(uint32_t base, qemu_irq irq,
|
|||
cpu_register_physical_memory(base, 0x00001000, iomemtype);
|
||||
s->base = base;
|
||||
s->irq = irq;
|
||||
s->type = type;
|
||||
s->chr = chr;
|
||||
s->read_trigger = 1;
|
||||
s->ifl = 0x12;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue