1 /* 2 * Copyright (c) 2013, Atmel Corporation 3 * 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * 9 * - Redistributions of source code must retain the above copyright notice, 10 * this list of conditions and the disclaimer below. 11 * 12 * Atmel's name may not be used to endorse or promote products derived from 13 * this software without specific prior written permission. 14 * 15 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 18 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 21 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 #ifndef TZ_MATRIX_H 27 #define TZ_MATRIX_H 28 29 #define MATRIX_MCFG(n) (0x0000 + (n) * 4) /* Master Configuration Register */ 30 #define MATRIX_SCFG(n) (0x0040 + (n) * 4) /* Slave Configuration Register */ 31 #define MATRIX_PRAS(n) (0x0080 + (n) * 8) /* Priority Register A for Slave */ 32 #define MATRIX_PRBS(n) (0x0084 + (n) * 8) /* Priority Register B for Slave */ 33 34 #define MATRIX_MRCR 0x0100 /* Master Remap Control Register */ 35 #define MATRIX_MEIER 0x0150 /* Master Error Interrupt Enable Register */ 36 #define MATRIX_MEIDR 0x0154 /* Master Error Interrupt Disable Register */ 37 #define MATRIX_MEIMR 0x0158 /* Master Error Interrupt Mask Register */ 38 #define MATRIX_MESR 0x015c /* Master Error Status Register */ 39 40 /* Master n Error Address Register */ 41 #define MATRIX_MEAR(n) (0x0160 + (n) * 4) 42 43 #define MATRIX_WPMR 0x01E4 /* Write Protect Mode Register */ 44 #define MATRIX_WPSR 0x01E8 /* Write Protect Status Register */ 45 46 /* Security Slave n Register */ 47 #define MATRIX_SSR(n) (0x0200 + (n) * 4) 48 /* Security Area Split Slave n Register */ 49 #define MATRIX_SASSR(n) (0x0240 + (n) * 4) 50 /* Security Region Top Slave n Register */ 51 #define MATRIX_SRTSR(n) (0x0280 + (n) * 4) 52 53 /* Security Peripheral Select n Register */ 54 #define MATRIX_SPSELR(n) (0x02c0 + (n) * 4) 55 56 /**************************************************************************/ 57 /* Write Protect Mode Register (MATRIX_WPMR) */ 58 #define MATRIX_WPMR_WPEN (1 << 0) /* Write Protect Enable */ 59 #define MATRIX_WPMR_WPEN_DISABLE (0 << 0) 60 #define MATRIX_WPMR_WPEN_ENABLE (1 << 0) 61 #define MATRIX_WPMR_WPKEY (PASSWD << 8) /* Write Protect KEY */ 62 #define MATRIX_WPMR_WPKEY_PASSWD (0x4D4154 << 8) 63 64 /* Security Slave Registers (MATRIX_SSRx) */ 65 #define MATRIX_LANSECH(n, bit) ((bit) << n) 66 #define MATRIX_LANSECH_S(n) (0x00 << n) 67 #define MATRIX_LANSECH_NS(n) (0x01 << n) 68 #define MATRIX_RDNSECH(n, bit) ((bit) << (n + 8)) 69 #define MATRIX_RDNSECH_S(n) (0x00 << (n + 8)) 70 #define MATRIX_RDNSECH_NS(n) (0x01 << (n + 8)) 71 #define MATRIX_WRNSECH(n, bit) ((bit) << (n + 16)) 72 #define MATRIX_WRNSECH_S(n) (0x00 << (n + 16)) 73 #define MATRIX_WRNSECH_NS(n) (0x01 << (n + 16)) 74 75 /* Security Areas Split Slave Registers (MATRIX_SASSRx) */ 76 #define MATRIX_SASPLIT(n, value) ((value) << (4 * n)) 77 #define MATRIX_SASPLIT_VALUE_4K 0x00 78 #define MATRIX_SASPLIT_VALUE_8K 0x01 79 #define MATRIX_SASPLIT_VALUE_16K 0x02 80 #define MATRIX_SASPLIT_VALUE_32K 0x03 81 #define MATRIX_SASPLIT_VALUE_64K 0x04 82 #define MATRIX_SASPLIT_VALUE_128K 0x05 83 #define MATRIX_SASPLIT_VALUE_256K 0x06 84 #define MATRIX_SASPLIT_VALUE_512K 0x07 85 #define MATRIX_SASPLIT_VALUE_1M 0x08 86 #define MATRIX_SASPLIT_VALUE_2M 0x09 87 #define MATRIX_SASPLIT_VALUE_4M 0x0a 88 #define MATRIX_SASPLIT_VALUE_8M 0x0b 89 #define MATRIX_SASPLIT_VALUE_16M 0x0c 90 #define MATRIX_SASPLIT_VALUE_32M 0x0d 91 #define MATRIX_SASPLIT_VALUE_64M 0x0e 92 #define MATRIX_SASPLIT_VALUE_128M 0x0f 93 94 /* Security Region Top Slave Registers (MATRIX_SRTSRx) */ 95 #define MATRIX_SRTOP(n, value) ((value) << (4 * n)) 96 #define MATRIX_SRTOP_VALUE_4K 0x00 97 #define MATRIX_SRTOP_VALUE_8K 0x01 98 #define MATRIX_SRTOP_VALUE_16K 0x02 99 #define MATRIX_SRTOP_VALUE_32K 0x03 100 #define MATRIX_SRTOP_VALUE_64K 0x04 101 #define MATRIX_SRTOP_VALUE_128K 0x05 102 #define MATRIX_SRTOP_VALUE_256K 0x06 103 #define MATRIX_SRTOP_VALUE_512K 0x07 104 #define MATRIX_SRTOP_VALUE_1M 0x08 105 #define MATRIX_SRTOP_VALUE_2M 0x09 106 #define MATRIX_SRTOP_VALUE_4M 0x0a 107 #define MATRIX_SRTOP_VALUE_8M 0x0b 108 #define MATRIX_SRTOP_VALUE_16M 0x0c 109 #define MATRIX_SRTOP_VALUE_32M 0x0d 110 #define MATRIX_SRTOP_VALUE_64M 0x0e 111 #define MATRIX_SRTOP_VALUE_128M 0x0f 112 113 #endif /* #ifndef TZ_MATRIX_H */ 114