From c38a9bc9b20c1fb0f07366e6a1ca99305ae62635 Mon Sep 17 00:00:00 2001 From: patrick Date: Sun, 31 Jan 2021 11:07:51 +0000 Subject: [PATCH] Add basic support for BCM4378 as found on the Apple M1 SoCs. There's a little bit more to do though before it can be enabled. --- sys/dev/ic/bwfm.c | 7 ++++++- sys/dev/ic/bwfmvar.h | 3 ++- sys/dev/pci/if_bwfm_pci.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index 7b798d47184..1783a57bd36 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.79 2020/12/17 15:37:09 jcs Exp $ */ +/* $OpenBSD: bwfm.c,v 1.80 2021/01/31 11:07:51 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -1323,6 +1323,8 @@ bwfm_chip_sr_capable(struct bwfm_softc *sc) reg = sc->sc_buscore_ops->bc_read(sc, core->co_base + BWFM_CHIP_REG_SR_CONTROL1); return reg != 0; + case BRCM_CC_4378_CHIP_ID: + return 0; default: core = bwfm_chip_get_pmu(sc); reg = sc->sc_buscore_ops->bc_read(sc, core->co_base + @@ -1482,6 +1484,9 @@ bwfm_chip_tcm_rambase(struct bwfm_softc *sc) case CY_CC_4373_CHIP_ID: sc->sc_chip.ch_rambase = 0x160000; break; + case BRCM_CC_4378_CHIP_ID: + sc->sc_chip.ch_rambase = 0x352000; + break; default: printf("%s: unknown chip: %d\n", DEVNAME(sc), sc->sc_chip.ch_chip); diff --git a/sys/dev/ic/bwfmvar.h b/sys/dev/ic/bwfmvar.h index c91cca79ce5..3262f326483 100644 --- a/sys/dev/ic/bwfmvar.h +++ b/sys/dev/ic/bwfmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfmvar.h,v 1.21 2020/12/02 17:06:35 krw Exp $ */ +/* $OpenBSD: bwfmvar.h,v 1.22 2021/01/31 11:07:51 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -48,6 +48,7 @@ #define BRCM_CC_4365_CHIP_ID 0x4365 #define BRCM_CC_4366_CHIP_ID 0x4366 #define BRCM_CC_4371_CHIP_ID 0x4371 +#define BRCM_CC_4378_CHIP_ID 0x4378 #define CY_CC_4373_CHIP_ID 0x4373 /* Defaults */ diff --git a/sys/dev/pci/if_bwfm_pci.c b/sys/dev/pci/if_bwfm_pci.c index 42cc85a9a4f..7fc2ec380e9 100644 --- a/sys/dev/pci/if_bwfm_pci.c +++ b/sys/dev/pci/if_bwfm_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_pci.c,v 1.38 2020/12/12 11:48:53 jan Exp $ */ +/* $OpenBSD: if_bwfm_pci.c,v 1.39 2021/01/31 11:07:51 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2017 Patrick Wildt @@ -432,6 +432,9 @@ bwfm_pci_preinit(struct bwfm_softc *bwfm) case BRCM_CC_4371_CHIP_ID: chip = "4371"; break; + case BRCM_CC_4378_CHIP_ID: + chip = "4378"; + break; default: printf("%s: unknown firmware for chip %s\n", DEVNAME(sc), bwfm->sc_chip.ch_name); -- 2.20.1