Skip to contentSkip to conversation

STI Rom address location

parisc-linux John Marvin 2 participants 2 messages Dec 13, 2000

lore
Share & tools
lore
#0 lore raw
Quoted 1 line

Hi Matt, and Hi STI god ;-)

Matt forwarded this to me, although I am not the "STI god" that he mentioned. However, I do know the answer to the problem you are having, since at one time I worked on the graphics driver for HP-UX. I am sending this to parisc-linux also, since I believe the answer is probably of interest to others, and it may be worthwhile discussing the appropriate solution to finding the STI rom in this case.

Quoted 9 lines

i can't find the sti rom on my B132/B180

well, unlike the 712,715 and 725, the address is not in the pdc. I tested it: PAGE0->0x604 == NULL

for sgc and gsc based graphic cards, the sti rom has to be available at the base hpa, which can be one of those addresses: 0xf4000000, 0xf6000000, 0xf8000000, or 0xfa000000.

With one exception, the sti rom for non PCI graphics cards can be found at the base hpa (note that for HP PCI graphics cards, the sti rom can be found in the extension rom). The one exception is for "Artist" graphics hardware. Artist graphic hardware has a sversion of 0x85, and can be found in a quite a few machines that were made in the Gecko -> B180 timeframe (you can look them up in the hardware database in hardware.c).

Artist graphics hardware was a low cost graphics solution, and the hardware folks decided not to have a separate rom for sti. Instead, the sti code was placed into the system's pdc firmware. On the first machines to have Artist hardware, e.g. Gecko, the address of the sti "rom" was stored at location 0x604 on the zero page. This was considered a hack, and another architected solution was designed. Newer machines implement the PDC_SYSTEM_MAP pdc call. In most cases, each fixed module has one entry in the system map, however this is not always the case. There is provision for modules that have discontiguous address ranges. The first system map entry will be for the hpa. If there are additional address ranges the "add_addrs" field in "struct pdc_system_map" will be non-zero. The "add_addrs" field will be non-zero for each entry except for the last one, where the "add_addrs" field will be zero. For Artist graphics, the first entry will contain the hpa in the mod_addr field. IF the add_addrs field is non-zero, THEN the second entry (i.e. the result from a call to PDC_SYSTEM_MAP with the next index value) will contain the address of the sti rom in the mod_addr field.

Note that address 0x604 on page zero is not reserved specifically for the Artist graphics sti rom address. You should only check the contents at 0x604 if the above check fails, i.e. if PDC_SYSTEM_MAP is not implemented, or the add_addrs field for the entry containing the hpa of the Artist hardware is zero.

Here is some pseudo code for the proper algorithm for finding the sti-rom for non PCI graphics cards:

IF sversion != 0x85:
Use base hpa
ELSE:
IF PDC_SYSTEM_MAP pdc call is implemented, and add_addrs field of entry containing hpa of artist graphics hardware is non zero:

Use mod_addr field from next index in system map.
ELSE:
Use address stored at location 0x604 on page zero.

Anyway, our current implementation doesn't appear to handle multiple entries for the same module in the system map, i.e. it calls register_module for every entry, and just silently drops entries that pdc_iodc_read doesn't acknowledge as a hardware device. So, some rearchitecting should be done to correctly support this. For a quick hack you can probably write your own loop calling pdc_system_map_find_mods (see code in do_newer_workstation_inventory).

John Marvin
[email protected]

#1 lore raw

Hi, thanks for your help, but there are still some pbs...

Quoted 8 lines

IF the
add_addrs field is non-zero, THEN the second entry (i.e. the result from a call to PDC_SYSTEM_MAP with the next index value) will contain the address of the sti rom in the mod_addr field.

For a quick
hack you can probably write your own loop calling pdc_system_map_find_mods (see code in do_newer_workstation_inventory).

To get familiar with pdc_system_map_find_mods, I modified do_newer_workstation_inventory (in inventory.c) like this:

printk("a newer box...\n");
for(i=0, status=PDC_RET_OK; status != PDC_RET_NE_PROC &&

                            status != PDC_RET_NE_MOD ;i++) {
	printk("--- %s: index is set to %i\n",__FUNCTION__,i);
        status =
pdc_system_map_find_mods(&module_result,&module_path,i);
        if (status == PDC_RET_OK) {
	        printk("--- %s: mod_addr is 0x%08x, add_addrs is 0x%08x \n",
__FUNCTION__,module_result.mod_addr,module_result.add_addrs);
                num++;
                register_module(module_result.mod_addr);
        }
        else printk("--- %s: status returned is not PDC_RET_OK\n");
}

This kernel runs on the B132, dmesg gives me this:

a newer box...
--- do_newer_workstation_inventory: index is set to 0
--- do_newer_workstation_inventory: mod_addr is 0xffc00000, add_addrs is 0x00000000
[... useless info removed ...]
--- do_newer_workstation_inventory: index is set to 11
--- do_newer_workstation_inventory: mod_addr is 0xf8000000, add_addrs is 0x00000001
--- do_newer_workstation_inventory: index is set to 12
--- do_newer_workstation_inventory: mod_addr is 0xfff80000, add_addrs is 0x00000001
--- do_newer_workstation_inventory: index is set to 13
--- do_newer_workstation_inventory: status returned is not PDC_RET_OK Found devices:
1. Phantom PseudoBC GSC+ Port (7) at 0xffc00000, versions 0x504, 0x0, 0x0, 0x0, 0x0
2. Merlin+ 132 Dino RS-232 (10) at 0xfff83000, versions 0x22, 0x0, 0x8c, 0x0, 0x0
3. Merlin L2+ 132 (9000/778/B132L) (0) at 0xfffbe000, versions 0x503, 0x0, 0x4, 0x0, 0x81
4. Merlin+ L2 132 (1) at 0xfffbf000, versions 0x61, 0x0, 0x9, 0x0, 0x0
5. Merlin+ 132 Core BA (11) at 0xffd00000, versions 0x3e, 0x0, 0x81, 0x0, 0x0
6. Merlin+ 132 Core RS-232 (10) at 0xffd05000, versions 0x3e, 0x0, 0x8c, 0x0, 0x0
7. Merlin+ 132 Core SCSI (10) at 0xffd06000, versions 0x3e, 0x0, 0x82, 0x0, 0x0
8. Merlin+ 132 Core Centronics (10) at 0xffd02000, versions 0x3e, 0x0, 0x74, 0x0, 0x0
9. Merlin+ 132 Core Audio (10) at 0xffd04000, versions 0x3e, 0x4, 0x7b, 0x0, 0x0
10. Merlin+ 132 Core PC Keyboard (10) at 0xffd08000, versions 0x3e, 0x0, 0x84, 0x0, 0x0
11. Merlin+ 132 Core PC Keyboard (10) at 0xffd08100, versions 0x3e, 0x0, 0x84, 0x0, 0x0
12. Gecko GSC Core Graphics (10) at 0xf8000000, versions 0x16, 0x0, 0x85, 0x0, 0x0
13. Dino PCI Bridge (13) at 0xfff80000, versions 0x680, 0x3, 0xa, 0x0, 0x0
That's a total of 13 devices.

As we can see, when mod_addr is 0xf8000000, the add_addrs is not zero, that's fine with your explanation.
the problem is that when I increment index (i=12) I get a mod_addr that points to the Dino PCI Bridge, and still not to the STI ROM. I had a look at 0xfff80000, just to be sure, and it doesn't seem to be my rom (the 8 first bytes are zeroes).

btw, all info I've found about PDC_SYSTEM_MAP was in pdc.pdf, just telling about the existence of such a procedure in chapter 2.2, but there's no more info about it (while ALL other procedures are explained in this book). This is just to get explained about the pdc_system_map_find_mods params.

Any idea?

Thanks for your help!
Xavier

ESIEE Team.