Commit f57f27bc authored by Lokesh Vutla's avatar Lokesh Vutla Committed by Greg Kroah-Hartman

memory: emif: Load the correct custom config values from dt

of_get_property returns value in Big Endian format.
Before using this value it should be converted to little endian
using be32_to_cpup().
Custom configs of emif are read from dt using of_get_property,
but these are not converted to litte endian format.
Correcting the same here.
Signed-off-by: default avatarLokesh Vutla <lokeshvutla@ti.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f02503b2
...@@ -1263,7 +1263,7 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif, ...@@ -1263,7 +1263,7 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
{ {
struct emif_custom_configs *cust_cfgs = NULL; struct emif_custom_configs *cust_cfgs = NULL;
int len; int len;
const int *lpmode, *poll_intvl; const __be32 *lpmode, *poll_intvl;
lpmode = of_get_property(np_emif, "low-power-mode", &len); lpmode = of_get_property(np_emif, "low-power-mode", &len);
poll_intvl = of_get_property(np_emif, "temp-alert-poll-interval", &len); poll_intvl = of_get_property(np_emif, "temp-alert-poll-interval", &len);
...@@ -1277,7 +1277,7 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif, ...@@ -1277,7 +1277,7 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
if (lpmode) { if (lpmode) {
cust_cfgs->mask |= EMIF_CUSTOM_CONFIG_LPMODE; cust_cfgs->mask |= EMIF_CUSTOM_CONFIG_LPMODE;
cust_cfgs->lpmode = *lpmode; cust_cfgs->lpmode = be32_to_cpup(lpmode);
of_property_read_u32(np_emif, of_property_read_u32(np_emif,
"low-power-mode-timeout-performance", "low-power-mode-timeout-performance",
&cust_cfgs->lpmode_timeout_performance); &cust_cfgs->lpmode_timeout_performance);
...@@ -1292,7 +1292,8 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif, ...@@ -1292,7 +1292,8 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
if (poll_intvl) { if (poll_intvl) {
cust_cfgs->mask |= cust_cfgs->mask |=
EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL; EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL;
cust_cfgs->temp_alert_poll_interval_ms = *poll_intvl; cust_cfgs->temp_alert_poll_interval_ms =
be32_to_cpup(poll_intvl);
} }
if (of_find_property(np_emif, "extended-temp-part", &len)) if (of_find_property(np_emif, "extended-temp-part", &len))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment