From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Thu, 1 Sep 2016 10:43:28 +0200 Subject: [U-Boot] [PATCH 0/6] sunxi: sun5/7i: add the psci suspend function In-Reply-To: <20160901075746.28564-1-antoine.tenart@free-electrons.com> References: <20160901075746.28564-1-antoine.tenart@free-electrons.com> Message-ID: <27f6879e-be0a-9280-710e-dcabe307be87@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 01-09-16 09:57, Antoine Tenart wrote: > Hi all, > > This series adds an implementation of the psci suspend function for both > sun5i and sun7i. This was tested on Nextthing's CHIP and on a A20, using > cpuidle in Linux. My tests showed a power consumption reduced by a factor > 2 on the CHIP when the system was idle. It went from ~1W without cpuidle > enabled to ~0.45W. > > The idea of this suspend function is to put the dram into self-refresh, > cut off some plls and to switch cpuclk to a source with a lower > frequency. Please note the sun7i implementation lacks some parts as > putting the ram into self-refresh and coming back from this state seems > a bit tricky. I made some tests but did not managed yet to have a stable > solution. > > As the sun5i does not have a GIC, I needed to remove some code from the > generic psci code. To do this I added an ARM_GIC Kconfig option which > needs to be selected by each SoC having a GIC. I already added the > relevant lines regarding sunXi SoCs. As this Kconfig option is currently > only used in the psci code, it should be safe to add it even of all the > SoCs having a GIC do not select it, as long as they don't have psci > functions. > > Finally the series has a patch to enable the psci support for sun5i > SoCs, and another patch to let sun5i SoCs boot the kernel in non-secure > mode so that it can call psci functions. Cool stuff. I've some minor remarks to some of the patches I'll reply to them separately. I also hope someone who knows this stuff better then me can also take a look, but if not then I'm just going to take it for the next u-boot cycle (with the remarks fixed). Regards, Hans > > Thanks! > > Antoine > > Antoine Tenart (6): > ARM: add the ARM_GIC configuration option > sunxi: select ARM_GIC for sun[6789]i > ARM: PSCI: protect GIC specific code with ARM_GIC > sun5/7i: add an implementation of the psci suspend function > sun5i: enable PSCI > sun5i: boot in HYP mode by default > > arch/arm/Kconfig | 3 + > arch/arm/cpu/armv7/nonsec_virt.S | 6 + > arch/arm/cpu/armv7/sunxi/Makefile | 9 +- > arch/arm/cpu/armv7/sunxi/psci_suspend.c | 175 ++++++++++++++++++++++++++ > arch/arm/cpu/armv7/virt-v7.c | 38 +++--- > arch/arm/include/asm/arch-sunxi/clock_sun4i.h | 7 ++ > arch/arm/include/asm/arch-sunxi/dram_sun4i.h | 11 ++ > board/sunxi/Kconfig | 9 ++ > include/configs/sun5i.h | 5 + > 9 files changed, 248 insertions(+), 15 deletions(-) > create mode 100644 arch/arm/cpu/armv7/sunxi/psci_suspend.c >