9cb669bd919b2d7fb91f60ae21df478bf6de8ff5
[openwrt-10.03/.git] / target / linux / brcm-2.4 / files / arch / mips / bcm947xx / include / bcmdefs.h
1 /*
2  * Misc system wide definitions
3  *
4  * Copyright 2006, Broadcom Corporation
5  * All Rights Reserved.
6  * 
7  * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8  * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9  * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10  * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11  * $Id: bcmdefs.h,v 1.1.1.3 2006/04/08 06:13:39 honor Exp $
12  */
13
14 #ifndef _bcmdefs_h_
15 #define _bcmdefs_h_
16
17 /*
18  * One doesn't need to include this file explicitly, gets included automatically if
19  * typedefs.h is included.
20  */
21
22 /* Reclaiming text and data :
23  * The following macros specify special linker sections that can be reclaimed
24  * after a system is considered 'up'.
25  */
26 #if defined(__GNUC__) && defined(BCMRECLAIM)
27 extern bool     bcmreclaimed;
28 #define BCMINITDATA(_data)      __attribute__ ((__section__ (".dataini." #_data))) _data
29 #define BCMINITFN(_fn)          __attribute__ ((__section__ (".textini." #_fn))) _fn
30 #else /* #if defined(__GNUC__) && defined(BCMRECLAIM) */
31 #define BCMINITDATA(_data)      _data
32 #define BCMINITFN(_fn)          _fn
33 #define bcmreclaimed            0
34 #endif /* #if defined(__GNUC__) && defined(BCMRECLAIM) */
35
36 /* Reclaim uninit functions if BCMNODOWN is defined             */
37 /* and if they are not already removed by -gc-sections  */
38 #ifdef BCMNODOWN
39 #define BCMUNINITFN(_fn)                BCMINITFN(_fn)
40 #else
41 #define BCMUNINITFN(_fn)                _fn
42 #endif
43
44 #ifdef BCMRECLAIM
45 #define CONST
46 #else
47 #define CONST   const
48 #endif /* BCMRECLAIM */
49
50 /* Compatibility with old-style BCMRECLAIM */
51 #define BCMINIT(_id)            _id
52
53
54 /* Put some library data/code into ROM to reduce RAM requirements */
55 #if defined(__GNUC__) && defined(BCMROMOFFLOAD)
56 #define BCMROMDATA(_data)       __attribute__ ((__section__ (".datarom." #_data))) _data
57 #define BCMROMFN(_fn)           __attribute__ ((__section__ (".textrom." #_fn))) _fn
58 #else
59 #define BCMROMDATA(_data)       _data
60 #define BCMROMFN(_fn)           _fn
61 #endif
62
63 /* Bus types */
64 #define SB_BUS                  0       /* Silicon Backplane */
65 #define PCI_BUS                 1       /* PCI target */
66 #define PCMCIA_BUS              2       /* PCMCIA target */
67 #define SDIO_BUS                3       /* SDIO target */
68 #define JTAG_BUS                4       /* JTAG */
69 #define NO_BUS                  0xFF    /* Bus that does not support R/W REG */
70
71 /* Allows optimization for single-bus support */
72 #ifdef BCMBUSTYPE
73 #define BUSTYPE(bus) (BCMBUSTYPE)
74 #else
75 #define BUSTYPE(bus) (bus)
76 #endif
77
78 /* Defines for DMA Address Width - Shared between OSL and HNDDMA */
79 #define DMADDR_MASK_32 0x0              /* Address mask for 32-bits */
80 #define DMADDR_MASK_30 0xc0000000       /* Address mask for 30-bits */
81 #define DMADDR_MASK_0  0xffffffff       /* Address mask for 0-bits (hi-part) */
82
83 #define DMADDRWIDTH_30  30 /* 30-bit addressing capability */
84 #define DMADDRWIDTH_32  32 /* 32-bit addressing capability */
85 #define DMADDRWIDTH_63  63 /* 64-bit addressing capability */
86 #define DMADDRWIDTH_64  64 /* 64-bit addressing capability */
87
88 /* packet headroom necessary to accomodate the largest header in the system, (i.e TXOFF).
89  * By doing, we avoid the need  to allocate an extra buffer for the header when bridging to WL.
90  * There is a compile time check in wlc.c which ensure that this value is at least as big
91  * as TXOFF. This value is used in dma_rxfill (hnddma.c).
92  */
93 #define BCMEXTRAHDROOM 160
94
95 /* Headroom required for dongle-to-host communication.  Packets allocated
96  * locally in the dongle (e.g. for CDC ioctls or RNDIS messages) should
97  * leave this much room in front for low-level message headers which may
98  * be needed to get across the dongle bus to the host.  (These messages
99  * don't go over the network, so room for the full WL header above would
100  * be a waste.)
101  */
102 #define BCMDONGLEHDRSZ 8
103
104 /* Max. nvram variable table size */
105 #define    MAXSZ_NVRAM_VARS    4096
106
107
108 #endif /* _bcmdefs_h_ */