public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/3] dm: spi: Add support for all targets which requires MANUAL_RELOC
@ 2015-10-30 14:56 Michal Simek
  2015-10-30 14:56 ` [U-Boot] [PATCH v2 2/3] dm: core: Add missing entries for manual relocation Michal Simek
  2015-10-30 14:56 ` [U-Boot] [PATCH v2 3/3] dm: sf: Add support for all targets which requires MANUAL_RELOC Michal Simek
  0 siblings, 2 replies; 5+ messages in thread
From: Michal Simek @ 2015-10-30 14:56 UTC (permalink / raw)
  To: u-boot

It is follow up patch based on
"dm: Add support for all targets which requires MANUAL_RELOC"
(sha1: 484fdf5ba058b07be5ca82763aa2b72063540ef3)
to update function pointers for DM.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 drivers/spi/spi-uclass.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index d666272e39ce..27409fb088ea 100644
--- a/drivers/spi/spi-uclass.c
+++ b/drivers/spi/spi-uclass.c
@@ -118,6 +118,26 @@ static int spi_post_probe(struct udevice *bus)
 	spi->max_hz = fdtdec_get_int(gd->fdt_blob, bus->of_offset,
 				     "spi-max-frequency", 0);
 
+#if defined(CONFIG_NEEDS_MANUAL_RELOC)
+	struct dm_spi_ops *ops = spi_get_ops(bus);
+
+
+	if (ops->claim_bus)
+		ops->claim_bus += gd->reloc_off;
+	if (ops->release_bus)
+		ops->release_bus += gd->reloc_off;
+	if (ops->set_wordlen)
+		ops->set_wordlen += gd->reloc_off;
+	if (ops->xfer)
+		ops->xfer += gd->reloc_off;
+	if (ops->set_speed)
+		ops->set_speed += gd->reloc_off;
+	if (ops->set_mode)
+		ops->set_mode += gd->reloc_off;
+	if (ops->cs_info)
+		ops->cs_info += gd->reloc_off;
+#endif
+
 	return 0;
 }
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-06  9:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-30 14:56 [U-Boot] [PATCH v2 1/3] dm: spi: Add support for all targets which requires MANUAL_RELOC Michal Simek
2015-10-30 14:56 ` [U-Boot] [PATCH v2 2/3] dm: core: Add missing entries for manual relocation Michal Simek
2015-10-30 14:56 ` [U-Boot] [PATCH v2 3/3] dm: sf: Add support for all targets which requires MANUAL_RELOC Michal Simek
2015-11-06  3:15   ` Simon Glass
2015-11-06  9:01     ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox