[Prism54-devel] prism54 on powerpc working with small patch

Herbert Valerio Riedel hvr@hvrlab.org
Sat, 01 Nov 2003 20:56:02 +0100


--=-73cJTxdhcvphTIwb1BcE
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Sat, 2003-11-01 at 18:45, Harald Welte wrote:
> On Sat, Nov 01, 2003 at 05:25:42PM +0100, Herbert Valerio Riedel wrote:
> > On Sat, 2003-11-01 at 16:49, Harald Welte wrote:
> > I'm quite sure it wouldn't work; quite a few 32/16bit write/read's
> > to/from ioremap'ed memory are performed in host horder... :-/

> It seems to be better than you thought. It's running now, without any
well yes... but yet, the code isn't as portable as it should, the way it
accesses the mmio space... so I expected the worst :-)

> problems (Allnet AL0277 basestation, similar to Linksys WRT54G, no WEP).
great :-)

> > but you're a welcome tester and you've motivated me to give this issue =
a
> > higher priority... expect some of the next cvs commits to be related to
> > portability :-)
> Please see the attached patch.  It has two hunks, one of them just fixes
> debug statements, and the other one is a one-line 'fix'.

> This needs more discussion.  Why are you converting cpu_to_le32() the
> buffer value?  Assuming the driver was written on x86, it doesn't make
> sense, since cpu =3D=3D le32
well, yes... that's just a typo... wonder who introduced it in the first
place; it's just the address of the struct obj_buffer holding the
address and length of the real psm buffer... which is correctly
initialized with little endian encoding at the beginning of the function

> On ppc it does actually the byte-swap _and_ doesn't work, the oops was
> related to that statement.


> If I'm not mistaken, the code tries to put the 32bit address of the psm
> buffer into a command frame for the intersil chip.  The intersil chip
> will see this address from the pci bus perspective.

the intersil chip expects the address in little endian encoding always
btw... and the PCI bus is little endian specified in most ppc's...
=20
> The pci bus can have a different view of the world than the host cpu,
> but that's hidden behind the pci API.  sinec psm_buffer is derived from
> device_host_address, which is in turn returned by pci_alloc_consistent,
> I don't think you need to do any conversion at that point.

the conversion is just needed when we cross the pci bus... and that's
being done...=20

...but anyway, the typo was much simpler than that :-)

ps: do you use the snapshots or cvs for keeping uptodate?
--=20
Herbert Valerio Riedel       /    Phone: (EUROPE) +43-1-58801-18840
Email: hvr@hvrlab.org       /    Finger hvr@gnu.org for GnuPG Public Key
GnuPG Key Fingerprint: 7BB9 2D6C D485 CE64 4748  5F65 4981 E064 883F 4142

--=-73cJTxdhcvphTIwb1BcE
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA/pA/RSYHgZIg/QUIRApYvAJ4vGMmyP39vUlS27U4NPxrDYB4BsgCgj2iL
+X+H6+QB+o3RlGFEaILnWQk=
=KS90
-----END PGP SIGNATURE-----

--=-73cJTxdhcvphTIwb1BcE--