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
283 * @iova_stop: IOMMU stop address for data (required)283 * @iova_stop: IOMMU stop address for data (required)
284 * @fw_image: Firmware image name for normal booting (required)284 * @fw_image: Firmware image name for normal booting (required)
285 * @edl_image: Firmware image name for emergency download mode (optional)285 * @edl_image: Firmware image name for emergency download mode (optional)
286 * @rddm_size: RAM dump size that host should allocate for debugging purpose
286 * @sbl_size: SBL image size downloaded through BHIe (optional)287 * @sbl_size: SBL image size downloaded through BHIe (optional)
287 * @seg_len: BHIe vector size (optional)288 * @seg_len: BHIe vector size (optional)
288 * @fbc_image: Points to firmware image buffer289 * @fbc_image: Points to firmware image buffer
290 * @rddm_image: Points to RAM dump buffer
289 * @mhi_chan: Points to the channel configuration table291 * @mhi_chan: Points to the channel configuration table
290 * @lpm_chans: List of channels that require LPM notifications292 * @lpm_chans: List of channels that require LPM notifications
291 * @irq: base irq # to request (required)293 * @irq: base irq # to request (required)
@@ -343,9 +345,11 @@ struct mhi_controller { · 51 unmodified lines
343 dma_addr_t iova_stop;345 dma_addr_t iova_stop;
344 const char *fw_image;346 const char *fw_image;
345 const char *edl_image;347 const char *edl_image;
348 size_t rddm_size;
346 size_t sbl_size;349 size_t sbl_size;
347 size_t seg_len;350 size_t seg_len;
348 struct image_info *fbc_image;351 struct image_info *fbc_image;
352 struct image_info *rddm_image;
349 struct mhi_chan *mhi_chan;353 struct mhi_chan *mhi_chan;
350 struct list_head lpm_chans;354 struct list_head lpm_chans;
351 int *irq;355 int *irq;
@@ -545,4 +549,24 @@ void mhi_power_down(struct mhi_controller *mhi_cntrl, bool graceful); · 193 unmodified lines
545 */549 */
546void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl);550void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl);
547 551
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 */
558int 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 */
564int 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 */
570enum mhi_state mhi_get_mhi_state(struct mhi_controller *mhi_cntrl);
571
548#endif /* _MHI_H_ */572#endif /* _MHI_H_ */