diff options
author | Nishanth Menon <nm@ti.com> | 2013-03-16 02:16:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 16:18:12 -0400 |
commit | f91a595d0b813c3a2f3b848c165e865ca4c5b8cc (patch) | |
tree | c14fc79d76636ef6118e0252c2408907c634d9a9 /drivers/memory | |
parent | 25aaacd2834233bbfa2b7ec697bfce42707e35b7 (diff) |
memory: emif: Handle devices which are not rated for >85C
As per JESD209-2E specification for LPDDR2,
http://www.jedec.org/standards-documents/results/jesd209-2E
Table 73, LPDDR2 memories come in two flavors - Standard and
Extended. The Standard types can operate from -25C to +85C
However, beyond that and upto +105C can only be supported by
Extended types.
Unfortunately, it seems there is no info in MR0(device info) or
MR[1,2](device feature) for run time detection of this capability
as far as seen on the spec. Hence, we provide a custom_config
flag to be populated by platforms which have these "extended"
type memories.
For the "Standard" memories, we need to consider MR4 notifications
of temperature triggers >85C as equivalent to thermal shutdown
events (equivalent to Spec specified thermal shutdown events for
"extended" parts).
Reported-by: Richard Woodruff <r-woodruff2@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/emif.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index 249222905c94..96add5b9ce5d 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c | |||
@@ -918,6 +918,7 @@ static irqreturn_t handle_temp_alert(void __iomem *base, struct emif_data *emif) | |||
918 | { | 918 | { |
919 | u32 old_temp_level; | 919 | u32 old_temp_level; |
920 | irqreturn_t ret = IRQ_HANDLED; | 920 | irqreturn_t ret = IRQ_HANDLED; |
921 | struct emif_custom_configs *custom_configs; | ||
921 | 922 | ||
922 | spin_lock_irqsave(&emif_lock, irq_state); | 923 | spin_lock_irqsave(&emif_lock, irq_state); |
923 | old_temp_level = emif->temperature_level; | 924 | old_temp_level = emif->temperature_level; |
@@ -930,6 +931,29 @@ static irqreturn_t handle_temp_alert(void __iomem *base, struct emif_data *emif) | |||
930 | goto out; | 931 | goto out; |
931 | } | 932 | } |
932 | 933 | ||
934 | custom_configs = emif->plat_data->custom_configs; | ||
935 | |||
936 | /* | ||
937 | * IF we detect higher than "nominal rating" from DDR sensor | ||
938 | * on an unsupported DDR part, shutdown system | ||
939 | */ | ||
940 | if (custom_configs && !(custom_configs->mask & | ||
941 | EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART)) { | ||
942 | if (emif->temperature_level >= SDRAM_TEMP_HIGH_DERATE_REFRESH) { | ||
943 | dev_err(emif->dev, | ||
944 | "%s:NOT Extended temperature capable memory." | ||
945 | "Converting MR4=0x%02x as shutdown event\n", | ||
946 | __func__, emif->temperature_level); | ||
947 | /* | ||
948 | * Temperature far too high - do kernel_power_off() | ||
949 | * from thread context | ||
950 | */ | ||
951 | emif->temperature_level = SDRAM_TEMP_VERY_HIGH_SHUTDOWN; | ||
952 | ret = IRQ_WAKE_THREAD; | ||
953 | goto out; | ||
954 | } | ||
955 | } | ||
956 | |||
933 | if (emif->temperature_level < old_temp_level || | 957 | if (emif->temperature_level < old_temp_level || |
934 | emif->temperature_level == SDRAM_TEMP_VERY_HIGH_SHUTDOWN) { | 958 | emif->temperature_level == SDRAM_TEMP_VERY_HIGH_SHUTDOWN) { |
935 | /* | 959 | /* |
@@ -1228,6 +1252,9 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif, | |||
1228 | cust_cfgs->temp_alert_poll_interval_ms = *poll_intvl; | 1252 | cust_cfgs->temp_alert_poll_interval_ms = *poll_intvl; |
1229 | } | 1253 | } |
1230 | 1254 | ||
1255 | if (of_find_property(np_emif, "extended-temp-part", &len)) | ||
1256 | cust_cfgs->mask |= EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART; | ||
1257 | |||
1231 | if (!is_custom_config_valid(cust_cfgs, emif->dev)) { | 1258 | if (!is_custom_config_valid(cust_cfgs, emif->dev)) { |
1232 | devm_kfree(emif->dev, cust_cfgs); | 1259 | devm_kfree(emif->dev, cust_cfgs); |
1233 | return; | 1260 | return; |