revert between 56095 -> 55830 in arch
[AROS.git] / arch / ppc-chrp / efika / ata / ata_bestcomm.c
blobefd3a002023e7a41a5f0ad3f7df52da366df2380
1 /*
2 Copyright © 2009-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 1
8 #include <aros/debug.h>
9 #include <asm/mpc5200b.h>
10 #include <inttypes.h>
14 #define MAX_DMA_BUFFERS 4
15 #define MAX_DMA_TRANSFER 256*512
17 /* Buffer descriptor */
18 typedef struct {
19 uint32_t status;
20 void *data1;
21 void *data2;
22 } ata_bd2_t;
24 #define SDMA_FLAGS_NONE 0x0000
25 #define SDMA_FLAGS_ENABLE 0x0001
26 #define SDMA_FLAGS_BD2 0x0002
27 #define SDMA_BD_READY 0x40000000UL
29 typedef struct {
30 uint32_t enable;
31 uint32_t bd_base;
32 uint32_t bd_last;
33 uint32_t bd_start;
34 uint32_t buffer_size;
35 } ata_ivar_t;
37 typedef struct {
38 int16_t pad0;
39 int16_t incr_bytes;
40 int16_t pad1;
41 int16_t incr_dst;
42 int16_t pad2;
43 int16_t incr_src;
44 } ata_inc_t;
46 uint8_t *sram = NULL;
47 volatile bestcomm_t *bestcomm = NULL;
48 volatile bestcomm_tdt_t *tdt = NULL;
49 uint32_t bestcomm_taskid = 0xffffffff;
50 volatile uint32_t *bestcomm_taskcode;
51 volatile uint32_t *bestcomm_vartable;
52 volatile ata_bd2_t *bd2;
53 uint16_t idx, odx, num_bd;
54 uint32_t flags;
56 volatile ata_ivar_t *ivar;
57 volatile ata_inc_t *inc;
59 void bestcomm_init()
61 D(bug("[ATA] bestcomm_init()\n"));
63 tdt = (bestcomm_tdt_t *)bestcomm->bc_taskBar;
65 D(bug("[ATA] taskBar at %08x\n", tdt));
67 bestcomm_taskcode = (tdt[bestcomm_taskid].start);
68 bestcomm_vartable = (tdt[bestcomm_taskid].var);
70 ivar = (ata_ivar_t *)bestcomm_vartable;
71 inc = (ata_inc_t *)(bestcomm_vartable + 24);
73 D(bug("[ATA] looking on ivar at %08x:\n", ivar));
74 D(bug("[ATA] enable=%08x bd_base=%08x bd_last=%08x bd_start=%08x buffer_size=%08x\n",
75 ivar->enable, ivar->bd_base, ivar->bd_last, ivar->bd_start, ivar->buffer_size));