<html><body>
<p><tt>On Tue, 2006-01-31 at 08:08 -0700, Tom Rini wrote:<br>
></tt><tt><i> On Tue, Jan 31, 2006 at 02:53:11PM +1100, Benjamin Herrenschmidt wrote:<br>
</i></tt><tt>></tt><tt><i> > Well, the RTC problem definitely looks like a bogus or lack of "ranges"<br>
</i></tt><tt>></tt><tt><i> > property or the fact that the parser doesn't recognize "ht" as a PCI<br>
</i></tt><tt>></tt><tt><i> > bus. You may want to try updating prom_parse.c to treat "ht" as a PCI<br>
</i></tt><tt>></tt><tt><i> > bus and see if that helps.<br>
</i></tt><tt>></tt><tt><i> <br>
</i></tt><tt>></tt><tt><i> With the following, I get parent bus is pci now, but still:<br>
</i></tt><tt>></tt><tt><i> OF: ** translation for device /</i></tt><a href="https://ozlabs.org/mailman/listinfo/linuxppc64-dev"><tt><i><u><font color="#0000FF">ht at 0</font></u></i></tt></a><tt><i>/</i></tt><a href="https://ozlabs.org/mailman/listinfo/linuxppc64-dev"><tt><i><u><font color="#0000FF">isa at 4</font></u></i></tt></a><tt><i>/</i></tt><a href="https://ozlabs.org/mailman/listinfo/linuxppc64-dev"><tt><i><u><font color="#0000FF">rtc at 900</font></u></i></tt></a><tt><i> **<br>
</i></tt><tt>></tt><tt><i> OF: bus is isa (na=2, ns=1) on /</i></tt><a href="https://ozlabs.org/mailman/listinfo/linuxppc64-dev"><tt><i><u><font color="#0000FF">ht at 0</font></u></i></tt></a><tt><i>/</i></tt><a href="https://ozlabs.org/mailman/listinfo/linuxppc64-dev"><tt><i><u><font color="#0000FF">isa at 4</font></u></i></tt></a><tt><i><br>
</i></tt><tt>></tt><tt><i> OF: translating address: 00000001 00000900<br>
</i></tt><tt>></tt><tt><i> OF: parent bus is pci (na=3, ns=2) on /</i></tt><a href="https://ozlabs.org/mailman/listinfo/linuxppc64-dev"><tt><i><u><font color="#0000FF">ht at 0</font></u></i></tt></a><tt><i><br>
</i></tt><tt>></tt><tt><i> OF: walking ranges...<br>
</i></tt><tt>></tt><tt><i> OF: not found !<br>
</i></tt><tt>></tt><tt><i> Maple: Unable to translate RTC address<br>
</i></tt><tt>></tt><tt><i> Maple: No device node for RTC, assuming legacy address (0x70)</i></tt><tt><i><font size="4"><br>
</font></i></tt><br>
For the record, changing the ISA ranges property does correct the problem translating the addresses for the devices hanging off that bus<br>
<br>
Old:<br>
<font face="Courier New"> /isa@4</font><br>
<font face="Courier New">        ...</font><br>
<font face="Courier New">>> ranges = 00000001 f4000000 00010000</font><br>
<br>
<br>
New:<br>
<tt> /isa@4</tt><br>
<tt>        ...</tt><br>
<tt>>> ranges = 00000001 00000000 f4000000 00000000 00000000 00010000</tt><br>
<br>
<br>
<tt>Output w/ ISA range property change only:</tt><br>
<tt>...</tt><br>
<tt>OF: ** translation for device /ht@0/isa@4/rtc@900 **</tt><br>
<tt>OF: bus is isa (na=2, ns=1) on /ht@0/isa@4</tt><br>
<tt>OF: translating address: 00000001 00000900</tt><br>
<tt>OF: parent bus is default (na=3, ns=2) on /ht@0</tt><br>
<tt>OF: walking ranges...</tt><br>
<tt>OF: ISA map, cp=0, s=10000, da=900</tt><br>
<tt>OF: parent translation for: f4000000 00000000 00000000</tt><br>
<tt>OF: with offset: 900</tt><br>
<tt>OF: one level translation: 00000000 00000000 00000900</tt><br>
<tt>OF: parent bus is default (na=2, ns=2) on /</tt><br>
<tt>OF: walking ranges...</tt><br>
<tt>OF: default map, cp=0, s=400000, da=900</tt><br>
<tt>OF: parent translation for: 00000000 f4000000</tt><br>
<tt>OF: with offset: 900</tt><br>
<tt>OF: one level translation: 00000000 f4000900</tt><br>
<tt>OF: reached root node</tt><br>
<tt>Maple: Found RTC at IO 0x900</tt><br>
<tt>...</tt><br>
<br>
<tt>Fixes similar issues w/ other devices on the bus as well.</tt><br>
<br>
<tt>Note Ben - it looks like adding "ht" as a match in of_bus_pci_match() doesn't help matters -</tt><br>
<br>
<tt>Output w/ ISA range property change and adding "ht" as match in of_bus_pci_match():</tt><br>
<tt>OF: of_bus_pci_match with ht</tt><br>
<tt>OF: ** translation for device /ht@0/isa@4/rtc@900 **</tt><br>
<tt>OF: of_bus_pci_match with ht</tt><br>
<tt>OF: bus is isa (na=2, ns=1) on /ht@0/isa@4</tt><br>
<tt>OF: translating address: 00000001 00000900</tt><br>
<tt>OF: of_bus_pci_match with ht</tt><br>
<tt>OF: parent bus is pci (na=3, ns=2) on /ht@0</tt><br>
<tt>OF: walking ranges...</tt><br>
<tt>OF: ISA map, cp=0, s=10000, da=900</tt><br>
<tt>OF: parent translation for: f4000000 00000000 00000000</tt><br>
<tt>OF: with offset: 900</tt><br>
<tt>OF: one level translation: f4000000 00000000 00000900</tt><br>
<tt>OF: of_bus_pci_match with ht</tt><br>
<tt>OF: parent bus is default (na=2, ns=2) on /</tt><br>
<tt>OF: walking ranges...</tt><br>
<tt>OF: not found !</tt><br>
<tt>Maple: Unable to translate RTC address</tt><br>
<tt>Maple: No device node for RTC, assuming legacy address (0x70)</tt><br>
<br>
Updating the range property can be done via the EPOS(/PIBS for more recent versions) shell using this function:<br>
<br>
of_change_property(char *nodename, char *propname, char* prop, size_t len)<br>
<br>
As an example:<br>
<br>
PIBS $ int val=malloc(24)<br>
PIBS $ int *p=val<br>
PIBS $ *p=0x0000000100000000<br>
PIBS $ p+=1<br>
PIBS $ *p=0xf400000000000000<br>
PIBS $ p+=8         # Note - there appears to be an anomoly in my PIBS version where ptr arith is only done for the<br>
                        # first addition - check your values using "print p"<br>
PIBS $ *p=0x0000000000010000<br>
PIBS $ of_change_property("/ht/isa", "ranges", val, 24)<br>
<br>
Note also - this range definition does appear to be compatible with older kernels (I booted a 2.6.10 based image w/ no obvious problems) <br>
<br>
Steve Winiecki<br>
<br>
</body></html>