1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
27 typedef struct str9xpec_flash_controller_s
29 struct target_s *target;
33 jtag_device_t* devarm;
35 } str9xpec_flash_controller_t;
37 enum str9xpec_status_codes
39 STR9XPEC_INVALID_COMMAND = 1,
40 STR9XPEC_ISC_SUCCESS = 2,
41 STR9XPEC_ISC_DISABLED = 3,
42 STR9XPEC_ISC_INTFAIL = 32,
47 #define ISC_IDCODE 0xFE
48 #define ISC_MFG_READ 0x4C
49 #define ISC_CONFIGURATION 0x07
50 #define ISC_ENABLE 0x0C
51 #define ISC_DISABLE 0x0F
53 #define ISC_ADDRESS_SHIFT 0x11
54 #define ISC_CLR_STATUS 0x13
55 #define ISC_PROGRAM 0x20
56 #define ISC_PROGRAM_SECURITY 0x22
57 #define ISC_PROGRAM_UC 0x23
58 #define ISC_ERASE 0x30
60 #define ISC_BLANK_CHECK 0x60
62 /* ISC_DEFAULT bit definitions */
64 #define ISC_STATUS_SECURITY 0x40
65 #define ISC_STATUS_INT_ERROR 0x30
66 #define ISC_STATUS_MODE 0x08
67 #define ISC_STATUS_BUSY 0x04
68 #define ISC_STATUS_ERROR 0x03
70 typedef struct mem_layout_str9pec {
74 } str9xpec_mem_layout_t;
76 /* Option bytes definitions */
78 #define STR9XPEC_OPT_CSMAPBIT 48
79 #define STR9XPEC_OPT_LVDTHRESBIT 49
80 #define STR9XPEC_OPT_LVDSELBIT 50
81 #define STR9XPEC_OPT_LVDWARNBIT 51
82 #define STR9XPEC_OPT_OTPBIT 63
84 #endif /* STR9XPEC_H */