Resync with broadcom drivers 5.100.138.20 and utilities.
[tomato.git] / release / src-rt / include / hndtcam.h
blob0c1497aad23ffefe6f51af8e5a6494bd6f479dfc
1 /*
2 * HND SOCRAM TCAM software interface.
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.
18 * $Id: hndtcam.h,v 1.3 2008-12-17 13:09:49 Exp $
20 #ifndef _hndtcam_h_
21 #define _hndtcam_h_
24 * 0 - 1
25 * 1 - 2 Consecutive locations are patched
26 * 2 - 4 Consecutive locations are patched
27 * 3 - 8 Consecutive locations are patched
28 * 4 - 16 Consecutive locations are patched
29 * Define default to patch 2 locations
32 #ifdef PATCHCOUNT
33 #define SRPC_PATCHCOUNT PATCHCOUNT
34 #else
35 #define PATCHCOUNT 0
36 #define SRPC_PATCHCOUNT PATCHCOUNT
37 #endif
39 /* N Consecutive location to patch */
40 #define SRPC_PATCHNLOC (1 << (SRPC_PATCHCOUNT))
42 /* patch values and address structure */
43 typedef struct patchaddrvalue {
44 uint32 addr;
45 uint32 value;
46 } patchaddrvalue_t;
48 extern void hnd_patch_init(void *srp);
49 extern void hnd_tcam_write(void *srp, uint16 index, uint32 data);
50 extern void hnd_tcam_read(void *srp, uint16 index, uint32 *content);
51 void * hnd_tcam_init(void *srp, uint no_addrs);
52 extern void hnd_tcam_disablepatch(void *srp);
53 extern void hnd_tcam_enablepatch(void *srp);
54 #ifdef CONFIG_XIP
55 extern void hnd_tcam_bootloader_load(void *srp, char *pvars);
56 #else
57 extern void hnd_tcam_load(void *srp, const patchaddrvalue_t *patchtbl);
58 #endif /* CONFIG_XIP */
60 #endif /* _hndtcam_h_ */