GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / include / bcmotp.h
blob46182d726ee351695b44d46a91544cba82e975cc
1 /*
2 * OTP support.
4 * Copyright (C) 2012, Broadcom Corporation. All Rights Reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
13 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
15 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * $Id: bcmotp.h 321779 2012-03-16 19:39:00Z $
21 #ifndef _bcmotp_h_
22 #define _bcmotp_h_
24 /* OTP regions */
25 #define OTP_HW_RGN 1
26 #define OTP_SW_RGN 2
27 #define OTP_CI_RGN 4
28 #define OTP_FUSE_RGN 8
29 #define OTP_ALL_RGN 0xf /* From h/w region to end of OTP including checksum */
31 /* OTP Size */
32 #define OTP_SZ_MAX (6144/8) /* maximum bytes in one CIS */
34 /* Fixed size subregions sizes in words */
35 #define OTPGU_CI_SZ 2
37 /* OTP usage */
38 #define OTP4325_FM_DISABLED_OFFSET 188
40 #ifdef BCMNVRAMW
41 /* Global RDE index for chips not having an OTP PMU resource. */
42 #define OTP_GLOBAL_RDE_IDX 0xFF
43 #endif
45 /* Exported functions */
46 extern int otp_status(void *oh);
47 extern int otp_size(void *oh);
48 extern uint16 otp_read_bit(void *oh, uint offset);
49 extern void* otp_init(si_t *sih);
50 extern int otp_read_region(si_t *sih, int region, uint16 *data, uint *wlen);
51 extern int otp_read_word(si_t *sih, uint wn, uint16 *data);
52 extern int otp_nvread(void *oh, char *data, uint *len);
53 #ifdef BCMNVRAMW
54 extern int otp_write_region(si_t *sih, int region, uint16 *data, uint wlen);
55 extern int otp_write_word(si_t *sih, uint wn, uint16 data);
56 extern int otp_cis_append_region(si_t *sih, int region, char *vars, int count);
57 extern int otp_lock(si_t *sih);
58 extern int otp_nvwrite(void *oh, uint16 *data, uint wlen);
59 #endif /* BCMNVRAMW */
61 #if defined(WLTEST)
62 extern int otp_dump(void *oh, int arg, char *buf, uint size);
63 extern int otp_dumpstats(void *oh, int arg, char *buf, uint size);
64 #endif
66 #if defined(BCMNVRAMW)
67 #define otp_write_rde(oh, rde, bit, val) ipxotp_write_rde(oh, rde, bit, val)
68 extern int ipxotp_write_rde(void *oh, int rde, uint bit, uint val);
69 extern int otp_write_bits(void *oh, uint offset, int bits, uint8* data);
71 #ifdef OTP_DEBUG
72 extern int otp_verify1x(void *oh, uint off, uint fuse);
73 extern int otp_read1x(void *oh, uint off, uint fuse);
74 extern int otp_repair_bit(void *oh, uint off, uint val);
75 extern int otp_write_ones(void *oh, uint off, uint bits);
76 extern int otp_write_ones_old(void *oh, uint off, uint bits);
77 #endif
79 #endif
81 #endif /* _bcmotp_h_ */