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>
#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>
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