]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/asm-arm/imx_iim.h
applied patches from Freescale and Ka-Ro
[karo-tx-uboot.git] / include / asm-arm / imx_iim.h
1 /*
2  * (C) Copyright 2009-2010 Freescale Semiconductor, Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17  * MA 02111-1307 USA
18  */
19
20 #ifndef __IMX_IIM_H__
21 #define __IMX_IIM_H__
22
23 /* IIM Control Registers */
24 struct iim_regs {
25 #define IIM_STAT_BUSY   (1 << 7)
26 #define IIM_STAT_PRGD   (1 << 1)
27 #define IIM_STAT_SNSD   (1 << 0)
28         u32 stat;
29         u32 statm;
30 #define IIM_ERR_PRGE    (1 << 7)
31 #define IIM_ERR_WPE     (1 << 6)
32 #define IIM_ERR_OPE     (1 << 5)
33 #define IIM_ERR_RPE     (1 << 4)
34 #define IIM_ERR_WLRE    (1 << 3)
35 #define IIM_ERR_SNSE    (1 << 2)
36 #define IIM_ERR_PARITYE (1 << 1)
37         u32 err;
38         u32 emask;
39         u32 fctl;
40         u32 ua;
41         u32 la;
42         u32 sdat;
43         u32 prev;
44         u32 srev;
45         u32 preg_p;
46         u32 scs0;
47         u32 scs1;
48         u32 scs2;
49         u32 scs3;
50 };
51
52 #define IIM_PROD_REV_SH         3
53 #define IIM_PROD_REV_LEN        5
54 #define IIM_SREV_REV_SH         4
55 #define IIM_SREV_REV_LEN        4
56 #define PROD_SIGNATURE_MX51     0x1
57
58 #define IIM_ERR_SHIFT       8
59 #define POLL_FUSE_PRGD      (IIM_STAT_PRGD | (IIM_ERR_PRGE << IIM_ERR_SHIFT))
60 #define POLL_FUSE_SNSD      (IIM_STAT_SNSD | (IIM_ERR_SNSE << IIM_ERR_SHIFT))
61
62 #define IIM_BANK_AREA_0_OFFSET  0x800
63 #define IIM_BANK_AREA_1_OFFSET  0xc00
64 #define IIM_BANK_AREA_2_OFFSET  0x1000
65 #define IIM_BANK_AREA_3_OFFSET  0x1400
66
67 int iim_read(int bank, char row);
68 int iim_blow(int bank, int row, int val);
69 int iim_blow_func(char *func_name, char *func_val);
70
71 #endif