Add basic support for BCM4378 as found on the Apple M1 SoCs. There's a
authorpatrick <patrick@openbsd.org>
Sun, 31 Jan 2021 11:07:51 +0000 (11:07 +0000)
committerpatrick <patrick@openbsd.org>
Sun, 31 Jan 2021 11:07:51 +0000 (11:07 +0000)
little bit more to do though before it can be enabled.

sys/dev/ic/bwfm.c
sys/dev/ic/bwfmvar.h
sys/dev/pci/if_bwfm_pci.c

index 7b798d4..1783a57 100644 (file)
@@ -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 <patrick@blueri.se>
@@ -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);
index c91cca7..3262f32 100644 (file)
@@ -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 <patrick@blueri.se>
@@ -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 */
index 42cc85a..7fc2ec3 100644 (file)
@@ -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 <patrick@blueri.se>
@@ -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);