wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 1 | /* include/mal.h, openbios_walnut, walnut_bios 8/6/99 08:48:40 */ |
| 2 | /*----------------------------------------------------------------------------+ |
Josh Boyer | 3177349 | 2009-08-07 13:53:20 -0400 | [diff] [blame] | 3 | | This source code is dual-licensed. You may use it under the terms of the |
| 4 | | GNU General Public License version 2, or under the license below. |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 5 | | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 6 | | This source code has been made available to you by IBM on an AS-IS |
| 7 | | basis. Anyone receiving this source is licensed under IBM |
| 8 | | copyrights to use it in any way he or she deems fit, including |
| 9 | | copying it, modifying it, compiling it, and redistributing it either |
| 10 | | with or without modifications. No license under IBM patents or |
| 11 | | patent applications is to be implied by the copyright license. |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 12 | | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 13 | | Any user of this software should understand that IBM cannot provide |
| 14 | | technical support for this software and will not be responsible for |
| 15 | | any consequences resulting from the use of this software. |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 16 | | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 17 | | Any person who transfers this source code or any derivative work |
| 18 | | must include the IBM copyright notice, this paragraph, and the |
| 19 | | preceding two paragraphs in the transferred software. |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 20 | | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 21 | | COPYRIGHT I B M CORPORATION 1999 |
| 22 | | LICENSED MATERIAL - PROGRAM PROPERTY OF I B M |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 23 | +----------------------------------------------------------------------------*/ |
| 24 | /*----------------------------------------------------------------------------+ |
| 25 | | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 26 | | File Name: mal.h |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 27 | | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 28 | | Function: Header file for the MAL (MADMAL) macro on the 405GP. |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 29 | | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 30 | | Author: Mark Wisner |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 31 | | |
| 32 | | Change Activity- |
| 33 | | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 34 | | Date Description of Change BY |
| 35 | | --------- --------------------- --- |
| 36 | | 29-Apr-99 Created MKW |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 37 | | |
| 38 | +----------------------------------------------------------------------------*/ |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 39 | /*----------------------------------------------------------------------------+ |
| 40 | | 17-Nov-03 Travis B. Sawyer, Sandburst Corporation, tsawyer@sandburst.com |
| 41 | | Added register bit definitions to support multiple channels |
| 42 | +----------------------------------------------------------------------------*/ |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 43 | #ifndef _mal_h_ |
| 44 | #define _mal_h_ |
| 45 | /* MADMAL transmit and receive status/control bits */ |
| 46 | /* for COMMAC bits, refer to the COMMAC header file */ |
| 47 | |
| 48 | #define MAL_TX_CTRL_READY 0x8000 |
| 49 | #define MAL_TX_CTRL_WRAP 0x4000 |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 50 | #define MAL_TX_CTRL_CM 0x2000 |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 51 | #define MAL_TX_CTRL_LAST 0x1000 |
| 52 | #define MAL_TX_CTRL_INTR 0x0400 |
| 53 | |
| 54 | #define MAL_RX_CTRL_EMPTY 0x8000 |
| 55 | #define MAL_RX_CTRL_WRAP 0x4000 |
| 56 | #define MAL_RX_CTRL_CM 0x2000 |
| 57 | #define MAL_RX_CTRL_LAST 0x1000 |
| 58 | #define MAL_RX_CTRL_FIRST 0x0800 |
| 59 | #define MAL_RX_CTRL_INTR 0x0400 |
| 60 | |
| 61 | /* Configuration Reg */ |
| 62 | #define MAL_CR_MMSR 0x80000000 |
| 63 | #define MAL_CR_PLBP_1 0x00400000 /* lowsest is 00 */ |
| 64 | #define MAL_CR_PLBP_2 0x00800000 |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 65 | #define MAL_CR_PLBP_3 0x00C00000 /* highest */ |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 66 | #define MAL_CR_GA 0x00200000 |
| 67 | #define MAL_CR_OA 0x00100000 |
| 68 | #define MAL_CR_PLBLE 0x00080000 |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 69 | #define MAL_CR_PLBLT_1 0x00040000 |
| 70 | #define MAL_CR_PLBLT_2 0x00020000 |
| 71 | #define MAL_CR_PLBLT_3 0x00010000 |
| 72 | #define MAL_CR_PLBLT_4 0x00008000 |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 73 | #define MAL_CR_PLBLT_DEFAULT 0x00078000 /* ????? */ |
| 74 | #define MAL_CR_PLBB 0x00004000 |
| 75 | #define MAL_CR_OPBBL 0x00000080 |
| 76 | #define MAL_CR_EOPIE 0x00000004 |
| 77 | #define MAL_CR_LEA 0x00000002 |
| 78 | #define MAL_CR_MSD 0x00000001 |
| 79 | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 80 | /* Error Status Reg */ |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 81 | #define MAL_ESR_EVB 0x80000000 |
| 82 | #define MAL_ESR_CID 0x40000000 |
| 83 | #define MAL_ESR_DE 0x00100000 |
| 84 | #define MAL_ESR_ONE 0x00080000 |
| 85 | #define MAL_ESR_OTE 0x00040000 |
| 86 | #define MAL_ESR_OSE 0x00020000 |
| 87 | #define MAL_ESR_PEIN 0x00010000 |
| 88 | /* same bit position as the IER */ |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 89 | /* VV VV */ |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 90 | #define MAL_ESR_DEI 0x00000010 |
| 91 | #define MAL_ESR_ONEI 0x00000008 |
| 92 | #define MAL_ESR_OTEI 0x00000004 |
| 93 | #define MAL_ESR_OSEI 0x00000002 |
| 94 | #define MAL_ESR_PBEI 0x00000001 |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 95 | /* ^^ ^^ */ |
| 96 | /* Mal IER */ |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 97 | #if defined(CONFIG_440SPE) || \ |
| 98 | defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \ |
Stefan Roese | 999ecd5 | 2008-03-11 15:07:10 +0100 | [diff] [blame] | 99 | defined(CONFIG_460EX) || defined(CONFIG_460GT) || \ |
Stefan Roese | dbbd125 | 2007-10-05 17:10:59 +0200 | [diff] [blame] | 100 | defined(CONFIG_405EX) |
Marian Balakowicz | 6c5879f | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 101 | #define MAL_IER_PT 0x00000080 |
| 102 | #define MAL_IER_PRE 0x00000040 |
| 103 | #define MAL_IER_PWE 0x00000020 |
| 104 | #define MAL_IER_DE 0x00000010 |
| 105 | #define MAL_IER_OTE 0x00000004 |
| 106 | #define MAL_IER_OE 0x00000002 |
| 107 | #define MAL_IER_PE 0x00000001 |
| 108 | #else |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 109 | #define MAL_IER_DE 0x00000010 |
| 110 | #define MAL_IER_NE 0x00000008 |
| 111 | #define MAL_IER_TE 0x00000004 |
| 112 | #define MAL_IER_OPBE 0x00000002 |
| 113 | #define MAL_IER_PLBE 0x00000001 |
Marian Balakowicz | 6c5879f | 2006-06-30 16:30:46 +0200 | [diff] [blame] | 114 | #endif |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 115 | |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 116 | /* MAL Channel Active Set and Reset Registers */ |
| 117 | #define MAL_TXRX_CASR (0x80000000) |
| 118 | |
| 119 | #define MAL_TXRX_CASR_V(__x) (__x) /* Channel 0 shifts 0, channel 1 shifts 1, etc */ |
| 120 | |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 121 | |
| 122 | /* MAL Buffer Descriptor structure */ |
| 123 | typedef struct { |
wdenk | ba56f62 | 2004-02-06 23:19:44 +0000 | [diff] [blame] | 124 | short ctrl; /* MAL / Commac status control bits */ |
| 125 | short data_len; /* Max length is 4K-1 (12 bits) */ |
| 126 | char *data_ptr; /* pointer to actual data buffer */ |
wdenk | 4a5b6a3 | 2001-04-28 17:59:11 +0000 | [diff] [blame] | 127 | } mal_desc_t; |
| 128 | |
| 129 | #endif |