Commit 9cf218fc authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcmfmac: rename chip and core related structures

Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarDaniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c805eeb7
...@@ -369,7 +369,7 @@ struct brcmf_sdio_hdrinfo { ...@@ -369,7 +369,7 @@ struct brcmf_sdio_hdrinfo {
/* Private data for SDIO bus interaction */ /* Private data for SDIO bus interaction */
struct brcmf_sdio { struct brcmf_sdio {
struct brcmf_sdio_dev *sdiodev; /* sdio device handler */ struct brcmf_sdio_dev *sdiodev; /* sdio device handler */
struct chip_info *ci; /* Chip info struct */ struct brcmf_chip *ci; /* Chip info struct */
u32 ramsize; /* Size of RAM in SOCRAM (bytes) */ u32 ramsize; /* Size of RAM in SOCRAM (bytes) */
......
...@@ -118,7 +118,7 @@ static const struct sdiod_drive_str sdiod_drvstr_tab2_3v3[] = { ...@@ -118,7 +118,7 @@ static const struct sdiod_drive_str sdiod_drvstr_tab2_3v3[] = {
}; };
u8 u8
brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid) brcmf_sdio_chip_getinfidx(struct brcmf_chip *ci, u16 coreid)
{ {
u8 idx; u8 idx;
...@@ -131,7 +131,7 @@ brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid) ...@@ -131,7 +131,7 @@ brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid)
static u32 static u32
brcmf_sdio_sb_corerev(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_sb_corerev(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid) struct brcmf_chip *ci, u16 coreid)
{ {
u32 regdata; u32 regdata;
u8 idx; u8 idx;
...@@ -146,7 +146,7 @@ brcmf_sdio_sb_corerev(struct brcmf_sdio_dev *sdiodev, ...@@ -146,7 +146,7 @@ brcmf_sdio_sb_corerev(struct brcmf_sdio_dev *sdiodev,
static u32 static u32
brcmf_sdio_ai_corerev(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_ai_corerev(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid) struct brcmf_chip *ci, u16 coreid)
{ {
u8 idx; u8 idx;
...@@ -157,7 +157,7 @@ brcmf_sdio_ai_corerev(struct brcmf_sdio_dev *sdiodev, ...@@ -157,7 +157,7 @@ brcmf_sdio_ai_corerev(struct brcmf_sdio_dev *sdiodev,
static bool static bool
brcmf_sdio_sb_iscoreup(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_sb_iscoreup(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid) struct brcmf_chip *ci, u16 coreid)
{ {
u32 regdata; u32 regdata;
u8 idx; u8 idx;
...@@ -176,7 +176,7 @@ brcmf_sdio_sb_iscoreup(struct brcmf_sdio_dev *sdiodev, ...@@ -176,7 +176,7 @@ brcmf_sdio_sb_iscoreup(struct brcmf_sdio_dev *sdiodev,
static bool static bool
brcmf_sdio_ai_iscoreup(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_ai_iscoreup(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid) struct brcmf_chip *ci, u16 coreid)
{ {
u32 regdata; u32 regdata;
u8 idx; u8 idx;
...@@ -200,7 +200,7 @@ brcmf_sdio_ai_iscoreup(struct brcmf_sdio_dev *sdiodev, ...@@ -200,7 +200,7 @@ brcmf_sdio_ai_iscoreup(struct brcmf_sdio_dev *sdiodev,
static void static void
brcmf_sdio_sb_coredisable(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_sb_coredisable(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid, u32 pre_resetbits, struct brcmf_chip *ci, u16 coreid, u32 pre_resetbits,
u32 in_resetbits) u32 in_resetbits)
{ {
u32 regdata, base; u32 regdata, base;
...@@ -287,7 +287,7 @@ brcmf_sdio_sb_coredisable(struct brcmf_sdio_dev *sdiodev, ...@@ -287,7 +287,7 @@ brcmf_sdio_sb_coredisable(struct brcmf_sdio_dev *sdiodev,
static void static void
brcmf_sdio_ai_coredisable(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_ai_coredisable(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid, u32 pre_resetbits, struct brcmf_chip *ci, u16 coreid, u32 pre_resetbits,
u32 in_resetbits) u32 in_resetbits)
{ {
u8 idx; u8 idx;
...@@ -327,7 +327,7 @@ brcmf_sdio_ai_coredisable(struct brcmf_sdio_dev *sdiodev, ...@@ -327,7 +327,7 @@ brcmf_sdio_ai_coredisable(struct brcmf_sdio_dev *sdiodev,
static void static void
brcmf_sdio_sb_resetcore(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_sb_resetcore(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid, u32 pre_resetbits, struct brcmf_chip *ci, u16 coreid, u32 pre_resetbits,
u32 in_resetbits, u32 post_resetbits) u32 in_resetbits, u32 post_resetbits)
{ {
u32 regdata; u32 regdata;
...@@ -395,7 +395,7 @@ brcmf_sdio_sb_resetcore(struct brcmf_sdio_dev *sdiodev, ...@@ -395,7 +395,7 @@ brcmf_sdio_sb_resetcore(struct brcmf_sdio_dev *sdiodev,
static void static void
brcmf_sdio_ai_resetcore(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_ai_resetcore(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid, u32 pre_resetbits, struct brcmf_chip *ci, u16 coreid, u32 pre_resetbits,
u32 in_resetbits, u32 post_resetbits) u32 in_resetbits, u32 post_resetbits)
{ {
u8 idx; u8 idx;
...@@ -425,7 +425,7 @@ brcmf_sdio_ai_resetcore(struct brcmf_sdio_dev *sdiodev, ...@@ -425,7 +425,7 @@ brcmf_sdio_ai_resetcore(struct brcmf_sdio_dev *sdiodev,
#ifdef DEBUG #ifdef DEBUG
/* safety check for chipinfo */ /* safety check for chipinfo */
static int brcmf_sdio_chip_cichk(struct chip_info *ci) static int brcmf_sdio_chip_cichk(struct brcmf_chip *ci)
{ {
u8 core_idx; u8 core_idx;
...@@ -452,14 +452,14 @@ static int brcmf_sdio_chip_cichk(struct chip_info *ci) ...@@ -452,14 +452,14 @@ static int brcmf_sdio_chip_cichk(struct chip_info *ci)
return 0; return 0;
} }
#else /* DEBUG */ #else /* DEBUG */
static inline int brcmf_sdio_chip_cichk(struct chip_info *ci) static inline int brcmf_sdio_chip_cichk(struct brcmf_chip *ci)
{ {
return 0; return 0;
} }
#endif #endif
static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev, static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci) struct brcmf_chip *ci)
{ {
u32 regdata; u32 regdata;
u32 socitype; u32 socitype;
...@@ -708,7 +708,7 @@ brcmf_sdio_chip_buscoreprep(struct brcmf_sdio_dev *sdiodev) ...@@ -708,7 +708,7 @@ brcmf_sdio_chip_buscoreprep(struct brcmf_sdio_dev *sdiodev)
static void static void
brcmf_sdio_chip_buscoresetup(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_chip_buscoresetup(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci) struct brcmf_chip *ci)
{ {
u32 base = ci->c_inf[0].base; u32 base = ci->c_inf[0].base;
...@@ -743,15 +743,14 @@ brcmf_sdio_chip_buscoresetup(struct brcmf_sdio_dev *sdiodev, ...@@ -743,15 +743,14 @@ brcmf_sdio_chip_buscoresetup(struct brcmf_sdio_dev *sdiodev,
} }
int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev, int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
struct chip_info **ci_ptr) struct brcmf_chip **ci_ptr)
{ {
int ret; int ret;
struct chip_info *ci; struct brcmf_chip *ci;
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
/* alloc chip_info_t */ ci = kzalloc(sizeof(*ci), GFP_ATOMIC);
ci = kzalloc(sizeof(struct chip_info), GFP_ATOMIC);
if (!ci) if (!ci)
return -ENOMEM; return -ENOMEM;
...@@ -779,7 +778,7 @@ int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev, ...@@ -779,7 +778,7 @@ int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
} }
void void
brcmf_sdio_chip_detach(struct chip_info **ci_ptr) brcmf_sdio_chip_detach(struct brcmf_chip **ci_ptr)
{ {
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
...@@ -798,7 +797,7 @@ static char *brcmf_sdio_chip_name(uint chipid, char *buf, uint len) ...@@ -798,7 +797,7 @@ static char *brcmf_sdio_chip_name(uint chipid, char *buf, uint len)
void void
brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u32 drivestrength) struct brcmf_chip *ci, u32 drivestrength)
{ {
const struct sdiod_drive_str *str_tab = NULL; const struct sdiod_drive_str *str_tab = NULL;
u32 str_mask; u32 str_mask;
...@@ -870,7 +869,7 @@ brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev, ...@@ -870,7 +869,7 @@ brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
static void static void
brcmf_sdio_chip_cm3_enterdl(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_chip_cm3_enterdl(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci) struct brcmf_chip *ci)
{ {
ci->coredisable(sdiodev, ci, BCMA_CORE_ARM_CM3, 0, 0); ci->coredisable(sdiodev, ci, BCMA_CORE_ARM_CM3, 0, 0);
ci->resetcore(sdiodev, ci, BCMA_CORE_80211, ci->resetcore(sdiodev, ci, BCMA_CORE_80211,
...@@ -879,8 +878,8 @@ brcmf_sdio_chip_cm3_enterdl(struct brcmf_sdio_dev *sdiodev, ...@@ -879,8 +878,8 @@ brcmf_sdio_chip_cm3_enterdl(struct brcmf_sdio_dev *sdiodev,
ci->resetcore(sdiodev, ci, BCMA_CORE_INTERNAL_MEM, 0, 0, 0); ci->resetcore(sdiodev, ci, BCMA_CORE_INTERNAL_MEM, 0, 0, 0);
} }
static bool static bool brcmf_sdio_chip_cm3_exitdl(struct brcmf_sdio_dev *sdiodev,
brcmf_sdio_chip_cm3_exitdl(struct brcmf_sdio_dev *sdiodev, struct chip_info *ci) struct brcmf_chip *ci)
{ {
u8 core_idx; u8 core_idx;
u32 reg_addr; u32 reg_addr;
...@@ -903,7 +902,7 @@ brcmf_sdio_chip_cm3_exitdl(struct brcmf_sdio_dev *sdiodev, struct chip_info *ci) ...@@ -903,7 +902,7 @@ brcmf_sdio_chip_cm3_exitdl(struct brcmf_sdio_dev *sdiodev, struct chip_info *ci)
static inline void static inline void
brcmf_sdio_chip_cr4_enterdl(struct brcmf_sdio_dev *sdiodev, brcmf_sdio_chip_cr4_enterdl(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci) struct brcmf_chip *ci)
{ {
u8 idx; u8 idx;
u32 regdata; u32 regdata;
...@@ -923,9 +922,8 @@ brcmf_sdio_chip_cr4_enterdl(struct brcmf_sdio_dev *sdiodev, ...@@ -923,9 +922,8 @@ brcmf_sdio_chip_cr4_enterdl(struct brcmf_sdio_dev *sdiodev,
D11_BCMA_IOCTL_PHYCLOCKEN, D11_BCMA_IOCTL_PHYCLOCKEN); D11_BCMA_IOCTL_PHYCLOCKEN, D11_BCMA_IOCTL_PHYCLOCKEN);
} }
static bool static bool brcmf_sdio_chip_cr4_exitdl(struct brcmf_sdio_dev *sdiodev,
brcmf_sdio_chip_cr4_exitdl(struct brcmf_sdio_dev *sdiodev, struct chip_info *ci, struct brcmf_chip *ci, u32 rstvec)
u32 rstvec)
{ {
u8 core_idx; u8 core_idx;
u32 reg_addr; u32 reg_addr;
...@@ -948,7 +946,7 @@ brcmf_sdio_chip_cr4_exitdl(struct brcmf_sdio_dev *sdiodev, struct chip_info *ci, ...@@ -948,7 +946,7 @@ brcmf_sdio_chip_cr4_exitdl(struct brcmf_sdio_dev *sdiodev, struct chip_info *ci,
} }
void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev, void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci) struct brcmf_chip *ci)
{ {
u8 arm_core_idx; u8 arm_core_idx;
...@@ -962,7 +960,7 @@ void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev, ...@@ -962,7 +960,7 @@ void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
} }
bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev, bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u32 rstvec) struct brcmf_chip *ci, u32 rstvec)
{ {
u8 arm_core_idx; u8 arm_core_idx;
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#define BRCMF_MAX_CORENUM 6 #define BRCMF_MAX_CORENUM 6
struct chip_core_info { struct brcmf_core {
u16 id; u16 id;
u16 rev; u16 rev;
u32 base; u32 base;
...@@ -63,27 +63,27 @@ struct chip_core_info { ...@@ -63,27 +63,27 @@ struct chip_core_info {
u32 cib; u32 cib;
}; };
struct chip_info { struct brcmf_chip {
u32 chip; u32 chip;
u32 chiprev; u32 chiprev;
/* core info */ /* core info */
/* always put chipcommon core at 0, bus core at 1 */ /* always put chipcommon core at 0, bus core at 1 */
struct chip_core_info c_inf[BRCMF_MAX_CORENUM]; struct brcmf_core c_inf[BRCMF_MAX_CORENUM];
u32 pmurev; u32 pmurev;
u32 pmucaps; u32 pmucaps;
u32 ramsize; u32 ramsize;
u32 rambase; u32 rambase;
u32 rst_vec; /* reset vertor for ARM CR4 core */ u32 rst_vec; /* reset vertor for ARM CR4 core */
bool (*iscoreup)(struct brcmf_sdio_dev *sdiodev, struct chip_info *ci, bool (*iscoreup)(struct brcmf_sdio_dev *sdiodev, struct brcmf_chip *ci,
u16 coreid); u16 coreid);
u32 (*corerev)(struct brcmf_sdio_dev *sdiodev, struct chip_info *ci, u32 (*corerev)(struct brcmf_sdio_dev *sdiodev, struct brcmf_chip *ci,
u16 coreid); u16 coreid);
void (*coredisable)(struct brcmf_sdio_dev *sdiodev, void (*coredisable)(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid, u32 pre_resetbits, struct brcmf_chip *ci, u16 coreid, u32 pre_resetbits,
u32 in_resetbits); u32 in_resetbits);
void (*resetcore)(struct brcmf_sdio_dev *sdiodev, void (*resetcore)(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u16 coreid, u32 pre_resetbits, struct brcmf_chip *ci, u16 coreid, u32 pre_resetbits,
u32 in_resetbits, u32 post_resetbits); u32 in_resetbits, u32 post_resetbits);
}; };
...@@ -217,14 +217,15 @@ struct sdpcmd_regs { ...@@ -217,14 +217,15 @@ struct sdpcmd_regs {
}; };
int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev, int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
struct chip_info **ci_ptr); struct brcmf_chip **ci_ptr);
void brcmf_sdio_chip_detach(struct chip_info **ci_ptr); void brcmf_sdio_chip_detach(struct brcmf_chip **ci_ptr);
void brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev, void brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u32 drivestrength); struct brcmf_chip *ci,
u8 brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid); u32 drivestrength);
u8 brcmf_sdio_chip_getinfidx(struct brcmf_chip *ci, u16 coreid);
void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev, void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci); struct brcmf_chip *ci);
bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev, bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev,
struct chip_info *ci, u32 rstvec); struct brcmf_chip *ci, u32 rstvec);
#endif /* _BRCMFMAC_SDIO_CHIP_H_ */ #endif /* _BRCMFMAC_SDIO_CHIP_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment