Commit e972b3ad26c85adb2e72e5608146909f0cfbc29a
1 parent
4f3f238b
Fix UniNorth
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6562 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
2 additions
and
13 deletions
hw/unin_pci.c
| ... | ... | @@ -44,22 +44,13 @@ static void pci_unin_main_config_writel (void *opaque, target_phys_addr_t addr, |
| 44 | 44 | uint32_t val) |
| 45 | 45 | { |
| 46 | 46 | UNINState *s = opaque; |
| 47 | - int i; | |
| 48 | 47 | |
| 49 | 48 | UNIN_DPRINTF("config_writel addr " TARGET_FMT_plx " val %x\n", addr, val); |
| 50 | 49 | #ifdef TARGET_WORDS_BIGENDIAN |
| 51 | 50 | val = bswap32(val); |
| 52 | 51 | #endif |
| 53 | 52 | |
| 54 | - for (i = 11; i < 32; i++) { | |
| 55 | - if ((val & (1 << i)) != 0) | |
| 56 | - break; | |
| 57 | - } | |
| 58 | -#if 0 | |
| 59 | - s->config_reg = 0x80000000 | (1 << 16) | (val & 0x7FC) | (i << 11); | |
| 60 | -#else | |
| 61 | - s->config_reg = 0x80000000 | (0 << 16) | (val & 0x7FC) | (i << 11); | |
| 62 | -#endif | |
| 53 | + s->config_reg = val; | |
| 63 | 54 | } |
| 64 | 55 | |
| 65 | 56 | static uint32_t pci_unin_main_config_readl (void *opaque, |
| ... | ... | @@ -67,10 +58,8 @@ static uint32_t pci_unin_main_config_readl (void *opaque, |
| 67 | 58 | { |
| 68 | 59 | UNINState *s = opaque; |
| 69 | 60 | uint32_t val; |
| 70 | - int devfn; | |
| 71 | 61 | |
| 72 | - devfn = (s->config_reg >> 8) & 0xFF; | |
| 73 | - val = (1 << (devfn >> 3)) | ((devfn & 0x07) << 8) | (s->config_reg & 0xFC); | |
| 62 | + val = s->config_reg; | |
| 74 | 63 | #ifdef TARGET_WORDS_BIGENDIAN |
| 75 | 64 | val = bswap32(val); |
| 76 | 65 | #endif | ... | ... |