0001
0002
0003
0004
0005 #ifndef BRCMF_CHIP_H
0006 #define BRCMF_CHIP_H
0007
0008 #include <linux/types.h>
0009
0010 #define CORE_CC_REG(base, field) \
0011 (base + offsetof(struct chipcregs, field))
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 struct brcmf_chip {
0029 u32 chip;
0030 u32 chiprev;
0031 u32 enum_base;
0032 u32 cc_caps;
0033 u32 cc_caps_ext;
0034 u32 pmucaps;
0035 u32 pmurev;
0036 u32 rambase;
0037 u32 ramsize;
0038 u32 srsize;
0039 char name[12];
0040 };
0041
0042
0043
0044
0045
0046
0047
0048
0049 struct brcmf_core {
0050 u16 id;
0051 u16 rev;
0052 u32 base;
0053 };
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 struct brcmf_buscore_ops {
0066 u32 (*read32)(void *ctx, u32 addr);
0067 void (*write32)(void *ctx, u32 addr, u32 value);
0068 int (*prepare)(void *ctx);
0069 int (*reset)(void *ctx, struct brcmf_chip *chip);
0070 int (*setup)(void *ctx, struct brcmf_chip *chip);
0071 void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec);
0072 };
0073
0074 int brcmf_chip_get_raminfo(struct brcmf_chip *pub);
0075 struct brcmf_chip *brcmf_chip_attach(void *ctx, u16 devid,
0076 const struct brcmf_buscore_ops *ops);
0077 void brcmf_chip_detach(struct brcmf_chip *chip);
0078 struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid);
0079 struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit);
0080 struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip);
0081 struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub);
0082 bool brcmf_chip_iscoreup(struct brcmf_core *core);
0083 void brcmf_chip_coredisable(struct brcmf_core *core, u32 prereset, u32 reset);
0084 void brcmf_chip_resetcore(struct brcmf_core *core, u32 prereset, u32 reset,
0085 u32 postreset);
0086 void brcmf_chip_set_passive(struct brcmf_chip *ci);
0087 bool brcmf_chip_set_active(struct brcmf_chip *ci, u32 rstvec);
0088 bool brcmf_chip_sr_capable(struct brcmf_chip *pub);
0089 char *brcmf_chip_name(u32 chipid, u32 chiprev, char *buf, uint len);
0090 u32 brcmf_chip_enum_base(u16 devid);
0091
0092 #endif