diff mbox

[v3,10/10] ARM: Exynos: extend soft-reset support for Exynos5420

Message ID 1371466836-4111-11-git-send-email-chander.kashyap@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Chander Kashyap June 17, 2013, 11 a.m. UTC
Extend the soft reset support for Exynos5420 SoC.

Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
---
 arch/arm/mach-exynos/common.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Arnd Bergmann June 17, 2013, 12:21 p.m. UTC | #1
On Monday 17 June 2013 16:30:35 Chander Kashyap wrote:
> @@ -330,10 +330,10 @@ void exynos5_restart(char mode, const char *cmd)
>         u32 val;
>         void __iomem *addr;
>  
> -       if (of_machine_is_compatible("samsung,exynos5250")) {
> -               val = 0x1;
> -               addr = EXYNOS_SWRESET;
> -       } else if (of_machine_is_compatible("samsung,exynos5440")) {
> +       val = 0x1;
> +       addr = EXYNOS_SWRESET;
> +
> +       if (of_machine_is_compatible("samsung,exynos5440")) {
>                 u32 status;
>                 np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
>  

Please try to avoid adding further uses of hardcoded MMIO addresses.

Can you change that to use the same logic that exynos5440 has?

	Arnd
Chander Kashyap June 18, 2013, 4:10 a.m. UTC | #2
On 17 June 2013 17:51, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 17 June 2013 16:30:35 Chander Kashyap wrote:
>> @@ -330,10 +330,10 @@ void exynos5_restart(char mode, const char *cmd)
>>         u32 val;
>>         void __iomem *addr;
>>
>> -       if (of_machine_is_compatible("samsung,exynos5250")) {
>> -               val = 0x1;
>> -               addr = EXYNOS_SWRESET;
>> -       } else if (of_machine_is_compatible("samsung,exynos5440")) {
>> +       val = 0x1;
>> +       addr = EXYNOS_SWRESET;
>> +
>> +       if (of_machine_is_compatible("samsung,exynos5440")) {
>>                 u32 status;
>>                 np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
>>
>
> Please try to avoid adding further uses of hardcoded MMIO addresses.
I am not adding new hard-coded address. I have simply removed the
unnecessary previously existing check.
>
Thanks.
> Can you change that to use the same logic that exynos5440 has?
>
>         Arnd



--
with warm regards,
Chander Kashyap
diff mbox

Patch

diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 6f435da..4e6c227 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -330,10 +330,10 @@  void exynos5_restart(char mode, const char *cmd)
 	u32 val;
 	void __iomem *addr;
 
-	if (of_machine_is_compatible("samsung,exynos5250")) {
-		val = 0x1;
-		addr = EXYNOS_SWRESET;
-	} else if (of_machine_is_compatible("samsung,exynos5440")) {
+	val = 0x1;
+	addr = EXYNOS_SWRESET;
+
+	if (of_machine_is_compatible("samsung,exynos5440")) {
 		u32 status;
 		np = of_find_compatible_node(NULL, NULL, "samsung,exynos5440-clock");
 
@@ -344,9 +344,6 @@  void exynos5_restart(char mode, const char *cmd)
 		val = __raw_readl(addr);
 
 		val = (val & 0xffff0000) | (status & 0xffff);
-	} else {
-		pr_err("%s: cannot support non-DT\n", __func__);
-		return;
 	}
 
 	__raw_writel(val, addr);