Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
TsiChung Liew | 7f1a046 | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Edge Port Memory Map |
| 4 | * |
| 5 | * Copyright (C) 2004-2008 Freescale Semiconductor, Inc. |
| 6 | * TsiChung Liew (Tsi-Chung.Liew@freescale.com) |
TsiChung Liew | 7f1a046 | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __EPORT_H__ |
| 10 | #define __EPORT_H__ |
| 11 | |
| 12 | /* Edge Port Module (EPORT) */ |
| 13 | typedef struct eport { |
TsiChung Liew | 7f1a046 | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 14 | u16 par; /* 0x00 Pin Assignment */ |
| 15 | u8 ddr; /* 0x02 Data Direction */ |
| 16 | u8 ier; /* 0x03 Interrupt Enable */ |
| 17 | u8 dr; /* 0x04 Data */ |
| 18 | u8 pdr; /* 0x05 Pin Data */ |
| 19 | u8 fr; /* 0x06 Flag */ |
| 20 | u8 res0; |
TsiChung Liew | 7f1a046 | 2008-10-21 10:03:07 +0000 | [diff] [blame] | 21 | } eport_t; |
| 22 | |
| 23 | /* EPPAR */ |
| 24 | #define EPORT_PAR_EPPA1(x) (((x)&0x0003)<<2) |
| 25 | #define EPORT_PAR_EPPA2(x) (((x)&0x0003)<<4) |
| 26 | #define EPORT_PAR_EPPA3(x) (((x)&0x0003)<<6) |
| 27 | #define EPORT_PAR_EPPA4(x) (((x)&0x0003)<<8) |
| 28 | #define EPORT_PAR_EPPA5(x) (((x)&0x0003)<<10) |
| 29 | #define EPORT_PAR_EPPA6(x) (((x)&0x0003)<<12) |
| 30 | #define EPORT_PAR_EPPA7(x) (((x)&0x0003)<<14) |
| 31 | #define EPORT_PAR_LEVEL (0) |
| 32 | #define EPORT_PAR_RISING (1) |
| 33 | #define EPORT_PAR_FALLING (2) |
| 34 | #define EPORT_PAR_BOTH (3) |
| 35 | #define EPORT_PAR_EPPA7_LEVEL (0x0000) |
| 36 | #define EPORT_PAR_EPPA7_RISING (0x4000) |
| 37 | #define EPORT_PAR_EPPA7_FALLING (0x8000) |
| 38 | #define EPORT_PAR_EPPA7_BOTH (0xC000) |
| 39 | #define EPORT_PAR_EPPA6_LEVEL (0x0000) |
| 40 | #define EPORT_PAR_EPPA6_RISING (0x1000) |
| 41 | #define EPORT_PAR_EPPA6_FALLING (0x2000) |
| 42 | #define EPORT_PAR_EPPA6_BOTH (0x3000) |
| 43 | #define EPORT_PAR_EPPA5_LEVEL (0x0000) |
| 44 | #define EPORT_PAR_EPPA5_RISING (0x0400) |
| 45 | #define EPORT_PAR_EPPA5_FALLING (0x0800) |
| 46 | #define EPORT_PAR_EPPA5_BOTH (0x0C00) |
| 47 | #define EPORT_PAR_EPPA4_LEVEL (0x0000) |
| 48 | #define EPORT_PAR_EPPA4_RISING (0x0100) |
| 49 | #define EPORT_PAR_EPPA4_FALLING (0x0200) |
| 50 | #define EPORT_PAR_EPPA4_BOTH (0x0300) |
| 51 | #define EPORT_PAR_EPPA3_LEVEL (0x0000) |
| 52 | #define EPORT_PAR_EPPA3_RISING (0x0040) |
| 53 | #define EPORT_PAR_EPPA3_FALLING (0x0080) |
| 54 | #define EPORT_PAR_EPPA3_BOTH (0x00C0) |
| 55 | #define EPORT_PAR_EPPA2_LEVEL (0x0000) |
| 56 | #define EPORT_PAR_EPPA2_RISING (0x0010) |
| 57 | #define EPORT_PAR_EPPA2_FALLING (0x0020) |
| 58 | #define EPORT_PAR_EPPA2_BOTH (0x0030) |
| 59 | #define EPORT_PAR_EPPA1_LEVEL (0x0000) |
| 60 | #define EPORT_PAR_EPPA1_RISING (0x0004) |
| 61 | #define EPORT_PAR_EPPA1_FALLING (0x0008) |
| 62 | #define EPORT_PAR_EPPA1_BOTH (0x000C) |
| 63 | |
| 64 | /* EPDDR */ |
| 65 | #define EPORT_DDR_EPDD1 (0x02) |
| 66 | #define EPORT_DDR_EPDD2 (0x04) |
| 67 | #define EPORT_DDR_EPDD3 (0x08) |
| 68 | #define EPORT_DDR_EPDD4 (0x10) |
| 69 | #define EPORT_DDR_EPDD5 (0x20) |
| 70 | #define EPORT_DDR_EPDD6 (0x40) |
| 71 | #define EPORT_DDR_EPDD7 (0x80) |
| 72 | |
| 73 | /* EPIER */ |
| 74 | #define EPORT_IER_EPIE1 (0x02) |
| 75 | #define EPORT_IER_EPIE2 (0x04) |
| 76 | #define EPORT_IER_EPIE3 (0x08) |
| 77 | #define EPORT_IER_EPIE4 (0x10) |
| 78 | #define EPORT_IER_EPIE5 (0x20) |
| 79 | #define EPORT_IER_EPIE6 (0x40) |
| 80 | #define EPORT_IER_EPIE7 (0x80) |
| 81 | |
| 82 | /* EPDR */ |
| 83 | #define EPORT_DR_EPD1 (0x02) |
| 84 | #define EPORT_DR_EPD2 (0x04) |
| 85 | #define EPORT_DR_EPD3 (0x08) |
| 86 | #define EPORT_DR_EPD4 (0x10) |
| 87 | #define EPORT_DR_EPD5 (0x20) |
| 88 | #define EPORT_DR_EPD6 (0x40) |
| 89 | #define EPORT_DR_EPD7 (0x80) |
| 90 | |
| 91 | /* EPPDR */ |
| 92 | #define EPORT_PDR_EPPD1 (0x02) |
| 93 | #define EPORT_PDR_EPPD2 (0x04) |
| 94 | #define EPORT_PDR_EPPD3 (0x08) |
| 95 | #define EPORT_PDR_EPPD4 (0x10) |
| 96 | #define EPORT_PDR_EPPD5 (0x20) |
| 97 | #define EPORT_PDR_EPPD6 (0x40) |
| 98 | #define EPORT_PDR_EPPD7 (0x80) |
| 99 | |
| 100 | /* EPFR */ |
| 101 | #define EPORT_FR_EPF1 (0x02) |
| 102 | #define EPORT_FR_EPF2 (0x04) |
| 103 | #define EPORT_FR_EPF3 (0x08) |
| 104 | #define EPORT_FR_EPF4 (0x10) |
| 105 | #define EPORT_FR_EPF5 (0x20) |
| 106 | #define EPORT_FR_EPF6 (0x40) |
| 107 | #define EPORT_FR_EPF7 (0x80) |
| 108 | |
| 109 | #endif /* __EPORT_H__ */ |