1/* 2 * OTP support. 3 * 4 * Copyright (C) 2010, 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. 17 * 18 * $Id: bcmotp.h,v 13.32.18.4 2011/01/17 10:33:12 Exp $ 19 */ 20 21#ifndef _bcmotp_h_ 22#define _bcmotp_h_ 23 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 */ 30 31/* OTP Size */ 32#define OTP_SZ_MAX (6144/8) /* maximum bytes in one CIS */ 33 34/* Fixed size subregions sizes in words */ 35#define OTPGU_CI_SZ 2 36 37/* OTP usage */ 38#define OTP4325_FM_DISABLED_OFFSET 188 39 40 41/* Exported functions */ 42extern int otp_status(void *oh); 43extern int otp_size(void *oh); 44extern uint16 otp_read_bit(void *oh, uint offset); 45extern void* otp_init(si_t *sih); 46extern int otp_read_region(si_t *sih, int region, uint16 *data, uint *wlen); 47extern int otp_read_word(si_t *sih, uint wn, uint16 *data); 48extern int otp_nvread(void *oh, char *data, uint *len); 49#ifdef BCMNVRAMW 50extern int otp_write_region(si_t *sih, int region, uint16 *data, uint wlen); 51extern int otp_write_word(si_t *sih, uint wn, uint16 data); 52extern int otp_cis_append_region(si_t *sih, int region, char *vars, int count); 53extern int otp_lock(si_t *sih); 54extern int otp_nvwrite(void *oh, uint16 *data, uint wlen); 55#endif /* BCMNVRAMW */ 56 57#if defined(WLTEST) 58extern int otp_dump(void *oh, int arg, char *buf, uint size); 59extern int otp_dumpstats(void *oh, int arg, char *buf, uint size); 60#endif 61 62#if defined(BCMNVRAMW) 63#define otp_write_rde(oh, rde, bit, val) ipxotp_write_rde(oh, rde, bit, val) 64extern int ipxotp_write_rde(void *oh, int rde, uint bit, uint val); 65#endif 66 67#endif /* _bcmotp_h_ */ 68