From patchwork Mon Mar 8 06:27:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Winkler, Tomas" X-Patchwork-Id: 12121559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E848FC433E0 for ; Mon, 8 Mar 2021 06:28:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A7A8651EF for ; Mon, 8 Mar 2021 06:28:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A7A8651EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A553F6E423; Mon, 8 Mar 2021 06:28:03 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 788A36E423 for ; Mon, 8 Mar 2021 06:28:02 +0000 (UTC) IronPort-SDR: GNc6tonhc2OIQ+GqkGdDbGNR3XLwuLcVaCmvZyjSqdOmaLNsNAxoZ+jiVrReU0r8KjDS2Mb1S5 /PhtOTeGzC6w== X-IronPort-AV: E=McAfee;i="6000,8403,9916"; a="249354800" X-IronPort-AV: E=Sophos;i="5.81,231,1610438400"; d="scan'208";a="249354800" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2021 22:28:01 -0800 IronPort-SDR: CWvx1z7gpnU9AgJ39vLXpWvqpox+5VXZ31mE3yfxyUQzofwQRQWc2embaa46PFetO2Kp/wtHA2 f/0D1awsROUg== X-IronPort-AV: E=Sophos;i="5.81,231,1610438400"; d="scan'208";a="409181879" Received: from twinkler-lnx.jer.intel.com ([10.12.91.138]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2021 22:27:58 -0800 From: Tomas Winkler To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi Date: Mon, 8 Mar 2021 08:27:38 +0200 Message-Id: <20210308062748.208017-1-tomas.winkler@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 00/10 v2] drm/i915/spi: discrete graphics internal spi X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mtd@lists.infradead.org, intel-gfx@lists.freedesktop.org, Tomas Winkler , Alexander Usyskin , Vitaly Lubart Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Intel discrete graphic devices have internal spi storage, that holds firmware and oprom images. The spi device is exposed to the user space via mtd framework to be accessed during manufacturing. The device is hardware locked after manufacturing and only read access is provided. The i915 plays role of a multi function device (mfd) and spi device is exposed as its child device. i915_spi platform driver binds to this device. Because the graphic card may undergo reset at any time and basically hot unplug all its child devices, this series also provides a fix to the mtd framework to make the reset graceful. V2: 1. Adding separate Makefile for i915_spi module 2. Adding MAINTAINERS entry 3. Addressing other small comments 4. Haven't got comments from the MTD maintainers so just resending the patch. Tomas Winkler (10): drm/i915/spi: add spi device for discrete graphics drm/i915/spi: intel_spi_region map drm/i915/spi: add driver for on-die spi device drm/i915/spi: implement regions enumeration drm/i915/spi: implement spi access functions drm/i915/spi: spi register with mtd drm/i915/spi: mtd: implement access handlers drm/i915/spi: serialize spi access MAINTAINERS: add Intel i915 spi driver entry mtd: use refcount to prevent corruption MAINTAINERS | 11 + drivers/gpu/drm/i915/Kconfig | 3 + drivers/gpu/drm/i915/Makefile | 4 + drivers/gpu/drm/i915/i915_drv.c | 7 + drivers/gpu/drm/i915/i915_drv.h | 4 + drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/spi/Kconfig | 17 + drivers/gpu/drm/i915/spi/Makefile | 7 + drivers/gpu/drm/i915/spi/i915_spi.c | 675 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/spi/intel_spi.c | 49 ++ drivers/gpu/drm/i915/spi/intel_spi.h | 22 + drivers/mtd/mtdcore.c | 64 ++- drivers/mtd/mtdcore.h | 1 + drivers/mtd/mtdpart.c | 13 +- include/linux/mtd/mtd.h | 2 +- 15 files changed, 848 insertions(+), 32 deletions(-) create mode 100644 drivers/gpu/drm/i915/spi/Kconfig create mode 100644 drivers/gpu/drm/i915/spi/Makefile create mode 100644 drivers/gpu/drm/i915/spi/i915_spi.c create mode 100644 drivers/gpu/drm/i915/spi/intel_spi.c create mode 100644 drivers/gpu/drm/i915/spi/intel_spi.h