Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500250

Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR memories

From Richard Genoud <richard.genoud@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR memories
Date 2016-10-13 14:50 +0200
Message-ID <srNCp-3zR-15@gated-at.bofh.it> (permalink)
References <spGlI-36r-3@gated-at.bofh.it> <spGlI-36r-11@gated-at.bofh.it> <srrse-4OM-59@gated-at.bofh.it> <srMdk-2NV-17@gated-at.bofh.it> <srNCp-3zR-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-10-13 14:27 GMT+02:00 Jean-Jacques Hiblot <jjhiblot@traphandler.com>:
> 2016-10-13 13:03 GMT+02:00 Alexandre Belloni
> <alexandre.belloni@free-electrons.com>:
>> On 12/10/2016 at 14:48:27 +0200, Jean-Jacques Hiblot wrote :
>>> > +static void at91_lpddr_poweroff(void)
>>> > +{
>>> > +       asm volatile(
>>> > +               /* Align to cache lines */
>>> > +               ".balign 32\n\t"
>>> > +
>>> > +               "       ldr     r6, [%2, #" __stringify(AT91_SHDW_CR) "]\n\t"
>>> At first sight, it looks useless. I assume it's used to preload the
>>> TLB before the LPDDR is turned off.
>>> A comment to explain why this line is useful would prevent its removal.
>>
>> Yes, this is the case. I can add a comment.
>>
>> Anyway, I would prefer the whole thing to run from SRAM, as a PIE
>> instead of relying on the cache.
>
> Instead of copying into the SRAM, you can make the cache reliable by
> preloading it, much like the TLB.
> LDI is probably not available for most of atmel's SOC, so the only way
> I can think of, is to execute code from the targeted area. here is an
> example:
> +               /*
> +                * Jump to the end of the sequence to preload instruction cache
> +                * It only works because the sequence is short enough not to
> +                * sit accross more than 2 cache lines
> +                */
> +               "       b end_of_sequence\n\t"
> +               "start_of_sequence:\n\t"
> +
>                 /* Power down SDRAM0 */
>                 "       str     %1, [%0, #"
> __stringify(AT91_DDRSDRC_LPR) "]\n\t"
>                 /* Shutdown CPU */
>                 "       str     %3, [%2, #" __stringify(AT91_SHDW_CR) "]\n\t"
>
>                 "       b       .\n\t"
> +
> +               /*
> +                * we're now 100% sure that the code to shutdown the LPDDR and
> +                * the CPU is in cache, go back to do the actual job
> +                */
> +               "end_of_sequence:\n\t"
> +               "       b start_of_sequence\n\t"
>                 :

My 2c: I think you may want to change your subject :)

Richard.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] ARM: at91: properly handle LPDDR poweroff Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-10-07 18:40 +0200
  [PATCH 1/2] ARM: at91: define LPDDR types Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-10-07 18:40 +0200
  [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR memories Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-10-07 18:40 +0200
    Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR memories Jean-Jacques Hiblot <jjhiblot@traphandler.com> - 2016-10-12 15:10 +0200
      Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR  memories Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-10-13 13:20 +0200
        Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR memories Richard Genoud <richard.genoud@gmail.com> - 2016-10-13 14:50 +0200
        Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR memories Jean-Jacques Hiblot <jjhiblot@traphandler.com> - 2016-10-13 14:50 +0200
          Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR  memories Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-10-13 15:50 +0200
            Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR memories Jean-Jacques Hiblot <jjhiblot@traphandler.com> - 2016-10-13 21:00 +0200
  Re: [PATCH 0/2] ARM: at91: properly handle LPDDR poweroff Alexander Stein <alexander.stein@systec-electronic.com> - 2016-10-10 08:10 +0200
    Re: [PATCH 0/2] ARM: at91: properly handle LPDDR poweroff Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-10-12 13:30 +0200

csiph-web