Message ID | E1oXg8C-0064vf-SN@rmk-PC.armlinux.org.uk |
---|---|
State | New |
Headers | show |
Series | Add support for bcm4378 on Apple platforms | expand |
On Thu, Sep 15, 2022 at 03:34:59PM +0000, Alvin Šipraga wrote: > On Mon, Sep 12, 2022 at 10:53:32AM +0100, Russell King wrote: > > From: Hector Martin <marcan@marcan.st> > > > > This chip is present on Apple M1 (t8103) platforms: > > > > * atlantisb (apple,j274): Mac mini (M1, 2020) > > * honshu (apple,j293): MacBook Pro (13-inch, M1, 2020) > > * shikoku (apple,j313): MacBook Air (M1, 2020) > > * capri (apple,j456): iMac (24-inch, 4x USB-C, M1, 2020) > > * santorini (apple,j457): iMac (24-inch, 2x USB-C, M1, 2020) > > > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> > > Signed-off-by: Hector Martin <marcan@marcan.st> > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> > > --- > > Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk> > > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 2 ++ > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 8 ++++++++ > > .../net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 2 ++ > > 3 files changed, 12 insertions(+) > > > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c > > index 23295fceb062..3026166a56c1 100644 > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c > > @@ -733,6 +733,8 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) > > return 0x160000; > > case CY_CC_43752_CHIP_ID: > > return 0x170000; > > + case BRCM_CC_4378_CHIP_ID: > > + return 0x352000; > > default: > > brcmf_err("unknown chip: %s\n", ci->pub.name); > > break; > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > > index 269a516ae654..0c627f33049e 100644 > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > > @@ -59,6 +59,7 @@ BRCMF_FW_DEF(4365C, "brcmfmac4365c-pcie"); > > BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie"); > > BRCMF_FW_DEF(4366C, "brcmfmac4366c-pcie"); > > BRCMF_FW_DEF(4371, "brcmfmac4371-pcie"); > > +BRCMF_FW_CLM_DEF(4378B1, "brcmfmac4378b1-pcie"); > > > > /* firmware config files */ > > MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-pcie.txt"); > > @@ -88,6 +89,7 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { > > BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C), > > BRCMF_FW_ENTRY(BRCM_CC_43666_CHIP_ID, 0xFFFFFFF0, 4366C), > > BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), > > + BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* 3 */ > > What is /* 3 */? Hector says that it was mentioned in the prior review round as well. It's the revision ID. The mask allows all IDs for chips where no split has been seen, but if a new one comes up that comment is there so we know where to split the mask.
On Thu, Sep 15, 2022 at 05:54:11PM +0100, Russell King (Oracle) wrote: > On Thu, Sep 15, 2022 at 03:34:59PM +0000, Alvin Šipraga wrote: > > On Mon, Sep 12, 2022 at 10:53:32AM +0100, Russell King wrote: > > > From: Hector Martin <marcan@marcan.st> > > > > > > This chip is present on Apple M1 (t8103) platforms: > > > > > > * atlantisb (apple,j274): Mac mini (M1, 2020) > > > * honshu (apple,j293): MacBook Pro (13-inch, M1, 2020) > > > * shikoku (apple,j313): MacBook Air (M1, 2020) > > > * capri (apple,j456): iMac (24-inch, 4x USB-C, M1, 2020) > > > * santorini (apple,j457): iMac (24-inch, 2x USB-C, M1, 2020) > > > > > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> > > > Signed-off-by: Hector Martin <marcan@marcan.st> > > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> > > > --- > > > > Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk> > > > > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 2 ++ > > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 8 ++++++++ > > > .../net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 2 ++ > > > 3 files changed, 12 insertions(+) > > > > > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c > > > index 23295fceb062..3026166a56c1 100644 > > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c > > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c > > > @@ -733,6 +733,8 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) > > > return 0x160000; > > > case CY_CC_43752_CHIP_ID: > > > return 0x170000; > > > + case BRCM_CC_4378_CHIP_ID: > > > + return 0x352000; > > > default: > > > brcmf_err("unknown chip: %s\n", ci->pub.name); > > > break; > > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > > > index 269a516ae654..0c627f33049e 100644 > > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > > > @@ -59,6 +59,7 @@ BRCMF_FW_DEF(4365C, "brcmfmac4365c-pcie"); > > > BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie"); > > > BRCMF_FW_DEF(4366C, "brcmfmac4366c-pcie"); > > > BRCMF_FW_DEF(4371, "brcmfmac4371-pcie"); > > > +BRCMF_FW_CLM_DEF(4378B1, "brcmfmac4378b1-pcie"); > > > > > > /* firmware config files */ > > > MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-pcie.txt"); > > > @@ -88,6 +89,7 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { > > > BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C), > > > BRCMF_FW_ENTRY(BRCM_CC_43666_CHIP_ID, 0xFFFFFFF0, 4366C), > > > BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), > > > + BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* 3 */ > > > > What is /* 3 */? > > Hector says that it was mentioned in the prior review round as well. > It's the revision ID. The mask allows all IDs for chips where no > split has been seen, but if a new one comes up that comment is there > so we know where to split the mask. Alright, makes sense. If you happen to re-spin the series then it would be nice to include this info in the commit message. Kind regards, Alvin
Alvin Šipraga <ALSI@bang-olufsen.dk> writes: > On Thu, Sep 15, 2022 at 05:54:11PM +0100, Russell King (Oracle) wrote: >> On Thu, Sep 15, 2022 at 03:34:59PM +0000, Alvin Šipraga wrote: >> > On Mon, Sep 12, 2022 at 10:53:32AM +0100, Russell King wrote: >> > > From: Hector Martin <marcan@marcan.st> >> > > >> > > This chip is present on Apple M1 (t8103) platforms: >> > > >> > > * atlantisb (apple,j274): Mac mini (M1, 2020) >> > > * honshu (apple,j293): MacBook Pro (13-inch, M1, 2020) >> > > * shikoku (apple,j313): MacBook Air (M1, 2020) >> > > * capri (apple,j456): iMac (24-inch, 4x USB-C, M1, 2020) >> > > * santorini (apple,j457): iMac (24-inch, 2x USB-C, M1, 2020) >> > > >> > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> >> > > Signed-off-by: Hector Martin <marcan@marcan.st> >> > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> >> > > --- >> > >> > Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk> >> > >> > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 2 ++ >> > > drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 8 ++++++++ >> > > .../net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 2 ++ >> > > 3 files changed, 12 insertions(+) >> > > >> > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c >> > > index 23295fceb062..3026166a56c1 100644 >> > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c >> > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c >> > > @@ -733,6 +733,8 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) >> > > return 0x160000; >> > > case CY_CC_43752_CHIP_ID: >> > > return 0x170000; >> > > + case BRCM_CC_4378_CHIP_ID: >> > > + return 0x352000; >> > > default: >> > > brcmf_err("unknown chip: %s\n", ci->pub.name); >> > > break; >> > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c >> > > index 269a516ae654..0c627f33049e 100644 >> > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c >> > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c >> > > @@ -59,6 +59,7 @@ BRCMF_FW_DEF(4365C, "brcmfmac4365c-pcie"); >> > > BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie"); >> > > BRCMF_FW_DEF(4366C, "brcmfmac4366c-pcie"); >> > > BRCMF_FW_DEF(4371, "brcmfmac4371-pcie"); >> > > +BRCMF_FW_CLM_DEF(4378B1, "brcmfmac4378b1-pcie"); >> > > >> > > /* firmware config files */ >> > > MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-pcie.txt"); >> > > @@ -88,6 +89,7 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { >> > > BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C), >> > > BRCMF_FW_ENTRY(BRCM_CC_43666_CHIP_ID, 0xFFFFFFF0, 4366C), >> > > BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), >> > > + BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* 3 */ >> > >> > What is /* 3 */? >> >> Hector says that it was mentioned in the prior review round as well. >> It's the revision ID. The mask allows all IDs for chips where no >> split has been seen, but if a new one comes up that comment is there >> so we know where to split the mask. > > Alright, makes sense. If you happen to re-spin the series then it would > be nice to include this info in the commit message. And maybe even change the comment to something like: /* revision ID 3 */
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index 23295fceb062..3026166a56c1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -733,6 +733,8 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) return 0x160000; case CY_CC_43752_CHIP_ID: return 0x170000; + case BRCM_CC_4378_CHIP_ID: + return 0x352000; default: brcmf_err("unknown chip: %s\n", ci->pub.name); break; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 269a516ae654..0c627f33049e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -59,6 +59,7 @@ BRCMF_FW_DEF(4365C, "brcmfmac4365c-pcie"); BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie"); BRCMF_FW_DEF(4366C, "brcmfmac4366c-pcie"); BRCMF_FW_DEF(4371, "brcmfmac4371-pcie"); +BRCMF_FW_CLM_DEF(4378B1, "brcmfmac4378b1-pcie"); /* firmware config files */ MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-pcie.txt"); @@ -88,6 +89,7 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C), BRCMF_FW_ENTRY(BRCM_CC_43666_CHIP_ID, 0xFFFFFFF0, 4366C), BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), + BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* 3 */ }; #define BRCMF_PCIE_FW_UP_TIMEOUT 5000 /* msec */ @@ -1970,6 +1972,11 @@ static int brcmf_pcie_read_otp(struct brcmf_pciedev_info *devinfo) int ret; switch (devinfo->ci->chip) { + case BRCM_CC_4378_CHIP_ID: + coreid = BCMA_CORE_GCI; + base = 0x1120; + words = 0x170; + break; default: /* OTP not supported on this chip */ return 0; @@ -2458,6 +2465,7 @@ static const struct pci_device_id brcmf_pcie_devid_table[] = { BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_2G_DEVICE_ID), BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID), BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID), + BRCMF_PCIE_DEVICE(BRCM_PCIE_4378_DEVICE_ID), { /* end: all zeroes */ } }; diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h index 1f225cdac9bd..1003f123ec25 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h @@ -51,6 +51,7 @@ #define BRCM_CC_43664_CHIP_ID 43664 #define BRCM_CC_43666_CHIP_ID 43666 #define BRCM_CC_4371_CHIP_ID 0x4371 +#define BRCM_CC_4378_CHIP_ID 0x4378 #define CY_CC_4373_CHIP_ID 0x4373 #define CY_CC_43012_CHIP_ID 43012 #define CY_CC_43439_CHIP_ID 43439 @@ -88,6 +89,7 @@ #define BRCM_PCIE_4366_2G_DEVICE_ID 0x43c4 #define BRCM_PCIE_4366_5G_DEVICE_ID 0x43c5 #define BRCM_PCIE_4371_DEVICE_ID 0x440d +#define BRCM_PCIE_4378_DEVICE_ID 0x4425 /* brcmsmac IDs */