From 928f3248b3e81a9fdaa818cf3aa02e5daef7015d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 25 Aug 2016 21:03:41 +0900 Subject: ARM: uniphier: support system reset functionality for PSCI This supports the system reset via PSCI for ARMv7 SoCs. Because the system reset is not supported on PSCI 0.1, let's define CONFIG_ARMV7_PSCI_1_0. (it is supported since PSCI 0.2, but there is no CONFIG to enable it in U-Boot for now.) Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/arm32/psci.c | 5 +++++ arch/arm/mach-uniphier/reset.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-uniphier/arm32/psci.c b/arch/arm/mach-uniphier/arm32/psci.c index 633a3e0..e668265 100644 --- a/arch/arm/mach-uniphier/arm32/psci.c +++ b/arch/arm/mach-uniphier/arm32/psci.c @@ -151,3 +151,8 @@ int __secure psci_cpu_on(u32 function_id, u32 cpuid, u32 entry_point) return PSCI_RET_SUCCESS; } + +void __secure psci_system_reset(u32 function_id) +{ + reset_cpu(0); +} diff --git a/arch/arm/mach-uniphier/reset.c b/arch/arm/mach-uniphier/reset.c index b5825bc..43e27d1 100644 --- a/arch/arm/mach-uniphier/reset.c +++ b/arch/arm/mach-uniphier/reset.c @@ -1,15 +1,25 @@ /* - * Copyright (C) 2012-2015 Masahiro Yamada + * Copyright (C) 2012-2014 Panasonic Corporation + * Copyright (C) 2015-2016 Socionext Inc. + * Author: Masahiro Yamada * * SPDX-License-Identifier: GPL-2.0+ */ #include #include +#include #include "sc-regs.h" -void reset_cpu(unsigned long ignored) +/* If PSCI is enabled, this is used for SYSTEM_RESET function */ +#ifdef CONFIG_ARMV7_PSCI +#define __SECURE __secure +#else +#define __SECURE +#endif + +void __SECURE reset_cpu(unsigned long ignored) { u32 tmp; -- cgit v1.1 From 499c8679be13383c44a1f277d5b0d7c63b6b2008 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 25 Aug 2016 17:02:31 +0900 Subject: ARM: uniphier: display revision of Micro Support Card 3.6.x kindly The revision of the original support card (rev 3.5, rev 3.6) fits in the 8 bit width revision register. When it was extended in a weird way, it was versioned in the format of "3.6.x" (where it should have been "3.7", of course). What is worse, only the sub-level version "6.x" was recorded in the 8 bit width register, completely ignoring the compatibility of the revision register format. This patch saves madly-versioned support cards by assuming the major version "3" when the MSB 4 bit of the register is read as "6". With this, the support card revision that were displayed as "6.10" is now corrected to "3.6.10". Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/micro-support-card.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-uniphier/micro-support-card.c b/arch/arm/mach-uniphier/micro-support-card.c index eeb515a..6987d1e 100644 --- a/arch/arm/mach-uniphier/micro-support-card.c +++ b/arch/arm/mach-uniphier/micro-support-card.c @@ -1,5 +1,7 @@ /* - * Copyright (C) 2012-2015 Masahiro Yamada + * Copyright (C) 2012-2015 Panasonic Corporation + * Copyright (C) 2015-2016 Socionext Inc. + * Author: Masahiro Yamada * * SPDX-License-Identifier: GPL-2.0+ */ @@ -38,7 +40,12 @@ static int support_card_show_revision(void) u32 revision; revision = readl(MICRO_SUPPORT_CARD_REVISION); - printf("(CPLD version %d.%d)\n", revision >> 4, revision & 0xf); + revision &= 0xff; + + /* revision 3.6.x card changed the revision format */ + printf("(CPLD version %s%d.%d)\n", revision >> 4 == 6 ? "3." : "", + revision >> 4, revision & 0xf); + return 0; } -- cgit v1.1 From f0633533d55a0b488d14a08d6625785fe09f42c1 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 25 Aug 2016 17:02:33 +0900 Subject: ARM: dts: uniphier: add u-boot, dm-pre-reloc to use eMMC boot on sLD3 The eMMC on sLD3 is assigned with dedicated pins (only multiplexed with GPIO), so it shouldn't hurt to enable eMMC on SPL all the time. Signed-off-by: Masahiro Yamada --- arch/arm/dts/uniphier-ph1-sld3-ref.dts | 8 ++++++++ arch/arm/dts/uniphier-ph1-sld3.dtsi | 1 + 2 files changed, 9 insertions(+) (limited to 'arch') diff --git a/arch/arm/dts/uniphier-ph1-sld3-ref.dts b/arch/arm/dts/uniphier-ph1-sld3-ref.dts index 099df83..0863588 100644 --- a/arch/arm/dts/uniphier-ph1-sld3-ref.dts +++ b/arch/arm/dts/uniphier-ph1-sld3-ref.dts @@ -85,3 +85,11 @@ &serial0 { u-boot,dm-pre-reloc; }; + +&mio { + u-boot,dm-pre-reloc; +}; + +&emmc { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/uniphier-ph1-sld3.dtsi b/arch/arm/dts/uniphier-ph1-sld3.dtsi index c3adaf1..6a95541 100644 --- a/arch/arm/dts/uniphier-ph1-sld3.dtsi +++ b/arch/arm/dts/uniphier-ph1-sld3.dtsi @@ -61,6 +61,7 @@ #size-cells = <1>; ranges; interrupt-parent = <&intc>; + u-boot,dm-pre-reloc; timer@20000200 { compatible = "arm,cortex-a9-global-timer"; -- cgit v1.1