Port-macppc archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Typo in if_wi_obio.c?
Hi,
I think there is a typo in src/sys/arch/macppc/dev/if_wi_obio.c, in-
troduced when the driver was bus-spacified.
In bus_space_map() it hardcodes the address "0x8000000" (six zeros),
i.e, 0x08000000, instead of 0x80000000 (seven zeros) which is the
correct base address.
The address was correct in the last revision before bus-spacification.
From -current revision 1.17:
87 void
88 wi_obio_attach(struct device *parent, struct device *self, void *aux)
89 {
[...]
98 bus_space_map(sc->sc_tag, 0x8000000, 0x20000, 0, &sc->sc_bsh);
^^^^^^^^^
wrong
99 bus_space_subregion(sc->sc_tag, sc->sc_bsh, 0x40, 4,
&sc->sc_fcr2h);
100 bus_space_subregion(sc->sc_tag, sc->sc_bsh, 0x6a, 16,
&sc->sc_gpioh);
101 bus_space_subregion(sc->sc_tag, sc->sc_bsh, 0x58, 16,
&sc->sc_extint_gpioh);
--
From revision 1.13 (before bus-spacification):
126 int
127 wi_obio_enable(sc)
128 struct wi_softc *sc;
129 {
130 const u_int keywest = 0x80000000; /* XXX */
^^^^^^^^^^
OK
131 const u_int fcr2 = keywest + 0x40;
132 const u_int gpio = keywest + 0x6a;
133 const u_int extint_gpio = keywest + 0x58;
So the fix would be to correct the address adding the missing zero.
Maybe it should be using 'ca->ca_baseaddr' to avoid typos when hard-
coding addresses ?
Regards,
Marco.
Home |
Main Index |
Thread Index |
Old Index