aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorT Karthik Reddy2021-03-17 12:31:30 +0100
committerSimon Glass2021-03-27 16:26:48 +1300
commit346df7d4fa62afc578d820b3a18815eec765074f (patch)
tree02fca97c2867a30201dc0b9bd27734d3a9356812
parent5d1bec30efcd1d0e74643a54a348718e8f79fc92 (diff)
spi: spi-uclass: Add support to manually relocate spi memory ops
Add spi memory operations to relocate manually when CONFIG_NEEDS_MANUAL_RELOC is enabled. Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
-rw-r--r--drivers/spi/spi-uclass.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index 7155d4aebd6..ee30110b565 100644
--- a/drivers/spi/spi-uclass.c
+++ b/drivers/spi/spi-uclass.c
@@ -11,6 +11,7 @@
#include <log.h>
#include <malloc.h>
#include <spi.h>
+#include <spi-mem.h>
#include <dm/device_compat.h>
#include <asm/global_data.h>
#include <dm/device-internal.h>
@@ -199,6 +200,16 @@ static int spi_post_probe(struct udevice *bus)
ops->set_mode += gd->reloc_off;
if (ops->cs_info)
ops->cs_info += gd->reloc_off;
+ if (ops->mem_ops) {
+ struct spi_controller_mem_ops *mem_ops =
+ (struct spi_controller_mem_ops *)ops->mem_ops;
+ if (mem_ops->adjust_op_size)
+ mem_ops->adjust_op_size += gd->reloc_off;
+ if (mem_ops->supports_op)
+ mem_ops->supports_op += gd->reloc_off;
+ if (mem_ops->exec_op)
+ mem_ops->exec_op += gd->reloc_off;
+ }
reloc_done++;
}
#endif