* [PATCH v2] spi: spi-uclass: Add support to manually relocate spi memory ops
@ 2021-03-17 11:31 Michal Simek
2021-03-17 13:29 ` Pratyush Yadav
2021-03-27 5:20 ` Simon Glass
0 siblings, 2 replies; 3+ messages in thread
From: Michal Simek @ 2021-03-17 11:31 UTC (permalink / raw)
To: u-boot
From: T Karthik Reddy <t.karthik.reddy@xilinx.com>
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>
---
Changes in v2:
- Check if mem_ops is defined before relocation - reported-by
Pratyush Yadav <p.yadav@ti.com>
drivers/spi/spi-uclass.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index 7155d4aebd6d..ee30110b5658 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
--
2.30.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2] spi: spi-uclass: Add support to manually relocate spi memory ops
2021-03-17 11:31 [PATCH v2] spi: spi-uclass: Add support to manually relocate spi memory ops Michal Simek
@ 2021-03-17 13:29 ` Pratyush Yadav
2021-03-27 5:20 ` Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Pratyush Yadav @ 2021-03-17 13:29 UTC (permalink / raw)
To: u-boot
On 17/03/21 12:31PM, Michal Simek wrote:
> From: T Karthik Reddy <t.karthik.reddy@xilinx.com>
>
> 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>
--
Regards,
Pratyush Yadav
Texas Instruments Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] spi: spi-uclass: Add support to manually relocate spi memory ops
2021-03-17 11:31 [PATCH v2] spi: spi-uclass: Add support to manually relocate spi memory ops Michal Simek
2021-03-17 13:29 ` Pratyush Yadav
@ 2021-03-27 5:20 ` Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2021-03-27 5:20 UTC (permalink / raw)
To: u-boot
On 17/03/21 12:31PM, Michal Simek wrote:
> From: T Karthik Reddy <t.karthik.reddy@xilinx.com>
>
> 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>
--
Regards,
Pratyush Yadav
Texas Instruments Inc.
Applied to u-boot-dm/next, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-27 5:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 11:31 [PATCH v2] spi: spi-uclass: Add support to manually relocate spi memory ops Michal Simek
2021-03-17 13:29 ` Pratyush Yadav
2021-03-27 5:20 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.