1
2
3
4
5#ifndef BRCMF_CHIP_H
6#define BRCMF_CHIP_H
7
8#include <linux/types.h>
9
10#define CORE_CC_REG(base, field) \
11 (base + offsetof(struct chipcregs, field))
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27struct brcmf_chip {
28 u32 chip;
29 u32 chiprev;
30 u32 cc_caps;
31 u32 cc_caps_ext;
32 u32 pmucaps;
33 u32 pmurev;
34 u32 rambase;
35 u32 ramsize;
36 u32 srsize;
37 char name[12];
38};
39
40
41
42
43
44
45
46
47struct brcmf_core {
48 u16 id;
49 u16 rev;
50 u32 base;
51};
52
53
54
55
56
57
58
59
60
61
62
63struct brcmf_buscore_ops {
64 u32 (*read32)(void *ctx, u32 addr);
65 void (*write32)(void *ctx, u32 addr, u32 value);
66 int (*prepare)(void *ctx);
67 int (*reset)(void *ctx, struct brcmf_chip *chip);
68 int (*setup)(void *ctx, struct brcmf_chip *chip);
69 void (*activate)(void *ctx, struct brcmf_chip *chip, u32 rstvec);
70};
71
72int brcmf_chip_get_raminfo(struct brcmf_chip *pub);
73struct brcmf_chip *brcmf_chip_attach(void *ctx,
74 const struct brcmf_buscore_ops *ops);
75void brcmf_chip_detach(struct brcmf_chip *chip);
76struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid);
77struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit);
78struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip);
79struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub);
80bool brcmf_chip_iscoreup(struct brcmf_core *core);
81void brcmf_chip_coredisable(struct brcmf_core *core, u32 prereset, u32 reset);
82void brcmf_chip_resetcore(struct brcmf_core *core, u32 prereset, u32 reset,
83 u32 postreset);
84void brcmf_chip_set_passive(struct brcmf_chip *ci);
85bool brcmf_chip_set_active(struct brcmf_chip *ci, u32 rstvec);
86bool brcmf_chip_sr_capable(struct brcmf_chip *pub);
87char *brcmf_chip_name(u32 chipid, u32 chiprev, char *buf, uint len);
88
89#endif
90