public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: khilman@ti•com (Kevin Hilman)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCHv2 15/19] ARM: OMAP4430: PM: workaround for DDR corruption on second CS
Date: Thu, 17 May 2012 09:47:06 -0700	[thread overview]
Message-ID: <87vcjuzred.fsf@ti.com> (raw)
In-Reply-To: <CAMQu2gzOeX3W1HouzVHf7uvMHtdTp7=E22fk6Uq81sxcdM5nxg@mail.gmail.com> (Santosh Shilimkar's message of "Thu, 17 May 2012 12:42:30 +0530")

"Shilimkar, Santosh" <santosh.shilimkar@ti•com> writes:

> On Thu, May 17, 2012 at 5:45 AM, Kevin Hilman <khilman@ti•com> wrote:
>> Tero Kristo <t-kristo@ti•com> writes:
>>
>>> From: Santosh Shilimkar <santosh.shilimkar@ti•com>
>>>
>>> Work around for Errata ID: i632 "LPDDR2 Corruption After OFF Mode
>>> Transition When CS1 Is Used On EMIF" which impacts OMAP443x silicon
>>> The issue occurs when EMIF_SDRAM_CONFIG is restored first before
>>> EMIF_SDRAM_CONFIG_2 is not yet restored, the register configuration
>>> is not set properly, we apply the required workaround allowing
>>> the restore sequence to work properly.
>>
>> Please summarize the workaround here as well.
>>
> ok
>>> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti•com>
>>> [t-kristo at ti.com: moved workaround from omap-sar.c to pm44xx.c]
>>> Signed-off-by: Tero Kristo <t-kristo@ti•com>
>>> ---
>>> ?.../include/mach/ctrl_module_wkup_44xx.h ? ? ? ? ? | ? ?2 +
>>> ?arch/arm/mach-omap2/pm44xx.c ? ? ? ? ? ? ? ? ? ? ? | ? 37 ++++++++++++++++++++
>>> ?2 files changed, 39 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h b/arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h
>>> index a0af9ba..b763a79 100644
>>> --- a/arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h
>>> +++ b/arch/arm/mach-omap2/include/mach/ctrl_module_wkup_44xx.h
>>> @@ -28,6 +28,8 @@
>>> ?#define OMAP4_CTRL_MODULE_WKUP_IP_REVISION ? ? ? ? ? 0x0000
>>> ?#define OMAP4_CTRL_MODULE_WKUP_IP_HWINFO ? ? ? ? ? ? 0x0004
>>> ?#define OMAP4_CTRL_MODULE_WKUP_IP_SYSCONFIG ? ? ? ? ?0x0010
>>> +#define OMAP4_CTRL_SECURE_EMIF1_SDRAM_CONFIG2_REG ? ?0x0114
>>> +#define OMAP4_CTRL_SECURE_EMIF2_SDRAM_CONFIG2_REG ? ?0x011c
>>> ?#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_0 ?0x0460
>>> ?#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_1 ?0x0464
>>> ?#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_2 ?0x0468
>>> diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
>>> index 215b80e..dfaa254 100644
>>> --- a/arch/arm/mach-omap2/pm44xx.c
>>> +++ b/arch/arm/mach-omap2/pm44xx.c
>>> @@ -17,12 +17,18 @@
>>> ?#include <linux/err.h>
>>> ?#include <linux/slab.h>
>>> ?#include <asm/system_misc.h>
>>> +#include <linux/io.h>
>>> +
>>> +#include <mach/ctrl_module_wkup_44xx.h>
>>> +#include <mach/hardware.h>
>>>
>>> ?#include "common.h"
>>> ?#include "clockdomain.h"
>>> ?#include "powerdomain.h"
>>> ?#include "pm.h"
>>>
>>> +#define EMIF_SDRAM_CONFIG2_OFFSET ? ?0xc
>>> +
>>> ?struct power_state {
>>> ? ? ? struct powerdomain *pwrdm;
>>> ? ? ? u32 next_state;
>>> @@ -215,6 +221,37 @@ static int __init omap4_pm_init(void)
>>>
>>> ? ? ? pr_err("Power Management for TI OMAP4.\n");
>>>
>>> + ? ? /*
>>> + ? ? ?* Work around for OMAP443x Errata i632: "LPDDR2 Corruption After OFF
>>> + ? ? ?* Mode Transition When CS1 Is Used On EMIF":
>>> + ? ? ?* Overwrite EMIF1/EMIF2
>>> + ? ? ?* SECURE_EMIF1_SDRAM_CONFIG2_REG
>>> + ? ? ?* SECURE_EMIF2_SDRAM_CONFIG2_REG
>>> + ? ? ?*/
>>> + ? ? if (cpu_is_omap443x()) {
>>
>> This should probably be done later in this function, after PM_ERRATUM
>> flags are setup, and then it should use a PM_ERRATUM flag instead of cpu_is*
>>
> ok
>
>>> + ? ? ? ? ? ? void __iomem *secure_ctrl_mod;
>>> + ? ? ? ? ? ? void __iomem *emif1;
>>> + ? ? ? ? ? ? void __iomem *emif2;
>>> + ? ? ? ? ? ? u32 val;
>>> +
>>> + ? ? ? ? ? ? secure_ctrl_mod = ioremap(OMAP4_CTRL_MODULE_WKUP, SZ_4K);
>>> + ? ? ? ? ? ? emif1 = ioremap(OMAP44XX_EMIF1_BASE, SZ_1M);
>>> + ? ? ? ? ? ? emif2 = ioremap(OMAP44XX_EMIF2_BASE, SZ_1M);
>>> +
>>> + ? ? ? ? ? ? BUG_ON(!secure_ctrl_mod || !emif1 || !emif2);
>>
>> Please avoid BUG_ON() and use proper error recovery. ?This is not a
>> condition where the entire kernel should panic.
>>
> Agree. WARN_ON() should suffice.

A WARN_ON() is ok (but noisy).  Better is a pr_warn() with some proper
error recovery.

Kevin

  reply	other threads:[~2012-05-17 16:47 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-14 10:18 [PATCHv2 00/19] ARM: OMAP4: device off support Tero Kristo
2012-05-14 10:18 ` [PATCHv2 01/19] ARM: OMAP4: PM: powerdomain: Add HWSAR flag to L3INIT Tero Kristo
2012-05-16 18:27   ` Kevin Hilman
2012-05-14 10:18 ` [PATCHv2 02/19] ARM: OMAP4: Add SAR ROM base address Tero Kristo
2012-05-16 18:28   ` Kevin Hilman
2012-05-21  8:28     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 03/19] ARM: OMAP4: PM: Add device-off support Tero Kristo
2012-05-16 22:36   ` Kevin Hilman
2012-05-17  7:10     ` Shilimkar, Santosh
2012-05-21  8:48     ` Tero Kristo
2012-05-21 14:05       ` Jean Pihet
2012-05-29 18:34         ` Kevin Hilman
2012-05-29 18:31       ` Kevin Hilman
2012-05-30  8:20         ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 04/19] ARM: OMAP4: PM: save/restore all DPLL settings in OFF mode Tero Kristo
2012-05-16 22:42   ` Kevin Hilman
2012-05-17  7:04     ` Shilimkar, Santosh
2012-05-17  8:52       ` Shilimkar, Santosh
2012-05-17 16:37         ` Kevin Hilman
2012-05-21  9:01           ` Tero Kristo
2012-05-29 19:46         ` Menon, Nishanth
2012-05-30 17:59           ` Kevin Hilman
2012-05-30 18:24             ` Menon, Nishanth
2012-05-30 22:09               ` Kevin Hilman
2012-05-31  2:38                 ` Shilimkar, Santosh
2012-05-21  8:58     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 05/19] ARM: OMAP4: PM: save/restore all CM1/2 " Tero Kristo
2012-05-16 22:48   ` Kevin Hilman
2012-05-17  7:05     ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 06/19] ARM: OMAP4: PM: Add SAR backup support towards device OFF Tero Kristo
2012-05-16 22:58   ` Kevin Hilman
2012-05-17  7:02     ` Shilimkar, Santosh
2012-05-17 16:42       ` Kevin Hilman
2012-05-18  5:53         ` Shilimkar, Santosh
2012-05-21  9:07           ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 07/19] ARM: OMAP4: Auto generate SAR layout contents Tero Kristo
2012-05-14 10:18 ` [PATCHv2 08/19] ARM: OMAP4: SAR: generate overwrite data based on SAR ROM contents Tero Kristo
2012-05-14 10:18 ` [PATCHv2 09/19] ARM: OMAP4: PM: add errata support Tero Kristo
2012-05-29 20:10   ` Menon, Nishanth
2012-05-30  8:32     ` Tero Kristo
2012-05-30 14:45       ` Menon, Nishanth
2012-05-14 10:18 ` [PATCHv2 10/19] ARM: OMAP4: PM: Work-around for ROM code BUG of IVAHD/TESLA Tero Kristo
2012-05-16 23:05   ` Kevin Hilman
2012-05-16 23:07     ` Kevin Hilman
2012-05-21  9:11       ` Tero Kristo
2012-05-29 20:13         ` Kevin Hilman
2012-05-17  6:52     ` Shilimkar, Santosh
2012-05-17 16:45       ` Kevin Hilman
2012-05-18  5:55         ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 11/19] ARM: OMAP4: PM: save/restore CM L3INSTR registers when MPU hits OSWR/OFF mode Tero Kristo
2012-05-16 23:17   ` Kevin Hilman
2012-05-17  6:53     ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 12/19] ARM: OMAP4: PM: update ROM return address for OSWR and OFF Tero Kristo
2012-05-16 23:36   ` Kevin Hilman
2012-05-21  9:29     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 13/19] ARM: OMAP4: PM: Mark the PPI and SPI interrupts as non-secure for GP Tero Kristo
2012-05-16 23:48   ` Kevin Hilman
2012-05-21  9:32     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 14/19] ARM: OMAP4: wakeupgen: enable clocks for save_secure_all Tero Kristo
2012-05-17  0:06   ` Kevin Hilman
2012-05-21  9:38     ` Tero Kristo
2012-05-21  9:43       ` Shilimkar, Santosh
2012-05-29 20:15       ` Kevin Hilman
2012-05-29 20:48         ` Menon, Nishanth
2012-05-30  8:44           ` Tero Kristo
2012-05-30  8:33         ` Tero Kristo
2012-05-17  0:17   ` Paul Walmsley
2012-05-21  9:35     ` Tero Kristo
2012-05-21  9:39       ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 15/19] ARM: OMAP4430: PM: workaround for DDR corruption on second CS Tero Kristo
2012-05-17  0:15   ` Kevin Hilman
2012-05-17  7:12     ` Shilimkar, Santosh
2012-05-17 16:47       ` Kevin Hilman [this message]
2012-05-18  5:55         ` Shilimkar, Santosh
2012-05-14 10:18 ` [PATCHv2 16/19] TEMP: ARM: OMAP4: prevent voltage transitions Tero Kristo
2012-05-14 10:18 ` [PATCHv2 17/19] ARM: OMAP4: put cpu1 back to sleep if no wake request Tero Kristo
2012-05-17  0:31   ` Kevin Hilman
2012-05-21 10:21     ` Tero Kristo
2012-05-21 10:40       ` Shilimkar, Santosh
2012-05-29 20:17         ` Kevin Hilman
2012-05-30 15:18         ` Menon, Nishanth
2012-05-14 10:18 ` [PATCHv2 18/19] ARM: OMAP4460: wakeupgen: set GIC_CPU0 backup status flag always Tero Kristo
2012-05-17  0:33   ` Kevin Hilman
2012-05-21  9:12     ` Tero Kristo
2012-05-14 10:18 ` [PATCHv2 19/19] ARM: OMAP4: powerdomain: update mpu / core off counters during device off Tero Kristo
2012-05-30 21:08   ` Menon, Nishanth
2012-05-31  6:50     ` Tero Kristo

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=87vcjuzred.fsf@ti.com \
    --to=khilman@ti$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox