From nobody Thu Aug 03 16:12:01 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 4RGv4K3BRmz3cNqD; Thu, 3 Aug 2023 16:12:01 +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 4RGv4K2fhqz4WYp; Thu, 3 Aug 2023 16:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691079121; 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=7pTxIZwAww5wrlY0aWLDv6fRobPkzHPKNhEdzTH7BIQ=; b=tLGMb5Wr20bb2HsQYv0zsEJ+21in4I9XDM0dr73jYySAjRhweBjcY02DHLrHxw2s2rWnjm ZGsbG7SAjFcVUkiCQ5IMpPojfDN5Mi83w8Ql9eQHiz5IY2VWmv16m+llO4qgfCXx++ANn3 zIqj2HW94kAZyBoLoB6WHx65cE0rDozZuV2qtYg9Rs+JHc5gGQovNY/9hjBOTcR9uRMd7G CDMy89NinspD2wNikdEo8AT6vHcUZdl2NguXhsuOVqIFmIMJvd4gkLyxJ9hDZJUNDdKgJV HZsiTCfvmqo3Gju7OderESs6tLNoqHiUrwxfmZ4gENjw/2JpiL38Hqydib6SlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691079121; 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=7pTxIZwAww5wrlY0aWLDv6fRobPkzHPKNhEdzTH7BIQ=; b=OsmG8f5Vl/cpbY0LNJNLKMCZoxhp4Nxq1NnqE95tHPhOmcdtd4eAKhIjsos+ZXg56EQj/k Kj2zHGXG+Ah01I2Ppl30H3mKVdDDtXP0wkC8NTdfgMyFi9c7ys6xuGV9lNmhtG9mvXlLNf Whq/p8VADfO8K0P0/6eoFbDAZ58yfI5msWdsVsR/wniUwSiGa5fJbrqwLsrC6v4Gk5GjpT fkBuGdzAw+6RyEz4bi8ngstL8KUbr/SipsHKS6Lu+zoaLodRCUkNNlXiJS/nnmZEPx+GcJ 1NfkTmUHZwYb/QSqzOGvyr1s4+5pHpJv5Q0HOAfl5cOo1drnrFwPyKZH0a60pA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691079121; a=rsa-sha256; cv=none; b=UIfse6ETHxo0K/U59dMreSCsslSduaK6b4ksQleUOdXzbROt4MDiz3QOr2sbicR8XyO/eA NowuH2qRJ1xG7FzyiOnGRN7rVmzwnd2BIT2YJOrbN675CB5B2DdmOvcLKv1HO/7zCIOzly zSqjVBK5b2wkaJZZxbrX4P6B+P0h+zF1VPwgA60I31bbhUJfjnGJYrqVUwMmYavVj4oQEB bUCuWAC2XCXvgMxYZZBOpVXao8IvXG7RiXMLdADf307yPF19BZ4GB60jL2HPWVLFttTenz GrV1h+UXNzuOEKOyiuqCKlk3Z9Pm5+WZUQZdDnJ21m5FVplDPrIjQ/CwdHcS7A== 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 4RGv4K1m7PzCK2; Thu, 3 Aug 2023 16:12:01 +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 373GC17g006054; Thu, 3 Aug 2023 16:12:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 373GC1VB006053; Thu, 3 Aug 2023 16:12:01 GMT (envelope-from git) Date: Thu, 3 Aug 2023 16:12:01 GMT Message-Id: <202308031612.373GC1VB006053@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: f56dbe7ad92f - main - intelspi: Move ACPI/PCI ids table out of header file. 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: f56dbe7ad92f97394690dca21f105d3a44fb7701 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f56dbe7ad92f97394690dca21f105d3a44fb7701 commit f56dbe7ad92f97394690dca21f105d3a44fb7701 Author: Vladimir Kondratyev AuthorDate: 2023-08-03 16:10:50 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-08-03 16:10:50 +0000 intelspi: Move ACPI/PCI ids table out of header file. There is no reason to store it multiple times. MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D41244 --- sys/dev/intel/spi.c | 23 +++++++++++++++++++++++ sys/dev/intel/spi.h | 30 +----------------------------- sys/dev/intel/spi_acpi.c | 7 ++++--- sys/dev/intel/spi_pci.c | 27 ++++++++++++++------------- 4 files changed, 42 insertions(+), 45 deletions(-) diff --git a/sys/dev/intel/spi.c b/sys/dev/intel/spi.c index c2308c20f8cd..42caed0c1c02 100644 --- a/sys/dev/intel/spi.c +++ b/sys/dev/intel/spi.c @@ -109,6 +109,29 @@ #define SPI_CS_CTRL_HW_MODE (1 << 0) #define SPI_CS_CTRL_CS_HIGH (1 << 1) +/* Same order as intelspi_vers */ +static const struct intelspi_info { + uint32_t reg_lpss_base; + uint32_t reg_cs_ctrl; +} intelspi_infos[] = { + [SPI_BAYTRAIL] = { + .reg_lpss_base = 0x400, + .reg_cs_ctrl = 0x18, + }, + [SPI_BRASWELL] = { + .reg_lpss_base = 0x400, + .reg_cs_ctrl = 0x18, + }, + [SPI_LYNXPOINT] = { + .reg_lpss_base = 0x800, + .reg_cs_ctrl = 0x18, + }, + [SPI_SUNRISEPOINT] = { + .reg_lpss_base = 0x200, + .reg_cs_ctrl = 0x24, + }, +}; + static void intelspi_intr(void *); static int diff --git a/sys/dev/intel/spi.h b/sys/dev/intel/spi.h index 31b708572630..bd79ec1e812a 100644 --- a/sys/dev/intel/spi.h +++ b/sys/dev/intel/spi.h @@ -41,38 +41,10 @@ enum intelspi_vers { SPI_SUNRISEPOINT, }; -/* Same order as intelspi_vers */ -static const struct intelspi_info { - const char *desc; - uint32_t reg_lpss_base; - uint32_t reg_cs_ctrl; -} intelspi_infos[] = { - [SPI_BAYTRAIL] = { - .desc = "Intel Bay Trail SPI Controller", - .reg_lpss_base = 0x400, - .reg_cs_ctrl = 0x18, - }, - [SPI_BRASWELL] = { - .desc = "Intel Braswell SPI Controller", - .reg_lpss_base = 0x400, - .reg_cs_ctrl = 0x18, - }, - [SPI_LYNXPOINT] = { - .desc = "Intel Lynx Point / Wildcat Point SPI Controller", - .reg_lpss_base = 0x800, - .reg_cs_ctrl = 0x18, - }, - [SPI_SUNRISEPOINT] = { - .desc = "Intel Sunrise Point SPI Controller", - .reg_lpss_base = 0x200, - .reg_cs_ctrl = 0x24, - }, -}; - struct intelspi_softc { ACPI_HANDLE sc_handle; device_t sc_dev; - enum intelspi_vers sc_vers; + enum intelspi_vers sc_vers; struct mtx sc_mtx; int sc_mem_rid; struct resource *sc_mem_res; diff --git a/sys/dev/intel/spi_acpi.c b/sys/dev/intel/spi_acpi.c index 4c22d7a351c4..033eb047cb29 100644 --- a/sys/dev/intel/spi_acpi.c +++ b/sys/dev/intel/spi_acpi.c @@ -42,9 +42,10 @@ static const struct intelspi_acpi_device { const char *hid; enum intelspi_vers vers; + const char *desc; } intelspi_acpi_devices[] = { - { "80860F0E", SPI_BAYTRAIL }, - { "8086228E", SPI_BRASWELL }, + { "80860F0E", SPI_BAYTRAIL, "Intel Bay Trail SPI Controller" }, + { "8086228E", SPI_BRASWELL, "Intel Braswell SPI Controller" }, }; static char *intelspi_ids[] = { "80860F0E", "8086228E", NULL }; @@ -66,7 +67,7 @@ intelspi_acpi_probe(device_t dev) if (strcmp(intelspi_acpi_devices[i].hid, hid) == 0) { sc->sc_vers = intelspi_acpi_devices[i].vers; sc->sc_handle = acpi_get_handle(dev); - device_set_desc(dev, intelspi_infos[sc->sc_vers].desc); + device_set_desc(dev, intelspi_acpi_devices[i].desc); return (BUS_PROBE_DEFAULT); } } diff --git a/sys/dev/intel/spi_pci.c b/sys/dev/intel/spi_pci.c index cb2b8bd82bfb..c2c118ca1eae 100644 --- a/sys/dev/intel/spi_pci.c +++ b/sys/dev/intel/spi_pci.c @@ -45,19 +45,20 @@ static struct intelspi_pci_device { uint32_t devid; enum intelspi_vers vers; + const char *desc; } intelspi_pci_devices[] = { - { 0x9c658086, SPI_LYNXPOINT }, - { 0x9c668086, SPI_LYNXPOINT }, - { 0x9ce58086, SPI_LYNXPOINT }, - { 0x9ce68086, SPI_LYNXPOINT }, - { 0x9d298086, SPI_SUNRISEPOINT }, - { 0x9d2a8086, SPI_SUNRISEPOINT }, - { 0xa1298086, SPI_SUNRISEPOINT }, - { 0xa12a8086, SPI_SUNRISEPOINT }, - { 0xa2a98086, SPI_SUNRISEPOINT }, - { 0xa2aa8086, SPI_SUNRISEPOINT }, - { 0xa3a98086, SPI_SUNRISEPOINT }, - { 0xa3aa8086, SPI_SUNRISEPOINT }, + { 0x9c658086, SPI_LYNXPOINT, "Intel Lynx Point-LP SPI Controller-0" }, + { 0x9c668086, SPI_LYNXPOINT, "Intel Lynx Point-LP SPI Controller-1" }, + { 0x9ce58086, SPI_LYNXPOINT, "Intel Wildcat Point SPI Controller-0" }, + { 0x9ce68086, SPI_LYNXPOINT, "Intel Wildcat Point SPI Controller-1" }, + { 0x9d298086, SPI_SUNRISEPOINT, "Intel Sunrise Point-LP SPI Controller-0" }, + { 0x9d2a8086, SPI_SUNRISEPOINT, "Intel Sunrise Point-LP SPI Controller-1" }, + { 0xa1298086, SPI_SUNRISEPOINT, "Intel Sunrise Point-H SPI Controller-0" }, + { 0xa12a8086, SPI_SUNRISEPOINT, "Intel Sunrise Point-H SPI Controller-1" }, + { 0xa2a98086, SPI_SUNRISEPOINT, "Intel Kaby Lake-H SPI Controller-0" }, + { 0xa2aa8086, SPI_SUNRISEPOINT, "Intel Kaby Lake-H SPI Controller-1" }, + { 0xa3a98086, SPI_SUNRISEPOINT, "Intel Comet Lake-V SPI Controller-0" }, + { 0xa3aa8086, SPI_SUNRISEPOINT, "Intel Comet Lake-V SPI Controller-1" }, }; static int @@ -73,7 +74,7 @@ intelspi_pci_probe(device_t dev) /* The PCI device is listed in ACPI too. * Not that we use the handle for anything... */ sc->sc_handle = acpi_get_handle(dev); - device_set_desc(dev, intelspi_infos[sc->sc_vers].desc); + device_set_desc(dev, intelspi_pci_devices[i].desc); return (BUS_PROBE_DEFAULT); } }