msm: pil: Calculate image region and inform drivers
Some processors need to know where in memory their image resides.
Add a new hook for this
int (*mem_setup)(struct pil_desc *pil, phys_addr_t addr, size_t size)
that pil drivers can implement so they can be informed of where
their image lies in memory. It's expected that drivers will
program an IOMMU or notify the authentication agent with the
information from this callback.
Change-Id: I6169e4376f8c9c155bab149ce14fde3b2548d5cc
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/peripheral-loader.h b/arch/arm/mach-msm/peripheral-loader.h
index 4b09adc..1c2faf7 100644
--- a/arch/arm/mach-msm/peripheral-loader.h
+++ b/arch/arm/mach-msm/peripheral-loader.h
@@ -40,6 +40,7 @@
/**
* struct pil_reset_ops - PIL operations
* @init_image: prepare an image for authentication
+ * @mem_setup: prepare the image memory region
* @verify_blob: authenticate a program segment, called once for each loadable
* program segment (optional)
* @proxy_vote: make proxy votes before auth_and_reset (optional)
@@ -50,6 +51,7 @@
struct pil_reset_ops {
int (*init_image)(struct pil_desc *pil, const u8 *metadata,
size_t size);
+ int (*mem_setup)(struct pil_desc *pil, phys_addr_t addr, size_t size);
int (*verify_blob)(struct pil_desc *pil, u32 phy_addr, size_t size);
int (*proxy_vote)(struct pil_desc *pil);
int (*auth_and_reset)(struct pil_desc *pil);