Skip to content

Commit

Permalink
[POWERPC] bestcomm: GenBD task support
Browse files Browse the repository at this point in the history
This is the microcode for the GenBD task and the associated
support code. This is a generic task that copy data to/from
a hardware FIFO. This is currently locked to 32bits wide
access but could be extended as needed.

The microcode itself comes directly from the offical
API (v2.2)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Sylvain Munaut authored and Grant Likely committed Oct 16, 2007
1 parent ba11c79 commit 7acb939
Show file tree
Hide file tree
Showing 6 changed files with 449 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/powerpc/sysdev/bestcomm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ config PPC_BESTCOMM_FEC
help
This option enables the support for the FEC tasks.

config PPC_BESTCOMM_GEN_BD
tristate "Bestcomm GenBD tasks support"
depends on PPC_BESTCOMM
default n
help
This option enables the support for the GenBD tasks.

2 changes: 2 additions & 0 deletions arch/powerpc/sysdev/bestcomm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
bestcomm-core-objs := bestcomm.o sram.o
bestcomm-ata-objs := ata.o bcom_ata_task.o
bestcomm-fec-objs := fec.o bcom_fec_rx_task.o bcom_fec_tx_task.o
bestcomm-gen-bd-objs := gen_bd.o bcom_gen_bd_rx_task.o bcom_gen_bd_tx_task.o

obj-$(CONFIG_PPC_BESTCOMM) += bestcomm-core.o
obj-$(CONFIG_PPC_BESTCOMM_ATA) += bestcomm-ata.o
obj-$(CONFIG_PPC_BESTCOMM_FEC) += bestcomm-fec.o
obj-$(CONFIG_PPC_BESTCOMM_GEN_BD) += bestcomm-gen-bd.o

63 changes: 63 additions & 0 deletions arch/powerpc/sysdev/bestcomm/bcom_gen_bd_rx_task.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Bestcomm GenBD RX task microcode
*
* Copyright (C) 2006 AppSpec Computer Technologies Corp.
* Jeff Gibbons <jeff.gibbons@appspec.com>
* Copyright (c) 2004 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 version 2 as published
* by the Free Software Foundation.
*
* Based on BestCommAPI-2.2/code_dma/image_rtos1/dma_image.hex
* on Tue Mar 4 10:14:12 2006 GMT
*
*/

#include <asm/types.h>

/*
* The header consists of the following fields:
* u32 magic;
* u8 desc_size;
* u8 var_size;
* u8 inc_size;
* u8 first_var;
* u8 reserved[8];
*
* The size fields contain the number of 32-bit words.
*/

u32 bcom_gen_bd_rx_task[] = {
/* header */
0x4243544b,
0x0d020409,
0x00000000,
0x00000000,

/* Task descriptors */
0x808220da, /* LCD: idx0 = var1, idx1 = var4; idx1 <= var3; idx0 += inc3, idx1 += inc2 */
0x13e01010, /* DRD1A: var4 = var2; FN=0 MORE init=31 WS=0 RS=0 */
0xb880025b, /* LCD: idx2 = *idx1, idx3 = var0; idx2 < var9; idx2 += inc3, idx3 += inc3 */
0x10001308, /* DRD1A: var4 = idx1; FN=0 MORE init=0 WS=0 RS=0 */
0x60140002, /* DRD2A: EU0=0 EU1=0 EU2=0 EU3=2 EXT init=0 WS=2 RS=2 */
0x0cccfcca, /* DRD2B1: *idx3 = EU3(); EU3(*idx3,var10) */
0xd9190240, /* LCDEXT: idx2 = idx2; idx2 > var9; idx2 += inc0 */
0xb8c5e009, /* LCD: idx3 = *(idx1 + var00000015); ; idx3 += inc1 */
0x07fecf80, /* DRD1A: *idx3 = *idx0; FN=0 INT init=31 WS=3 RS=3 */
0x99190024, /* LCD: idx2 = idx2; idx2 once var0; idx2 += inc4 */
0x60000005, /* DRD2A: EU0=0 EU1=0 EU2=0 EU3=5 EXT init=0 WS=0 RS=0 */
0x0c4cf889, /* DRD2B1: *idx1 = EU3(); EU3(idx2,var9) */
0x000001f8, /* NOP */

/* VAR[9]-VAR[10] */
0x40000000,
0x7fff7fff,

/* INC[0]-INC[3] */
0x40000000,
0xe0000000,
0xa0000008,
0x20000000,
};

69 changes: 69 additions & 0 deletions arch/powerpc/sysdev/bestcomm/bcom_gen_bd_tx_task.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Bestcomm GenBD TX task microcode
*
* Copyright (C) 2006 AppSpec Computer Technologies Corp.
* Jeff Gibbons <jeff.gibbons@appspec.com>
* Copyright (c) 2004 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 version 2 as published
* by the Free Software Foundation.
*
* Based on BestCommAPI-2.2/code_dma/image_rtos1/dma_image.hex
* on Tue Mar 4 10:14:12 2006 GMT
*
*/

#include <asm/types.h>

/*
* The header consists of the following fields:
* u32 magic;
* u8 desc_size;
* u8 var_size;
* u8 inc_size;
* u8 first_var;
* u8 reserved[8];
*
* The size fields contain the number of 32-bit words.
*/

u32 bcom_gen_bd_tx_task[] = {
/* header */
0x4243544b,
0x0f040609,
0x00000000,
0x00000000,

/* Task descriptors */
0x800220e3, /* LCD: idx0 = var0, idx1 = var4; idx1 <= var3; idx0 += inc4, idx1 += inc3 */
0x13e01010, /* DRD1A: var4 = var2; FN=0 MORE init=31 WS=0 RS=0 */
0xb8808264, /* LCD: idx2 = *idx1, idx3 = var1; idx2 < var9; idx2 += inc4, idx3 += inc4 */
0x10001308, /* DRD1A: var4 = idx1; FN=0 MORE init=0 WS=0 RS=0 */
0x60140002, /* DRD2A: EU0=0 EU1=0 EU2=0 EU3=2 EXT init=0 WS=2 RS=2 */
0x0cccfcca, /* DRD2B1: *idx3 = EU3(); EU3(*idx3,var10) */
0xd9190300, /* LCDEXT: idx2 = idx2; idx2 > var12; idx2 += inc0 */
0xb8c5e009, /* LCD: idx3 = *(idx1 + var00000015); ; idx3 += inc1 */
0x03fec398, /* DRD1A: *idx0 = *idx3; FN=0 init=31 WS=3 RS=3 */
0x9919826a, /* LCD: idx2 = idx2, idx3 = idx3; idx2 > var9; idx2 += inc5, idx3 += inc2 */
0x0feac398, /* DRD1A: *idx0 = *idx3; FN=0 TFD INT init=31 WS=1 RS=1 */
0x99190036, /* LCD: idx2 = idx2; idx2 once var0; idx2 += inc6 */
0x60000005, /* DRD2A: EU0=0 EU1=0 EU2=0 EU3=5 EXT init=0 WS=0 RS=0 */
0x0c4cf889, /* DRD2B1: *idx1 = EU3(); EU3(idx2,var9) */
0x000001f8, /* NOP */

/* VAR[9]-VAR[12] */
0x40000000,
0x7fff7fff,
0x00000000,
0x40000004,

/* INC[0]-INC[5] */
0x40000000,
0xe0000000,
0xe0000000,
0xa0000008,
0x20000000,
0x4000ffff,
};

Loading

0 comments on commit 7acb939

Please sign in to comment.