All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 10/24] ARM: OMAP5/DRA7: Enable iodelay recalibration to be done from uboot
Date: Thu, 25 Jan 2018 11:51:36 +0100	[thread overview]
Message-ID: <1516877510-14863-11-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1516877510-14863-1-git-send-email-jjhiblot@ti.com>

From: Kishon Vijay Abraham I <kishon@ti.com>

Add a new API to perform iodelay recalibration without isolate
io to be used in uboot.

The data manual of J6/J6 Eco recommends to set different IODELAY values
depending on the mode in which the MMC/SD is enumerated in order to
ensure IO timings are met. The MMC driver can use the new API to
set the IO delay values depending on the MMC mode.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---

 arch/arm/include/asm/arch-omap5/dra7xx_iodelay.h |  3 +++
 arch/arm/mach-omap2/omap5/dra7xx_iodelay.c       | 30 ++++++++++++++++++++++++
 include/configs/am57xx_evm.h                     |  2 --
 include/configs/dra7xx_evm.h                     |  2 --
 4 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap5/dra7xx_iodelay.h b/arch/arm/include/asm/arch-omap5/dra7xx_iodelay.h
index c997004..a8780ee 100644
--- a/arch/arm/include/asm/arch-omap5/dra7xx_iodelay.h
+++ b/arch/arm/include/asm/arch-omap5/dra7xx_iodelay.h
@@ -83,6 +83,9 @@
 void __recalibrate_iodelay(struct pad_conf_entry const *pad, int npads,
 			   struct iodelay_cfg_entry const *iodelay,
 			   int niodelays);
+void late_recalibrate_iodelay(struct pad_conf_entry const *pad, int npads,
+			      struct iodelay_cfg_entry const *iodelay,
+			      int niodelays);
 int __recalibrate_iodelay_start(void);
 void __recalibrate_iodelay_end(int ret);
 
diff --git a/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c b/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c
index 8798730..a9a9f75 100644
--- a/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c
+++ b/arch/arm/mach-omap2/omap5/dra7xx_iodelay.c
@@ -272,3 +272,33 @@ err:
 	__recalibrate_iodelay_end(ret);
 
 }
+
+void late_recalibrate_iodelay(struct pad_conf_entry const *pad, int npads,
+			      struct iodelay_cfg_entry const *iodelay,
+			      int niodelays)
+{
+	int ret = 0;
+
+	/* unlock IODELAY CONFIG registers */
+	writel(CFG_IODELAY_UNLOCK_KEY, (*ctrl)->iodelay_config_base +
+	       CFG_REG_8_OFFSET);
+
+	ret = calibrate_iodelay((*ctrl)->iodelay_config_base);
+	if (ret)
+		goto err;
+
+	ret = update_delay_mechanism((*ctrl)->iodelay_config_base);
+
+	/* Configure Mux settings */
+	do_set_mux32((*ctrl)->control_padconf_core_base, pad, npads);
+
+	/* Configure Manual IO timing modes */
+	ret = do_set_iodelay((*ctrl)->iodelay_config_base, iodelay, niodelays);
+	if (ret)
+		goto err;
+
+err:
+	/* lock IODELAY CONFIG registers */
+	writel(CFG_IODELAY_LOCK_KEY, (*ctrl)->iodelay_config_base +
+	       CFG_REG_8_OFFSET);
+}
diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
index 7546b3f..65465d1 100644
--- a/include/configs/am57xx_evm.h
+++ b/include/configs/am57xx_evm.h
@@ -15,9 +15,7 @@
 #include <environment/ti/dfu.h>
 #include <linux/sizes.h>
 
-#ifdef CONFIG_SPL_BUILD
 #define CONFIG_IODELAY_RECALIBRATION
-#endif
 
 #define CONFIG_NR_DRAM_BANKS		2
 
diff --git a/include/configs/dra7xx_evm.h b/include/configs/dra7xx_evm.h
index ff90b6d..975e6fd 100644
--- a/include/configs/dra7xx_evm.h
+++ b/include/configs/dra7xx_evm.h
@@ -14,9 +14,7 @@
 
 #include <environment/ti/dfu.h>
 
-#ifdef CONFIG_SPL_BUILD
 #define CONFIG_IODELAY_RECALIBRATION
-#endif
 
 #define CONFIG_VERY_BIG_RAM
 #define CONFIG_NR_DRAM_BANKS		2
-- 
1.9.1

  parent reply	other threads:[~2018-01-25 10:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180125105204epcas1p33c3b7c1ace6aae2cfd1da807e869ad7e@epcas1p3.samsung.com>
2018-01-25 10:51 ` [U-Boot] [PATCH v2 00/24] omap_hsmmc: Add support for HS200 and UHS modes Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 01/24] mmc: omap_hsmmc: cleanup clock configuration Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 02/24] mmc: omap_hsmmc: cleanup omap_hsmmc_set_ios Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 03/24] mmc: omap_hsmmc: add support to set default io voltage Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 04/24] mmc: omap_hsmmc: set MMC mode in the UHSMS bit field Jean-Jacques Hiblot
2018-01-29  4:33     ` Jaehoon Chung
2018-01-29 13:26       ` Jaehoon Chung
2018-01-30 13:40       ` Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 05/24] mmc: omap_hsmmc: Enable DDR mode support Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 06/24] mmc: omap_hsmmc: Add tuning support Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 07/24] mmc: omap_hsmmc: Workaround for errata id i802 Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 08/24] mmc: omap_hsmmc: Reduce the max timeout for reset controller fsm Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 09/24] mmc: omap_hsmmc: use mmc_of_parse to populate mmc_config Jean-Jacques Hiblot
2018-01-25 10:51   ` Jean-Jacques Hiblot [this message]
2018-01-25 10:51   ` [U-Boot] [PATCH v2 11/24] mmc: omap_hsmmc: Add support to set IODELAY values Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 12/24] mmc: omap_hsmmc: Add support to get pinctrl values and max frequency for different hw revisions Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 13/24] mmc: omap_hsmmc: allow the simple HS modes to use the default pinctrl Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 14/24] mmc: omap_hsmmc: update mmc->clock with the actual bus speed Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 15/24] mmc: omap_hsmmc: implement send_init_stream callback Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 16/24] mmc: omap_hsmmc: allow mmc clock to be gated Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 17/24] mmc: omap_hsmmc: add signal voltage selection support Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 18/24] ARM: OMAP5: set mmc clock frequency to 192MHz Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 19/24] ARM: dts: DRA7: use new dra7-specific compatible string Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 20/24] ARM: dts: dra7: Add supported MMC/SD modes in MMC dt nodes Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 21/24] dts: am57xx-beagle-x15: disable UHS and HS200 support Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 22/24] dts: am57xx-idk: disable " Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 23/24] ARM: DRA7x/AM57x: Add MMC/SD fixups for rev1.0 and rev 1.1 Jean-Jacques Hiblot
2018-01-25 10:51   ` [U-Boot] [PATCH v2 24/24] configs: dra7xx_evm/dra7xx_hs_evm: Enable MMC HS200 and SD UHS support Jean-Jacques Hiblot
2018-01-25 11:14   ` [U-Boot] [PATCH v2 00/24] omap_hsmmc: Add support for HS200 and UHS modes Jaehoon Chung
2018-01-29  4:45   ` Lokesh Vutla
2018-01-29 10:20     ` Jean-Jacques Hiblot
2018-01-30  5:17   ` Jaehoon Chung
2018-01-30 13:30     ` Jean-Jacques Hiblot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516877510-14863-11-git-send-email-jjhiblot@ti.com \
    --to=jjhiblot@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.