All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-2.4-mpc5xxx repository updates
@ 2004-01-21 17:01 Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2004-01-21 17:01 UTC (permalink / raw)
  To: linuxppc-dev


I know it's been a while, and the general consensious (as I read it at
least) was that this code is still too ugly to get to kernel.org, but
regardless, I've finally gotten around to updating this repository
again.  And this time I didn't restart the repository from scratch, I
just pushed.  The only change is:
- From Dale Farnsworth, fix the IceCube support

--
Tom Rini
http://gate.crashing.org/~trini/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-2.4-mpc5xxx repository updates
  2004-01-21 20:32 Wolfgang Denk
  2004-01-21 21:46 ` Benjamin Herrenschmidt
@ 2004-01-22 16:59 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2004-01-22 16:59 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-dev


On Wed, Jan 21, 2004 at 09:32:37PM +0100, Wolfgang Denk wrote:

> In message <20040121170151.GS13454@stop.crashing.org> you wrote:
> >
> > I know it's been a while, and the general consensious (as I read it at
> > least) was that this code is still too ugly to get to kernel.org, but
> > regardless, I've finally gotten around to updating this repository
> > again.  And this time I didn't restart the repository from scratch, I
> > just pushed.  The only change is:
> > - From Dale Farnsworth, fix the IceCube support
>
> OK, here are some more patches:
[snip]
> patch.i2c_speed:
>
> 	* Make I2C speed on MPC5200 configurable by module parameter

I've changed this slightly so that we export __res on || CONFIG_UBOOT,
not CONFIG_6xx (EXPORT_SYMBOL() of an undefined symbol doesn't work,
iirc).

I'll be pushing 'em all out within the hour.

--
Tom Rini
http://gate.crashing.org/~trini/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-2.4-mpc5xxx repository updates
  2004-01-21 20:32 Wolfgang Denk
@ 2004-01-21 21:46 ` Benjamin Herrenschmidt
  2004-01-22 16:59 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2004-01-21 21:46 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: Tom Rini, linuxppc-dev list


On Thu, 2004-01-22 at 07:32, Wolfgang Denk wrote:
> In message <20040121170151.GS13454@stop.crashing.org> you wrote:
> >
> > I know it's been a while, and the general consensious (as I read it at
> > least) was that this code is still too ugly to get to kernel.org, but
> > regardless, I've finally gotten around to updating this repository
> > again.  And this time I didn't restart the repository from scratch, I
> > just pushed.  The only change is:
> > - From Dale Farnsworth, fix the IceCube support

Did you guys ever get the ATA in a working state with DMA ?

Ben.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-2.4-mpc5xxx repository updates
@ 2004-01-21 20:32 Wolfgang Denk
  2004-01-21 21:46 ` Benjamin Herrenschmidt
  2004-01-22 16:59 ` Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-01-21 20:32 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]

In message <20040121170151.GS13454@stop.crashing.org> you wrote:
>
> I know it's been a while, and the general consensious (as I read it at
> least) was that this code is still too ugly to get to kernel.org, but
> regardless, I've finally gotten around to updating this repository
> again.  And this time I didn't restart the repository from scratch, I
> just pushed.  The only change is:
> - From Dale Farnsworth, fix the IceCube support

OK, here are some more patches:

patch.i2c_protocol:

	* Fix I2C protocol problem on MPC5200

patch.cleanup:

	* Cleanup MPC5200 code.
	* Cleanup a few compiler warnings

patch.i2c_speed:

	* Make I2C speed on MPC5200 configurable by module parameter

patch.bestcomm:

	* Update BestComm API implementation and documentation

        [In this patch the file
        arch/ppc/5xxx_io/bestcomm/doc/BestCommAPIUserGuide.pdf is
        missing because of size (615kB). Please get it from our CVS
        server.]

patch.MBAR:

	* Fix PSC* MBAR offsets for MPC5xxx


Best regards,

Wolfgang Denk

--
See us @ Embedded World, Nuremberg, Feb 17 - 19,  Hall 12.0 Booth 440
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
A good aphorism is too hard for the tooth of time, and  is  not  worn
away  by  all  the  centuries,  although  it serves as food for every
epoch.                                  - Friedrich Wilhelm Nietzsche
                          _Miscellaneous Maxims and Opinions_ no. 168


[-- Attachment #2: patch.i2c_protocol --]
[-- Type: application/octet-stream , Size: 846 bytes --]

PatchSet 147 
Date: 2003/12/05 11:59:56
Log:
Fix I2C protocol problem on MPC5200

Index: drivers/i2c/i2c-algo-mpc5xxx.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/drivers/i2c/i2c-algo-mpc5xxx.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- drivers/i2c/i2c-algo-mpc5xxx.c	3 Dec 2003 19:13:30 -0000	1.1
+++ drivers/i2c/i2c-algo-mpc5xxx.c	5 Dec 2003 11:59:56 -0000	1.2
@@ -210,6 +210,7 @@
 	int				i;
 	
 	mpc5xxx_out(&regs->mcr, 0, MPC5xxx_I2C_TX);
+	mpc5xxx_out(&regs->mcr, 0, MPC5xxx_I2C_TXAK);
 
 	for (i = 0; i < count; ++i)
 	{
@@ -233,7 +234,6 @@
 	
 	mpc5xxx_out(&regs->mcr, MPC5xxx_I2C_TXAK, MPC5xxx_I2C_TXAK);
 	buf[rdcount++] = mpc5xxx_in(&regs->mdr);
-	mpc5xxx_out(&regs->mcr, 0, MPC5xxx_I2C_TXAK);
 	
 	if (wait_for_pin(algo_data, &status))
 	{

[-- Attachment #3: patch.cleanup --]
[-- Type: application/octet-stream , Size: 1712 bytes --]

PatchSet 149 
Date: 2003/12/05 19:17:23
Log:
Cleanup MPC5200 code.
Cleanup a few compiler warnings

Index: arch/ppc/5xxx_io/bestcomm/Makefile
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- arch/ppc/5xxx_io/bestcomm/Makefile	3 Dec 2003 19:08:20 -0000	1.2
+++ arch/ppc/5xxx_io/bestcomm/Makefile	5 Dec 2003 19:17:23 -0000	1.3
@@ -7,7 +7,10 @@
 #
 # Note 2! The CFLAGS definition is now in the main makefile...
 
-EXTRA_CFLAGS = -I$(TOPDIR)/arch/$(ARCH)/5xxx_io/bestcomm/include -I$(TOPDIR)/arch/$(ARCH)/5xxx_io/bestcomm/capi -I$(TOPDIR)/arch/$(ARCH)/5xxx_io/bestcomm/capi/task_api -I$(TOPDIR)/arch/$(ARCH)/5xxx_io/bestcomm/code_dma/image_rtos1
+EXTRA_CFLAGS = -I$(TOPDIR)/arch/$(ARCH)/5xxx_io/bestcomm/include \
+	       -I$(TOPDIR)/arch/$(ARCH)/5xxx_io/bestcomm/capi \
+	       -I$(TOPDIR)/arch/$(ARCH)/5xxx_io/bestcomm/capi/task_api \
+	       -I$(TOPDIR)/arch/$(ARCH)/5xxx_io/bestcomm/code_dma/image_rtos1
 
 O_TARGET := bestcomm.o
 
Index: arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/dma_image.h
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/dma_image.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/dma_image.h	15 Nov 2003 20:01:19 -0000	1.1
+++ arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/dma_image.h	5 Dec 2003 19:17:23 -0000	1.2
@@ -450,4 +450,4 @@
 extern TASK_GEN_DP_BD_1_api_t *TASK_GEN_DP_BD_1_api;
 
 
-#endif
\ No newline at end of file
+#endif

[-- Attachment #4: patch.i2c_speed --]
[-- Type: application/octet-stream , Size: 3068 bytes --]

PatchSet 158 
Date: 2003/12/20 22:23:53
Log:
Make I2C speed on MPC5200 configurable by module parameter

Index: arch/ppc/kernel/ppc_ksyms.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/kernel/ppc_ksyms.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- arch/ppc/kernel/ppc_ksyms.c	15 Nov 2003 01:11:32 -0000	1.9
+++ arch/ppc/kernel/ppc_ksyms.c	20 Dec 2003 22:23:53 -0000	1.10
@@ -355,7 +355,7 @@
 EXPORT_SYMBOL(debugger_fault_handler);
 #endif
 
-#if defined(CONFIG_8xx) || defined(CONFIG_4xx)
+#if defined(CONFIG_8xx) || defined(CONFIG_4xx) || defined(CONFIG_6xx)
 EXPORT_SYMBOL(__res);
 #endif
 #ifdef  CONFIG_8xx
Index: drivers/i2c/i2c-algo-mpc5xxx.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/drivers/i2c/i2c-algo-mpc5xxx.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- drivers/i2c/i2c-algo-mpc5xxx.c	5 Dec 2003 11:59:56 -0000	1.2
+++ drivers/i2c/i2c-algo-mpc5xxx.c	20 Dec 2003 22:23:53 -0000	1.3
@@ -16,6 +16,9 @@
 #include <linux/string.h>
 #include <asm/io.h>
 #include <asm/mpc5xxx.h>
+#ifdef CONFIG_UBOOT
+#include <asm/ppcboot.h>
+#endif
 
 #include <linux/i2c.h>
 #include <linux/i2c-algo-ppc_5xxx.h>
@@ -24,6 +27,11 @@
 #define MPC5xxx_TIMEOUT	100
 #define MPC5xxx_RETRIES	3
 
+static int speed = 100;
+
+MODULE_PARM(speed, "i");
+
+
 static int mpc5xxx_in(volatile u32 *reg)
 {
 	return in_be32(reg) >> 24;
@@ -108,6 +116,53 @@
 	return 0;
 }
 
+static int mpc5xxx_get_fdr(void)
+{
+	int i2c_speed = speed * 1000;
+	ulong best_speed = 0;
+	ulong divider;
+	ulong scl;
+#ifdef CONFIG_UBOOT
+	extern unsigned char __res[];
+	bd_t *bd = (bd_t *)__res;
+	ulong ipb = bd->bi_ipbfreq;
+#else
+	ulong ipb = CONFIG_PPC_5xxx_IPBFREQ
+#endif
+	ulong bestmatch = 0xffffffffUL;
+	int best_i = 0, best_j = 0, i, j;
+	int SCL_Tap[] = { 9, 10, 12, 15, 5, 6, 7, 8};
+	struct {int scl2tap, tap2tap; } scltap[] = {
+		{4, 1},
+		{4, 2},
+		{6, 4},
+		{6, 8},
+		{14, 16},
+		{30, 32},
+		{62, 64},
+		{126, 128}
+	};
+	
+	for (i = 7; i >= 0; i--) {
+		for (j = 7; j >= 0; j--) {
+			scl = 2 * (scltap[j].scl2tap +
+				(SCL_Tap[i] - 1) * scltap[j].tap2tap + 2);
+			if (ipb <= i2c_speed*scl) {
+				if ((i2c_speed*scl - ipb) < bestmatch) {
+					bestmatch = i2c_speed*scl - ipb;
+					best_i = i;
+					best_j = j;
+					best_speed = ipb/scl;
+				}
+			}
+		}
+	}
+
+	divider = (best_i & 3) | ((best_i & 4) << 3) | (best_j << 2);
+
+	return divider;
+}
+
 static void mpc5xxx_init(struct i2c_algo_mpc5xxx_data *algo_data)
 {
 	struct mpc5xxx_i2c	*regs = algo_data->regs;
@@ -121,9 +176,7 @@
 	 */
 	mpc5xxx_out(&regs->madr, algo_data->addr, 0);
 	
-	/* Make clock run maximum slow.
-	 */
-	mpc5xxx_out(&regs->mfdr, MPC5xxx_I2C_100HZ, 0);
+	mpc5xxx_out(&regs->mfdr, mpc5xxx_get_fdr(), 0);
 
 	/* Enable module and disable interrupts.
 	 */
@@ -377,5 +430,5 @@
 
 EXPORT_SYMBOL(i2c_mpc5xxx_add_bus);
 EXPORT_SYMBOL(i2c_mpc5xxx_del_bus);
-MODULE_LICENSE("GPL")
+MODULE_LICENSE("GPL");
 

[-- Attachment #5: patch.bestcomm --]
[-- Type: application/octet-stream , Size: 15062 bytes --]

PatchSet 171 
Date: 2004/01/13 15:32:25
Log:
Update BestComm API implementation and documentation

Index: arch/ppc/5xxx_io/bestcomm/capi/bestcomm_api.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/capi/bestcomm_api.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- arch/ppc/5xxx_io/bestcomm/capi/bestcomm_api.c	15 Nov 2003 20:01:18 -0000	1.1
+++ arch/ppc/5xxx_io/bestcomm/capi/bestcomm_api.c	13 Jan 2004 15:32:25 -0000	1.2
@@ -292,6 +292,9 @@
 	SDMA_TASK_DISABLE( SDMA_TCR, taskId );
 
 	BDHead[taskId] = BDTail[taskId] = 0;
+	
+	(TaskBDIdxTable[taskId].currBDInUse) = 0;
+	
 	return TASK_ERR_NO_ERR;
 }
 
Index: arch/ppc/5xxx_io/bestcomm/capi/task_api/tasksetup_bdtable.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/capi/task_api/tasksetup_bdtable.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- arch/ppc/5xxx_io/bestcomm/capi/task_api/tasksetup_bdtable.c	15 Nov 2003 20:01:19 -0000	1.1
+++ arch/ppc/5xxx_io/bestcomm/capi/task_api/tasksetup_bdtable.c	13 Jan 2004 15:32:25 -0000	1.2
@@ -65,27 +65,28 @@
    uint32 *ptr;
 
 
-   if (TaskTableFree == 0) {
-   	if (SramOffsetGlobal == 0) {
-       	TaskTableFree = MBarGlobal + MBAR_SRAM + taskTableBytes;
-       	SramOffsetGlobal = taskTableBytes;
-
-    }
-    else {
-    /*
-     * If another process has used SRAM already, then the start value will have been passed in already
-     * using the TasksSetSramOffset() function.
-     */
+   /*
+    * If another process has not used SRAM already, then the start value
+    * will have to be passed in using the TasksSetSramOffset() function.
+    */
+   if (SramOffsetGlobal == 0) {
+       SramOffsetGlobal = taskTableBytes;
+   }
      
-       	TaskTableFree = MBarGlobal + MBAR_SRAM + SramOffsetGlobal;
+   TaskTableFree = MBarGlobal + MBAR_SRAM + SramOffsetGlobal;
        	
-    }
-       
-   }
-   
+   /*
+    * First time through the Buffer Descriptor table configuration
+    * set the buffer descriptor table with parameters that will not
+    * change since they are determined by the task itself.	The
+    * SramOffsetGlobal variable must be updated to reflect the new SRAM
+    * space used by the buffer descriptor table.  The next time through
+    * this function (i.e. TaskSetup called again) the only parameters
+    * that should be changed are the LastPtr pointers and the NumBD part
+    * of the table.
+    */
    if (TaskBDIdxTable[TaskNum].BDTablePtr == 0) {
        TaskBDIdxTable[TaskNum].BDTablePtr = TaskTableFree;
-       TaskBDIdxTable[TaskNum].numBD      = (uint16)NumBD;
        TaskBDIdxTable[TaskNum].numPtr     = NumPtr;
        TaskBDIdxTable[TaskNum].apiConfig  = ApiConfig;
 
@@ -93,19 +94,29 @@
 
        switch (NumPtr) {
           case 1:
-             TaskTableFree += MaxBD*sizeof(TaskBD1_t);
              SramOffsetGlobal += MaxBD*sizeof(TaskBD1_t);
-             *LastPtr = (uint32)(*BasePtr + sizeof(TaskBD1_t) * (NumBD - 1));
              break;
           case 2:
-             TaskTableFree += MaxBD*sizeof(TaskBD2_t);
              SramOffsetGlobal += MaxBD*sizeof(TaskBD2_t);
-             *LastPtr = (uint32)(*BasePtr + sizeof(TaskBD2_t) * (NumBD - 1));
              break;
           default:
              /* error */
              break;
        }
+   }
+
+   TaskBDIdxTable[TaskNum].currBDInUse = 0;
+   TaskBDIdxTable[TaskNum].numBD = (uint16)NumBD;
+   switch (NumPtr) {
+      case 1:
+         *LastPtr = (uint32)(*BasePtr + sizeof(TaskBD1_t) * (NumBD - 1));
+         break;
+      case 2:
+         *LastPtr = (uint32)(*BasePtr + sizeof(TaskBD2_t) * (NumBD - 1));
+         break;
+      default:
+         /* error */
+         break;
    }
 
    /*
Index: arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_gen_rx_bd.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_gen_rx_bd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_gen_rx_bd.c	15 Nov 2003 20:01:19 -0000	1.1
+++ arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_gen_rx_bd.c	13 Jan 2004 15:32:25 -0000	1.2
@@ -58,7 +58,7 @@
 #define AUTO_START       -1
 #define ITERATIONS       -1
 
-#define MAX_BD            2
+#define MAX_BD            25
 #define BD_FLAG           0
 
 #define INCR_TYPE_SRC     0
Index: arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_gen_tx_bd.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_gen_tx_bd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_gen_tx_bd.c	15 Nov 2003 20:01:19 -0000	1.1
+++ arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_gen_tx_bd.c	13 Jan 2004 15:32:25 -0000	1.2
@@ -58,7 +58,7 @@
 #define AUTO_START       -1
 #define ITERATIONS       -1
 
-#define MAX_BD            2
+#define MAX_BD            25
 #define BD_FLAG           0
 
 #define INCR_TYPE_SRC     1
Index: arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_pci_rx.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_pci_rx.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_pci_rx.c	15 Nov 2003 20:01:19 -0000	1.1
+++ arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_pci_rx.c	13 Jan 2004 15:32:25 -0000	1.2
@@ -56,7 +56,7 @@
 #define INITIATOR_DATA    INITIATOR_SCPCI_RX
 
 #define AUTO_START       -2
-#define ITERATIONS        4
+#define ITERATIONS        0
 
 #define MAX_BD            0
 #define BD_FLAG           0
Index: arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_pci_tx.c
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_pci_tx.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_pci_tx.c	15 Nov 2003 20:01:19 -0000	1.1
+++ arch/ppc/5xxx_io/bestcomm/code_dma/image_rtos1/task_capi/tasksetup_pci_tx.c	13 Jan 2004 15:32:25 -0000	1.2
@@ -55,7 +55,7 @@
 #define INITIATOR_DATA    INITIATOR_SCPCI_TX
 
 #define AUTO_START       -2
-#define ITERATIONS        4
+#define ITERATIONS        0
 
 #define MAX_BD            0
 #define BD_FLAG           0
Index: arch/ppc/5xxx_io/bestcomm/doc/BestCommAPINoBD.txt
===================================================================
RCS file: arch/ppc/5xxx_io/bestcomm/doc/BestCommAPINoBD.txt
diff -N arch/ppc/5xxx_io/bestcomm/doc/BestCommAPINoBD.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ arch/ppc/5xxx_io/bestcomm/doc/BestCommAPINoBD.txt	13 Jan 2004 15:32:25 -0000	1.1
@@ -0,0 +1,158 @@
+This document explains how a programmer can interface with the
+BestComm buffer descriptor (BD) tasks without using TaskBDAssign() and
+TaskBDRelease() as provided by the BestComm API. It assumes the rest of
+the BestComm API (e.g. TaskSetup()) is used. Please refer to the BestComm
+API documentation for information concerning API initialization and usage.
+
+
+
+Half-Duplex Buffer Descriptor Functionality
+
+Task Functionality:
+
+    These tasks implement a half-duplex mode of communication between two
+    addressable memory locations using buffer descriptors (BDs). Tasks are
+    configured to support single or double data pointers. The following
+    tasks are provided in each of the BestComm API image_rtos1 and
+    image_rtos2 task images.
+
+    image_rtos1
+	TASK_ATA		ATA double-pointer
+	TASK_FEC_RX		ethernet single-pointer receive
+	TASK_FEC_TX		ethernet single-pointer transmit
+	TASK_GEN_DP_BD_0	general double-pointer
+	TASK_GEN_DP_BD_1	general double-pointer alternate
+	TASK_GEN_RX_BD		general single-pointer receive
+	TASK_GEN_TX_BD		general single-pointer transmit
+
+    image_rtos2
+	TASK_ATA		ATA double-pointer
+	TASK_CRC16_DP_BD	16-bit CRC double-pointer
+	TASK_FEC_RX		ethernet single-pointer receive
+	TASK_FEC_TX		ethernet single-pointer transmit
+	TASK_GEN_RX_BD_0	general single-pointer receive
+	TASK_GEN_TX_BD_0	general single-pointer transmit
+	TASK_GEN_RX_BD_1	general single-pointer receive alternate
+	TASK_GEN_TX_BD_1	general single-pointer transmit alternate
+
+
+    The following describes the BD data structures used by the BestComm
+    tasks.
+
+
+BD Table Format (single pointer):
+
+    typedef struct {
+	uint32 Status;		/*!< Status and length bits	*/
+	uint32 DataPtr[1];	/*!< Pointer to data buffer	*/
+    } TaskBD1_t;
+
+    BDTableBase+0x00  bd[0].Status      Buffer descriptor status word
+    BDTableBase+0x04  bd[0].DataPtr[0]  Data pointer to src/dst buffer
+    BDTableBase+0x08  bd[1].Status      Buffer descriptor status word
+    BDTableBase+0x0C  bd[1].DataPtr[0]  Data pointer to src/dst buffer
+		    ...
+    BDTableLast+0x00  bd[n].Status      Buffer descriptor status word
+    BDTableLast+0x04  bd[n].DataPtr[0]  Data pointer to src/dst buffer
+
+BD Table Format (double pointer):
+
+    typedef struct {
+	uint32 Status;		/*!< Status and length bits	*/
+	uint32 DataPtr[2];	/*!< Pointer to data buffers	*/
+    } TaskBD2_t;
+
+    BDTableBase+0x00  bd[0].Status      Buffer descriptor status word
+    BDTableBase+0x04  bd[0].DataPtr[0]  Data pointer to src buffer
+    BDTableBase+0x08  bd[0].DataPtr[1]  Data pointer to dst buffer
+    BDTableBase+0x0C  bd[1].Status      Buffer descriptor status word
+    BDTableBase+0x10  bd[1].DataPtr[0]  Data pointer to src buffer
+    BDTableBase+0x14  bd[1].DataPtr[1]  Data pointer to dst buffer
+		    ...
+    BDTableLast+0x00  bd[n].Status      Buffer descriptor status word
+    BDTableLast+0x04  bd[n].DataPtr[0]  Data pointer to src buffer
+    BDTableLast+0x08  bd[n].DataPtr[1]  Data pointer to dst buffer
+
+Buffer Status Format:
+
+    The Status field is a 32-bit word with the following bit fields.
+
+    reserved[31], ready[30], reserved[28:26], buffer length[25:0]
+
+    The FEC transmit task uses two additional bit fields.
+
+    reserved[31], ready[30], reserved[28], TFD[27], INT[26], buffer length[25:0]
+
+
+    The BDTableBase pointer for each task can be returned from
+    the TaskGetBDRing() BestComm API function. Single pointer BDs
+    are used when either the source or destination pointer does not
+    change. E.g. copying data to a FIFO. Double pointer BDs are used
+    when both the source and the destination pointers increment.
+
+
+BD Initialization:
+
+    Tasks are configured by TaskSetup(). This function clears the
+    BD table Status and DataPointer[] words. The internal function,
+    TaskSetup_BDTable(), called by TaskSetup() performs the actual BD
+    initialization.
+
+    A "ready bit" in the Status field determines if the BestComm (bit is
+    set) or the core (bit is unset) may access the contents of the BD. By
+    convention, the owner relinquishes the BD. The ready bit is defined
+    by the SDMA_BD_MASK_READY macro in capi/task_api/bestcomm_cntrl.h
+    as 0x40000000.
+
+    Note: the tasks will disable themselves after finishing the last BD
+    in the ring. The auto start bit needs to be set with the task number
+    to assure the task wraps around after the last BD in the ring.
+
+    The BestComm task code visits the BDs in a round-robin order starting
+    at index 0. A task begins again at the first BD even when a task is
+    stopped (via TaskStop()) somewhere in the middle of the BD ring and
+    started again (via TaskStart()). There is currently no way to start
+    a task on any other BD. The task waits on the BD if the ready bit
+    is not set.
+
+Using the BD Ring:
+
+    The BDs of a receive task must be initialized by the user with
+    buffers to receive incoming data. The DataPointer[0] field of each
+    BD to be used must be assigned the address of a buffer in memory
+    and the Status field should be assigned the length of the buffer
+    in bytes arithmetically ORed with the ready bit (0x40000000 or
+    SDMA_BD_MASK_READY from capi/task_api/bestcomm_cntrl.h). The BDs of a
+    transmit task are initialized by the TaskSetup_BDTable() BestComm API
+    function. Significantly, the ready bit is unset in the Status field.
+
+    Upon receipt of an interrupt from a BestComm receive task the user may
+    examine the BD ring for full buffers. The ready bit in full buffers
+    will be unset and the Status field set to the number of bytes read
+    into the buffer pointed to by DataPointer[0]. The user may continue
+    processing BDs around the ring until a set ready bit is encountered.
+    Processed buffers in the receive ring should be reinitialized by
+    loading the DataPointer[0] with a pointer to any empty buffer and
+    Status with the size of that buffer ORed with the ready bit.
+
+    To transmit a frame the DataPointer[0] field is loaded with a
+    pointer to the buffer to be transmitted and the Status field with
+    the length of that buffer ORed with the ready bit. The task will
+    begin sending the data when it reads the ready bit for a given BD.
+    When transmission is complete, the task clears the ready bit in the
+    BD Status field and interrupts the core.
+
+    The FEC TX task supports two flags in addition to the ready bit for
+    transmit frame done (TFD, 0x08000000) and interrupt on frame done
+    (INT, 0x04000000) in the BD Status word. When the task is finished
+    copying the buffer to the FEC TX FIFO it will assert an FEC TFD
+    interrupt (TFD) and/or a BestComm interrupt (INT). The FEC TX task
+    will not interrupt the core unless the INT flag is set.
+
+
+    Note: the BestComm task code maintains a non-visible internal BD
+    pointer so the core needs to maintain its own. This should not be
+    an issue because the BDs are handled in round-robin order around
+    the BD ring starting from 0 and waits if a BD is not ready. If the
+    core handles the BD ring in the same way, it should never get out
+    of synchronization with BestComm.
Index: arch/ppc/5xxx_io/bestcomm/doc/BestCommAPIUserGuide.pdf
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/arch/ppc/5xxx_io/bestcomm/doc/BestCommAPIUserGuide.pdf,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
Binary files /tmp/cvscUj8sk and /tmp/cvsIl4dKY differ

[-- Attachment #6: patch.MBAR --]
[-- Type: application/octet-stream , Size: 1063 bytes --]

PatchSet 172 
Date: 2004/01/16 15:34:55
Log:
Fix PSC* MBAR offsets for MPC5xxx

Index: include/asm-ppc/mpc5xxx.h
===================================================================
RCS file: /cvsroot/linuxppc_2_4_devel/include/asm-ppc/mpc5xxx.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- include/asm-ppc/mpc5xxx.h	3 Dec 2003 19:08:20 -0000	1.2
+++ include/asm-ppc/mpc5xxx.h	16 Jan 2004 15:34:55 -0000	1.3
@@ -48,8 +48,11 @@
 #define MPC5xxx_SDMA		(MPC5xxx_MBAR + 0x1200)
 #define MPC5xxx_XLB		(MPC5xxx_MBAR + 0x1f00)
 #define MPC5xxx_PSC1		(MPC5xxx_MBAR + 0x2000)
-#define MPC5xxx_PSC2		(MPC5xxx_MBAR + 0x2400)
-#define MPC5xxx_PSC3		(MPC5xxx_MBAR + 0x2800)
+#define MPC5xxx_PSC2		(MPC5xxx_MBAR + 0x2200)
+#define MPC5xxx_PSC3		(MPC5xxx_MBAR + 0x2400)
+#define MPC5xxx_PSC4		(MPC5xxx_MBAR + 0x2600)
+#define MPC5xxx_PSC5		(MPC5xxx_MBAR + 0x2800)
+#define MPC5xxx_PSC6		(MPC5xxx_MBAR + 0x2C00)
 #define MPC5xxx_FEC		(MPC5xxx_MBAR + 0x3000)
 #define MPC5xxx_ATA		(MPC5xxx_MBAR + 0x3a00)
 #define MPC5xxx_I2C1		(MPC5xxx_MBAR + 0x3d00)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-22 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-21 17:01 linux-2.4-mpc5xxx repository updates Tom Rini
2004-01-21 20:32 Wolfgang Denk
2004-01-21 21:46 ` Benjamin Herrenschmidt
2004-01-22 16:59 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.