booting-without-of: add Xilinx uart 16550.
PATCH 1/1 booting-without-of: add Xilinx uart 16550.
Add uart 16550 properties description to Xilinx portion of booting-without-of.txt
--- Documentation/powerpc/booting-without-of.txt | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-)
Documentation/powerpc/booting-without-of.txt +14 -2
@@ -2575,10 +2575,22 @@ platforms are moved over to use the flattened-device-tree model. Xilinx uartlite devices are simple fixed speed serial ports. - Requred properties: + Required properties: - current-speed : Baud rate of uartlite - v) Xilinx hwicap + v) Xilinx Uart 16550 + + Xilinx uart 16550 device registers are compatible with all standard 16540 + and 16550 UARTs. + + Required properties: + - current-speed : Baud rate of uart. + - clock-frequency : Baud rate generator reference clock. May be driven + by OPB_Clk (100 MHz). + - reg-shift : registers offset shift (standard uart_port field). + Property is optional if regshift is zero. + + vi) Xilinx hwicap Xilinx hwicap devices provide access to the configuration logic of the FPGA through the Internal Configuration Access Port
Signature · 1 line
1.5.4.1
Quoted 2 lines
+ - reg-shift : registers offset shift (standard
uart_port
field).
Quoted 1 line
+ Property is optional if regshift is zero.
I was hoping to get an idea of what is required here, or when I might use it?
It looks like the ARCH=3Dppc code instantiates this with a reg-shift of 2... Is this the expected value? When would it be not zero? or not two?
Steve
Quoted 9 lines · Stephen Neuendorffer
Quoted 1 line
+ - reg-shift : registers offset shift (standard
uart_portfield).
Quoted 1 line
+ Property is optional if regshift is zero.
I was hoping to get an idea of what is required here, or when I might use it?
It looks like the ARCH=ppc code instantiates this with a reg-shift of 2... Is this the expected value?
Yes, reg-shift = 2 should be set for Xilinx 16550 uart. Should I add this to patch?
BTW regshift=2 is hardcoded for uartlite.
Quoted 2 lines
When would it be not zero? or not
two?
Sorry, it seems I don't follow here.
--
Regards,
Pavel
Quoted 15 lines
-----Original Message-----
From: Pavel Kiryukhin [mailto:[email protected]]
Sent: Friday, February 15, 2008 9:41 AM
To: Stephen Neuendorffer
Cc: [email protected]
Subject: Re: [PATCH] booting-without-of: add Xilinx uart 16550. =20Quoted 5 lines · Stephen Neuendorffer
Quoted 1 line
+ - reg-shift : registers offset shift (standard
uart_portfield).
Quoted 1 line
+ Property is optional if regshift is zero.
I was hoping to get an idea of what is required here, or when I
might
Quoted 3 lines
Quoted 3 lines
use it?
It looks like the ARCH=3Dppc code instantiates this with a reg-shift
of
Quoted 4 lines
Quoted 1 line
2... Is this the expected value?
=20
Yes, reg-shift =3D 2 should be set for Xilinx 16550 uart. Should I add this to patch?
Yes, please!
=20
Quoted 5 lines
BTW regshift=3D2 is hardcoded for uartlite.
=20Quoted 2 lines
When would it be not zero? or not
two?Sorry, it seems I don't follow here.
I think all that needs to get added is 'For the Xilinx uart 16550 cores, reg-shift must be set to 2'
Steve
Quoted 1 line · Pavel Kiryukhin pkiryukhin
Add uart 16550 properties description to Xilinx portion of booting-without-of.txt
This patch description is a bit weak. How about adding what properties are being added. Also, as described below, it's going to become more than just adding a property.
Quoted 28 lines
Signed-off-by Pavel Kiryukhin <pkiryukhin at ru.mvista.com>--- Documentation/powerpc/booting-without-of.txt | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-)Documentation/powerpc/booting-without-of.txt +0
-0@@ -2575,10 +2575,22 @@ platforms are moved over to use theflattened-device-tree model.
Xilinx uartlite devices are simple fixed speed serial ports.
Documentation/powerpc/booting-without-of.txt +4
-2- Requred properties: + Required properties: - current-speed : Baud rate of uartlite - v) Xilinx hwicap + v) Xilinx Uart 16550 + + Xilinx uart 16550 device registers are compatible with allstandard 16540
Documentation/powerpc/booting-without-of.txt +5
-0+ and 16550 UARTs. + + Required properties: + - current-speed : Baud rate of uart. + - clock-frequency : Baud rate generator reference clock. May
Quoted 2 lines
be driven
+ byOPB_Clk(100 MHz).
Freqency of the reference clock generating the baud rate. (Sometimes this is connected to the OBP_Clk which is usually 100MHz). This is not the documentation for the macro, its the documentation for the device tree.
Quoted 3 lines
+ - reg-shift : registers offset shift (standard
uart_port
field).
+ Property is optional if regshift is zero.
As Steven said, you must define what the property means (don't say that the value should be 2 on chip x, describe how to determine the correct value and how to use it). "When this property is present, the address bits selecting the different 16550 registers are shifted left this many bits."
Also, since this is not register compatible with previous the previous ns16550 binding, we need to use a new compatible string. ns16550-shifted or ns16550-offset would be ok with me. When we define this node, refer to 16550, and state that we expect nodes that have a zero shfit should include the ns16550 string.
Looking in the bigger context, this binding is not Xilinx specific; but I don't see an obviousy better place and am not going to do more than mention that issue.
milton
Quoted 19 lines · Pavel Kiryukhin
Add uart 16550 properties description to Xilinx portion of booting-without-of.txt
Signed-off-by Pavel Kiryukhin <[email protected]>---
Documentation/powerpc/booting-without-of.txt | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-)diff --git
a/Documentation/powerpc/booting-without-of.txtb/Documentation/powerpc/booting-without-of.txtindex 7b4e8a7..dd77bbc 100644
---a/Documentation/powerpc/booting-without-of.txt
+++b/Documentation/powerpc/booting-without-of.txt
@@ -2575,10 +2575,22 @@ platforms are moved over to use the flattened-device-tree model.Xilinx uartlite devices are simple fixed speed serial ports.
- Requred properties:
+ Required properties:
- current-speed : Baud rate of uartlite
Quoted 5 lines
- v) Xilinx hwicap
+ v) Xilinx Uart 16550
+
+ Xilinx uart 16550 device registers are compatible with all standard 16540
+ and 16550 UARTs.
Not strictly true; the xilinx uart is *almost* compatible with the ns16550. The same driver can be made to work, but it is not register level compatible so we cannot claim compatible="ns16550". We need a new compatible property for 16550 like devices with a reg shift and offset. Instead of attempting to come up with a generic description of this, I recommend just naming it after the actual device instance; something like compatible="xlnx,opb-uart16550";
Cheers,
g.
Quoted 19 lines · Grant Likely
Quoted 19 lines
Add uart 16550 properties description to Xilinx portion of booting-without-of.txt
Signed-off-by Pavel Kiryukhin <[email protected]>--- Documentation/powerpc/booting-without-of.txt | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-)Documentation/powerpc/booting-without-of.txt +1
-1@@ -2575,10 +2575,22 @@ platforms are moved over to use the flattened-device-tree model. Xilinx uartlite devices are simple fixed speed serial ports. - Requred properties: + Required properties: - current-speed : Baud rate of uartlite
Quoted 10 lines
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2584
Quoted 5 lines
Documentation/powerpc/booting-without-of.txt +4
-1- v) Xilinx hwicap + v) Xilinx Uart 16550 + + Xilinx uart 16550 device registers are compatible with all standard 16540 + and 16550 UARTs.Not strictly true; the xilinx uart is *almost* compatible with the ns16550. The same driver can be made to work, but it is not register level compatible so we cannot claim compatible="ns16550".
How much incompatible it is with 16550? Does that only extend to register
stride of 4 instead of 1 -- if so, it should be considered compatible since
the same chip can be into address space mapped with stride of 1, 2, or 4, or whatever power of 2. If it has some actual register difference, like e. g. DLAB not existing and the divisor latch mapped to a separate register rather than 0..1, then indeed, new compatible property must be defined.
Quoted 2 lines
We need a new compatible property for 16550 like devices with a reg shift and offset.
No, we don't strictly need it if all incompatibilty is constrained to how
the same 16550 registers mapped to address space which is a function of the address decoder, not the chip itself. Well, that's of course based in 8250.c's ability to handle different strides -- an imaginary driver could only handle 1:1 chip mapping.
Quoted 3 lines
Instead of attempting to come up with a generic description of this, I recommend just naming it after the actual device instance; something like compatible="xlnx,opb-uart16550";
Well, that means that we'll need a to add a code which "glues" the chip to
8250.c driver... well, of_serial.c could be that glue layer if we add to it the ability to recognize Xilinx UART... well, legacy_serial.c could be taught that trick too...
Well, we could also add the new compatible, but still claim "ns16550"
compatibility...
Quoted 2 lines
Cheers,
g.
WBR, Sergei
Quoted 10 lines · Sergei Shtylyov
Quoted 7 lines · Grant Likely
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2584
Quoted 2 lines
Documentation/powerpc/booting-without-of.txt +2
-0+ Xilinx uart 16550 device registers are compatible with all standard 16540 + and 16550 UARTs.Not strictly true; the xilinx uart is *almost* compatible with the ns16550. The same driver can be made to work, but it is not register level compatible so we cannot claim compatible="ns16550".
Quoted 6 lines
How much incompatible it is with 16550? Does that only extend to register
stride of 4 instead of 1 -- if so, it should be considered compatible since the same chip can be into address space mapped with stride of 1, 2, or 4, or whatever power of 2. If it has some actual register difference, like e. g. DLAB not existing and the divisor latch mapped to a separate register rather than 0..1, then indeed, new compatible property must be defined.
The definition of compatible (from the OpenFirmware) docs is that the
*device* is register level compatible. That includes register
locations and offsets. The registers are not at the same location, therefore it is not compatible.
However, the *driver* can be easily made compatible with the devices. We just teach the driver to bind against both "ns16550" and whatever value is chosen for these reg-shifted devices. Not a big deal.
Quoted 8 lines
Quoted 2 lines
We need a new compatible property for 16550 like devices with a reg shift and offset.
No, we don't strictly need it if all incompatibilty is constrained to how
the same 16550 registers mapped to address space which is a function of the address decoder, not the chip itself. Well, that's of course based in 8250.c's ability to handle different strides -- an imaginary driver could only handle 1:1 chip mapping.
compatible also covers bus binding when it is a memory mapped device. Otherwise you need another node between the bus and the ns16550 type device that does translation from the wide stride (regshift=2) to the ns16550 register definitions (regshift=0).
Quoted 6 lines
Quoted 5 lines
Instead of attempting to come up with a generic description of this, I recommend just naming it after the actual device instance; something like compatible="xlnx,opb-uart16550";
Quoted 6 lines
Well, that means that we'll need a to add a code which "glues" the chip to
8250.c driver... well,of_serial.ccould be that glue layer if we add to it the ability to recognize Xilinx UART... well,legacy_serial.ccould be taught that trick too...
Well, we could also add the new compatible, but still claim "ns16550"
compatibility...
No, we cannot because it is not register level compatible (and once again, that definition includes the stride between registers)
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Quoted 14 lines · Grant Likely
Quoted 7 lines
Quoted 6 lines
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2584
Quoted 2 lines
Documentation/powerpc/booting-without-of.txt +2
-0+ Xilinx uart 16550 device registers are compatible with all standard 16540 + and 16550 UARTs.Not strictly true; the xilinx uart is *almost* compatible with the ns16550. The same driver can be made to work, but it is not register level compatible so we cannot claim compatible="ns16550".
Quoted 6 lines
How much incompatible it is with 16550? Does that only extend to register
stride of 4 instead of 1 -- if so, it should be considered compatible since the same chip can be into address space mapped with stride of 1, 2, or 4, or whatever power of 2. If it has some actual register difference, like e. g. DLAB not existing and the divisor latch mapped to a separate register rather than 0..1, then indeed, new compatible property must be defined.
Quoted 3 lines
The definition of compatible (from the OpenFirmware) docs is that the
*device* is register level compatible. That includes register
locations and offsets.
I'd disagree here: register offsets are the function of the chip select,
not a chip itself -- you can possible wire chip selects to 16550 so that the registers would be spaced by 4 bytes.
Quoted 5 lines
The registers are not at the same location, therefore it is not compatible.
However, the *driver* can be easily made compatible with the devices. We just teach the driver to bind against both "ns16550" and whatever value is chosen for these reg-shifted devices. Not a big deal.
You're going to "teach" 8250.c? Good luck. :-)
IMO we can only teach a glue layer which "passes" UARTs to 8250.c via
platform devices.
Quoted 9 lines
Quoted 8 lines
Quoted 2 lines
We need a new compatible property for 16550 like devices with a reg shift and offset.
No, we don't strictly need it if all incompatibilty is constrained to how
the same 16550 registers mapped to address space which is a function of the address decoder, not the chip itself. Well, that's of course based in 8250.c's ability to handle different strides -- an imaginary driver could only handle 1:1 chip mapping.
Quoted 4 lines
compatible also covers bus binding when it is a memory mapped device. Otherwise you need another node between the bus and the ns16550 type device that does translation from the wide stride (regshift=2) to the ns16550 register definitions (regshift=0).
The chip can be connected to the bus (via chip select circuitry) in
different ways, therefore we need a "glue" node for that circuitry?
Quoted 11 lines
Quoted 10 lines
Quoted 3 lines
Instead of attempting to come up with a generic description of this, I recommend just naming it after the actual device instance; something like compatible="xlnx,opb-uart16550";
Well, that means that we'll need a to add a code which "glues" the chip to
8250.c driver... well,of_serial.ccould be that glue layer if we add to it the ability to recognize Xilinx UART... well,legacy_serial.ccould be taught that trick too...
Well, we could also add the new compatible, but still claim "ns16550"
compatibility...
Quoted 2 lines
No, we cannot because it is not register level compatible (and once again, that definition includes the stride between registers)
Once again, I disagree. :-)
Quoted 2 lines
Cheers,
g.
WBR, Sergei
Quoted 8 lines · Sergei Shtylyov
Quoted 5 lines · Grant Likely
The registers are not at the same location, therefore it is not compatible.
However, the *driver* can be easily made compatible with the devices. We just teach the driver to bind against both "ns16550" and whatever value is chosen for these reg-shifted devices. Not a big deal.
You're going to "teach" 8250.c? Good luck. :-)
:-P
As you already know, 8250.c already knows how to handle reg shifts. But that is not what this conversation is about.
Quoted 2 lines
IMO we can only teach a glue layer which "passes" UARTs to 8250.c via
platform devices.
That's right. This discussion is only about the device tree binding. It is not about the core driver.
Quoted 7 lines
Quoted 4 lines
compatible also covers bus binding when it is a memory mapped device. Otherwise you need another node between the bus and the ns16550 type device that does translation from the wide stride (regshift=2) to the ns16550 register definitions (regshift=0).
The chip can be connected to the bus (via chip select circuitry) in
different ways, therefore we need a "glue" node for that circuitry?
I'm not arguing that we want a glue node. What I'm arguing is that "compatible=ns16550" has a very specific meaning that has become a defacto standard over the years. To add a new interpretation of that meaning is problematic. Instead, if reg shift is needed then use a different value for compatible.
It's not like we're talking about something that is hard to do. It is simply being explicit in the device tree layout. Historically "ns16550" means no reg shift, so don't use it for devices that have a reg shift.
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Quoted 3 lines
Quoted 3 lines
Instead of attempting to come up with a generic description of this, I recommend just naming it after the actual device
instance;
Quoted 3 lines
Quoted 1 line
something like compatible=3D"xlnx,opb-uart16550";
=20
Well, that means that we'll need a to add a code which "glues" the
chip to
Quoted 1 line
8250.c driver... well,
of_serial.ccould be that glue layer if we add
to it
Quoted 1 line
the ability to recognize Xilinx UART... well,
legacy_serial.ccould be
taught
Quoted 2 lines
that trick too...
Well, we could also add the new compatible, but still claim
"ns16550"
Quoted 1 line
compatibility...
This actually makes more sense to me... I'd rather have the code set the reg-shift than have it explicitly set in the device tree anyway. The compatibility set should include (at the least):
opb_uart16550_v1_00_c
opb_uart16550_v1_00_d
opb_uart16550_v1_00_e
plb_uart16550_v1_00_c
xps_uart16550_v1_00_aI think this is somewhat independent of Sergei's arguments that generic ns16550 devices should allow having a reg-shift set....
Steve
Hello.
Quoted 19 lines · Stephen Neuendorffer
Quoted 8 lines
Quoted 4 lines
Instead of attempting to come up with a generic description of this, I recommend just naming it after the actual device instance;
something like compatible="xlnx,opb-uart16550";
Well, that means that we'll need a to add a code which "glues" the chip to
8250.c driver... well,of_serial.ccould be that glue layer if we add to itQuoted 6 lines
the ability to recognize Xilinx UART... well,
legacy_serial.ccould be taughtthat trick too...
Well, we could also add the new compatible, but still claim "ns16550"compatibility...
This actually makes more sense to me... I'd rather have the code set the reg-shift than have it explicitly set in the device tree anyway. The compatibility set should include (at the least):
Quoted 5 lines
opb_uart16550_v1_00_c
opb_uart16550_v1_00_d
opb_uart16550_v1_00_e
plb_uart16550_v1_00_c
xps_uart16550_v1_00_aSounds like too much? Couldn't this be handled via the "model" prop?
Quoted 4 lines
I think this is somewhat independent of Sergei's arguments that generic ns16550 devices should allow having a reg-shift set....
Steve
WBR, Sergei