4 * Copyright (C) 2010, Broadcom Corporation. All Rights Reserved.
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.
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,v 13.32.18.4 2011-01-17 10:33:12 Exp $
28 #define OTP_FUSE_RGN 8
29 #define OTP_ALL_RGN 0xf /* From h/w region to end of OTP including checksum */
32 #define OTP_SZ_MAX (6144/8) /* maximum bytes in one CIS */
34 /* Fixed size subregions sizes in words */
38 #define OTP4325_FM_DISABLED_OFFSET 188
41 /* Exported functions */
42 extern int otp_status(void *oh
);
43 extern int otp_size(void *oh
);
44 extern uint16
otp_read_bit(void *oh
, uint offset
);
45 extern void* otp_init(si_t
*sih
);
46 extern int otp_read_region(si_t
*sih
, int region
, uint16
*data
, uint
*wlen
);
47 extern int otp_read_word(si_t
*sih
, uint wn
, uint16
*data
);
48 extern int otp_nvread(void *oh
, char *data
, uint
*len
);
50 extern int otp_write_region(si_t
*sih
, int region
, uint16
*data
, uint wlen
);
51 extern int otp_write_word(si_t
*sih
, uint wn
, uint16 data
);
52 extern int otp_cis_append_region(si_t
*sih
, int region
, char *vars
, int count
);
53 extern int otp_lock(si_t
*sih
);
54 extern int otp_nvwrite(void *oh
, uint16
*data
, uint wlen
);
55 #endif /* BCMNVRAMW */
58 extern int otp_dump(void *oh
, int arg
, char *buf
, uint size
);
59 extern int otp_dumpstats(void *oh
, int arg
, char *buf
, uint size
);
62 #if defined(BCMNVRAMW)
63 #define otp_write_rde(oh, rde, bit, val) ipxotp_write_rde(oh, rde, bit, val)
64 extern int ipxotp_write_rde(void *oh
, int rde
, uint bit
, uint val
);
67 #endif /* _bcmotp_h_ */