aboutsummaryrefslogtreecommitdiff
path: root/drivers/ddr
diff options
context:
space:
mode:
authorPali Rohár2022-04-03 00:24:26 +0200
committerPriyanka Jain2022-04-26 17:18:39 +0530
commit78cdaf405311682281d9c5f58dc0b4455e72da61 (patch)
tree332c2bbdd3fb1e256944024b50528899bae83906 /drivers/ddr
parentd64a8fd0a9021ef0a87e6f3e315c8d65a8dd7bd0 (diff)
ddr: fsl: Allow to compile it without env support
When env support is disabled then usage of env_get_f() generates linker errors. So do not compile env_get_f() when env support is disabled (for example when disabled only in SPL). Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'drivers/ddr')
-rw-r--r--drivers/ddr/fsl/options.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ddr/fsl/options.c b/drivers/ddr/fsl/options.c
index c000a45f8ea..9555b9a29d4 100644
--- a/drivers/ddr/fsl/options.c
+++ b/drivers/ddr/fsl/options.c
@@ -761,7 +761,9 @@ unsigned int populate_memctl_options(const common_timing_params_t *common_dimm,
* Extract hwconfig from environment since we have not properly setup
* the environment but need it for ddr config params
*/
+#if CONFIG_IS_ENABLED(ENV_SUPPORT)
if (env_get_f("hwconfig", buf, sizeof(buf)) < 0)
+#endif
buf[0] = '\0';
#if defined(CONFIG_SYS_FSL_DDR3) || \
@@ -1408,7 +1410,9 @@ int fsl_use_spd(void)
* Extract hwconfig from environment since we have not properly setup
* the environment but need it for ddr config params
*/
+#if CONFIG_IS_ENABLED(ENV_SUPPORT)
if (env_get_f("hwconfig", buf, sizeof(buf)) < 0)
+#endif
buf[0] = '\0';
/* if hwconfig is not enabled, or "sdram" is not defined, use spd */