[PATCH UCC TDM 1/3 Updated] Platform changes for UCC TDM driver for MPC8323eRDB. Also includes related QE changes and dts entries.

2008-01-24 Thread Poonam_Aggrwal-b10812
Thanks Stephen for your comments, incorporated them.
From: Poonam Aggrwal [EMAIL PROTECTED]

This patch makes necessary changes in the QE and UCC framework to support 
TDM. It also adds support to configure the BRG properly through device 
tree entries. Includes the device tree changes for UCC TDM driver as well.
It also includes device tree entries for UCC TDM driver.

Tested on MPC8323ERDB platform.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc832x_rdb.dts |   58 +++
 arch/powerpc/sysdev/qe_lib/qe.c   |  184 +--
 arch/powerpc/sysdev/qe_lib/ucc.c  |  265 +
 arch/powerpc/sysdev/qe_lib/ucc_fast.c |   37 +
 include/asm-powerpc/qe.h  |8 +
 include/asm-powerpc/ucc.h |4 +
 include/asm-powerpc/ucc_fast.h|4 +
 7 files changed, 548 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..c0e6283 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -105,6 +105,17 @@
device_type = par_io;
num-ports = 7;
 
+   ucc1pio:[EMAIL PROTECTED] {
+   pio-map = 
+   /* port  pin  dir  open_drain  assignment  has_irq */
+   0  e  2  0  1  0/* CLK11 */
+   3 16  1  0  2  0/* BRG9 */
+   3 1b  1  0  2  0/* BRG3 */
+   0  0  3  0  2  0/* TDMATxD0 */
+   0  4  3  0  2  0/* TDMARxD0 */
+   3 1b  2  0  1  0;  /* CLK1 */
+   };
+
ucc2pio:[EMAIL PROTECTED] {
pio-map = 
/* port  pin  dir  open_drain  assignment  has_irq */
@@ -169,6 +180,36 @@
};
};
 
+   clocks {
+   compatible = fsl,cpm-clocks;
+   /* clock freqs in Hz(for CLK1~CLK24).
+* CLK11 is 1024KHz,
+* all other clocks unused
+* #clock-cells define number of cells
+* used by the clock-frequency.
+* right now only #clock cells=1 is
+* implemented. Provision is there to
+* handle frequencies 4Gig
+*/
+   #clock-cells = 1;
+   clock-frequency = 0 0 0 0 0 0
+  0 0 0 0 d#1024000 0
+  0 0 0 0 0 0
+  0 0 0 0 0 0;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,cpm-brg;
+   /* input clock sources for all the 16 BRGs.
+* 1-24 for CLK1 to CLK24.
+* BRG9 uses CLK11,BRG1 and BRG2-8 use
+* the QE clock.
+*/
+   fsl,brg-sources = 0 0 0 0 0 0 0 0
+  b 0 0 0 0 0 0 0;
+   reg = 640 7f;
+   };
+
[EMAIL PROTECTED] {
device_type = spi;
compatible = fsl_spi;
@@ -187,6 +228,23 @@
mode = cpu;
};
 
+   [EMAIL PROTECTED] {
+   device_type = tdm;
+   compatible = fsl,ucc-tdm;
+   model = UCC;
+   device-id = 1;
+   fsl,tdm-num = 1;
+   fsl,si-num = 1;
+   fsl,tdm-tx-clk = CLK1;
+   fsl,tdm-rx-clk = CLK1;
+   fsl,tdm-tx-sync = BRG9;
+   fsl,tdm-rx-sync = BRG9;
+   reg = 2000 200;
+   interrupts = 20;
+   interrupt-parent = qeic;
+   pio-handle = ucc1pio;
+   };
+
[EMAIL PROTECTED] {
device_type = network;
compatible = ucc_geth;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1df3b4a..9b9971d 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -149,20 +149,170 @@ EXPORT_SYMBOL(qe_issue_cmd);
  */
 static unsigned int brg_clk = 0;
 
-unsigned int get_brg_clk(void)
+u32 get_brg_clk(enum qe_clock brgclk, enum 

[PATCH UCC TDM 2/3 ]Updated: UCC TDM driver for QE based MPC83xx platforms.

2008-01-24 Thread Poonam_Aggrwal-b10812
Incorporated Stephen's comments.

From: Poonam Agarwal-b10812 [EMAIL PROTECTED]

The UCC TDM driver basically multiplexes and demultiplexes data from
different channels. It can interface with for example SLIC kind of devices
to receive TDM data  demultiplex it and send to upper modules. At the
transmit end it receives data for different channels multiplexes it and
sends them on the TDM channel. It internally uses TSA( Time Slot Assigner)
which does multiplexing and demultiplexing, UCC to perform SDMA between
host buffers and the TSA, CMX to connect TSA to UCC.

It can be used by a kernel module which can call tdm_register_client to
get access to a TDM device.

The driver is right now a misc driver with no subsystem as such.
There can be a platform independent TDM layer which is planned to be
done after this. TDM bus sort of thing.

The dts file keeps a track of the TDM devices present on the board.
Depending on them the TDM driver initializes those many driver instances
while coming up.

The driver on the upper level can plug to more than one tdm clients
depending on the availablity of TDM devices. At every new request of a TDM
client to bind with a TDM device, a free driver instance is allocated to
the client.

The interface can be described as follows.

tdm_register_client(struct tdm_client *)
   This API returns a pointer to the structure tdm_client which is of
type
  struct tdm_client {
   u32 client_id;
   u32 (*tdm_read)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
   u32 (*tdm_write)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
   wait_queue_head_t *wakeup_event;
   }

It consists of:
  - client_id: It is basically to identify the particular TDM
device/driver instance.
  - tdm_read: It is a function pointer returned by the TDM driver to be
used to read TDM data from a particular TDM channel.
  - tdm_write: It is a function pointer returned by the TDM driver to be
used to write TDM data to a particular TDM channel.
  - wakeup_event: It is address of a wait_queue event on which the client
keeps on sleeping, and the TDM driver wakes it up periodically. The driver
is configured to
wake up the client after every 10ms.

Once the TDM client gets registered to a TDM driver instance and a TDM
device, it interfaces with the driver using tdm_read, tdm_write and
wakeup_event.

This driver will run on MPC8323E-RDB platforms.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
 drivers/misc/Kconfig   |   14 +
 drivers/misc/Makefile  |1 +
 drivers/misc/ucc_tdm.c | 1017 
 drivers/misc/ucc_tdm.h |  221 +++
 4 files changed, 1253 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/ucc_tdm.c
 create mode 100644 drivers/misc/ucc_tdm.h

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b5e67c0..628b14b 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -232,4 +232,18 @@ config ATMEL_SSC
 
  If unsure, say N.
 
+config UCC_TDM
+   bool Freescale UCC  TDM Driver
+   depends on QUICC_ENGINE  UCC_FAST
+   default n
+   ---help---
+ The TDM driver is for UCC based TDM devices for example, TDM device on
+ MPC832x RDB. Select it to run PowerVoIP on MPC832x RDB board.
+ The TDM driver can interface with SLIC kind of devices to transmit
+ and receive TDM samples. The TDM driver receives Time Division
+ multiplexed samples(for different channels) from the SLIC device,
+ demutiplexes them and sends them to the upper layers. At the transmit
+ end the TDM drivers receives samples for different channels, it
+ multiplexes them and sends them to the SLIC device.
+
 endif # MISC_DEVICES
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 87f2685..6f0c49d 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)+= thinkpad_acpi.o
 obj-$(CONFIG_FUJITSU_LAPTOP)   += fujitsu-laptop.o
 obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
+obj-$(CONFIG_UCC_TDM)  += ucc_tdm.o
diff --git a/drivers/misc/ucc_tdm.c b/drivers/misc/ucc_tdm.c
new file mode 100644
index 000..2181132
--- /dev/null
+++ b/drivers/misc/ucc_tdm.c
@@ -0,0 +1,1017 @@
+/*
+ * drivers/misc/ucc_tdm.c
+ *
+ * UCC Based Linux TDM Driver
+ * This driver is designed to support UCC based TDM for PowerPC processors.
+ * This driver can interface with SLIC device to run VOIP kind of
+ * applications.
+ *
+ * Author: Ashish Kalra  Poonam Aggrwal
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by 

[PATCH] UCC TDM driver for QE based MPC83xx platforms.

2008-01-23 Thread Poonam_Aggrwal-b10812

From: Poonam Agarwal-b10812 [EMAIL PROTECTED]

The UCC TDM driver basically multiplexes and demultiplexes data from
different channels. It can interface with for example SLIC kind of devices
to receive TDM data  demultiplex it and send to upper modules. At the
transmit end it receives data for different channels multiplexes it and
sends them on the TDM channel. It internally uses TSA( Time Slot Assigner)
which does multiplexing and demultiplexing, UCC to perform SDMA between
host buffers and the TSA, CMX to connect TSA to UCC.

It can be used by a kernel module which can call tdm_register_client to
get access to a TDM device.

The driver is right now a misc driver with no subsystem as such.
There can be a platform independent TDM layer which is planned to be
done after this. TDM bus sort of thing.

The dts file keeps a track of the TDM devices present on the board.
Depending on them the TDM driver initializes those many driver instances
while coming up.

The driver on the upper level can plug to more than one tdm clients
depending on the availablity of TDM devices. At every new request of a TDM
client to bind with a TDM device, a free driver instance is allocated to 
the client.

The interface can be described as follows.

tdm_register_client(struct tdm_client *)
This API returns a pointer to the structure tdm_client which is of
type
   struct tdm_client {
u32 client_id;
u32 (*tdm_read)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
u32 (*tdm_write)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
wait_queue_head_t *wakeup_event;
}

It consists of:
   - client_id: It is basically to identify the particular TDM
device/driver instance.
   - tdm_read: It is a function pointer returned by the TDM driver to be
used to read TDM data from a particular TDM channel.
   - tdm_write: It is a function pointer returned by the TDM driver to be
used to write TDM data to a particular TDM channel.
   - wakeup_event: It is address of a wait_queue event on which the client
keeps on sleeping, and the TDM driver wakes it up periodically. The driver 
is configured to
wake up the client after every 10ms.

Once the TDM client gets registered to a TDM driver instance and a TDM
device, it interfaces with the driver using tdm_read, tdm_write and 
wakeup_event.

This driver will run on MPC8323E-RDB platforms.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]

---
 drivers/misc/Kconfig   |   14 +
 drivers/misc/Makefile  |1 +
 drivers/misc/ucc_tdm.c | 1000 
 drivers/misc/ucc_tdm.h |  221 +++
 4 files changed, 1236 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/ucc_tdm.c
 create mode 100644 drivers/misc/ucc_tdm.h

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b5e67c0..628b14b 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -232,4 +232,18 @@ config ATMEL_SSC
 
  If unsure, say N.
 
+config UCC_TDM
+   bool Freescale UCC  TDM Driver
+   depends on QUICC_ENGINE  UCC_FAST
+   default n
+   ---help---
+ The TDM driver is for UCC based TDM devices for example, TDM device on
+ MPC832x RDB. Select it to run PowerVoIP on MPC832x RDB board.
+ The TDM driver can interface with SLIC kind of devices to transmit
+ and receive TDM samples. The TDM driver receives Time Division
+ multiplexed samples(for different channels) from the SLIC device,
+ demutiplexes them and sends them to the upper layers. At the transmit
+ end the TDM drivers receives samples for different channels, it
+ multiplexes them and sends them to the SLIC device.
+
 endif # MISC_DEVICES
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 87f2685..6f0c49d 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)+= thinkpad_acpi.o
 obj-$(CONFIG_FUJITSU_LAPTOP)   += fujitsu-laptop.o
 obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
+obj-$(CONFIG_UCC_TDM)  += ucc_tdm.o
diff --git a/drivers/misc/ucc_tdm.c b/drivers/misc/ucc_tdm.c
new file mode 100644
index 000..98e7c72
--- /dev/null
+++ b/drivers/misc/ucc_tdm.c
@@ -0,0 +1,1000 @@
+/*
+ * drivers/misc/ucc_tdm.c
+ *
+ * UCC Based Linux TDM Driver
+ * This driver is designed to support UCC based TDM for PowerPC processors.
+ * This driver can interface with SLIC device to run VOIP kind of
+ * applications.
+ *
+ * Author: Ashish Kalra  Poonam Aggrwal
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free 

[PATCH 2/3] Platform changes for UCC TDM driver for MPC8323ERDB.Also includes related QE changes and dts entries.

2008-01-23 Thread Poonam_Aggrwal-b10812
From: Poonam Aggrwal [EMAIL PROTECTED]

This patch makes necessary changes in the QE and UCC framework to support 
TDM. It also adds support to configure the BRG properly through device 
tree entries. Includes the device tree changes for UCC TDM driver as well.
It also includes device tree entries for UCC TDM driver.

Tested on MPC8323ERDB platform.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED] 
---
 arch/powerpc/boot/dts/mpc832x_rdb.dts |   58 +++
 arch/powerpc/sysdev/qe_lib/qe.c   |  205 --
 arch/powerpc/sysdev/qe_lib/ucc.c  |  265 +
 arch/powerpc/sysdev/qe_lib/ucc_fast.c |   37 +
 include/asm-powerpc/qe.h  |8 +
 include/asm-powerpc/ucc.h |4 +
 include/asm-powerpc/ucc_fast.h|4 +
 7 files changed, 568 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..c0e6283 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -105,6 +105,17 @@
device_type = par_io;
num-ports = 7;
 
+   ucc1pio:[EMAIL PROTECTED] {
+   pio-map = 
+   /* port  pin  dir  open_drain  assignment  has_irq */
+   0  e  2  0  1  0/* CLK11 */
+   3 16  1  0  2  0/* BRG9 */
+   3 1b  1  0  2  0/* BRG3 */
+   0  0  3  0  2  0/* TDMATxD0 */
+   0  4  3  0  2  0/* TDMARxD0 */
+   3 1b  2  0  1  0;  /* CLK1 */
+   };
+
ucc2pio:[EMAIL PROTECTED] {
pio-map = 
/* port  pin  dir  open_drain  assignment  has_irq */
@@ -169,6 +180,36 @@
};
};
 
+   clocks {
+   compatible = fsl,cpm-clocks;
+   /* clock freqs in Hz(for CLK1~CLK24).
+* CLK11 is 1024KHz,
+* all other clocks unused
+* #clock-cells define number of cells
+* used by the clock-frequency.
+* right now only #clock cells=1 is
+* implemented. Provision is there to
+* handle frequencies 4Gig
+*/
+   #clock-cells = 1;
+   clock-frequency = 0 0 0 0 0 0
+  0 0 0 0 d#1024000 0
+  0 0 0 0 0 0
+  0 0 0 0 0 0;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,cpm-brg;
+   /* input clock sources for all the 16 BRGs.
+* 1-24 for CLK1 to CLK24.
+* BRG9 uses CLK11,BRG1 and BRG2-8 use
+* the QE clock.
+*/
+   fsl,brg-sources = 0 0 0 0 0 0 0 0
+  b 0 0 0 0 0 0 0;
+   reg = 640 7f;
+   };
+
[EMAIL PROTECTED] {
device_type = spi;
compatible = fsl_spi;
@@ -187,6 +228,23 @@
mode = cpu;
};
 
+   [EMAIL PROTECTED] {
+   device_type = tdm;
+   compatible = fsl,ucc-tdm;
+   model = UCC;
+   device-id = 1;
+   fsl,tdm-num = 1;
+   fsl,si-num = 1;
+   fsl,tdm-tx-clk = CLK1;
+   fsl,tdm-rx-clk = CLK1;
+   fsl,tdm-tx-sync = BRG9;
+   fsl,tdm-rx-sync = BRG9;
+   reg = 2000 200;
+   interrupts = 20;
+   interrupt-parent = qeic;
+   pio-handle = ucc1pio;
+   };
+
[EMAIL PROTECTED] {
device_type = network;
compatible = ucc_geth;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1df3b4a..fddc3d8 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -149,20 +149,189 @@ EXPORT_SYMBOL(qe_issue_cmd);
  */
 static unsigned int brg_clk = 0;
 
-unsigned int get_brg_clk(void)
+u32 get_brg_clk(enum qe_clock brgclk, enum qe_clock *brg_source)
 {
-   struct device_node 

[PATCH UCC TDM 3/3 ] Modified Documentation to explain dts entries for TDM driver

2008-01-23 Thread Poonam_Aggrwal-b10812
From: Poonam Aggrwal [EMAIL PROTECTED]

Modified Documentation to explain new properties introduced for UCC TDM 
driver. Also two new nodes have been added brg and clocks to configure 
a BRG from device tree.


Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
 Documentation/powerpc/booting-without-of.txt |   96 +-
 1 files changed, 94 insertions(+), 2 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index e9a3cb1..94a6b4b 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1613,8 +1613,8 @@ platforms are moved over to use the flattened-device-tree 
model.
 
Required properties:
- device_type : should be network, hldc, uart, transparent
-bisync or atm.
-   - compatible : could be ucc_geth or fsl_atm and so on.
+bisync, atm or tdm.
+   - compatible : could be ucc_geth, fsl_atm or fsl,ucc_tdm and so on.
- model : should be UCC.
- device-id : the ucc number(1-8), corresponding to UCCx in UM.
- reg : Offset and length of the register set for the device
@@ -1666,7 +1666,44 @@ platforms are moved over to use the 
flattened-device-tree model.
pio-handle = 140001;
};
 
+   Required properties for tdm device_type:
+   - instead of tx-clock and rx-clock following clock properties are
+ required:
+   - fsl,tdm-tx-clk : This property selects the TX clock source for TDM
+   from a bank of clocks.
+   - fsl,tdm-rx-clk : This property selects the RX clock source for TDM
+   from a bank of clocks.
+   - fsl,tdm-tx-sync : This property selects the TX Frame sync source
+   for TDM from a bank of clocks.
+   - fsl,tdm-rx-sync : This property selects the TX Frame sync source
+   for TDM from a bank of clocks.
+
+   All the above mentioned properties are string type with possible
+   values
+   CLK1, CLK2, CLK3...CLK24 and so on
+   BRG1, BRG2, BRG3...BRG16 and so on
+
+  - fsl,tdm-num : TDM to be used (1,2,3 or 4 for TDMA TDMB TDMC TDMD)
+  - fsl,si-num :  Serial Interface to be used.
 
+   Example:
+   [EMAIL PROTECTED] {
+   device_type = tdm;
+   compatible = fsl,ucc-tdm;
+   model = UCC;
+   device-id = 1;
+   fsl,tdm-num = 1;
+   fsl,si-num = 1;
+   fsl,tdm-tx-clk = CLK1;
+   fsl,tdm-rx-clk = CLK1;
+   fsl,tdm-tx-sync = BRG9;
+   fsl,tdm-rx-sync = BRG9;
+   reg = 2000 200;
+   interrupts = 20;
+   interrupt-parent = qeic;
+   pio-handle = ucc1pio;
+   };
+
v) Parallel I/O Ports
 
This node configures Parallel I/O ports for CPUs with QE support.
@@ -1772,6 +1809,61 @@ platforms are moved over to use the 
flattened-device-tree model.
};
};
 
+  viii) Clocks (clocks)
+   This node specifies the frequency values for all the external clocks
+   viz CLK1 to CLK24 in Hz.
+
+  Required Properties:
+  - compatible : should be fsl,cpm-clocks.
+  - #clock-cells : It specifies the number of cells occupied by clock-frequency
+property. Currently #clock-cells = 1 is only supported and implemented.
+This property is kept for future in case we need frequencies higher than
+4 GHz.
+  - clock-frequency : It is a list of u32 values to represent the frequency
+of each external clock(CLK1 to CLK24) in Hz.Each entry occupies
+number of cells specified by #clock-cells property(1 for now).
+
+  Example:
+
+   clocks {
+   compatible = fsl,cpm-clocks;
+   #clock-cells = 1;
+   /* clock freqs in Hz(for CLK1~CLK24).
+* CLK11 is 1024KHz,
+* all other clocks unused
+*/
+   clock-frequency = 0 0 0 0 0 0
+  0 0 0 0 0 d#1024000 0
+  0 0 0 0 0 0
+  0 0 0 0 0 0;
+   };
+
+  ix) Baud Rate Generator (BRG)
+
+  Required properties:
+  - compatible : shpuld be fsl,cpm-brg
+  - fsl,brg-sources : define the input clock for all 16 BRGs. The input
+clock source could be 1 to 24 for CLK1 to CLK24. Zero means that the
+particular BRG will be driven by QE clock(BRGCLK).
+  - reg : This property defines the address and size of the memory-mapped
+registers of the BRG.
+
+  Example:
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,qe-brg;
+   /* input clock sources for all the 16 BRGs.
+* 1-24 for CLK1 to CLK24.
+* BRG9 uses CLK11 others 

[PATCH] Platform Changes for UCC TDM driver for MPC8323ERDB. Also includes related QE changes.

2007-12-18 Thread Poonam_Aggrwal-b10812
From: Poonam Aggrwal [EMAIL PROTECTED]

This patch makes necessary changes in the QE and UCC framework to support 
TDM. It also adds support to configure the BRG properly through device 
tree entries. Includes the device tree changes for UCC TDM driver as well.
It also includes device tree entries for UCC TDM driver.

Tested on MPC8323ERDB platform.


Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
Incorporated comments of Stephen and Tabi. Please review if they look 
fine.

 arch/powerpc/boot/dts/mpc832x_rdb.dts |   58 +++
 arch/powerpc/sysdev/qe_lib/qe.c   |  205 --
 arch/powerpc/sysdev/qe_lib/ucc.c  |  265 +
 arch/powerpc/sysdev/qe_lib/ucc_fast.c |   37 +
 include/asm-powerpc/qe.h  |8 +
 include/asm-powerpc/ucc.h |4 +
 include/asm-powerpc/ucc_fast.h|4 +
 7 files changed, 568 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..c0e6283 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -105,6 +105,17 @@
device_type = par_io;
num-ports = 7;
 
+   ucc1pio:[EMAIL PROTECTED] {
+   pio-map = 
+   /* port  pin  dir  open_drain  assignment  has_irq */
+   0  e  2  0  1  0/* CLK11 */
+   3 16  1  0  2  0/* BRG9 */
+   3 1b  1  0  2  0/* BRG3 */
+   0  0  3  0  2  0/* TDMATxD0 */
+   0  4  3  0  2  0/* TDMARxD0 */
+   3 1b  2  0  1  0;  /* CLK1 */
+   };
+
ucc2pio:[EMAIL PROTECTED] {
pio-map = 
/* port  pin  dir  open_drain  assignment  has_irq */
@@ -169,6 +180,36 @@
};
};
 
+   clocks {
+   compatible = fsl,cpm-clocks;
+   /* clock freqs in Hz(for CLK1~CLK24).
+* CLK11 is 1024KHz,
+* all other clocks unused
+* #clock-cells define number of cells
+* used by the clock-frequency.
+* right now only #clock cells=1 is
+* implemented. Provision is there to
+* handle frequencies 4Gig
+*/
+   #clock-cells = 1;
+   clock-frequency = 0 0 0 0 0 0
+  0 0 0 0 d#1024000 0
+  0 0 0 0 0 0
+  0 0 0 0 0 0;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,cpm-brg;
+   /* input clock sources for all the 16 BRGs.
+* 1-24 for CLK1 to CLK24.
+* BRG9 uses CLK11,BRG1 and BRG2-8 use
+* the QE clock.
+*/
+   fsl,brg-sources = 0 0 0 0 0 0 0 0
+  b 0 0 0 0 0 0 0;
+   reg = 640 7f;
+   };
+
[EMAIL PROTECTED] {
device_type = spi;
compatible = fsl_spi;
@@ -187,6 +228,23 @@
mode = cpu;
};
 
+   [EMAIL PROTECTED] {
+   device_type = tdm;
+   compatible = fsl,ucc-tdm;
+   model = UCC;
+   device-id = 1;
+   fsl,tdm-num = 1;
+   fsl,si-num = 1;
+   fsl,tdm-tx-clk = CLK1;
+   fsl,tdm-rx-clk = CLK1;
+   fsl,tdm-tx-sync = BRG9;
+   fsl,tdm-rx-sync = BRG9;
+   reg = 2000 200;
+   interrupts = 20;
+   interrupt-parent = qeic;
+   pio-handle = ucc1pio;
+   };
+
[EMAIL PROTECTED] {
device_type = network;
compatible = ucc_geth;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1df3b4a..f1bc902 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -149,20 +149,189 @@ EXPORT_SYMBOL(qe_issue_cmd);
  */
 static unsigned int brg_clk = 0;
 
-unsigned int get_brg_clk(void)
+u32 

[PATCH 1/3] UCC based TDM driver for MPC83xx platforms.

2007-12-10 Thread Poonam_Aggrwal-b10812
From: Poonam Agarwal-b10812 [EMAIL PROTECTED]

The UCC TDM driver basically multiplexes and demultiplexes data from 
different channels. It can interface with for example SLIC kind of devices 
to receive TDM data  demultiplex it and send to upper applications. At the 
transmit end it receives data for different channels multiplexes it and 
sends them on the TDM channel. It internally uses TSA( Time Slot Assigner) 
which does multiplexing and demultiplexing, UCC to perform SDMA between 
host buffers and the TSA, CMX to connect TSA to UCC.

This driver will run on MPC8323E-RDB platforms.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---

 drivers/misc/Kconfig   |   21 +
 drivers/misc/Makefile  |1 +
 drivers/misc/ucc_tdm.c | 1068 
 drivers/misc/ucc_tdm.h |  227 ++
 4 files changed, 1317 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/ucc_tdm.c
 create mode 100644 drivers/misc/ucc_tdm.h

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b5e67c0..698a72c 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -219,6 +219,27 @@ config THINKPAD_ACPI_BAY
 
  If you are not sure, say Y here.
 
+config UCC_TDM
+   bool Freescale UCC  TDM Driver
+   depends on QUICC_ENGINE  UCC_FAST
+   default n
+   ---help---
+ The TDM driver is for UCC based TDM devices for example, TDM device on
+ MPC832x RDB. Select it to run PowerVoIP on MPC832x RDB board.
+ The TDM driver can interface with SLIC kind of devices to transmit
+ and receive TDM samples. The TDM driver receives Time Division
+ multiplexed samples(for different channels) from the SLIC device,
+ demutiplexes them and sends them to the upper layers. At the transmit
+ end the TDM drivers receives samples for different channels, it
+ multiplexes them and sends them to the SLIC device.
+
+config TDM_LINEAR_PCM
+   bool Linear PCM mode
+   depends on UCC_TDM
+   ---help---
+ This mode should be selected if the TDM driver interface with the
+ SLIC device is linear PCM(e.g. 16 bit samples). If not selected the
+ interface will be 8 bit u-law.
 
 config ATMEL_SSC
tristate Device driver for Atmel SSC peripheral
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 87f2685..6f0c49d 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)+= thinkpad_acpi.o
 obj-$(CONFIG_FUJITSU_LAPTOP)   += fujitsu-laptop.o
 obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
+obj-$(CONFIG_UCC_TDM)  += ucc_tdm.o
diff --git a/drivers/misc/ucc_tdm.c b/drivers/misc/ucc_tdm.c
new file mode 100644
index 000..232d537
--- /dev/null
+++ b/drivers/misc/ucc_tdm.c
@@ -0,0 +1,1068 @@
+/*
+ * drivers/misc/ucc_tdm.c
+ *
+ * UCC Based Linux TDM Driver
+ * This driver is designed to support UCC based TDM for PowerPC processors.
+ * This driver can interface with SLIC device to run VOIP kind of
+ * applications.
+ *
+ * Author: Ashish Kalra  Poonam Aggrwal
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include linux/autoconf.h
+#include linux/module.h
+#include linux/sched.h
+#include linux/kernel.h
+#include linux/slab.h
+#include linux/errno.h
+#include linux/types.h
+#include linux/interrupt.h
+#include linux/time.h
+#include linux/skbuff.h
+#include linux/proc_fs.h
+#include linux/delay.h
+#include linux/dma-mapping.h
+#include linux/string.h
+#include linux/irq.h
+#include linux/of_platform.h
+#include linux/io.h
+#include linux/wait.h
+#include linux/timer.h
+
+#include asm/immap_qe.h
+#include asm/qe.h
+#include asm/ucc.h
+#include asm/ucc_fast.h
+#include asm/ucc_slow.h
+
+#include ucc_tdm.h
+#define DRV_DESC Freescale QE UCC TDM Driver
+#define DRV_NAME ucc_tdm
+
+/*
+ * define the following #define if snooping or hardware-based cache coherency
+ * is disabled on the UCC transparent controller.This flag enables
+ * software-based cache-coherency support by explicitly flushing data cache
+ * contents after setting up the TDM output buffer(s) and invalidating the
+ * data cache contents before the TDM input buffer(s) are read.
+ */
+#undef UCC_CACHE_SNOOPING_DISABLED
+
+#define MAX_NUM_TDM_DEVICES 8
+
+static struct tdm_ctrl *tdm_ctrl[MAX_NUM_TDM_DEVICES];
+
+static int num_tdm_devices;
+static int num_tdm_clients;
+
+#define PREV_PHASE(x) ((x == 0) ? MAX_PHASE : (x - 1))
+#define NEXT_PHASE(x) (((x + 1)  MAX_PHASE) ? 0 : (x + 

[PATCH 1/3] drivers/misc :UCC based TDM driver for MPC83xx platforms.

2007-12-10 Thread Poonam_Aggrwal-b10812
From: Poonam Aggrwal [EMAIL PROTECTED]

The UCC TDM driver basically multiplexes and demultiplexes data from 
different channels. It can interface with for example SLIC kind of devices 
to receive TDM data  demultiplex it and send to upper applications. At the 
transmit end it receives data for different channels multiplexes it and 
sends them on the TDM channel. It internally uses TSA( Time Slot Assigner) 
which does multiplexing and demultiplexing, UCC to perform SDMA between 
host buffers and the TSA, CMX to connect TSA to UCC.

This driver will run on MPC8323E-RDB platforms.


Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
 drivers/misc/Kconfig   |   21 +
 drivers/misc/Makefile  |1 +
 drivers/misc/ucc_tdm.c | 1068 
 drivers/misc/ucc_tdm.h |  227 ++
 4 files changed, 1317 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/ucc_tdm.c
 create mode 100644 drivers/misc/ucc_tdm.h

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b5e67c0..698a72c 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -219,6 +219,27 @@ config THINKPAD_ACPI_BAY
 
  If you are not sure, say Y here.
 
+config UCC_TDM
+   bool Freescale UCC  TDM Driver
+   depends on QUICC_ENGINE  UCC_FAST
+   default n
+   ---help---
+ The TDM driver is for UCC based TDM devices for example, TDM device on
+ MPC832x RDB. Select it to run PowerVoIP on MPC832x RDB board.
+ The TDM driver can interface with SLIC kind of devices to transmit
+ and receive TDM samples. The TDM driver receives Time Division
+ multiplexed samples(for different channels) from the SLIC device,
+ demutiplexes them and sends them to the upper layers. At the transmit
+ end the TDM drivers receives samples for different channels, it
+ multiplexes them and sends them to the SLIC device.
+
+config TDM_LINEAR_PCM
+   bool Linear PCM mode
+   depends on UCC_TDM
+   ---help---
+ This mode should be selected if the TDM driver interface with the
+ SLIC device is linear PCM(e.g. 16 bit samples). If not selected the
+ interface will be 8 bit u-law.
 
 config ATMEL_SSC
tristate Device driver for Atmel SSC peripheral
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 87f2685..6f0c49d 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -17,3 +17,4 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o
 obj-$(CONFIG_THINKPAD_ACPI)+= thinkpad_acpi.o
 obj-$(CONFIG_FUJITSU_LAPTOP)   += fujitsu-laptop.o
 obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o
+obj-$(CONFIG_UCC_TDM)  += ucc_tdm.o
diff --git a/drivers/misc/ucc_tdm.c b/drivers/misc/ucc_tdm.c
new file mode 100644
index 000..232d537
--- /dev/null
+++ b/drivers/misc/ucc_tdm.c
@@ -0,0 +1,1068 @@
+/*
+ * drivers/misc/ucc_tdm.c
+ *
+ * UCC Based Linux TDM Driver
+ * This driver is designed to support UCC based TDM for PowerPC processors.
+ * This driver can interface with SLIC device to run VOIP kind of
+ * applications.
+ *
+ * Author: Ashish Kalra  Poonam Aggrwal
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include linux/autoconf.h
+#include linux/module.h
+#include linux/sched.h
+#include linux/kernel.h
+#include linux/slab.h
+#include linux/errno.h
+#include linux/types.h
+#include linux/interrupt.h
+#include linux/time.h
+#include linux/skbuff.h
+#include linux/proc_fs.h
+#include linux/delay.h
+#include linux/dma-mapping.h
+#include linux/string.h
+#include linux/irq.h
+#include linux/of_platform.h
+#include linux/io.h
+#include linux/wait.h
+#include linux/timer.h
+
+#include asm/immap_qe.h
+#include asm/qe.h
+#include asm/ucc.h
+#include asm/ucc_fast.h
+#include asm/ucc_slow.h
+
+#include ucc_tdm.h
+#define DRV_DESC Freescale QE UCC TDM Driver
+#define DRV_NAME ucc_tdm
+
+/*
+ * define the following #define if snooping or hardware-based cache coherency
+ * is disabled on the UCC transparent controller.This flag enables
+ * software-based cache-coherency support by explicitly flushing data cache
+ * contents after setting up the TDM output buffer(s) and invalidating the
+ * data cache contents before the TDM input buffer(s) are read.
+ */
+#undef UCC_CACHE_SNOOPING_DISABLED
+
+#define MAX_NUM_TDM_DEVICES 8
+
+static struct tdm_ctrl *tdm_ctrl[MAX_NUM_TDM_DEVICES];
+
+static int num_tdm_devices;
+static int num_tdm_clients;
+
+#define PREV_PHASE(x) ((x == 0) ? MAX_PHASE : (x - 1))
+#define NEXT_PHASE(x) (((x + 1)  MAX_PHASE) ? 0 : (x + 1))
+

[PATCH 2/3] arch/ : Platform changes for UCC TDM driver for MPC8323ERDB.Also includes related QE changes.

2007-12-10 Thread Poonam_Aggrwal-b10812
From: Poonam Aggrwal [EMAIL PROTECTED]

This patch makes necessary changes in the QE and UCC framework to support 
TDM. It also adds support to configure the BRG properly through device 
tree entries. Includes the device tree changes for UCC TDM driver as well.
It also includes device tree entries for UCC TDM driver.

Tested on MPC8323ERDB platform.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
 arch/powerpc/boot/dts/mpc832x_rdb.dts |   58 +++
 arch/powerpc/sysdev/qe_lib/qe.c   |  128 ++--
 arch/powerpc/sysdev/qe_lib/ucc.c  |  265 +
 arch/powerpc/sysdev/qe_lib/ucc_fast.c |   37 +
 include/asm-powerpc/qe.h  |8 +
 include/asm-powerpc/ucc.h |4 +
 include/asm-powerpc/ucc_fast.h|4 +
 7 files changed, 492 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts 
b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..333408c 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -105,6 +105,17 @@
device_type = par_io;
num-ports = 7;
 
+   ucc1pio:[EMAIL PROTECTED] {
+   pio-map = 
+   /* port  pin  dir  open_drain  assignment  has_irq */
+   0  e  2  0  1  0/* CLK11 */
+   3 16  1  0  2  0/* BRG9 */
+   3 1b  1  0  2  0/* BRG3 */
+   0  0  3  0  2  0/* TDMATxD0 */
+   0  4  3  0  2  0/* TDMARxD0 */
+   3 1b  2  0  1  0;  /* CLK1 */
+   };
+
ucc2pio:[EMAIL PROTECTED] {
pio-map = 
/* port  pin  dir  open_drain  assignment  has_irq */
@@ -169,6 +180,36 @@
};
};
 
+   clocks {
+   compatible = fsl,cpm-clocks;
+   /* clock freqs in Hz(for CLK1~CLK24).
+* CLK11 is 1024KHz,
+* all other clocks unused
+* #clock-cells define number of cells
+* used by the clock-frequency.
+* right now only #clock cells=1 is
+* implemented. Provision is there to
+* handle frequencies 4Gig
+*/
+   #clock-cells = 1;
+   clock-frequency = 0 0 0 0 0 0
+  0 0 0 0 d#1024000 0
+  0 0 0 0 0 0
+  0 0 0 0 0 0;
+   };
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,cpm-brg;
+   /* input clock sources for all the 16 BRGs.
+* 1-24 for CLK1 to CLK24.
+* BRG9 uses CLK11,BRG1 and BRG2-8 use
+* the QE clock.
+*/
+   fsl,brg-sources = 0 0 0 0 0 0 0 0
+  b 0 0 0 0 0 0 0;
+   reg = 640 7f;
+   };
+
[EMAIL PROTECTED] {
device_type = spi;
compatible = fsl_spi;
@@ -187,6 +228,23 @@
mode = cpu;
};
 
+   [EMAIL PROTECTED] {
+   device_type = tdm;
+   compatible = fsl,ucc-tdm;
+   model = UCC;
+   device-id = 1;
+   fsl,tdm-num = 1;
+   fsl,si-num = 1;
+   fsl,tdm-tx-clk = CLK1;
+   fsl,tdm-rx-clk = CLK1;
+   fsl,tdm-tx-sync = BRG9;
+   fsl,tdm-rx-sync = BRG9;
+   reg = 2000 200;
+   interrupts = 20;
+   interrupt-parent = qeic;
+   pio-handle = ucc1pio;
+   };
+
[EMAIL PROTECTED] {
device_type = network;
compatible = ucc_geth;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 1df3b4a..abcf0b4 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -149,22 +149,116 @@ EXPORT_SYMBOL(qe_issue_cmd);
  */
 static unsigned int brg_clk = 0;
 
-unsigned int get_brg_clk(void)
+u32 get_brg_clk(enum qe_clock brgclk, enum qe_clock *brg_source)
 {
-   struct device_node *qe;
- 

[PATCH 3/3] Modified Documentation to explain dts entries for UCC TDM driver.

2007-12-10 Thread Poonam_Aggrwal-b10812
From: Poonam Aggrwal [EMAIL PROTECTED]

Modified Documentation to explain new properties introduced for UCC TDM 
driver. Also two new nodes have been added brg and clocks to configure 
a BRG from device tree.

Signed-off-by: Poonam Aggrwal [EMAIL PROTECTED]
Signed-off-by: Ashish Kalra [EMAIL PROTECTED]
Signed-off-by: Kim Phillips [EMAIL PROTECTED]
Signed-off-by: Michael Barkowski [EMAIL PROTECTED]
---
 Documentation/powerpc/booting-without-of.txt |   96 +-
 1 files changed, 94 insertions(+), 2 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt 
b/Documentation/powerpc/booting-without-of.txt
index e9a3cb1..94a6b4b 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1613,8 +1613,8 @@ platforms are moved over to use the flattened-device-tree 
model.
 
Required properties:
- device_type : should be network, hldc, uart, transparent
-bisync or atm.
-   - compatible : could be ucc_geth or fsl_atm and so on.
+bisync, atm or tdm.
+   - compatible : could be ucc_geth, fsl_atm or fsl,ucc_tdm and so on.
- model : should be UCC.
- device-id : the ucc number(1-8), corresponding to UCCx in UM.
- reg : Offset and length of the register set for the device
@@ -1666,7 +1666,44 @@ platforms are moved over to use the 
flattened-device-tree model.
pio-handle = 140001;
};
 
+   Required properties for tdm device_type:
+   - instead of tx-clock and rx-clock following clock properties are
+ required:
+   - fsl,tdm-tx-clk : This property selects the TX clock source for TDM
+   from a bank of clocks.
+   - fsl,tdm-rx-clk : This property selects the RX clock source for TDM
+   from a bank of clocks.
+   - fsl,tdm-tx-sync : This property selects the TX Frame sync source
+   for TDM from a bank of clocks.
+   - fsl,tdm-rx-sync : This property selects the TX Frame sync source
+   for TDM from a bank of clocks.
+
+   All the above mentioned properties are string type with possible
+   values
+   CLK1, CLK2, CLK3...CLK24 and so on
+   BRG1, BRG2, BRG3...BRG16 and so on
+
+  - fsl,tdm-num : TDM to be used (1,2,3 or 4 for TDMA TDMB TDMC TDMD)
+  - fsl,si-num :  Serial Interface to be used.
 
+   Example:
+   [EMAIL PROTECTED] {
+   device_type = tdm;
+   compatible = fsl,ucc-tdm;
+   model = UCC;
+   device-id = 1;
+   fsl,tdm-num = 1;
+   fsl,si-num = 1;
+   fsl,tdm-tx-clk = CLK1;
+   fsl,tdm-rx-clk = CLK1;
+   fsl,tdm-tx-sync = BRG9;
+   fsl,tdm-rx-sync = BRG9;
+   reg = 2000 200;
+   interrupts = 20;
+   interrupt-parent = qeic;
+   pio-handle = ucc1pio;
+   };
+
v) Parallel I/O Ports
 
This node configures Parallel I/O ports for CPUs with QE support.
@@ -1772,6 +1809,61 @@ platforms are moved over to use the 
flattened-device-tree model.
};
};
 
+  viii) Clocks (clocks)
+   This node specifies the frequency values for all the external clocks
+   viz CLK1 to CLK24 in Hz.
+
+  Required Properties:
+  - compatible : should be fsl,cpm-clocks.
+  - #clock-cells : It specifies the number of cells occupied by clock-frequency
+property. Currently #clock-cells = 1 is only supported and implemented.
+This property is kept for future in case we need frequencies higher than
+4 GHz.
+  - clock-frequency : It is a list of u32 values to represent the frequency
+of each external clock(CLK1 to CLK24) in Hz.Each entry occupies
+number of cells specified by #clock-cells property(1 for now).
+
+  Example:
+
+   clocks {
+   compatible = fsl,cpm-clocks;
+   #clock-cells = 1;
+   /* clock freqs in Hz(for CLK1~CLK24).
+* CLK11 is 1024KHz,
+* all other clocks unused
+*/
+   clock-frequency = 0 0 0 0 0 0
+  0 0 0 0 0 d#1024000 0
+  0 0 0 0 0 0
+  0 0 0 0 0 0;
+   };
+
+  ix) Baud Rate Generator (BRG)
+
+  Required properties:
+  - compatible : shpuld be fsl,cpm-brg
+  - fsl,brg-sources : define the input clock for all 16 BRGs. The input
+clock source could be 1 to 24 for CLK1 to CLK24. Zero means that the
+particular BRG will be driven by QE clock(BRGCLK).
+  - reg : This property defines the address and size of the memory-mapped
+registers of the BRG.
+
+  Example:
+
+   [EMAIL PROTECTED] {
+   compatible = fsl,qe-brg;
+   /* input clock sources for all the 16 BRGs.
+* 1-24 for CLK1 to CLK24.
+* BRG9 uses CLK11 others use