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
72struct brcmf_chip *brcmf_chip_attach(void *ctx,
73 const struct brcmf_buscore_ops *ops);
74void brcmf_chip_detach(struct brcmf_chip *chip);
75struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid);
76struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip);
77struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub);
78bool brcmf_chip_iscoreup(struct brcmf_core *core);
79void brcmf_chip_coredisable(struct brcmf_core *core, u32 prereset, u32 reset);
80void brcmf_chip_resetcore(struct brcmf_core *core, u32 prereset, u32 reset,
81 u32 postreset);
82void brcmf_chip_set_passive(struct brcmf_chip *ci);
83bool brcmf_chip_set_active(struct brcmf_chip *ci, u32 rstvec);
84bool brcmf_chip_sr_capable(struct brcmf_chip *pub);
85char *brcmf_chip_name(u32 chipid, u32 chiprev, char *buf, uint len);
86
87#endif
88