Linux Media Controller development
 help / color / mirror / Atom feed
From: Antti Laakso <antti.laakso@linux.intel.com>
To: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
	sarang.sapre@intel.com, divyamani.tripathi@intel.com
Cc: manik.bajpai@intel.com
Subject: [PATCH 5/7] media: ipu6: Export the ipu7 firmware boot state
Date: Thu,  1 Oct 2026 15:45:38 +0300	[thread overview]
Message-ID: <20261001124540.2129309-6-antti.laakso@linux.intel.com> (raw)
In-Reply-To: <20261001124540.2129309-1-antti.laakso@linux.intel.com>

Export a boot state accessor, so subsystem interrupt handler can detect
a firmware error state.

Assisted-by: LLM
Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
---
 drivers/media/pci/intel/ipu6/ipu7-boot.c | 9 ++++++---
 drivers/media/pci/intel/ipu6/ipu7-boot.h | 5 +++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/media/pci/intel/ipu6/ipu7-boot.c b/drivers/media/pci/intel/ipu6/ipu7-boot.c
index f695d668d46b..965783fd50d2 100644
--- a/drivers/media/pci/intel/ipu6/ipu7-boot.c
+++ b/drivers/media/pci/intel/ipu6/ipu7-boot.c
@@ -18,9 +18,6 @@
 
 #define IPU7_FW_START_STOP_TIMEOUT		2000
 #define IPU7_BOOT_CELL_RESET_TIMEOUT		(2 * USEC_PER_SEC)
-#define IPU7_BOOT_STATE_CRITICAL(s)		(((s) & 0xffff0000U) == 0xdead0000U)
-#define IPU7_BOOT_STATE_READY(s)		((s) == 0x57a7e100U)
-#define IPU7_BOOT_STATE_INACTIVE(s)		((s) == 0x57a7e300U)
 #define IPU7_BUTTRESS_REG_FW_BOOT_PARAMS0				0x4000
 #define IPU7_BUTTRESS_FW_BOOT_PARAMS_ENTRY(i) \
 	(IPU7_BUTTRESS_REG_FW_BOOT_PARAMS0 + ((i) * 4U))
@@ -395,3 +392,9 @@ int ipu6_ipu7_boot_stop_fw(const struct ipu6_bus_device *adev)
 	return 0;
 }
 EXPORT_SYMBOL_NS_GPL(ipu6_ipu7_boot_stop_fw, "INTEL_IPU6");
+
+u32 ipu6_ipu7_boot_get_state(const struct ipu6_bus_device *adev)
+{
+	return read_fw_boot_param(adev, IPU7_FW_BOOT_STATE_ID);
+}
+EXPORT_SYMBOL_NS_GPL(ipu6_ipu7_boot_get_state, "INTEL_IPU6");
diff --git a/drivers/media/pci/intel/ipu6/ipu7-boot.h b/drivers/media/pci/intel/ipu6/ipu7-boot.h
index 48b7cbbde3d3..a7e59067b3eb 100644
--- a/drivers/media/pci/intel/ipu6/ipu7-boot.h
+++ b/drivers/media/pci/intel/ipu6/ipu7-boot.h
@@ -8,6 +8,10 @@
 
 #define IPU7_BOOT_MSG_VER_MAX_ENTRIES	3U
 
+#define IPU7_BOOT_STATE_CRITICAL(s)	(((s) & 0xffff0000U) == 0xdead0000U)
+#define IPU7_BOOT_STATE_READY(s)	((s) == 0x57a7e100U)
+#define IPU7_BOOT_STATE_INACTIVE(s)	((s) == 0x57a7e300U)
+
 struct ipu7_boot_abi_version {
 	u8 patch;
 	u8 subminor;
@@ -45,5 +49,6 @@ void ipu6_ipu7_release_boot_config(struct ipu6_bus_device *adev,
 int ipu6_ipu7_boot_start_fw(const struct ipu6_bus_device *adev,
 			    struct ipu7_fw_com_context *fwctx);
 int ipu6_ipu7_boot_stop_fw(const struct ipu6_bus_device *adev);
+u32 ipu6_ipu7_boot_get_state(const struct ipu6_bus_device *adev);
 
 #endif
-- 
2.55.0


  parent reply	other threads:[~2026-10-01 12:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 12:45 [PATCH 0/7] Make ipu7 fw boot code subsystem agnostic Antti Laakso
2026-10-01 12:45 ` [PATCH 1/7] media: ipu6: Fix media entity names for different ipu versions Antti Laakso
2026-10-01 12:45 ` [PATCH 2/7] media: ipu6: Forward declare struct ipu6_mmu Antti Laakso
2026-10-01 12:45 ` [PATCH 3/7] media: ipu6: Pass the fw context to the ipu7 boot helpers Antti Laakso
2026-10-01 12:45 ` [PATCH 4/7] media: ipu6: Make ipu7 fw config subsystem agnostic Antti Laakso
2026-10-01 12:45 ` Antti Laakso [this message]
2026-10-01 12:45 ` [PATCH 6/7] media: ipu6: Add the ipu7 psys buttress support Antti Laakso
2026-10-01 12:45 ` [PATCH 7/7] media: ipu6: Move ipu7 fw logger and watchdog configuration Antti Laakso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261001124540.2129309-6-antti.laakso@linux.intel.com \
    --to=antti.laakso@linux.intel.com \
    --cc=divyamani.tripathi@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=manik.bajpai@intel.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sarang.sapre@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox