diff options
-rw-r--r-- | .vimrc | 4 | ||||
-rw-r--r-- | src/boot.c | 2 | ||||
-rw-r--r-- | src/fw/pciinit.c | 30 | ||||
-rw-r--r-- | src/parisc/hppa.h | 2 | ||||
-rw-r--r-- | src/parisc/parisc.c | 6 |
5 files changed, 40 insertions, 4 deletions
@@ -0,0 +1,4 @@ +set expandtab +set shiftwidth=4 +set smarttab +autocmd FileType asm setlocal ts=8 sts=8 sw=8 noexpandtab nosmarttab @@ -50,7 +50,7 @@ glob_prefix(const char *glob, const char *str) } #if CONFIG_PARISC -#define FW_PCI_DOMAIN "/dino-pcihost" +#define FW_PCI_DOMAIN (has_astro ? "/astro-pcihost" : "/dino-pcihost") #else #define FW_PCI_DOMAIN "/pci@i0cf8" #endif diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index 4c16ea0..7f93a1f 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -536,6 +536,34 @@ static void dino_mem_addr_setup(struct pci_device *dev, void *arg) /* setup io address space */ pci_io_low_end = 0xa000; } + +static int astro_pci_slot_get_irq(struct pci_device *pci, int pin) +{ + int slot = pci_bdf_to_dev(pci->bdf); + return slot & 0x03; +} + +static void astro_mem_addr_setup(struct pci_device *dev, void *arg) +{ + pcimem_start = 0xf4000000ULL; + pcimem_end = pcimem_start + 0x4000000ULL; + +// outl(0x00000080, DINO_HPA + 0x038); /* IO_CONTROL - enable DINO PCI */ +// outl(0x7ffffffe, DINO_HPA + 0x060); /* Set DINO_IO_ADDR_EN */ + + pci_slot_get_irq = astro_pci_slot_get_irq; + + /* setup io address space */ + pci_io_low_end = 0x40000; +} + +static void parisc_mem_addr_setup(struct pci_device *dev, void *arg) +{ + if (has_astro) + return astro_mem_addr_setup(dev, arg); + else + return dino_mem_addr_setup(dev, arg); +} #endif /* CONFIG_PARISC */ @@ -558,7 +586,7 @@ static void pci_bios_init_platform(void) } #if CONFIG_PARISC - dino_mem_addr_setup(NULL, NULL); + parisc_mem_addr_setup(NULL, NULL); #endif } diff --git a/src/parisc/hppa.h b/src/parisc/hppa.h index fabfb9b..1a00288 100644 --- a/src/parisc/hppa.h +++ b/src/parisc/hppa.h @@ -204,6 +204,8 @@ static inline u32 ror(u32 word, unsigned int shift) return (word >> (shift & 31)) | (word << ((-shift) & 31)); } +extern char has_astro; /* false for B160L machine with Dino PCI chip */ + #define pci_ioport_addr(port) ((port >= 0x1000) && (port < FIRMWARE_START)) static inline void outl(u32 value, portaddr_t port) { diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index 8da0c07..8a97339 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -119,6 +119,7 @@ int sti_font; char qemu_version[16] = "unknown version"; char qemu_machine[16] = "B160L"; char cpu_bit_width; +char has_astro; /* Want PDC boot menu? Enable via qemu "-boot menu=on" option. */ unsigned int show_boot_menu; @@ -1540,7 +1541,6 @@ static int pdc_pci_index(unsigned int *arg) unsigned long option = ARG1; unsigned long *result = (unsigned long *)ARG2; /* machines with Dino don't provide this info */ - int has_astro = (current_machine != &machine_B160L); u32 *irt_table, i; #if 0 @@ -2252,8 +2252,10 @@ void __VISIBLE start_parisc_firmware(void) str = romfile_loadfile("/etc/hppa/machine", NULL); if (!str) str = "B160L"; - if (strcmp(str, "C3700") == 0) + if (strcmp(str, "C3700") == 0) { current_machine = &machine_C3700; + has_astro = 1; + } parisc_devices = current_machine->device_list; strtcpy(qemu_machine, str, sizeof(qemu_machine)); |