From patchwork Wed Jan 1 15:39:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Usyskin, Alexander" X-Patchwork-Id: 13924210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0161DE7718F for ; Wed, 1 Jan 2025 15:50:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9CC010E1E5; Wed, 1 Jan 2025 15:50:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Evo09Vnw"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id DA7A210E16E; Wed, 1 Jan 2025 15:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735746635; x=1767282635; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yaU+DdgVTQBtfo9/bPrN68AdyWg8b/vb+BkHxJGrl7g=; b=Evo09VnwvZ72NcLmYx19U6fSmYXvLdCb2DjGZlN73QNPWZFIhYUov2p6 TL7OV554ijKrR1X7iY9v7OSW4KT7feATBkPk/peqESI5+mVvbTlZRErfR 6bBnd7Q6Q3pKO4uB54Uc9Q8pMadyerBKOPmqKk1rb5tS5R13k3P8NSKqO 0h8L/yXoxFj2W7uli4AL8/hKuo8/kWWsc78fgJs5XpdXMTxt75RAJ4j0U WGbN0Vdi4AdKSldXQbnF7qAem3ShVNWnoaUs0tTCTJpOnePU2zLuG6hBq 0BWj1CtNRx7g68tfBfW8Fk4sCRbcRXL2EAXVSPa1guSDmcKm62aKbyIP5 Q==; X-CSE-ConnectionGUID: QAOjWdViQtipeiUWpK/ZaQ== X-CSE-MsgGUID: VXRwNBF0Tzuztjz59c4+gA== X-IronPort-AV: E=McAfee;i="6700,10204,11302"; a="46485509" X-IronPort-AV: E=Sophos;i="6.12,282,1728975600"; d="scan'208";a="46485509" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jan 2025 07:50:34 -0800 X-CSE-ConnectionGUID: Ds2L6PrlQSaZ3OYAk6GxDA== X-CSE-MsgGUID: /tgKOXVjRvWQEAe0wHOV3A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,282,1728975600"; d="scan'208";a="132138899" Received: from sannilnx-dsk.jer.intel.com ([10.12.231.107]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jan 2025 07:50:29 -0800 From: Alexander Usyskin To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Lucas De Marchi , =?utf-8?q?Thomas_Hellstr=C3=B6m?= , Rodrigo Vivi , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jani Nikula , Joonas Lahtinen , Tvrtko Ursulin , Karthik Poosa Cc: Reuven Abliyev , Oren Weil , linux-mtd@lists.infradead.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Alexander Usyskin Subject: [PATCH v4 00/11] mtd: add driver for Intel discrete graphics Date: Wed, 1 Jan 2025 17:39:14 +0200 Message-ID: <20250101153925.865703-1-alexander.usyskin@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add driver for access to Intel discrete graphics card internal NVM device. Expose device on auxiliary bus by i915 and Xe drivers and provide mtd driver to register this device with MTD framework. This is a rewrite of "drm/i915/spi: spi access for discrete graphics" and "spi: add driver for Intel discrete graphics" series with connection to the Xe driver and splitting the spi driver part to separate module in mtd subsystem. This series intended to be pushed through drm-xe-next. V2: Replace dev_* prints with drm_* prints in drm (xe and i915) patches. Enable NVM device on Battlemage HW (xe driver patch) Fix overwrite register address (xe driver patch) Add Rodrigo's r-b V3: Use devm_pm_runtime_enable to simplify flow. Drop print in i915 unload that was accidentally set as error. Drop HAS_GSC_NVM macro in line with latest Xe changes. Add more Rodrigo's r-b and Miquel's ack. V4: Add patch that always creates mtd master device and adjust mtd-intel-dg power management to use this device. Alexander Usyskin (11): mtd: core: always create master device mtd: add driver for intel graphics non-volatile memory device mtd: intel-dg: implement region enumeration mtd: intel-dg: implement access functions mtd: intel-dg: register with mtd mtd: intel-dg: align 64bit read and write mtd: intel-dg: wake card on operations drm/i915/nvm: add nvm device for discrete graphics drm/i915/nvm: add support for access mode drm/xe/nvm: add on-die non-volatile memory device drm/xe/nvm: add support for access mode MAINTAINERS | 7 + drivers/gpu/drm/i915/Makefile | 4 + drivers/gpu/drm/i915/i915_driver.c | 6 + drivers/gpu/drm/i915/i915_drv.h | 3 + drivers/gpu/drm/i915/i915_reg.h | 1 + drivers/gpu/drm/i915/intel_nvm.c | 115 ++++ drivers/gpu/drm/i915/intel_nvm.h | 15 + drivers/gpu/drm/xe/Makefile | 1 + drivers/gpu/drm/xe/regs/xe_gsc_regs.h | 4 + drivers/gpu/drm/xe/xe_device.c | 3 + drivers/gpu/drm/xe/xe_device_types.h | 7 + drivers/gpu/drm/xe/xe_heci_gsc.c | 5 +- drivers/gpu/drm/xe/xe_nvm.c | 130 ++++ drivers/gpu/drm/xe/xe_nvm.h | 15 + drivers/gpu/drm/xe/xe_pci.c | 6 + drivers/mtd/devices/Kconfig | 11 + drivers/mtd/devices/Makefile | 1 + drivers/mtd/devices/mtd-intel-dg.c | 847 ++++++++++++++++++++++++++ drivers/mtd/mtdcore.c | 123 +++- drivers/mtd/mtdpart.c | 6 +- include/linux/intel_dg_nvm_aux.h | 27 + 21 files changed, 1299 insertions(+), 38 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_nvm.c create mode 100644 drivers/gpu/drm/i915/intel_nvm.h create mode 100644 drivers/gpu/drm/xe/xe_nvm.c create mode 100644 drivers/gpu/drm/xe/xe_nvm.h create mode 100644 drivers/mtd/devices/mtd-intel-dg.c create mode 100644 include/linux/intel_dg_nvm_aux.h