Don't reset the internal memory core on chips other than the Broadcom
authorpatrick <patrick@openbsd.org>
Wed, 10 Jan 2018 02:07:11 +0000 (02:07 +0000)
committerpatrick <patrick@openbsd.org>
Wed, 10 Jan 2018 02:07:11 +0000 (02:07 +0000)
43602, as it's only necessary on that specific chip.

Found the hard way by jcs@ on a MacBook 12-inch (2017)

sys/dev/pci/if_bwfm_pci.c

index b1769c8..0c3d527 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_bwfm_pci.c,v 1.12 2018/01/10 01:43:01 patrick Exp $        */
+/*     $OpenBSD: if_bwfm_pci.c,v 1.13 2018/01/10 02:07:11 patrick Exp $        */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
  * Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
@@ -699,8 +699,10 @@ bwfm_pci_load_microcode(struct bwfm_pci_softc *sc, const u_char *ucode, size_t s
        /* TODO: restore NVRAM */
 
        /* Load reset vector from firmware and kickstart core. */
-       core = bwfm_chip_get_core(bwfm, BWFM_AGENT_INTERNAL_MEM);
-       bwfm->sc_chip.ch_core_reset(bwfm, core, 0, 0, 0);
+       if (bwfm->sc_chip.ch_chip == BRCM_CC_43602_CHIP_ID) {
+               core = bwfm_chip_get_core(bwfm, BWFM_AGENT_INTERNAL_MEM);
+               bwfm->sc_chip.ch_core_reset(bwfm, core, 0, 0, 0);
+       }
        bwfm_chip_set_active(bwfm, *(uint32_t *)ucode);
 
        for (i = 0; i < 40; i++) {