History

bus: mhi: core: Add support for downloading RDDM image during panic

MHI protocol supports downloading RDDM (RAM Dump) image from the device through BHIE. This is useful to debugging as the RDDM image can capture the firmware state. This is based on the patch submitted by Sujeev Dias: https://lkml.org/lkml/2018/7/9/989

Manivannan Sadhasivam committed 6 years ago

Commit 6fdfdd21 parent cd457af5 files · +249 −0Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/mhi.h+24−0
@@ -283,9 +283,11 @@ struct mhi_controller_config { · 282 unmodified lines
283283 * @iova_stop: IOMMU stop address for data (required)
284284 * @fw_image: Firmware image name for normal booting (required)
285285 * @edl_image: Firmware image name for emergency download mode (optional)
286+ * @rddm_size: RAM dump size that host should allocate for debugging purpose
286287 * @sbl_size: SBL image size downloaded through BHIe (optional)
287288 * @seg_len: BHIe vector size (optional)
288289 * @fbc_image: Points to firmware image buffer
290+ * @rddm_image: Points to RAM dump buffer
289291 * @mhi_chan: Points to the channel configuration table
290292 * @lpm_chans: List of channels that require LPM notifications
291293 * @irq: base irq # to request (required)
@@ -343,9 +345,11 @@ struct mhi_controller { · 51 unmodified lines
343345 dma_addr_t iova_stop;
344346 const char *fw_image;
345347 const char *edl_image;
348+ size_t rddm_size;
346349 size_t sbl_size;
347350 size_t seg_len;
348351 struct image_info *fbc_image;
352+ struct image_info *rddm_image;
349353 struct mhi_chan *mhi_chan;
350354 struct list_head lpm_chans;
351355 int *irq;
@@ -545,4 +549,24 @@ void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful); · 193 unmodified lines
545549 */
546550 void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl);
547551
552+/**
553+ * mhi_download_rddm_img - Download ramdump image from device for
554+ * debugging purpose.
555+ * @mhi_cntrl: MHI controller
556+ * @in_panic: Download rddm image during kernel panic
557+ */
558+int mhi_download_rddm_img(struct mhi_controller *mhi_cntrl, bool in_panic);
559+
560+/**
561+ * mhi_force_rddm_mode - Force device into rddm mode
562+ * @mhi_cntrl: MHI controller
563+ */
564+int mhi_force_rddm_mode(struct mhi_controller *mhi_cntrl);
565+
566+/**
567+ * mhi_get_mhi_state - Get MHI state of the device
568+ * @mhi_cntrl: MHI controller
569+ */
570+enum mhi_state mhi_get_mhi_state(struct mhi_controller *mhi_cntrl);
571+
548572 #endif /* _MHI_H_ */