mirror of https://github.com/xemu-project/xemu.git
Check the Galilleo config register instead of hardcoding the endianness.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3417 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
647de6ca24
commit
1931e26054
30
hw/gt64xxx.c
30
hw/gt64xxx.c
|
@ -306,9 +306,8 @@ static void gt64120_writel (void *opaque, target_phys_addr_t addr,
|
||||||
GT64120State *s = opaque;
|
GT64120State *s = opaque;
|
||||||
uint32_t saddr;
|
uint32_t saddr;
|
||||||
|
|
||||||
#ifdef TARGET_WORDS_BIGENDIAN
|
if (!(s->regs[GT_PCI0_CMD] & 1))
|
||||||
val = bswap32(val);
|
val = bswap32(val);
|
||||||
#endif
|
|
||||||
|
|
||||||
saddr = (addr & 0xfff) >> 2;
|
saddr = (addr & 0xfff) >> 2;
|
||||||
switch (saddr) {
|
switch (saddr) {
|
||||||
|
@ -528,8 +527,7 @@ static void gt64120_writel (void *opaque, target_phys_addr_t addr,
|
||||||
s->pci->config_reg = val & 0x80fffffc;
|
s->pci->config_reg = val & 0x80fffffc;
|
||||||
break;
|
break;
|
||||||
case GT_PCI0_CFGDATA:
|
case GT_PCI0_CFGDATA:
|
||||||
if (s->pci->config_reg & (1u << 31))
|
pci_host_data_writel(s->pci, 0, val);
|
||||||
pci_host_data_writel(s->pci, 0, val);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Interrupts */
|
/* Interrupts */
|
||||||
|
@ -585,9 +583,7 @@ static uint32_t gt64120_readl (void *opaque,
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
uint32_t saddr;
|
uint32_t saddr;
|
||||||
|
|
||||||
val = 0;
|
|
||||||
saddr = (addr & 0xfff) >> 2;
|
saddr = (addr & 0xfff) >> 2;
|
||||||
|
|
||||||
switch (saddr) {
|
switch (saddr) {
|
||||||
|
|
||||||
/* CPU Configuration */
|
/* CPU Configuration */
|
||||||
|
@ -768,10 +764,7 @@ static uint32_t gt64120_readl (void *opaque,
|
||||||
val = s->pci->config_reg;
|
val = s->pci->config_reg;
|
||||||
break;
|
break;
|
||||||
case GT_PCI0_CFGDATA:
|
case GT_PCI0_CFGDATA:
|
||||||
if (!(s->pci->config_reg & (1u << 31)))
|
val = pci_host_data_readl(s->pci, 0);
|
||||||
val = 0xffffffff;
|
|
||||||
else
|
|
||||||
val = pci_host_data_readl(s->pci, 0);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GT_PCI0_CMD:
|
case GT_PCI0_CMD:
|
||||||
|
@ -844,9 +837,9 @@ static uint32_t gt64120_readl (void *opaque,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TARGET_WORDS_BIGENDIAN
|
if (!(s->regs[GT_PCI0_CMD] & 1))
|
||||||
val = bswap32(val);
|
val = bswap32(val);
|
||||||
#endif
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1083,19 +1076,12 @@ void gt64120_reset(void *opaque)
|
||||||
|
|
||||||
static uint32_t gt64120_read_config(PCIDevice *d, uint32_t address, int len)
|
static uint32_t gt64120_read_config(PCIDevice *d, uint32_t address, int len)
|
||||||
{
|
{
|
||||||
uint32_t val = pci_default_read_config(d, address, len);
|
return pci_default_read_config(d, address, len);
|
||||||
#ifdef TARGET_WORDS_BIGENDIAN
|
|
||||||
val = bswap32(val);
|
|
||||||
#endif
|
|
||||||
return val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gt64120_write_config(PCIDevice *d, uint32_t address, uint32_t val,
|
static void gt64120_write_config(PCIDevice *d, uint32_t address, uint32_t val,
|
||||||
int len)
|
int len)
|
||||||
{
|
{
|
||||||
#ifdef TARGET_WORDS_BIGENDIAN
|
|
||||||
val = bswap32(val);
|
|
||||||
#endif
|
|
||||||
pci_default_write_config(d, address, val, len);
|
pci_default_write_config(d, address, val, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue