diff options
-rw-r--r-- | src/parisc/b160l.h | 26 | ||||
-rw-r--r-- | src/parisc/parisc.c | 63 |
2 files changed, 21 insertions, 68 deletions
diff --git a/src/parisc/b160l.h b/src/parisc/b160l.h index 9072120..d53e7be 100644 --- a/src/parisc/b160l.h +++ b/src/parisc/b160l.h @@ -129,7 +129,7 @@ static struct pdc_iodc iodc_data_hpa_fff8c000 = { static struct pdc_system_map_mod_info mod_info_hpa_ffd00000 = { .mod_addr = 0xffd00000, .mod_pgs = 0x1, - .add_addrs = 0, // x2, + .add_addrs = 0x2, }; static struct pdc_module_path mod_path_hpa_ffd00000 = { .path = { .flags = 0x0, .bc = { 0xff, 0xff, 0xff, 0xff, 0xff, 0x8 }, .mod = 0x10 }, @@ -150,7 +150,7 @@ static struct pdc_iodc iodc_data_hpa_ffd00000 = { .length = 0x0000, /* pad: 0x0000, 0x0000 */ }; -#define HPA_ffd00000_num_addr 0 // 2 +#define HPA_ffd00000_num_addr 2 #define HPA_ffd00000_add_addr 0xffd0c000, 0xffc00000, #define HPA_ffd05000_DESCRIPTION "Merlin 160 Core RS-232" @@ -241,7 +241,7 @@ static struct pdc_iodc iodc_data_hpa_ffd07000 = { static struct pdc_system_map_mod_info mod_info_hpa_ffd02000 = { .mod_addr = 0xffd02000, .mod_pgs = 0x1, - .add_addrs = 0, // 2, + .add_addrs = 0x2, }; static struct pdc_module_path mod_path_hpa_ffd02000 = { .path = { .flags = 0x0, .bc = { 0xff, 0xff, 0xff, 0xff, 0x8, 0x10 }, .mod = 0x0 }, @@ -262,7 +262,7 @@ static struct pdc_iodc iodc_data_hpa_ffd02000 = { .length = 0x0000, /* pad: 0x0000, 0x0000 */ }; -#define HPA_ffd02000_num_addr 0 // 2 +#define HPA_ffd02000_num_addr 2 #define HPA_ffd02000_add_addr 0xffd01000, 0xffd03000, #define HPA_ffd04000_DESCRIPTION "Merlin 160 Core Audio" @@ -409,7 +409,7 @@ static struct pdc_iodc iodc_data_hpa_f4000000 = { static struct pdc_system_map_mod_info mod_info_hpa_f8000000 = { .mod_addr = LASI_GFX_HPA, .mod_pgs = 0x2000, - .add_addrs = 0, // 1, + .add_addrs = 0x1, }; static struct pdc_module_path mod_path_hpa_f8000000 = { .path = { .flags = 0x0, .bc = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, .mod = 0x1 }, @@ -608,12 +608,6 @@ static struct pdc_iodc iodc_data_hpa_fff81000 = { .mod_path = &mod_path_hpa_f8000000,\ .num_addr = HPA_f8000000_num_addr,\ .add_addr = { HPA_f8000000_add_addr } },\ - { .hpa = MEMORY_HPA,\ - .iodc = &iodc_data_hpa_fffbf000,\ - .mod_info = &mod_info_hpa_fffbf000,\ - .mod_path = &mod_path_hpa_fffbf000,\ - .num_addr = HPA_fffbf000_num_addr,\ - .add_addr = { HPA_fffbf000_add_addr } },\ { .hpa = 0xfff81000,\ .iodc = &iodc_data_hpa_fff81000,\ .mod_info = &mod_info_hpa_fff81000,\ @@ -627,3 +621,13 @@ static struct pdc_iodc iodc_data_hpa_fff81000 = { .num_addr = HPA_fff10000_num_addr,\ .add_addr = { HPA_fff10000_add_addr } },\ { 0, } + +#if 0 + { .hpa = MEMORY_HPA,\ + .iodc = &iodc_data_hpa_fffbf000,\ + .mod_info = &mod_info_hpa_fffbf000,\ + .mod_path = &mod_path_hpa_fffbf000,\ + .num_addr = HPA_fffbf000_num_addr,\ + .add_addr = { HPA_fffbf000_add_addr } },\ + +#endif diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index c223161..c90902d 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -855,56 +855,19 @@ static int compare_module_path(struct pdc_module_path *path, } /* add index number to all devices */ -static int add_index(unsigned long parent, unsigned int bc, signed char *search, int len) -{ - hppa_device_t *dev; - int i, index = 0; - - for (i = 0; i < (MAX_DEVICES-1); i++) { - dev = parisc_devices + i; - if (!dev->hpa) - continue; - if (0) - dprintf(1, "%d: device HPA %lx %s bc=%d ist %d %d\n", bc, dev->hpa, - hpa_name(dev->hpa),dev->mod_path->path.bc[bc], - dev->mod_path->path.bc[bc], dev->mod_path->path.bc[bc-1]); - if (dev->mod_path->path.bc[bc-1] != -1) - continue; - if (memcmp(&dev->mod_path->path.bc[bc], search, len) != 0) - continue; - dev->index = index; - if (1) - dprintf(1, "device HPA %lx %s is index # %d\n", dev->hpa, hpa_name(dev->hpa), index); - dev->hpa_parent = parent; - dev->num_addr = add_index(dev->hpa, bc-1, &dev->mod_path->path.bc[bc], len+1); - dev->mod_info->add_addrs = dev->num_addr; - index++; - } - return index; -} - -/* add index number to all devices */ static hppa_device_t *add_index_all_devices(void) { hppa_device_t *dev; - int i, index = 0, bc = 5; + int i, index = 0; for (i = 0; i < (MAX_DEVICES-1); i++) { dev = parisc_devices + i; - // keep all devices as main devices on astro... - if (0 && !has_astro && dev->mod_path->path.bc[bc] != -1) - continue; - // dprintf(1, "device HPA %lx %s \n", dev->hpa, hpa_name(dev->hpa)); dev->index = index; if (0) dprintf(1, "device HPA %lx %s is index # %d\n", dev->hpa, hpa_name(dev->hpa), index); dev->hpa_parent = 0; - if (1 || has_astro) - dev->num_addr = 0; - else - dev->num_addr = add_index(dev->hpa, bc, &dev->mod_path->path.mod, 1); - dev->mod_info->add_addrs = dev->num_addr; + dev->num_addr = dev->mod_info->add_addrs; index++; } @@ -1960,7 +1923,6 @@ static int pdc_system_map(unsigned int *arg) unsigned long *result = (unsigned long *)ARG2; struct pdc_module_path *mod_path; hppa_device_t *dev; - unsigned long hpa; unsigned long hpa_index; // dprintf(0, "\n\nSeaBIOS: Info: PDC_SYSTEM_MAP function %ld ARG3=%x ARG4=%x ARG5=%x\n", option, ARG3, ARG4, ARG5); @@ -1970,7 +1932,6 @@ static int pdc_system_map(unsigned int *arg) dev = find_hppa_device_by_index(0, hpa_index, 0); /* root devices */ if (!dev) return PDC_NE_MOD; // Module not found - hpa = dev->hpa; if (0) { dprintf(1, "PDC_FIND_MODULE dev=%p hpa=%lx ", dev, dev ? dev->hpa:0UL); @@ -2001,23 +1962,11 @@ static int pdc_system_map(unsigned int *arg) if (!dev) return PDC_NE_MOD; // Module not found ARG4 -= 1; - // if (ARG4 >= dev->num_addr) return PDC_INVALID_ARG; - dev = find_hppa_device_by_index(dev->hpa, ARG4, 0); /* root devices */ - if (!dev) - return PDC_NE_MOD; // Module not found - hpa = dev->hpa; - - if (0) { - dprintf(1, "PDC_FIND_ADDRESS dev=%p hpa=%lx ", dev, dev ? dev->hpa:0UL); - print_mod_path(dev->mod_path); - if (dev->pci) - dprintf(1, "PCI %pP ", dev->pci); - dprintf(1, "\n"); - } - + if (ARG4 >= dev->num_addr) + return PDC_INVALID_ARG; memset(result, 0, 32*sizeof(long)); - result[0] = dev->hpa; // dev->add_addr[ARG4]; - result[1] = HPA_is_graphics_device(hpa) ? GFX_NUM_PAGES : 1; + result[0] = dev->add_addr[ARG4]; + result[1] = HPA_is_graphics_device(dev->hpa) ? GFX_NUM_PAGES : 1; return PDC_OK; case PDC_TRANSLATE_PATH: |