diff options
Diffstat (limited to 'arch/arm/mach-tegra/include/mach/tegra_odm_fuses.h')
-rw-r--r-- | arch/arm/mach-tegra/include/mach/tegra_odm_fuses.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/tegra_odm_fuses.h b/arch/arm/mach-tegra/include/mach/tegra_odm_fuses.h new file mode 100644 index 00000000000..4ab8433dbbf --- /dev/null +++ b/arch/arm/mach-tegra/include/mach/tegra_odm_fuses.h | |||
@@ -0,0 +1,107 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-tegra/include/mach/tegra_odm_fuses.h | ||
3 | * | ||
4 | * Copyright (c) 2011, NVIDIA Corporation. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef __MACH_TEGRA_ODM_FUSES_H | ||
22 | #define __MACH_TEGRA_ODM_FUSES_H | ||
23 | |||
24 | #define SBK_DEVKEY_STATUS_SZ sizeof(u32) | ||
25 | |||
26 | /* | ||
27 | * fuse io parameters: params with sizes less than a byte are | ||
28 | * explicitly mentioned | ||
29 | */ | ||
30 | enum fuse_io_param { | ||
31 | DEVKEY, | ||
32 | JTAG_DIS, /* 1 bit long */ | ||
33 | /* | ||
34 | * Programming the odm production fuse at the same | ||
35 | * time as the sbk or dev_key is not allowed as it is not possible to | ||
36 | * verify that the sbk or dev_key were programmed correctly. | ||
37 | */ | ||
38 | ODM_PROD_MODE, /* 1 bit long */ | ||
39 | SEC_BOOT_DEV_CFG, | ||
40 | SEC_BOOT_DEV_SEL, /* 3 bits long */ | ||
41 | SBK, | ||
42 | SW_RSVD, /* 4 bits long */ | ||
43 | IGNORE_DEV_SEL_STRAPS, /* 1 bit long */ | ||
44 | ODM_RSVD, | ||
45 | SBK_DEVKEY_STATUS, | ||
46 | _PARAMS_U32 = 0x7FFFFFFF | ||
47 | }; | ||
48 | |||
49 | #define MAX_PARAMS SBK_DEVKEY_STATUS | ||
50 | |||
51 | /* the order of the members is pre-decided. please do not change */ | ||
52 | struct fuse_data { | ||
53 | u32 devkey; | ||
54 | u32 jtag_dis; | ||
55 | u32 odm_prod_mode; | ||
56 | u32 bootdev_cfg; | ||
57 | u32 bootdev_sel; | ||
58 | u32 sbk[4]; | ||
59 | u32 sw_rsvd; | ||
60 | u32 ignore_devsel_straps; | ||
61 | u32 odm_rsvd[8]; | ||
62 | }; | ||
63 | |||
64 | /* secondary boot device options */ | ||
65 | enum { | ||
66 | SECBOOTDEV_SDMMC, | ||
67 | SECBOOTDEV_NOR, | ||
68 | SECBOOTDEV_SPI, | ||
69 | SECBOOTDEV_NAND, | ||
70 | SECBOOTDEV_LBANAND, | ||
71 | SECBOOTDEV_MUXONENAND, | ||
72 | _SECBOOTDEV_MAX, | ||
73 | _SECBOOTDEV_U32 = 0x7FFFFFFF | ||
74 | }; | ||
75 | |||
76 | /* | ||
77 | * read the fuse settings | ||
78 | * @param: io_param_type - param type enum | ||
79 | * @param: size - read size in bytes | ||
80 | */ | ||
81 | int tegra_fuse_read(enum fuse_io_param io_param_type, u32 *data, int size); | ||
82 | |||
83 | #define FLAGS_DEVKEY BIT(DEVKEY) | ||
84 | #define FLAGS_JTAG_DIS BIT(JTAG_DIS) | ||
85 | #define FLAGS_SBK_DEVKEY_STATUS BIT(SBK_DEVKEY_STATUS) | ||
86 | #define FLAGS_ODM_PROD_MODE BIT(ODM_PROD_MODE) | ||
87 | #define FLAGS_SEC_BOOT_DEV_CFG BIT(SEC_BOOT_DEV_CFG) | ||
88 | #define FLAGS_SEC_BOOT_DEV_SEL BIT(SEC_BOOT_DEV_SEL) | ||
89 | #define FLAGS_SBK BIT(SBK) | ||
90 | #define FLAGS_SW_RSVD BIT(SW_RSVD) | ||
91 | #define FLAGS_IGNORE_DEV_SEL_STRAPS BIT(IGNORE_DEV_SEL_STRAPS) | ||
92 | #define FLAGS_ODMRSVD BIT(ODM_RSVD) | ||
93 | |||
94 | /* | ||
95 | * Prior to invoking this routine, the caller is responsible for supplying | ||
96 | * valid fuse programming voltage. | ||
97 | * | ||
98 | * @param: pgm_data - entire data to be programmed | ||
99 | * @flags: program flags (e.g. FLAGS_DEVKEY) | ||
100 | */ | ||
101 | int tegra_fuse_program(struct fuse_data *pgm_data, u32 flags); | ||
102 | |||
103 | /* Disables the fuse programming until the next system reset */ | ||
104 | void tegra_fuse_program_disable(void); | ||
105 | |||
106 | extern int (*tegra_fuse_regulator_en)(int); | ||
107 | #endif | ||