Thread (18 messages) 18 messages, 6 authors, 2015-10-27
STALE3885d

[PATCH v13 5/5] uart: pl011: Add support to ZTE ZX296702 uart

From: andre.przywara@arm.com (Andre Przywara)
Date: 2015-10-26 14:42:23
Also in: linux-serial

Hi,

On 26/10/15 14:07, Timur Tabi wrote:
Andre Przywara wrote:
quoted
Yeah, I was interested in that scenario too, because the SBSA spec
actually speaks of 32-bit registers and vendors may implement it
strictly as that. Still waiting for actual failure reports on this
before I wanted to push a fix, though.
What do you mean by failure reports?  Our hardware generates an SError
if you try to access the PL011 registers with 8-bit or 16-bit reads or
writes.
I meant that if some hardware does not work with an upstream kernel, I'd
expect some kind of failure report or a patch on the public mailing
list. I may have missed it, but I couldn't find anything on the list so far.

As mentioned earlier, I didn't want to change code without good reasons,
that's why I was waiting for people to scream.

So I just take this as a scream, then ;-)

Can you elaborate on that? Is your UART a PL011 one (using the arm,pl011
DT binding or AMBA ID registers) or are you using the SBSA subset only?
Is there some means to identify this particular UART?
quoted
quoted
We have an internal patch
that replaces all of the read/write routines with vendor function calls.
  I would need to refactor our patch on top of yours.
But wouldn't Jun's patch address this more easily, because it wraps
every call already? TBH I found this change the most interesting.
Yes, but I think it changes a lot of things unnecessarily, like the
register names.
Which is unfortunate, but cannot be changed anymore. And as much as I
dislike this myself, I guess we cannot ignore this hardware just because
it doesn't go easily with our driver code. So instead of having just
another driver which is strikingly similar, I'd rather have this in the
one-and-only PL011 driver which is much less subject to bit-rot.

So my idea here was to split Jun's series into introducing the
readl/writel wrappers first, and adding the register address mangling on
top of that. Given that those changed register addresses seem to be a
mishap to me, we could just get away with a ZTE specific translate
function, which takes a PL011 register number and returns the actual
register offset to use. That isn't very generic, but would hide this
ugliness without spoiling the whole driver.

So both you and me could benefit from the wrapper functions already,
while Jun has some patches less to care about.

Cheers,
Andre.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help