lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 24 Mar 2020 15:47:10 +0100
From:   Lukas Wunner <lukas@...ner.de>
To:     Marek Vasut <marex@...x.de>
Cc:     Andrew Lunn <andrew@...n.ch>, netdev@...r.kernel.org,
        "David S . Miller" <davem@...emloft.net>,
        Petr Stetiar <ynezz@...e.cz>,
        YueHaibing <yuehaibing@...wei.com>
Subject: Re: [PATCH 07/14] net: ks8851: Use 16-bit writes to program MAC
 address

On Tue, Mar 24, 2020 at 02:09:18PM +0100, Marek Vasut wrote:
> I have a feeling this whole thing might be more messed up then we
> thought. At least the KS8851-16MLL has an "endian mode" bit in the CCR
> register, the SPI variant does not.

On the MLL variant of this chip, pin 10 can be pulled up to force it
into big endian mode, otherwise it's in little-endian mode.  Obviously
this should be configured by the board designer such that it matches
the CPU's endianness.

Of course we *could* support inverted endianness in case the hardware
engineer botched the board layout.  Not sure if we have to.

In the CCR register that you mention, you can determine whether the
pin is pulled up or not.  If it is in big-endian mode and you're
on a little-endian CPU, you're hosed and the only option that you've
got is to invert endianness in software, i.e. in the accessors.

If the pin is pulled to ground or not connected (again, can be
determined from CCR) then you're able to switch the endianness by
setting bit 11 in the RXFDPR register.  No need to convert it in
the accessors in this case.

Thanks,

Lukas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ