From nobody Thu Aug 03 16:12:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RGv4L69RXz3cPF3; Thu, 3 Aug 2023 16:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RGv4L3hFxz4WwC; Thu, 3 Aug 2023 16:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691079122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L2dFZFONzUNnP3hF2Vq/JjfPtCptilKJULB3wLB1O8A=; b=vr/0OSaphK5/zuUmy5DG9Pd7JhEos5ephHXUOsnm92yJ71ueUv53efl0UDu75Y0oh3aJNa cjjC7HVUbU6OfMvfpSTZ7zOU03wxTn6it1zQXKCgbf4GIhjcP9Wmg3JRPnoD7iv1irBNMZ Zso/IPgsbUMFPwNpyIqv9wG5UDWyFVuA5x8jQ+mid4L+sezCeazcDh4IQlFkRn8psgC6Ej zOhUSDlXIxLgLUlm20biZlsKzPWBN9XiGW2KGjPQikA7zofnsu6MrmEj15a+DEecr+daf8 Ifg3gDoZd0g0SW7mY9lvOxbNTOhEk0aAJvWYOPzo6gUibmo/upzGIl0QjGn8xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691079122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L2dFZFONzUNnP3hF2Vq/JjfPtCptilKJULB3wLB1O8A=; b=Xl/BfQoZqeG2l3I08GTpfmvgAfnvR9EbXaKG2VlxhH27TcCmnrn1wJmwP3SllQ00nHmAVC Oy0da+WIG/EUc1cjp2/zDQqr4sjgo2Xtk6PUaPjs9hfhrLkKmLn0PoovTwF+pixH/Bi4iY QS9afaXtSkArLz+ZXbDqyacCKexZLnkddUn1n/tfJ5ZkPPDXmTpoVnv5BhG2296AiWJph0 ts6PMsBqyeyV5D/OWMVaj/J6LtJBq8j0RLXjfcJqzYx2NOV0/mFCiBjQpdHXA8W6cskZZF JQM9h/a4gx/P0MrrLju0UyqHjHpsWAgC6rih3hfMnykt59ivsES5jSPUwYbcJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691079122; a=rsa-sha256; cv=none; b=jJkgJoZC9J5UIcnmbSz8hjFORDZJG/xc4ywpb67wQdTnYIlU83HxNjwF+qwItf7cRoNARo 5OdCkg3x0mD2qOk2H85c97EQ3c9pXNfn2VPxyubGieOuTfUop3wLB/2CPZpCDUKb0ZWWyT 4Tcf2C9jMX1Pqc1HxHjmfIFFWttl4TmvF1Pn/rMKt5LT6IbifAK0bAPLBC8wPRwABKkvyo 45LeqRAaup+WA0NmiEDTdiVmwU/QoZX8n1EnuZ45gHsc7wR514tGv3ffidL4ijj8QXNWVc sbG9g32wmktFN6qpvl9cMQSjajiSX5+d+MIkFlQO74tR+QOaTcrhIGEYt0PzMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RGv4L2hCqzCBS; Thu, 3 Aug 2023 16:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 373GC2ID006075; Thu, 3 Aug 2023 16:12:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 373GC2Uu006074; Thu, 3 Aug 2023 16:12:02 GMT (envelope-from git) Date: Thu, 3 Aug 2023 16:12:02 GMT Message-Id: <202308031612.373GC2Uu006074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: b109946d7564 - main - intelspi: Release LPSS reset on Sunrise Point controllers. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b109946d7564afde6f3d3b3a78f428c8da14e17c Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b109946d7564afde6f3d3b3a78f428c8da14e17c commit b109946d7564afde6f3d3b3a78f428c8da14e17c Author: Vladimir Kondratyev AuthorDate: 2023-08-03 16:10:50 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-08-03 16:10:50 +0000 intelspi: Release LPSS reset on Sunrise Point controllers. MacBookPro 14.1 SPI controller requires that to start functioning. MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D41245 --- sys/dev/intel/spi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/intel/spi.c b/sys/dev/intel/spi.c index 42caed0c1c02..6dd063511e26 100644 --- a/sys/dev/intel/spi.c +++ b/sys/dev/intel/spi.c @@ -109,6 +109,10 @@ #define SPI_CS_CTRL_HW_MODE (1 << 0) #define SPI_CS_CTRL_CS_HIGH (1 << 1) +#define INTELSPI_RESETS 0x204 +#define INTELSPI_RESET_HOST (1 << 0) | (1 << 1) +#define INTELSPI_RESET_DMA (1 << 2) + /* Same order as intelspi_vers */ static const struct intelspi_info { uint32_t reg_lpss_base; @@ -477,6 +481,11 @@ intelspi_attach(device_t dev) goto error; } + /* Release LPSS reset */ + if (sc->sc_vers == SPI_SUNRISEPOINT) + INTELSPI_WRITE(sc, INTELSPI_RESETS, + (INTELSPI_RESET_HOST | INTELSPI_RESET_DMA)); + sc->sc_irq_res = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, &sc->sc_irq_rid, RF_ACTIVE | RF_SHAREABLE); if (sc->sc_irq_res == NULL) {