powerpc: Add FSL CPM2 device tree node documentation
PATCH 1/1 powerpc: Add FSL CPM2 device tree node documentation
Updated the documentation to include the initial description of the CPM2 device that are used on PQII and PQIII families. Only initial sub-devices described so far, but that should be sufficient to move the respective boards to powerpc, with a reasonable minimum supporteddevice set.
---
Documentation/powerpc/booting-without-of.txt | 149 ++++++++++++++++++++++++++ 1 files changed, 149 insertions(+), 0 deletions(-)
Documentation/powerpc/booting-without-of.txt +149 -0
@@ -1436,6 +1436,155 @@ platforms are moved over to use the flat descriptor-types-mask = <073f1127>; }; + h) Freescale SOC communication processor module (CPM) + This represents cpm module that is installed on PQ (PowerQUICC) + series,1-st, 2-nd and 3-rd generation. Basically, is is a bus of devices, + both those that are inalienable cpm parts (BRGs, etc.), and those that could act + more or less as a complete entity (FCC, SCC). All af them should be + siblings on the "root" cpm node, using the common properties from + there. The description below applies to the CPM2 (2-nd rev. found on + PQ2 and PQ3) but I beleive could be extended to the PQ CPM1 as well + later. + + 1) Root cpm2 device + Required properties: + + - device_type : Should be "cpm" + - model : Model of the device. Should be "CPM1" or "CPM2" + - reg : Offset and length of the register set for the device + - command-proc : Offset to the CPM command processor + + 2) Baud-rate generators (BRG) + The CPM contains eight independent, identical baud-rate generators (BRGs) that can be + used with the FCCs, SCCs, and SMCs. The clocks produced by the BRGs are sent to the + bank-of-clocks selection logic, where they can be routed to the controllers. In addition, the + output of a BRG can be routed to a pin to be used externally. + + Required properties: + + - device_type : Should be "brg" + - model : should be "BRGx", x relative to the BRG number (usually + from 1 to 8) + - reg : Offset to the configuration register (from cpm reg) + - linux,phandle : phandle for this node; likely referenced by the CPM + devices (SCC, FCC, SMC, etc.) + + Recommended properties: + + - clock-divider : 12-bit integer (internal counter that is decremented at the DIV16 output rate) + - div16 : Either <0> or <1> the 1/16 prescalar before reaching the clock divider + - ext-clock : Either <0> or phandle of the external clock source + + 3) CPM multiplexor + CPM supports special NMSI mode of operation for its devices. In short, + each serial device could be connected to the set of dedicated pins, + and this pseudo-device controls such behavior. They are different for + each device set, and could be recognised using "compatible" field. + + Required properties: + + - device_type : Should be "cpmux" + - reg : offset to the configuration register + - compatible : "fcc", "scc", or "smc" + + 4) SCCs (Serial Communications Controllers) + + Required properties: + + - device_type : "serial" or "network" + - model : "SCCx", x is typically a small number depending on the + devices amount + - compatible : Either "fs_enet" or "cpm_uart" + - reg : offset to the register set and its length + - reg-pram : offset to the device parameter RAM + - clock-setup : should be <CMX_RT CMX_MSK> where CMX_... values define + multiplexor clock routing and clock mask respectively + - interrupts : <a b> where a is the interrupt number and b is a + field that represents an encoding of the sense and level + information for the interrupt. This should be encoded based on + the information in section 2) depending on the type of interrupt + controller you have. + - interrupt-parent : the phandle for the interrupt controller that + services interrupts for this device. + + 5) FCCs (Fast Communications Controllers) + + Required properties: + + - device_type : should be "network" + - model : "FCCx", x is typically a small number depending on the + devices amount + - compatible : should be "fs_enet" + - address : List of bytes representing the ethernet address of + this controller + - reg : offset to the register set and its length + - reg-pram : offset to the device parameter RAM + - clock-setup : should be <CMX_RT CMX_MSK> where CMX_... values define + multiplexor clock routing and clock mask respectively + - interrupts : <a b> where a is the interrupt number and b is a + field that represents an encoding of the sense and level + information for the interrupt. This should be encoded based on + the information in section 2) depending on the type of interrupt + controller you have. + - interrupt-parent : the phandle for the interrupt controller that + services interrupts for this device. + - phy-handle : The phandle for the PHY connected to this ethernet + controller. + Example: + /*8272ADS*/ + cpm@f0000000 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + device_type = "cpm"; + model = "CPM2"; + ranges = <0 f0000000 00100000>; + reg = <f0000000 000101a8>; + command-proc = <119c0> + + brg@119f0 { + device_type = "brg"; + model = "BRG1"; + reg = <119f0>; + linux,phandle = <775>; + }; + + cpmux@11b04 { + device_type = "cpmux"; + compatible = "fcc"; + reg = <11b04>; + }; + + cpmux@11b08 { + device_type = "cpmux"; + compatible = "scc"; + reg = <11b08>; + }; + + scc@11a20 { + device_type = "serial"; + compatible = "cpm_uart"; + model = "SCC1"; + reg = <11a20 100>; + reg_pram = <8000 ff>; + clock_setup = <0x00ffffff 0>; + interrupts = <28 3>; + interrupt-parent = <700>; + brg_phandle = <775>; + }; + + fcc@11300 { + device_type = "network"; + compatible = "fs_enet"; + model = "FCC1"; + reg = <11300 1f>; + reg_pram = <8400 ff>; + address = [00 00 00 00 00 00]; + interrupts = <20 3>; + interrupt-parent = <700>; + phy_handle = <2452000>; + }; + }; More devices will be defined as this spec matures.
Paul,
Please dont accept this patch right away. I think we should let this have some discussion on the list before it goes in. I believe this is the first time any of the 8xx maintainers have seen this (Dan or Marcelo) so getting their feedback would be good.
Nothing against your patch Vitaly :)
- kumar
Quoted 192 lines · Vitaly Bordug
Updated the documentation to include the initial description of the CPM2 device that are used on PQII and PQIII families. Only initial sub-devices described so far, but that should be sufficient to move the respective boards to powerpc, with a reasonable minimum supporteddevice set.
Signed-off-by Vitaly Bordug <[email protected]>---
Documentation/powerpc/booting-without-of.txt | 149 +++++++++++++++ +++++++++++ 1 files changed, 149 insertions(+), 0 deletions(-)Documentation/powerpc/booting-without-of.txt +4
-0@@ -1436,6 +1436,155 @@ platforms are moved over to use the flat descriptor-types-mask = <073f1127>; }; + h) Freescale SOC communication processor module (CPM) + This represents cpm module that is installed on PQ (PowerQUICC) + series,1-st, 2-nd and 3-rd generation. Basically, is is a bus of devices, + both those that are inalienable cpm parts (BRGs, etc.), and thosethat could act
Documentation/powerpc/booting-without-of.txt +16
-0+ more or less as a complete entity (FCC, SCC). All af them should be + siblings on the "root" cpm node, using the common properties from + there. The description below applies to the CPM2 (2-nd rev. found on + PQ2 and PQ3) but I beleive could be extended to the PQ CPM1 as well + later. + + 1) Root cpm2 device + Required properties: + + - device_type : Should be "cpm" + - model : Model of the device. Should be "CPM1" or "CPM2" + - reg : Offset and length of the register set for the device + - command-proc : Offset to the CPM command processor + + 2) Baud-rate generators (BRG) + The CPM contains eight independent, identical baud-rategenerators (BRGs) that can be
+ used with the FCCs, SCCs, and SMCs. The clocks produced
by the BRGs are sent to the
+ bank-of-clocks selection logic, where they can be routed
to the controllers. In addition, the
+ output of a BRG can be routed to a pin to be used
externally.Documentation/powerpc/booting-without-of.txt +8
-0+ + Required properties: + + - device_type : Should be "brg" + - model : should be "BRGx", x relative to the BRG number (usually + from 1 to 8) + - reg : Offset to the configuration register (from cpm reg) + - linux,phandle : phandle for this node; likely referenced bythe CPM
Documentation/powerpc/booting-without-of.txt +5
-0+ devices (SCC, FCC, SMC, etc.) + + Recommended properties: + + - clock-divider : 12-bit integer (internal counter that isdecremented at the DIV16 output rate)
Documentation/powerpc/booting-without-of.txt +1
-0+ - div16 : Either <0> or <1> the 1/16 prescalar before reachingthe clock divider
Documentation/powerpc/booting-without-of.txt +4
-0+ - ext-clock : Either <0> or phandle of the external clock source + + 3) CPM multiplexor + CPM supports special NMSI mode of operation for its devices. Inshort,
Documentation/powerpc/booting-without-of.txt +1
-0+ each serial device could be connected to the set of dedicatedpins,
Documentation/powerpc/booting-without-of.txt +1
-0+ and this pseudo-device controls such behavior. They aredifferent for
Documentation/powerpc/booting-without-of.txt +19
-0+ each device set, and could be recognised using "compatible" field. + + Required properties: + + - device_type : Should be "cpmux" + - reg : offset to the configuration register + - compatible : "fcc", "scc", or "smc" + + 4) SCCs (Serial Communications Controllers) + + Required properties: + + - device_type : "serial" or "network" + - model : "SCCx", x is typically a small number depending on the + devices amount + - compatible : Either "fs_enet" or "cpm_uart" + - reg : offset to the register set and its length + - reg-pram : offset to the device parameter RAM + - clock-setup : should be <CMX_RT CMX_MSK> where CMX_... valuesdefine
Documentation/powerpc/booting-without-of.txt +22
-0+ multiplexor clock routing and clock mask respectively + - interrupts : <a b> where a is the interrupt number and b is a + field that represents an encoding of the sense and level + information for the interrupt. This should be encoded based on + the information in section 2) depending on the type of interrupt + controller you have. + - interrupt-parent : the phandle for the interrupt controller that + services interrupts for this device. + + 5) FCCs (Fast Communications Controllers) + + Required properties: + + - device_type : should be "network" + - model : "FCCx", x is typically a small number depending on the + devices amount + - compatible : should be "fs_enet" + - address : List of bytes representing the ethernet address of + this controller + - reg : offset to the register set and its length + - reg-pram : offset to the device parameter RAM + - clock-setup : should be <CMX_RT CMX_MSK> where CMX_... valuesdefine
Documentation/powerpc/booting-without-of.txt +65
-0+ multiplexor clock routing and clock mask respectively + - interrupts : <a b> where a is the interrupt number and b is a + field that represents an encoding of the sense and level + information for the interrupt. This should be encoded based on + the information in section 2) depending on the type of interrupt + controller you have. + - interrupt-parent : the phandle for the interrupt controller that + services interrupts for this device. + - phy-handle : The phandle for the PHY connected to this ethernet + controller. + Example: + /*8272ADS*/ + cpm@f0000000 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + device_type = "cpm"; + model = "CPM2"; + ranges = <0 f0000000 00100000>; + reg = <f0000000 000101a8>; + command-proc = <119c0> + + brg@119f0 { + device_type = "brg"; + model = "BRG1"; + reg = <119f0>; + linux,phandle = <775>; + }; + + cpmux@11b04 { + device_type = "cpmux"; + compatible = "fcc"; + reg = <11b04>; + }; + + cpmux@11b08 { + device_type = "cpmux"; + compatible = "scc"; + reg = <11b08>; + }; + + scc@11a20 { + device_type = "serial"; + compatible = "cpm_uart"; + model = "SCC1"; + reg = <11a20 100>; + reg_pram = <8000 ff>; + clock_setup = <0x00ffffff 0>; + interrupts = <28 3>; + interrupt-parent = <700>; + brg_phandle = <775>; + }; + + fcc@11300 { + device_type = "network"; + compatible = "fs_enet"; + model = "FCC1"; + reg = <11300 1f>; + reg_pram = <8400 ff>; + address = [00 00 00 00 00 00]; + interrupts = <20 3>; + interrupt-parent = <700>; + phy_handle = <2452000>; + }; + }; More devices will be defined as this spec matures._______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Quoted 7 lines · On Tue, 28 Mar 2006 10:37:02 -0600 Kumar Gala <[email protected]> wrote:
Paul,
Please dont accept this patch right away. I think we should let this have some discussion on the list before it goes in. I believe this is the first time any of the 8xx maintainers have seen this (Dan or Marcelo) so getting their feedback would be good.
That was implied... This is definitely RFC, I forgot to add that to the subject :)
Quoted 4 lines
Nothing against your patch Vitaly :)
- kumar
Sincerely,
Vitaly
Quoted 6 lines · Vitaly Bordug
Updated the documentation to include the initial description of the CPM2 device that are used on PQII and PQIII families. Only initial sub-devices described so far, but that should be sufficient to move the respective boards to powerpc, with a reasonable minimum supporteddevice set.
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1519
Quoted 10 lines
Documentation/powerpc/booting-without-of.txt +10
-0+ 5) FCCs (Fast Communications Controllers) + + Required properties: + + - device_type : should be "network" + - model : "FCCx", x is typically a small number depending on the + devices amount + - compatible : should be "fs_enet" + - address : List of bytes representing the ethernet address of + this controller
Umm should we not use local-mac-address and mac-address (and address-bits) as in section 3.7.4 in 1275-1994?
Paul
Quoted 2 lines · Vitaly Bordug
Updated the documentation to include the initial description of the CPM2 device that are used on PQII and PQIII families.
I haven't followed the device tree development in detail, but when looking at this the only question that comes to mind is wondering what this really does to help me. None of the information provided here is variable nor configurable .... except I guess for the internal register base address (IMMR), which for some reason has turned into a variable which hasn't changed since I did the first kernel port. About the only thing that is variable, which is the two different bank addresses of the CPM memory that affects the configuration of the FCCs in Ethernet mode, isn't reflected here in any way.
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1550
Quoted 6 lines
Documentation/powerpc/booting-without-of.txt +6
-0+ brg@119f0 { + device_type = "brg"; + model = "BRG1"; + reg = <119f0>; + linux,phandle = <775>; + };
Why? We already know it's at this address offset.
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1562
Quoted 12 lines
Documentation/powerpc/booting-without-of.txt +12
-0+ + cpmux@11b04 { + device_type = "cpmux"; + compatible = "fcc"; + reg = <11b04>; + }; + + cpmux@11b08 { + device_type = "cpmux"; + compatible = "scc"; + reg = <11b08>; + };
I don't understand the value of these either.
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1571
Quoted 9 lines
Documentation/powerpc/booting-without-of.txt +9
-0+ + scc@11a20 { + device_type = "serial"; + compatible = "cpm_uart"; + model = "SCC1"; + reg = <11a20 100>; + reg_pram = <8000 ff>; + clock_setup = <0x00ffffff 0>; + interrupts = <28 3>;
None of this is variable. If you know you are using scc1, you must use certain configuration bits in the cmxscr (the thing you are calling cpmux). Why would you want to make this variable and prone to error? The driver knows, and there are no options. Same for the interrupts that are used.
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1582
Quoted 7 lines
Documentation/powerpc/booting-without-of.txt +7
-0+ fcc@11300 { + device_type = "network"; + compatible = "fs_enet"; + model = "FCC1"; + reg = <11300 1f>; + reg_pram = <8400 ff>; + address = [00 00 00 00 00 00];
I'm assuming this is the MAC address, and is probably the only thing I see of value here.
Quoted 1 line
More devices will be defined as this spec matures.
I just don't understand the value of this. Will you explain it for me?
Thanks.
-- Dan
Quoted 9 lines · Dan Malek
I haven't followed the device tree development in detail, but when looking at this the only question that comes to mind is wondering what this really does to help me. None of the information provided here is variable nor configurable .... except I guess for the internal register base address (IMMR), which for some reason has turned into a variable which hasn't changed since I did the first kernel port. About the only thing that is variable, which is the two different bank addresses of the CPM memory that affects the configuration of the FCCs in Ethernet mode, isn't reflected here in any way.
I don't know much about the CPM or CPM2, so I don't know precisely why these bits have been put in. If the CPM2 is completely unique and is identical across all possible past and future implementations, then indeed there isn't a lot of value in putting details about it in the device tree. Having details in the device tree becomes useful if:
* there are variants that have different collections of subdevices, or subdevices at different offsets, or
* there are common subdevices between CPM and CPM2 (or future CPM* devices), potentially with subtle variations in offset, method of enabling, etc., or
* there are subdevices in CPM/CPM2 which match some common device (e.g. a 16550 uart) for which a generic driver can be used with some appropriate configuration.
As I say, I don't know if these points apply to CPM/CPM2 specifically.
Paul.
Quoted 12 lines · On Thu, 30 Mar 2006 17:10:48 +1100 Paul Mackerras <[email protected]> wrote:
Quoted 9 lines · Dan Malek
I haven't followed the device tree development in detail, but when looking at this the only question that comes to mind is wondering what this really does to help me. None of the information provided here is variable nor configurable .... except I guess for the internal register base address (IMMR), which for some reason has turned into a variable which hasn't changed since I did the first kernel port. About the only thing that is variable, which is the two different bank addresses of the CPM memory that affects the configuration of the FCCs in Ethernet mode, isn't reflected here in any way.
Quoted 9 lines
I don't know much about the CPM or CPM2, so I don't know precisely why these bits have been put in. If the CPM2 is completely unique and is identical across all possible past and future implementations, then indeed there isn't a lot of value in putting details about it in the device tree. Having details in the device tree becomes useful if:
* there are variants that have different collections of subdevices, or subdevices at different offsets, or
Yes. Offsets differ across the different PQ families. Collections may differ even on the same reference design, 885 for instance could have all the scc's/smc's utilized as UARTs, while on classic SMC1+SMC2, only, SCC may be used as 10M network.
Quoted 4 lines
* there are common subdevices between CPM and CPM2 (or future CPM* devices), potentially with subtle variations in offset, method of enabling, etc., or
Yes, but this is similar with the first point... Well even cpm and cpm2 differ (different immap.h ), and we have CPM future heading for QE.
Quoted 3 lines
* there are subdevices in CPM/CPM2 which match some common device (e.g. a 16550 uart) for which a generic driver can be used with some appropriate configuration.
Yep - cpm_uart and fs_enet are live examples. Both are intended to deal with serial and Ethernet stuff from the different variations of CPM. Right now they are not ideal, because they still have to remap the whole immr (say to access cpm command register) ,and such parts are still board-specific which is not good...
Quoted 6 lines
As I say, I don't know if these points apply to CPM/CPM2 specifically.
Paul.
Thank you for your comments - now I'm sure all this following the right way...
Signature · 2 lines
Sincerely, Vitaly
Quoted 7 lines · On Thu, 30 Mar 2006 00:05:38 -0500 Dan Malek <[email protected]> wrote:
Quoted 3 lines · Vitaly Bordug
Updated the documentation to include the initial description of the CPM2
device that are used on PQII and PQIII families.
Quoted 9 lines
I haven't followed the device tree development in detail, but when looking at this the only question that comes to mind is wondering what this really does to help me. None of the information provided here is variable nor configurable .... except I guess for the internal register base address (IMMR), which for some reason has turned into a variable which hasn't changed since I did the first kernel port. About the only thing that is variable, which is the two different bank addresses of the CPM memory that affects the configuration of the FCCs in Ethernet mode, isn't reflected here in any way.
Why do you think/guess the values below _should_ be variable? Well they could, but the target is to have the auto-config only in places it makes sense. (I currently see only PCI stuff in this relation). The dts will be compiled together with the firmware, and provide the correct information to the kernel. The dts is a board-specific thing, it is intended to present all the necessary devices to live happily without all the immr structure. In other words, what it should present, is the same logical construction uniting all the legacy (CPM on 8xx), up-to-date (CPM2 on PQ2 and PQ3) and future (QuiccEngine on 8360) boards in an easy to maintain and extensible way.
I'll elaborate of course if needed - note I am not the theoretical fanatic of this idea, but it
- makes sense,
- the new way, all that will not follow it will be obsoleted sooner or later
Quoted 9 lines
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1550
Quoted 7 lines
Documentation/powerpc/booting-without-of.txt +6
-0+ brg@119f0 { + device_type = "brg"; + model = "BRG1"; + reg = <119f0>; + linux,phandle = <775>; + };Why? We already know it's at this address offset.
Hmm? The same offset for 8xx, 82xx PQII and new QE? don't think so...
Quoted 15 lines
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1562
Quoted 13 lines
Documentation/powerpc/booting-without-of.txt +12
-0+ + cpmux@11b04 { + device_type = "cpmux"; + compatible = "fcc"; + reg = <11b04>; + }; + + cpmux@11b08 { + device_type = "cpmux"; + compatible = "scc"; + reg = <11b08>; + };I don't understand the value of these either.
As far as I got the idea, on startup I'll have _only_ devicetree, in order to configure the stuff, and insert the devices properly. Hereby, I need the offsets to configure things. And I don't really want to hide those into *.h - or we'll return to #ifdef hell there. These offsets are *not* constant if we look over different PQ generations.
Quoted 17 lines
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1571
Quoted 10 lines
Documentation/powerpc/booting-without-of.txt +9
-0+ + scc@11a20 { + device_type = "serial"; + compatible = "cpm_uart"; + model = "SCC1"; + reg = <11a20 100>; + reg_pram = <8000 ff>; + clock_setup = <0x00ffffff 0>; + interrupts = <28 3>;None of this is variable. If you know you are using scc1, you must use certain configuration bits in the cmxscr (the thing you are calling cpmux). Why would you want to make this variable and prone to error? The driver knows, and there are no options. Same for the interrupts that are used.
Just compared in CPM, CPM2 and QE reference manuals - found no equal values. The aim is to move all that specific offsets over to BSP land in devicetree source. The logic is common, but the numbers/offsets are different, and features as well, for instance, QE UCC is much more flexible than SCC/FCC, differing technically but is really common logically.
Quoted 11 lines
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1582
Quoted 7 lines
Documentation/powerpc/booting-without-of.txt +7
-0+ fcc@11300 { + device_type = "network"; + compatible = "fs_enet"; + model = "FCC1"; + reg = <11300 1f>; + reg_pram = <8400 ff>; + address = [00 00 00 00 00 00];I'm assuming this is the MAC address, and is probably the only thing I see of value here.
Quoted 5 lines
Quoted 1 line
More devices will be defined as this spec matures.
I just don't understand the value of this. Will you explain it for me?
I am not a good "explainer", but AFAIR, the powerpc land is generic-code-prone. All the bsp stuff should be either dealt in the firmware, of passed as a flattened devtree and unpacked/used in one function.
Even conflicting IOPs in 8xx I am going to be configured completely within u-boot, using env or something like that. I know, the kernel should be able to deal with tuning like the upper dependless of the firmware, but there are no much such designs remaining (that are targeting to the new-generation kernel), and all of them (I know about) are using u-boot.
Quoted 2 lines
Thanks.
Thanks for attention to this :)
Quoted 4 lines
-- Dan
Signature · 2 lines
Sincerely, Vitaly
Quoted 2 lines · Vitaly Bordug
(quoted diff) +0
-1- the new way, all that will not follow it will be obsoleted sooneror later
The problem I see is the "new way" is done for the sake of doing something new, without adding any value. If you want to make the drivers dynamically configurable, which I'll continue to argue is silly in an embedded environment of the type with CPMs, all you need to know is personality of the device. The reason it's silly is the wiring on the particular board dictates how a CPM peripheral will be used. The SCC1 can't be a serial uart one moment and an Ethernet the next time you boot up. Since you have already done a "board port", you may as well wire this as part of the configuration and eliminate potential mistakes. If you insist on making this dynamic (and as a port maintainer I would reject such patches), the only thing you need to describe is the device type. For example, the SCC1 can be an Ethernet or uart. We only support FCCs as Ethernets, and unless someone submits some other kind of driver, like ATM/UTOPIA, there isn't anything variable to configure.
All of the truly configurable options, like NMSI vs. TSA, are so complex the device tree would not be helpful, as that would be built into the custom driver to configure as necessary.
The offsets into the internal register maps are not so variable that adding the information into the device tree is useful. There is CPM1 and CPM2, some common code shared between them that already solves the problems, and the real difference between the two different CPM2 maps on 82xx isn't reflected here (but again is already solved in the existing software). As I said in the past message, this seems more likely to cause errors than be helpful. To me it just seems new for the sake of being new, rather than providing any real value.
I'd rather we spend our time adding the xmon and kgdb over serial port features back into the driver that were lost during the "great driver clean up" than pursing stuff like this.
Thanks.
-- Dan
Quoted 44 lines · Dan Malek
Quoted 2 lines · Vitaly Bordug
(quoted diff) +0
-1- the new way, all that will not follow it will be obsoleted sooneror later
The problem I see is the "new way" is done for the sake of doing something
new, without adding any value. If you want to make the drivers dynamically
configurable, which I'll continue to argue is silly in an embedded environment
of the type with CPMs, all you need to know is personality of the device.
The reason it's silly is the wiring on the particular board dictates how a
CPM peripheral will be used. The SCC1 can't be a serial uart one moment and an Ethernet the next time you boot up. Since you have already
done a "board port", you may as well wire this as part of the configuration
and eliminate potential mistakes. If you insist on making this dynamic (and as a port maintainer I would reject such patches), the only thing you need to describe is the device type. For example, the SCC1 can be an Ethernet or uart. We only support FCCs as Ethernets, and unless someone submits some other kind of driver, like ATM/UTOPIA, there isn't anything variable to configure.All of the truly configurable options, like NMSI vs. TSA, are so complex the device tree would not be helpful, as that would be built into the custom driver to configure as necessary.
The offsets into the internal register maps are not so variable that adding
the information into the device tree is useful. There is CPM1 and CPM2, some common code shared between them that already solves the problems, and the real difference between the two different CPM2 maps on 82xx isn't reflected here (but again is already solved in the existing
software). As I said in the past message, this seems more likely to cause
errors than be helpful. To me it just seems new for the sake of being new, rather than providing any real value.
Quoted 4 lines
I'd rather we spend our time adding the xmon and kgdb over serial port features back into the driver that were lost during the "great driver clean up"
than pursing stuff like this.
Maybe we should look at this from a different point of view. What are the things that change can change between boards for the same CPU?
* What a give channel (SCC, FCC, UCC, SMC?) is used for serial, ethernet, ATM, etc.
* How a channel is wired? [pin muxing] (I really hate having drivers have board specific ifdefs for this)
* which (if any) BRG a channel is using?
* ...? [I feel like I'm missing some but haven't worked on a CPM driver in a while :)]
The other question is what changes between CPUs?
* Number/Mix of channels
* some PRAM offset (8272 FCC comes to mind)
* channel differences for same channel type? (what's an example of this?)
* ...?
I think we should attempt to answer my two questions first (which Dan took an initial swag at) and use those answers to drive how/what we need in the description of a CPM node.
- kumar
Quoted 2 lines · Kumar Gala
* What a give channel (SCC, FCC, UCC, SMC?) is used for serial, ethernet, ATM, etc.
You need to view this from the other direction. As I've always said, we don't have an "SCC driver", we have a uart driver for SCCs. So, you configure from that perspective. The uart driver is configured to use certain SCCs.
Quoted 2 lines
* How a channel is wired? [pin muxing] (I really hate having drivers have board specific ifdefs for this)
I've got a solution for IO pin multiplexing that I have to get pushed in using the "feature_call" method like a pmac. The other thing to realize here is there is often hardware beyond just "pin muxing" that is unique to a board and requires configuration. Statically describing what pins set/clear is a small, and already understood part, of more complex set up that needs to be done with code unique to a board.
Quoted 1 line
* which (if any) BRG a channel is using?
These are already a dynamically allocated resource. Drivers don't care which one is assigned, you should be allocating one and using the handle provided to the support functions.
Quoted 2 lines
* ...? [I feel like I'm missing some but haven't worked on a CPM driver in a while :)]
I can't think of any, and I use the CPM all of the time. :-)
Quoted 1 line
The other question is what changes between CPUs?
Almost nothing, except the PRAM offset you mention below and I've mentioned in past messages as memory bank differences.
Quoted 5 lines
* Number/Mix of channels
* some PRAM offset (8272 FCC comes to mind)
* channel differences for same channel type? (what's an example of this?)
* ...?
Don't be creating problems to solve because we seem to have a solution for _something_. Yes, this would be a cute piece of code to write and interesting driver updates, but in the end all we have is change for the sake of change, without adding any new features.
The thing to remember is the few public Linux drivers we have take little advantage of the CPM features. We just configure a few fixed standard modes (like serial and Ethernet). The CPM is far more powerful and flexible than this, so it seems silly to create some complex method of describing our trivial fixed modes that has no hope of actually being useful for "real" CPM usage. Then, when someone does write a more complex driver, we have all of this "framework" that just gets in the way instead of being useful.
Thanks.
-- Dan
Quoted 10 lines · Dan Malek
Quoted 2 lines · Kumar Gala
* What a give channel (SCC, FCC, UCC, SMC?) is used for serial, ethernet, ATM, etc.
You need to view this from the other direction. As I've always said, we don't have an "SCC driver", we have a uart driver for SCCs. So, you configure from that perspective. The uart driver is configured to use certain SCCs.
Oh, I agree with you. This becomes more obvious with QE where everything is a UCC channel.
Quoted 10 lines
Quoted 2 lines
* How a channel is wired? [pin muxing] (I really hate having drivers have board specific ifdefs for this)
I've got a solution for IO pin multiplexing that I have to get pushed in using the "
feature_call" method like a pmac. The other thing to realize here is there is often hardware beyond just "pin muxing" that is unique to a board and requires configuration. Statically describing what pins set/clear is a small, and already understood part, of more complex set up that needs to be done with code unique to a board.
still waiting :)
Quoted 5 lines
Quoted 1 line
* which (if any) BRG a channel is using?
These are already a dynamically allocated resource. Drivers don't care which one is assigned, you should be allocating one and using the handle provided to the support functions.
Ok, good.
Quoted 16 lines
Quoted 2 lines
* ...? [I feel like I'm missing some but haven't worked on a CPM driver in a while :)]
I can't think of any, and I use the CPM all of the time. :-)
Quoted 1 line
The other question is what changes between CPUs?
Almost nothing, except the PRAM offset you mention below and I've mentioned in past messages as memory bank differences.
Quoted 5 lines
* Number/Mix of channels
* some PRAM offset (8272 FCC comes to mind)
* channel differences for same channel type? (what's an example of this?)
* ...?
Quoted 4 lines
Don't be creating problems to solve because we seem to have a solution for _something_. Yes, this would be a cute piece of code to write and interesting driver updates, but in the end all we have is change for the sake of change, without adding any new features.
I'm hopefully not suggesting that or at least not something I see as this extensive.
Quoted 8 lines
The thing to remember is the few public Linux drivers we have take little advantage of the CPM features. We just configure a few fixed standard modes (like serial and Ethernet). The CPM is far more powerful and flexible than this, so it seems silly to create some complex method of describing our trivial fixed modes that has no hope of actually being useful for "real" CPM usage. Then, when someone does write a more complex driver, we have all of this "framework" that just gets in the way instead of being useful.
I know.
I guess what I'd suggest is something that makes letting the kernel know about serial & enet usage on the CPM is the extent to take this to start with. If in time we have more drivers for more things great, then extend it then. I dont see any reason we can't leverage the flat-dev-tree to have a single way to describe the serial & enet configs for a board.
I see how you can see this as duplication of a solved problem. However, we need some place to describe some basic config info that we have in arch/ppc for arch/powerpc and flat-dev/.dts is that mechanism. While we are moving it out of the kernel proper, I think the idea is that over time using the flat-dev tree will allow the information we have to be described in one place and shared between kernel & firmware.
(and if Vitaly finishes this off we can beat him up to add kgdb support back to cpm_uart :)
- kumar
Quoted 11 lines · On Thu, 30 Mar 2006 10:14:18 -0500 Dan Malek <[email protected]> wrote:
Quoted 2 lines · Kumar Gala
* What a give channel (SCC, FCC, UCC, SMC?) is used for serial, ethernet, ATM, etc.
You need to view this from the other direction. As I've always said, we don't have an "SCC driver", we have a uart driver for SCCs. So, you configure from that perspective. The uart driver is configured to use certain SCCs.
Well, I am going to move the board-specific code to the BSP place, and make the driver use the callback when it needs to configure the HW tp use SCC/SMC (that includes pin setup as well - the way it is in fs_enet). Actually, it can use any (or even all the SXCs) simultaneously, and that strict configuration can be obsoleted (I mean - nothing required in .config to mention which soc device has the uart, as gianfar does not require what TSEC to utilize) - people often misconfigure things, and to be right there should be ifdef hell in the driver which is _odd_.
Quoted 10 lines
Quoted 2 lines
* How a channel is wired? [pin muxing] (I really hate having drivers have board specific ifdefs for this)
I've got a solution for IO pin multiplexing that I have to get pushed in using the "
feature_call" method like a pmac. The other thing to realize here is there is often hardware beyond just "pin muxing" that is unique to a board and requires configuration. Statically describing what pins set/clear is a small, and already understood part, of more complex set up that needs to be done with code unique to a board.
well, ... :D
Quoted 7 lines
Quoted 2 lines
* which (if any) BRG a channel is using?
These are already a dynamically allocated resource. Drivers don't care which one is assigned, you should be allocating one and using the handle provided to the support functions.
Nobody is arguing. But we need offsets to deal with BRGs (at least repeat that behavior in powerpc), CMX, CP - and there are 2 options to have them - yet another foo_immap.h or that "static" nodes in the flattened device tree.
We already have mature implementation of the first approach - and I just want to give the second one a try and to see if it will be more flexible/effective that what we have in ppc right now.
Quoted 4 lines
Quoted 2 lines
* ...? [I feel like I'm missing some but haven't worked on a CPM driver in a while :)]
I can't think of any, and I use the CPM all of the time. :-)
That is great :)
Quoted 12 lines
Quoted 2 lines
The other question is what changes between CPUs?
Almost nothing, except the PRAM offset you mention below and I've mentioned in past messages as memory bank differences.
Quoted 5 lines
* Number/Mix of channels
* some PRAM offset (8272 FCC comes to mind)
* channel differences for same channel type? (what's an example of this?)
* ...?
Quoted 4 lines
Don't be creating problems to solve because we seem to have a solution for _something_. Yes, this would be a cute piece of code to write and interesting driver updates, but in the end all we have is change for the sake of change, without adding any new features.
Let me disagree. Each big change is "a change for change, for design" usually at start. Or, why don't we still use 2.4 - I'm pretty sure there was some period of "redesign" when the new architecture tries to re-implement features yet-existing in mature-stable branch... Or am I missing something?
Quoted 10 lines
The thing to remember is the few public Linux drivers we have take little advantage of the CPM features. We just configure a few fixed standard modes (like serial and Ethernet). The CPM is far more powerful and flexible than this, so it seems silly to create some complex method of describing our trivial fixed modes that has no hope of actually being useful for "real" CPM usage. Then, when someone does write a more complex driver, we have all of this "framework" that just gets in the way instead of being useful.
Currently we'll be stale on that small fixed functionality with the implementation we have in ppc. Yes, feature_call could help, but will not save the world, so drivers will have that ifdeffed code inside, direct immr dereference, etc. Well, it's really hard to make use of CPM flexibility the way it is now. I don't believe that devicetree approach will save the world either, but it is promising enough at least to try that way.
Signature · 2 lines
Sincerely, Vitaly
Quoted 71 lines · On Thu, 30 Mar 2006 09:43:38 -0600 Kumar Gala <[email protected]> wrote:
Quoted 10 lines · Dan Malek
Quoted 2 lines · Kumar Gala
* What a give channel (SCC, FCC, UCC, SMC?) is used for serial, ethernet, ATM, etc.
You need to view this from the other direction. As I've always said, we don't have an "SCC driver", we have a uart driver for SCCs. So, you configure from that perspective. The uart driver is configured to use certain SCCs.
Oh, I agree with you. This becomes more obvious with QE where everything is a UCC channel.
Quoted 10 lines
Quoted 2 lines
* How a channel is wired? [pin muxing] (I really hate having drivers have board specific ifdefs for this)
I've got a solution for IO pin multiplexing that I have to get pushed in using the "
feature_call" method like a pmac. The other thing to realize here is there is often hardware beyond just "pin muxing" that is unique to a board and requires configuration. Statically describing what pins set/clear is a small, and already understood part, of more complex set up that needs to be done with code unique to a board.still waiting :)
Quoted 5 lines
Quoted 1 line
* which (if any) BRG a channel is using?
These are already a dynamically allocated resource. Drivers don't care which one is assigned, you should be allocating one and using the handle provided to the support functions.
Ok, good.
Quoted 16 lines
Quoted 2 lines
* ...? [I feel like I'm missing some but haven't worked on a CPM driver in a while :)]
I can't think of any, and I use the CPM all of the time. :-)
Quoted 1 line
The other question is what changes between CPUs?
Almost nothing, except the PRAM offset you mention below and I've mentioned in past messages as memory bank differences.
Quoted 5 lines
* Number/Mix of channels
* some PRAM offset (8272 FCC comes to mind)
* channel differences for same channel type? (what's an example of this?)
* ...?Quoted 4 lines
Don't be creating problems to solve because we seem to have a solution for _something_. Yes, this would be a cute piece of code to write and interesting driver updates, but in the end all we have is change for the sake of change, without adding any new features.
I'm hopefully not suggesting that or at least not something I see as this extensive.
Quoted 8 lines
The thing to remember is the few public Linux drivers we have take little advantage of the CPM features. We just configure a few fixed standard modes (like serial and Ethernet). The CPM is far more powerful and flexible than this, so it seems silly to create some complex method of describing our trivial fixed modes that has no hope of actually being useful for "real" CPM usage. Then, when someone does write a more complex driver, we have all of this "framework" that just gets in the way instead of being useful.
Quoted 9 lines
I know.
I guess what I'd suggest is something that makes letting the kernel know about serial & enet usage on the CPM is the extent to take this to start with. If in time we have more drivers for more things great, then extend it then. I dont see any reason we can't leverage the flat-dev-tree to have a single way to describe the serial & enet configs for a board.
Yes, that's definitely what it is intended to be...
Quoted 8 lines
I see how you can see this as duplication of a solved problem. However, we need some place to describe some basic config info that we have in
arch/ppcforarch/powerpcand flat-dev/.dts is that mechanism. While we are moving it out of the kernel proper, I think the idea is that over time using the flat-dev tree will allow the information we have to be described in one place and shared between kernel & firmware.
And the results we have now for 85xx family look very nice using this approach.
Quoted 2 lines
(and if Vitaly finishes this off we can beat him up to add kgdb support back to
cpm_uart:)
Hrm, I've added that to kgdb already... I even have the KGDB stuff implemented in the platform-device-reworked cpm_uart driver :)
Signature · 2 lines
Sincerely, Vitaly
Quoted 7 lines · Paul Nasrat
Quoted 5 lines · Vitaly Bordug
Updated the documentation to include the initial description of the CPM2 device that are used on PQII and PQIII families. Only initial sub-devices described so far, but that should be sufficient to move the respective boards to powerpc, with a reasonable minimum supporteddevice set.
Quoted 13 lines
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1519
Quoted 10 lines
Documentation/powerpc/booting-without-of.txt +10
-0+ 5) FCCs (Fast Communications Controllers) + + Required properties: + + - device_type : should be "network" + - model : "FCCx", x is typically a small number depending on the + devices amount + - compatible : should be "fs_enet" + - address : List of bytes representing the ethernet address of + this controllerUmm should we not use local-mac-address and mac-address (and address-bits) as in section 3.7.4 in 1275-1994?
So no one chimed in on this. Clearly, 1275 states that it's supposed to be local-mac-address or mac-address. We use "address". But I'm pretty sure we copied our ethernet node from somewhere else, so which one should it be?
Andy Fleming
Quoted 11 lines · Andy Fleming
Quoted 7 lines · Paul Nasrat
Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flat · line 1519
Quoted 2 lines · Vitaly Bordug
Documentation/powerpc/booting-without-of.txt +2
-0+ - address : List of bytes representing the ethernet address of + this controllerUmm should we not use local-mac-address and mac-address (and address-bits) as in section 3.7.4 in 1275-1994?
Quoted 4 lines
So no one chimed in on this. Clearly, 1275 states that it's supposed to be local-mac-address or mac-address. We use "address". But I'm pretty sure we copied our ethernet node from somewhere else, so which one should it be?
Well I'm biased and say we shouldn't reinvent the wheel with dtc if we don't need to. I've sent Jon a patch to start validating this for dtc and am waiting feedback before I add additional device_types. So we should have local-mac-address be preassiged hwaddr and mac-address last used. For some setups this would be the same persistently, but I can envisage some non OF setups populating mac-address from the card.
Paul
So, like, the other day Paul Nasrat mumbled:
Quoted 4 lines
Well I'm biased and say we shouldn't reinvent the wheel with dtc if we don't need to. I've sent Jon a patch to start validating this for dtc and am waiting feedback before I add additional
device_types.
What other device_types do you want to check?
Quoted 4 lines
So we
should have local-mac-address be preassiged hwaddr and mac-address last used. For some setups this would be the same persistently, but I can envisage some non OF setups populating mac-address from the card.
I'm sitting at a conference right now. I'll slate some time for looking into it early next week.
jdl
Quoted 4 lines · Andy Fleming
So no one chimed in on this. Clearly, 1275 states that it's supposed to be local-mac-address or mac-address. We use "address". But I'm pretty sure we copied our ethernet node from somewhere else, so which one should it be?
It shouldn't be "address". That would normally be the physical address of the device's registers, if anything.
Paul.