blob: 7ea4eb1cc489356f378988dc28422afb5cb20f74 [file] [log] [blame]
wdenk4a5b6a32001-04-28 17:59:11 +00001/* include/mal.h, openbios_walnut, walnut_bios 8/6/99 08:48:40 */
2/*----------------------------------------------------------------------------+
3|
wdenkba56f622004-02-06 23:19:44 +00004| This source code has been made available to you by IBM on an AS-IS
5| basis. Anyone receiving this source is licensed under IBM
6| copyrights to use it in any way he or she deems fit, including
7| copying it, modifying it, compiling it, and redistributing it either
8| with or without modifications. No license under IBM patents or
9| patent applications is to be implied by the copyright license.
wdenk4a5b6a32001-04-28 17:59:11 +000010|
wdenkba56f622004-02-06 23:19:44 +000011| Any user of this software should understand that IBM cannot provide
12| technical support for this software and will not be responsible for
13| any consequences resulting from the use of this software.
wdenk4a5b6a32001-04-28 17:59:11 +000014|
wdenkba56f622004-02-06 23:19:44 +000015| Any person who transfers this source code or any derivative work
16| must include the IBM copyright notice, this paragraph, and the
17| preceding two paragraphs in the transferred software.
wdenk4a5b6a32001-04-28 17:59:11 +000018|
wdenkba56f622004-02-06 23:19:44 +000019| COPYRIGHT I B M CORPORATION 1999
20| LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
wdenk4a5b6a32001-04-28 17:59:11 +000021+----------------------------------------------------------------------------*/
22/*----------------------------------------------------------------------------+
23|
wdenkba56f622004-02-06 23:19:44 +000024| File Name: mal.h
wdenk4a5b6a32001-04-28 17:59:11 +000025|
wdenkba56f622004-02-06 23:19:44 +000026| Function: Header file for the MAL (MADMAL) macro on the 405GP.
wdenk4a5b6a32001-04-28 17:59:11 +000027|
wdenkba56f622004-02-06 23:19:44 +000028| Author: Mark Wisner
wdenk4a5b6a32001-04-28 17:59:11 +000029|
30| Change Activity-
31|
wdenkba56f622004-02-06 23:19:44 +000032| Date Description of Change BY
33| --------- --------------------- ---
34| 29-Apr-99 Created MKW
wdenk4a5b6a32001-04-28 17:59:11 +000035|
36+----------------------------------------------------------------------------*/
wdenkba56f622004-02-06 23:19:44 +000037/*----------------------------------------------------------------------------+
38| 17-Nov-03 Travis B. Sawyer, Sandburst Corporation, tsawyer@sandburst.com
39| Added register bit definitions to support multiple channels
40+----------------------------------------------------------------------------*/
wdenk4a5b6a32001-04-28 17:59:11 +000041#ifndef _mal_h_
42#define _mal_h_
43/* MADMAL transmit and receive status/control bits */
44/* for COMMAC bits, refer to the COMMAC header file */
45
46#define MAL_TX_CTRL_READY 0x8000
47#define MAL_TX_CTRL_WRAP 0x4000
wdenkba56f622004-02-06 23:19:44 +000048#define MAL_TX_CTRL_CM 0x2000
wdenk4a5b6a32001-04-28 17:59:11 +000049#define MAL_TX_CTRL_LAST 0x1000
50#define MAL_TX_CTRL_INTR 0x0400
51
52#define MAL_RX_CTRL_EMPTY 0x8000
53#define MAL_RX_CTRL_WRAP 0x4000
54#define MAL_RX_CTRL_CM 0x2000
55#define MAL_RX_CTRL_LAST 0x1000
56#define MAL_RX_CTRL_FIRST 0x0800
57#define MAL_RX_CTRL_INTR 0x0400
58
59 /* Configuration Reg */
60#define MAL_CR_MMSR 0x80000000
61#define MAL_CR_PLBP_1 0x00400000 /* lowsest is 00 */
62#define MAL_CR_PLBP_2 0x00800000
wdenkba56f622004-02-06 23:19:44 +000063#define MAL_CR_PLBP_3 0x00C00000 /* highest */
wdenk4a5b6a32001-04-28 17:59:11 +000064#define MAL_CR_GA 0x00200000
65#define MAL_CR_OA 0x00100000
66#define MAL_CR_PLBLE 0x00080000
wdenkba56f622004-02-06 23:19:44 +000067#define MAL_CR_PLBLT_1 0x00040000
68#define MAL_CR_PLBLT_2 0x00020000
69#define MAL_CR_PLBLT_3 0x00010000
70#define MAL_CR_PLBLT_4 0x00008000
wdenk4a5b6a32001-04-28 17:59:11 +000071#define MAL_CR_PLBLT_DEFAULT 0x00078000 /* ????? */
72#define MAL_CR_PLBB 0x00004000
73#define MAL_CR_OPBBL 0x00000080
74#define MAL_CR_EOPIE 0x00000004
75#define MAL_CR_LEA 0x00000002
76#define MAL_CR_MSD 0x00000001
77
wdenkba56f622004-02-06 23:19:44 +000078 /* Error Status Reg */
wdenk4a5b6a32001-04-28 17:59:11 +000079#define MAL_ESR_EVB 0x80000000
80#define MAL_ESR_CID 0x40000000
81#define MAL_ESR_DE 0x00100000
82#define MAL_ESR_ONE 0x00080000
83#define MAL_ESR_OTE 0x00040000
84#define MAL_ESR_OSE 0x00020000
85#define MAL_ESR_PEIN 0x00010000
86 /* same bit position as the IER */
wdenkba56f622004-02-06 23:19:44 +000087 /* VV VV */
wdenk4a5b6a32001-04-28 17:59:11 +000088#define MAL_ESR_DEI 0x00000010
89#define MAL_ESR_ONEI 0x00000008
90#define MAL_ESR_OTEI 0x00000004
91#define MAL_ESR_OSEI 0x00000002
92#define MAL_ESR_PBEI 0x00000001
wdenkba56f622004-02-06 23:19:44 +000093 /* ^^ ^^ */
94 /* Mal IER */
Stefan Roesedbbd1252007-10-05 17:10:59 +020095#if defined(CONFIG_440SPE) || \
96 defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
97 defined(CONFIG_405EX)
Marian Balakowicz6c5879f2006-06-30 16:30:46 +020098#define MAL_IER_PT 0x00000080
99#define MAL_IER_PRE 0x00000040
100#define MAL_IER_PWE 0x00000020
101#define MAL_IER_DE 0x00000010
102#define MAL_IER_OTE 0x00000004
103#define MAL_IER_OE 0x00000002
104#define MAL_IER_PE 0x00000001
105#else
wdenk4a5b6a32001-04-28 17:59:11 +0000106#define MAL_IER_DE 0x00000010
107#define MAL_IER_NE 0x00000008
108#define MAL_IER_TE 0x00000004
109#define MAL_IER_OPBE 0x00000002
110#define MAL_IER_PLBE 0x00000001
Marian Balakowicz6c5879f2006-06-30 16:30:46 +0200111#endif
wdenk4a5b6a32001-04-28 17:59:11 +0000112
wdenkba56f622004-02-06 23:19:44 +0000113/* MAL Channel Active Set and Reset Registers */
114#define MAL_TXRX_CASR (0x80000000)
115
116#define MAL_TXRX_CASR_V(__x) (__x) /* Channel 0 shifts 0, channel 1 shifts 1, etc */
117
wdenk4a5b6a32001-04-28 17:59:11 +0000118
119/* MAL Buffer Descriptor structure */
120typedef struct {
wdenkba56f622004-02-06 23:19:44 +0000121 short ctrl; /* MAL / Commac status control bits */
122 short data_len; /* Max length is 4K-1 (12 bits) */
123 char *data_ptr; /* pointer to actual data buffer */
wdenk4a5b6a32001-04-28 17:59:11 +0000124} mal_desc_t;
125
126#endif