mbox

[00/12] ARM: restart: SAMSUNG: use new restart hook

Message ID 1324385316-6052-1-git-send-email-kgene.kim@samsung.com
State New
Headers show

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git next/rmk-restart

Message

Kukjin Kim Dec. 20, 2011, 12:48 p.m. UTC
This patch introduces common.[ch] in each SAMSUNG mach- directories
and implements using new restart hook for Samsung stuff.

This is against on rmk/devel-stable branch.

[PATCH 01/12] ARM: S3C64XX: introduce arch/arm/mach-s3c64xx/common.[ch]
[PATCH 02/12] ARM: restart: S3C64XX: use new restart hook
[PATCH 03/12] ARM: S5P64X0: introduce arch/arm/mach-s5p64x0/common.[ch]
[PATCH 04/12] ARM: restart: S5P64X0: use new restart hook
[PATCH 05/12] ARM: S5PC100: introduce arch/arm/mach-s5pc100/common.[ch]
[PATCH 06/12] ARM: restart: S5PC100: use new restart hook
[PATCH 07/12] ARM: S5PV210: introduce arch/arm/mach-s5pv210/common.[ch]
[PATCH 08/12] ARM: restart: S5PV210: use new restart hook
[PATCH 09/12] ARM: EXYNOS: introduce arch/arm/mach-exynos/common.[ch]
[PATCH 10/12] ARM: restart: EXYNOS: use new restart hook
[PATCH 11/12] ARM: restart: S3C24XX: move SWRST based S3C platforms
[PATCH 12/12] ARM: restart: S3C24XX: use new restart hook

---

The following changes since commit 3bdc3484e8f2b1b219ad0397d81ce4601fbaf76d:

  ARM: kexec: use soft_restart for branching to the reboot buffer (2011-12-12 16:07:36 +0000)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git next/rmk-restart

Heiko Stuebner (1):
      ARM: restart: S3C24XX: move SWRST based S3C platforms to machine_desc hook

Kukjin Kim (9):
      ARM: S3C64XX: introduce arch/arm/mach-s3c64xx/common.[ch]
      ARM: restart: S3C64XX: use new restart hook
      ARM: S5P64X0: introduce arch/arm/mach-s5p64x0/common.[ch]
      ARM: restart: S5P64X0: use new restart hook
      ARM: S5PC100: introduce arch/arm/mach-s5pc100/common.[ch]
      ARM: restart: S5PC100: use new restart hook
      ARM: S5PV210: introduce arch/arm/mach-s5pv210/common.[ch]
      ARM: EXYNOS: introduce arch/arm/mach-exynos/common.[ch]
      ARM: restart: S3C24XX: use new restart hook

Russell King (2):
      ARM: restart: S5PV210: use new restart hook
      ARM: restart: EXYNOS: use new restart hook

 arch/arm/mach-exynos/Makefile                      |    9 +-
 arch/arm/mach-exynos/clock-exynos4210.c            |    3 +-
 arch/arm/mach-exynos/clock-exynos4212.c            |    3 +-
 arch/arm/mach-exynos/clock.c                       |    3 +-
 arch/arm/mach-exynos/common.c                      |  704 ++++++++++++++++++++
 arch/arm/mach-exynos/common.h                      |   41 ++
 arch/arm/mach-exynos/cpu.c                         |  284 --------
 arch/arm/mach-exynos/include/mach/map.h            |   12 +-
 arch/arm/mach-exynos/include/mach/system.h         |    2 -
 arch/arm/mach-exynos/init.c                        |   42 --
 arch/arm/mach-exynos/irq-combiner.c                |  124 ----
 arch/arm/mach-exynos/irq-eint.c                    |  237 -------
 arch/arm/mach-exynos/mach-armlex4210.c             |    6 +-
 arch/arm/mach-exynos/mach-nuri.c                   |    6 +-
 arch/arm/mach-exynos/mach-origen.c                 |    6 +-
 arch/arm/mach-exynos/mach-smdk4x12.c               |    7 +-
 arch/arm/mach-exynos/mach-smdkv310.c               |    7 +-
 arch/arm/mach-exynos/mach-universal_c210.c         |    6 +-
 arch/arm/mach-s3c2410/common.h                     |   17 +
 arch/arm/mach-s3c2410/include/mach/reset.h         |   22 -
 arch/arm/mach-s3c2410/include/mach/system-reset.h  |   32 -
 arch/arm/mach-s3c2410/include/mach/system.h        |    4 -
 arch/arm/mach-s3c2410/mach-amlm5900.c              |    3 +
 arch/arm/mach-s3c2410/mach-bast.c                  |    2 +
 arch/arm/mach-s3c2410/mach-h1940.c                 |    3 +
 arch/arm/mach-s3c2410/mach-n30.c                   |    4 +
 arch/arm/mach-s3c2410/mach-otom.c                  |    3 +
 arch/arm/mach-s3c2410/mach-qt2410.c                |    5 +-
 arch/arm/mach-s3c2410/mach-smdk2410.c              |    5 +-
 arch/arm/mach-s3c2410/mach-tct_hammer.c            |    3 +
 arch/arm/mach-s3c2410/mach-vr1000.c                |    2 +
 arch/arm/mach-s3c2410/s3c2410.c                    |    9 +
 arch/arm/mach-s3c2412/mach-jive.c                  |    2 +
 arch/arm/mach-s3c2412/mach-smdk2413.c              |    3 +
 arch/arm/mach-s3c2412/mach-vstms.c                 |    1 +
 arch/arm/mach-s3c2412/s3c2412.c                    |   10 +-
 arch/arm/mach-s3c2416/mach-smdk2416.c              |    1 +
 arch/arm/mach-s3c2416/s3c2416.c                    |    7 +-
 arch/arm/mach-s3c2440/common.h                     |   17 +
 arch/arm/mach-s3c2440/mach-anubis.c                |    3 +
 arch/arm/mach-s3c2440/mach-at2440evb.c             |    3 +
 arch/arm/mach-s3c2440/mach-gta02.c                 |    2 +
 arch/arm/mach-s3c2440/mach-mini2440.c              |    3 +
 arch/arm/mach-s3c2440/mach-nexcoder.c              |    3 +
 arch/arm/mach-s3c2440/mach-osiris.c                |    3 +
 arch/arm/mach-s3c2440/mach-rx1950.c                |    3 +
 arch/arm/mach-s3c2440/mach-rx3715.c                |    3 +
 arch/arm/mach-s3c2440/mach-smdk2440.c              |    3 +
 arch/arm/mach-s3c2440/s3c2440.c                    |    9 +
 arch/arm/mach-s3c2443/mach-smdk2443.c              |    1 +
 arch/arm/mach-s3c2443/s3c2443.c                    |    8 +-
 arch/arm/mach-s3c64xx/Makefile                     |   65 +-
 arch/arm/mach-s3c64xx/clock.c                      |    4 +-
 arch/arm/mach-s3c64xx/{irq-eint.c => common.c}     |  192 +++++-
 arch/arm/mach-s3c64xx/common.h                     |   57 ++
 arch/arm/mach-s3c64xx/cpu.c                        |  161 -----
 arch/arm/mach-s3c64xx/include/mach/system.h        |   11 -
 arch/arm/mach-s3c64xx/irq.c                        |   47 --
 arch/arm/mach-s3c64xx/mach-anw6410.c               |    4 +-
 arch/arm/mach-s3c64xx/mach-crag6410.c              |    4 +-
 arch/arm/mach-s3c64xx/mach-hmt.c                   |    4 +-
 arch/arm/mach-s3c64xx/mach-mini6410.c              |    4 +-
 arch/arm/mach-s3c64xx/mach-ncp.c                   |    4 +-
 arch/arm/mach-s3c64xx/mach-real6410.c              |    4 +-
 arch/arm/mach-s3c64xx/mach-smartq.c                |    2 +
 arch/arm/mach-s3c64xx/mach-smartq5.c               |    3 +-
 arch/arm/mach-s3c64xx/mach-smartq7.c               |    3 +-
 arch/arm/mach-s3c64xx/mach-smdk6400.c              |    4 +-
 arch/arm/mach-s3c64xx/mach-smdk6410.c              |    4 +-
 arch/arm/mach-s3c64xx/s3c6400.c                    |    5 +-
 arch/arm/mach-s3c64xx/s3c6410.c                    |    6 +-
 arch/arm/mach-s5p64x0/Makefile                     |    9 +-
 arch/arm/mach-s5p64x0/clock-s5p6440.c              |    3 +-
 arch/arm/mach-s5p64x0/clock-s5p6450.c              |    3 +-
 arch/arm/mach-s5p64x0/clock.c                      |    4 +-
 arch/arm/mach-s5p64x0/common.c                     |  468 +++++++++++++
 arch/arm/mach-s5p64x0/common.h                     |   57 ++
 arch/arm/mach-s5p64x0/cpu.c                        |  215 ------
 arch/arm/mach-s5p64x0/include/mach/system.h        |    2 -
 arch/arm/mach-s5p64x0/init.c                       |   73 --
 arch/arm/mach-s5p64x0/irq-eint.c                   |  155 -----
 arch/arm/mach-s5p64x0/mach-smdk6440.c              |    6 +-
 arch/arm/mach-s5p64x0/mach-smdk6450.c              |    6 +-
 arch/arm/mach-s5pc100/Makefile                     |   29 +-
 arch/arm/mach-s5pc100/clock.c                      |    3 +-
 arch/arm/mach-s5pc100/{cpu.c => common.c}          |  103 +++-
 arch/arm/mach-s5pc100/common.h                     |   37 +
 arch/arm/mach-s5pc100/include/mach/system.h        |    2 -
 arch/arm/mach-s5pc100/init.c                       |   24 -
 arch/arm/mach-s5pv210/common.h                     |   37 +
 arch/arm/mach-s5pv210/include/mach/system.h        |    2 -
 arch/arm/mach-s5pv210/init.c                       |   44 --
 arch/arm/mach-s5pv210/mach-aquila.c                |    6 +-
 arch/arm/mach-s5pv210/mach-goni.c                  |    6 +-
 arch/arm/mach-s5pv210/mach-smdkc110.c              |    6 +-
 arch/arm/mach-s5pv210/mach-smdkv210.c              |    6 +-
 arch/arm/mach-s5pv210/mach-torbreck.c              |    6 +-
 arch/arm/plat-s3c24xx/cpu.c                        |    2 -
 arch/arm/plat-s5p/Makefile                         |    1 -
 arch/arm/plat-s5p/cpu.c                            |  144 ----
 arch/arm/plat-samsung/include/plat/cpu.h           |    6 -
 arch/arm/plat-samsung/include/plat/exynos4.h       |   35 -
 arch/arm/plat-samsung/include/plat/reset.h         |   16 -
 arch/arm/plat-samsung/include/plat/s3c2412.h       |    3 +
 arch/arm/plat-samsung/include/plat/s3c2416.h       |    2 +
 arch/arm/plat-samsung/include/plat/s3c2443.h       |    2 +
 arch/arm/plat-samsung/include/plat/s3c6400.h       |   36 -
 arch/arm/plat-samsung/include/plat/s3c6410.h       |   29 -
 arch/arm/plat-samsung/include/plat/s5p6440.h       |   36 -
 arch/arm/plat-samsung/include/plat/s5p6450.h       |   36 -
 arch/arm/plat-samsung/include/plat/s5pc100.h       |   33 -
 arch/arm/plat-samsung/include/plat/s5pv210.h       |   33 -
 arch/arm/plat-samsung/include/plat/system-reset.h  |   31 -
 .../arm/plat-samsung/include/plat/watchdog-reset.h |    1 +
 118 files changed, 2072 insertions(+), 2116 deletions(-)
 create mode 100644 arch/arm/mach-exynos/common.c
 create mode 100644 arch/arm/mach-exynos/common.h
 delete mode 100644 arch/arm/mach-exynos/cpu.c
 delete mode 100644 arch/arm/mach-exynos/init.c
 delete mode 100644 arch/arm/mach-exynos/irq-combiner.c
 delete mode 100644 arch/arm/mach-exynos/irq-eint.c
 create mode 100644 arch/arm/mach-s3c2410/common.h
 delete mode 100644 arch/arm/mach-s3c2410/include/mach/reset.h
 delete mode 100644 arch/arm/mach-s3c2410/include/mach/system-reset.h
 create mode 100644 arch/arm/mach-s3c2440/common.h
 rename arch/arm/mach-s3c64xx/{irq-eint.c => common.c} (50%)
 create mode 100644 arch/arm/mach-s3c64xx/common.h
 delete mode 100644 arch/arm/mach-s3c64xx/cpu.c
 delete mode 100644 arch/arm/mach-s3c64xx/irq.c
 create mode 100644 arch/arm/mach-s5p64x0/common.c
 create mode 100644 arch/arm/mach-s5p64x0/common.h
 delete mode 100644 arch/arm/mach-s5p64x0/cpu.c
 delete mode 100644 arch/arm/mach-s5p64x0/init.c
 delete mode 100644 arch/arm/mach-s5p64x0/irq-eint.c
 rename arch/arm/mach-s5pc100/{cpu.c => common.c} (66%)
 create mode 100644 arch/arm/mach-s5pc100/common.h
 delete mode 100644 arch/arm/mach-s5pc100/init.c
 rename arch/arm/mach-s5pv210/{cpu.c => common.c} (67%)
 create mode 100644 arch/arm/mach-s5pv210/common.h
 delete mode 100644 arch/arm/mach-s5pv210/init.c
 delete mode 100644 arch/arm/plat-s5p/cpu.c
 delete mode 100644 arch/arm/plat-samsung/include/plat/exynos4.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/reset.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/s3c6400.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/s3c6410.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/s5p6440.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/s5p6450.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/s5pc100.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/s5pv210.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/system-reset.h

Comments

Heiko Stübner Dec. 20, 2011, 1:18 p.m. UTC | #1
Am Dienstag, 20. Dezember 2011, 13:48:36 schrieb Kukjin Kim:
> Hook these platforms restart code into the new restart hook rather
> than using arch_reset().
> And adds local header file, common.h in arch/arm/mach-s3c2410/ and
> arch/arm/mach-s3c2440/ directories.
> 
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
just for my understanding would it not also be possible to move the function 
prototype to plat-samsung/include/plat/s3c2410.h and s3c244x.h?

Or should these files vanish in the long run?


Also, if you have a minute could you take a look at the 
[PATCH 1/8] s3c-hsudc: move platform_data struct to global header
from yesterday, as Felipe Balbi would like an Ack on it.

Thanks
Heiko

> ---
>  arch/arm/mach-s3c2410/common.h                    |   17 +++++++++++++
>  arch/arm/mach-s3c2410/include/mach/system-reset.h |   27
> --------------------- arch/arm/mach-s3c2410/include/mach/system.h       | 
>   2 -
>  arch/arm/mach-s3c2410/mach-amlm5900.c             |    3 ++
>  arch/arm/mach-s3c2410/mach-bast.c                 |    2 +
>  arch/arm/mach-s3c2410/mach-h1940.c                |    3 ++
>  arch/arm/mach-s3c2410/mach-n30.c                  |    4 +++
>  arch/arm/mach-s3c2410/mach-otom.c                 |    3 ++
>  arch/arm/mach-s3c2410/mach-qt2410.c               |    5 ++-
>  arch/arm/mach-s3c2410/mach-smdk2410.c             |    5 ++-
>  arch/arm/mach-s3c2410/mach-tct_hammer.c           |    3 ++
>  arch/arm/mach-s3c2410/mach-vr1000.c               |    2 +
>  arch/arm/mach-s3c2410/s3c2410.c                   |    9 +++++++
>  arch/arm/mach-s3c2440/common.h                    |   17 +++++++++++++
>  arch/arm/mach-s3c2440/mach-anubis.c               |    3 ++
>  arch/arm/mach-s3c2440/mach-at2440evb.c            |    3 ++
>  arch/arm/mach-s3c2440/mach-gta02.c                |    2 +
>  arch/arm/mach-s3c2440/mach-mini2440.c             |    3 ++
>  arch/arm/mach-s3c2440/mach-nexcoder.c             |    3 ++
>  arch/arm/mach-s3c2440/mach-osiris.c               |    3 ++
>  arch/arm/mach-s3c2440/mach-rx1950.c               |    3 ++
>  arch/arm/mach-s3c2440/mach-rx3715.c               |    3 ++
>  arch/arm/mach-s3c2440/mach-smdk2440.c             |    3 ++
>  arch/arm/mach-s3c2440/s3c2440.c                   |    9 +++++++
>  arch/arm/plat-s3c24xx/cpu.c                       |    2 -
>  25 files changed, 104 insertions(+), 35 deletions(-)
>  create mode 100644 arch/arm/mach-s3c2410/common.h
>  delete mode 100644 arch/arm/mach-s3c2410/include/mach/system-reset.h
>  create mode 100644 arch/arm/mach-s3c2440/common.h
> 
> diff --git a/arch/arm/mach-s3c2410/common.h
> b/arch/arm/mach-s3c2410/common.h new file mode 100644
> index 0000000..f65dc80
> --- /dev/null
> +++ b/arch/arm/mach-s3c2410/common.h
> @@ -0,0 +1,17 @@
> +/*
> + * Copyright (c) 2011 Samsung Electronics Co., Ltd.
> + *		http://www.samsung.com
> + *
> + * Common Header for S3C2410 machines
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __ARCH_ARM_MACH_S3C2410_COMMON_H
> +#define __ARCH_ARM_MACH_S3C2410_COMMON_H
> +
> +void s3c2410_restart(char mode, const char *cmd);
> +
> +#endif /* __ARCH_ARM_MACH_S3C2410_COMMON_H */
> diff --git a/arch/arm/mach-s3c2410/include/mach/system-reset.h
> b/arch/arm/mach-s3c2410/include/mach/system-reset.h deleted file mode
> 100644
> index 1e495f3..0000000
> --- a/arch/arm/mach-s3c2410/include/mach/system-reset.h
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -/* arch/arm/mach-s3c2410/include/mach/system-reset.h
> - *
> - * Copyright (c) 2008 Simtec Electronics
> - *	Ben Dooks <ben@simtec.co.uk>
> - *
> - * S3C2410 - System define for arch_reset() function
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> -*/
> -
> -#include <mach/hardware.h>
> -#include <plat/watchdog-reset.h>
> -
> -static void
> -arch_reset(char mode, const char *cmd)
> -{
> -	if (mode == 's') {
> -		soft_restart(0);
> -	}
> -
> -	arch_wdt_reset();
> -
> -	/* we'll take a jump through zero as a poor second */
> -	soft_restart(0);
> -}
> diff --git a/arch/arm/mach-s3c2410/include/mach/system.h
> b/arch/arm/mach-s3c2410/include/mach/system.h index eef8f24..5e215c1
> 100644
> --- a/arch/arm/mach-s3c2410/include/mach/system.h
> +++ b/arch/arm/mach-s3c2410/include/mach/system.h
> @@ -52,5 +52,3 @@ static void arch_idle(void)
>  	else
>  		s3c24xx_default_idle();
>  }
> -
> -#include <mach/system-reset.h>
> diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c
> b/arch/arm/mach-s3c2410/mach-amlm5900.c index 7983894..4220cc6 100644
> --- a/arch/arm/mach-s3c2410/mach-amlm5900.c
> +++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
> @@ -63,6 +63,8 @@
>  #include <linux/mtd/map.h>
>  #include <linux/mtd/physmap.h>
> 
> +#include "common.h"
> +
>  static struct resource amlm5900_nor_resource = {
>  		.start = 0x00000000,
>  		.end   = 0x01000000 - 1,
> @@ -241,4 +243,5 @@ MACHINE_START(AML_M5900, "AML_M5900")
>  	.init_irq	= s3c24xx_init_irq,
>  	.init_machine	= amlm5900_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2410/mach-bast.c
> b/arch/arm/mach-s3c2410/mach-bast.c index a20ae1a..c6133c6 100644
> --- a/arch/arm/mach-s3c2410/mach-bast.c
> +++ b/arch/arm/mach-s3c2410/mach-bast.c
> @@ -66,6 +66,7 @@
> 
>  #include "usb-simtec.h"
>  #include "nor-simtec.h"
> +#include "common.h"
> 
>  #define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics"
> 
> @@ -662,4 +663,5 @@ MACHINE_START(BAST, "Simtec-BAST")
>  	.init_irq	= s3c24xx_init_irq,
>  	.init_machine	= bast_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2410/mach-h1940.c
> b/arch/arm/mach-s3c2410/mach-h1940.c index 05a7d16..ad9d865 100644
> --- a/arch/arm/mach-s3c2410/mach-h1940.c
> +++ b/arch/arm/mach-s3c2410/mach-h1940.c
> @@ -70,6 +70,8 @@
> 
>  #include <sound/uda1380.h>
> 
> +#include "common.h"
> +
>  #define H1940_LATCH		((void __force __iomem *)0xF8000000)
> 
>  #define H1940_PA_LATCH		S3C2410_CS2
> @@ -751,4 +753,5 @@ MACHINE_START(H1940, "IPAQ-H1940")
>  	.init_irq	= h1940_init_irq,
>  	.init_machine	= h1940_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2410/mach-n30.c
> b/arch/arm/mach-s3c2410/mach-n30.c index 1dc3e32..383d00c 100644
> --- a/arch/arm/mach-s3c2410/mach-n30.c
> +++ b/arch/arm/mach-s3c2410/mach-n30.c
> @@ -51,6 +51,8 @@
>  #include <plat/s3c2410.h>
>  #include <plat/udc.h>
> 
> +#include "common.h"
> +
>  static struct map_desc n30_iodesc[] __initdata = {
>  	/* nothing here yet */
>  };
> @@ -591,6 +593,7 @@ MACHINE_START(N30, "Acer-N30")
>  	.init_machine	= n30_init,
>  	.init_irq	= s3c24xx_init_irq,
>  	.map_io		= n30_map_io,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> 
>  MACHINE_START(N35, "Acer-N35")
> @@ -601,4 +604,5 @@ MACHINE_START(N35, "Acer-N35")
>  	.init_machine	= n30_init,
>  	.init_irq	= s3c24xx_init_irq,
>  	.map_io		= n30_map_io,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2410/mach-otom.c
> b/arch/arm/mach-s3c2410/mach-otom.c index f03f3fd..5f1e0ee 100644
> --- a/arch/arm/mach-s3c2410/mach-otom.c
> +++ b/arch/arm/mach-s3c2410/mach-otom.c
> @@ -38,6 +38,8 @@
>  #include <plat/iic.h>
>  #include <plat/cpu.h>
> 
> +#include "common.h"
> +
>  static struct map_desc otom11_iodesc[] __initdata = {
>    /* Device area */
>  	{ (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
> @@ -121,4 +123,5 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
>  	.init_machine	= otom11_init,
>  	.init_irq	= s3c24xx_init_irq,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c
> b/arch/arm/mach-s3c2410/mach-qt2410.c index 4518521..58f2c17 100644
> --- a/arch/arm/mach-s3c2410/mach-qt2410.c
> +++ b/arch/arm/mach-s3c2410/mach-qt2410.c
> @@ -62,6 +62,8 @@
>  #include <plat/cpu.h>
>  #include <plat/pm.h>
> 
> +#include "common.h"
> +
>  static struct map_desc qt2410_iodesc[] __initdata = {
>  	{ 0xe0000000, __phys_to_pfn(S3C2410_CS3+0x01000000), SZ_1M, MT_DEVICE }
>  };
> @@ -350,6 +352,5 @@ MACHINE_START(QT2410, "QT2410")
>  	.init_irq	= s3c24xx_init_irq,
>  	.init_machine	= qt2410_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> -
> -
> diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c
> b/arch/arm/mach-s3c2410/mach-smdk2410.c index 99c9dfd..bdc27e7 100644
> --- a/arch/arm/mach-s3c2410/mach-smdk2410.c
> +++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
> @@ -54,6 +54,8 @@
> 
>  #include <plat/common-smdk.h>
> 
> +#include "common.h"
> +
>  static struct map_desc smdk2410_iodesc[] __initdata = {
>    /* nothing here yet */
>  };
> @@ -116,6 +118,5 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a
> new identifier and switc .init_irq	= s3c24xx_init_irq,
>  	.init_machine	= smdk2410_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> -
> -
> diff --git a/arch/arm/mach-s3c2410/mach-tct_hammer.c
> b/arch/arm/mach-s3c2410/mach-tct_hammer.c index e0d0b6f..1114666 100644
> --- a/arch/arm/mach-s3c2410/mach-tct_hammer.c
> +++ b/arch/arm/mach-s3c2410/mach-tct_hammer.c
> @@ -54,6 +54,8 @@
>  #include <linux/mtd/map.h>
>  #include <linux/mtd/physmap.h>
> 
> +#include "common.h"
> +
>  static struct resource tct_hammer_nor_resource = {
>  		.start = 0x00000000,
>  		.end   = 0x01000000 - 1,
> @@ -151,4 +153,5 @@ MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
>  	.init_irq	= s3c24xx_init_irq,
>  	.init_machine	= tct_hammer_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c
> b/arch/arm/mach-s3c2410/mach-vr1000.c index df47e8e..cc7032b 100644
> --- a/arch/arm/mach-s3c2410/mach-vr1000.c
> +++ b/arch/arm/mach-s3c2410/mach-vr1000.c
> @@ -53,6 +53,7 @@
> 
>  #include "usb-simtec.h"
>  #include "nor-simtec.h"
> +#include "common.h"
> 
>  /* macros for virtual address mods for the io space entries */
>  #define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5)
> @@ -405,4 +406,5 @@ MACHINE_START(VR1000, "Thorcom-VR1000")
>  	.init_machine	= vr1000_init,
>  	.init_irq	= s3c24xx_init_irq,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2410_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2410/s3c2410.c
> b/arch/arm/mach-s3c2410/s3c2410.c index 3d7ebc5..c3044cd 100644
> --- a/arch/arm/mach-s3c2410/s3c2410.c
> +++ b/arch/arm/mach-s3c2410/s3c2410.c
> @@ -42,6 +42,7 @@
>  #include <plat/clock.h>
>  #include <plat/pll.h>
>  #include <plat/pm.h>
> +#include <plat/watchdog-reset.h>
> 
>  #include <plat/gpio-core.h>
>  #include <plat/gpio-cfg.h>
> @@ -183,3 +184,11 @@ int __init s3c2410a_init(void)
>  	s3c2410_sysdev.cls = &s3c2410a_sysclass;
>  	return s3c2410_init();
>  }
> +
> +void s3c2410_restart(char mode, const char *cmd)
> +{
> +	if (mode != 's')
> +		arch_wdt_reset();
> +
> +	soft_restart(0);
> +}
> diff --git a/arch/arm/mach-s3c2440/common.h
> b/arch/arm/mach-s3c2440/common.h new file mode 100644
> index 0000000..db8a98a
> --- /dev/null
> +++ b/arch/arm/mach-s3c2440/common.h
> @@ -0,0 +1,17 @@
> +/*
> + * Copyright (c) 2011 Samsung Electronics Co., Ltd.
> + *		http://www.samsung.com
> + *
> + * Common Header for S3C2440 machines
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __ARCH_ARM_MACH_S3C2440_COMMON_H
> +#define __ARCH_ARM_MACH_S3C2440_COMMON_H
> +
> +void s3c2440_restart(char mode, const char *cmd);
> +
> +#endif /* __ARCH_ARM_MACH_S3C2440_COMMON_H */
> diff --git a/arch/arm/mach-s3c2440/mach-anubis.c
> b/arch/arm/mach-s3c2440/mach-anubis.c index 74f92fc..121ff8d 100644
> --- a/arch/arm/mach-s3c2440/mach-anubis.c
> +++ b/arch/arm/mach-s3c2440/mach-anubis.c
> @@ -55,6 +55,8 @@
>  #include <plat/cpu.h>
>  #include <plat/audio-simtec.h>
> 
> +#include "common.h"
> +
>  #define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics"
> 
>  static struct map_desc anubis_iodesc[] __initdata = {
> @@ -503,4 +505,5 @@ MACHINE_START(ANUBIS, "Simtec-Anubis")
>  	.init_machine	= anubis_init,
>  	.init_irq	= s3c24xx_init_irq,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c
> b/arch/arm/mach-s3c2440/mach-at2440evb.c index 38887ee..b7e334f 100644
> --- a/arch/arm/mach-s3c2440/mach-at2440evb.c
> +++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
> @@ -49,6 +49,8 @@
>  #include <plat/cpu.h>
>  #include <plat/mci.h>
> 
> +#include "common.h"
> +
>  static struct map_desc at2440evb_iodesc[] __initdata = {
>  	/* Nothing here */
>  };
> @@ -238,4 +240,5 @@ MACHINE_START(AT2440EVB, "AT2440EVB")
>  	.init_machine	= at2440evb_init,
>  	.init_irq	= s3c24xx_init_irq,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
> b/arch/arm/mach-s3c2440/mach-gta02.c index de1e0ff..5859e60 100644
> --- a/arch/arm/mach-s3c2440/mach-gta02.c
> +++ b/arch/arm/mach-s3c2440/mach-gta02.c
> @@ -90,6 +90,7 @@
>  #include <plat/iic.h>
>  #include <plat/ts.h>
> 
> +#include "common.h"
> 
>  static struct pcf50633 *gta02_pcf;
> 
> @@ -600,4 +601,5 @@ MACHINE_START(NEO1973_GTA02, "GTA02")
>  	.init_irq	= s3c24xx_init_irq,
>  	.init_machine	= gta02_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c
> b/arch/arm/mach-s3c2440/mach-mini2440.c index 91fe0b4..437322f 100644
> --- a/arch/arm/mach-s3c2440/mach-mini2440.c
> +++ b/arch/arm/mach-s3c2440/mach-mini2440.c
> @@ -60,6 +60,8 @@
> 
>  #include <sound/s3c24xx_uda134x.h>
> 
> +#include "common.h"
> +
>  #define MACH_MINI2440_DM9K_BASE (S3C2410_CS4 + 0x300)
> 
>  static struct map_desc mini2440_iodesc[] __initdata = {
> @@ -681,4 +683,5 @@ MACHINE_START(MINI2440, "MINI2440")
>  	.init_machine	= mini2440_init,
>  	.init_irq	= s3c24xx_init_irq,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c
> b/arch/arm/mach-s3c2440/mach-nexcoder.c index 61c0bf1..40eaf84 100644
> --- a/arch/arm/mach-s3c2440/mach-nexcoder.c
> +++ b/arch/arm/mach-s3c2440/mach-nexcoder.c
> @@ -47,6 +47,8 @@
>  #include <plat/devs.h>
>  #include <plat/cpu.h>
> 
> +#include "common.h"
> +
>  static struct map_desc nexcoder_iodesc[] __initdata = {
>  	/* nothing here yet */
>  };
> @@ -156,4 +158,5 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder
> 2440") .init_machine	= nexcoder_init,
>  	.init_irq	= s3c24xx_init_irq,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/mach-osiris.c
> b/arch/arm/mach-s3c2440/mach-osiris.c index dc142eb..e795715 100644
> --- a/arch/arm/mach-s3c2440/mach-osiris.c
> +++ b/arch/arm/mach-s3c2440/mach-osiris.c
> @@ -54,6 +54,8 @@
>  #include <plat/devs.h>
>  #include <plat/cpu.h>
> 
> +#include "common.h"
> +
>  /* onboard perihperal map */
> 
>  static struct map_desc osiris_iodesc[] __initdata = {
> @@ -452,4 +454,5 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
>  	.init_irq	= s3c24xx_init_irq,
>  	.init_machine	= osiris_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c
> b/arch/arm/mach-s3c2440/mach-rx1950.c index 0d3453b..1c50d3e 100644
> --- a/arch/arm/mach-s3c2440/mach-rx1950.c
> +++ b/arch/arm/mach-s3c2440/mach-rx1950.c
> @@ -62,6 +62,8 @@
> 
>  #include <sound/uda1380.h>
> 
> +#include "common.h"
> +
>  #define LCD_PWM_PERIOD 192960
>  #define LCD_PWM_DUTY 127353
> 
> @@ -832,4 +834,5 @@ MACHINE_START(RX1950, "HP iPAQ RX1950")
>  	.init_irq = s3c24xx_init_irq,
>  	.init_machine = rx1950_init_machine,
>  	.timer = &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c
> b/arch/arm/mach-s3c2440/mach-rx3715.c index e19499c..4d20a01 100644
> --- a/arch/arm/mach-s3c2440/mach-rx3715.c
> +++ b/arch/arm/mach-s3c2440/mach-rx3715.c
> @@ -51,6 +51,8 @@
>  #include <plat/cpu.h>
>  #include <plat/pm.h>
> 
> +#include "common.h"
> +
>  static struct map_desc rx3715_iodesc[] __initdata = {
>  	/* dump ISA space somewhere unused */
> 
> @@ -224,4 +226,5 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
>  	.init_irq	= rx3715_init_irq,
>  	.init_machine	= rx3715_init_machine,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c
> b/arch/arm/mach-s3c2440/mach-smdk2440.c index 36eeb41..1deb60d 100644
> --- a/arch/arm/mach-s3c2440/mach-smdk2440.c
> +++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
> @@ -47,6 +47,8 @@
> 
>  #include <plat/common-smdk.h>
> 
> +#include "common.h"
> +
>  static struct map_desc smdk2440_iodesc[] __initdata = {
>  	/* ISA IO Space map (memory space selected by A24) */
> 
> @@ -181,4 +183,5 @@ MACHINE_START(S3C2440, "SMDK2440")
>  	.map_io		= smdk2440_map_io,
>  	.init_machine	= smdk2440_machine_init,
>  	.timer		= &s3c24xx_timer,
> +	.restart	= s3c2440_restart,
>  MACHINE_END
> diff --git a/arch/arm/mach-s3c2440/s3c2440.c
> b/arch/arm/mach-s3c2440/s3c2440.c index 37f8cc6..01a8dc8 100644
> --- a/arch/arm/mach-s3c2440/s3c2440.c
> +++ b/arch/arm/mach-s3c2440/s3c2440.c
> @@ -35,6 +35,7 @@
>  #include <plat/cpu.h>
>  #include <plat/s3c244x.h>
>  #include <plat/pm.h>
> +#include <plat/watchdog-reset.h>
> 
>  #include <plat/gpio-core.h>
>  #include <plat/gpio-cfg.h>
> @@ -73,3 +74,11 @@ void __init s3c2440_map_io(void)
>  	s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1up;
>  	s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1up;
>  }
> +
> +void s3c2440_restart(char mode, const char *cmd)
> +{
> +	if (mode != 's')
> +		arch_wdt_reset();
> +
> +	soft_restart(0);
> +}
> diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
> index 3c63353..48fb8d8 100644
> --- a/arch/arm/plat-s3c24xx/cpu.c
> +++ b/arch/arm/plat-s3c24xx/cpu.c
> @@ -38,8 +38,6 @@
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
> 
> -#include <mach/system-reset.h>
> -
>  #include <mach/regs-gpio.h>
>  #include <plat/regs-serial.h>
Kukjin Kim Dec. 20, 2011, 1:34 p.m. UTC | #2
On 12/20/11 22:18, Heiko Stübner wrote:
> Am Dienstag, 20. Dezember 2011, 13:48:36 schrieb Kukjin Kim:
>> Hook these platforms restart code into the new restart hook rather
>> than using arch_reset().
>> And adds local header file, common.h in arch/arm/mach-s3c2410/ and
>> arch/arm/mach-s3c2440/ directories.
>>
>> Cc: Ben Dooks<ben-linux@fluff.org>
>> Cc: Russell King<rmk+kernel@arm.linux.org.uk>
>> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> just for my understanding would it not also be possible to move the function
> prototype to plat-samsung/include/plat/s3c2410.h and s3c244x.h?
>
Hi Heiko,

Yeah, we have many choices about that and I will sort out the 
mach-s3c24.. directories to mach-s3c24xx or just mach-s3c...

> Or should these files vanish in the long run?
>
Yes, as per Russell's suggestion, I think we don't need that and as a 
note, I'm working on removing plat-s3c24xx and plat-s5p, just keeping 
one plat-samsung.

>
> Also, if you have a minute could you take a look at the
> [PATCH 1/8] s3c-hsudc: move platform_data struct to global header
> from yesterday, as Felipe Balbi would like an Ack on it.
>
Sure, let me look at that tomorrow with others.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

>
>> ---
>>   arch/arm/mach-s3c2410/common.h                    |   17 +++++++++++++
>>   arch/arm/mach-s3c2410/include/mach/system-reset.h |   27
>> --------------------- arch/arm/mach-s3c2410/include/mach/system.h       |
>>    2 -
>>   arch/arm/mach-s3c2410/mach-amlm5900.c             |    3 ++
>>   arch/arm/mach-s3c2410/mach-bast.c                 |    2 +
>>   arch/arm/mach-s3c2410/mach-h1940.c                |    3 ++
>>   arch/arm/mach-s3c2410/mach-n30.c                  |    4 +++
>>   arch/arm/mach-s3c2410/mach-otom.c                 |    3 ++
>>   arch/arm/mach-s3c2410/mach-qt2410.c               |    5 ++-
>>   arch/arm/mach-s3c2410/mach-smdk2410.c             |    5 ++-
>>   arch/arm/mach-s3c2410/mach-tct_hammer.c           |    3 ++
>>   arch/arm/mach-s3c2410/mach-vr1000.c               |    2 +
>>   arch/arm/mach-s3c2410/s3c2410.c                   |    9 +++++++
>>   arch/arm/mach-s3c2440/common.h                    |   17 +++++++++++++
>>   arch/arm/mach-s3c2440/mach-anubis.c               |    3 ++
>>   arch/arm/mach-s3c2440/mach-at2440evb.c            |    3 ++
>>   arch/arm/mach-s3c2440/mach-gta02.c                |    2 +
>>   arch/arm/mach-s3c2440/mach-mini2440.c             |    3 ++
>>   arch/arm/mach-s3c2440/mach-nexcoder.c             |    3 ++
>>   arch/arm/mach-s3c2440/mach-osiris.c               |    3 ++
>>   arch/arm/mach-s3c2440/mach-rx1950.c               |    3 ++
>>   arch/arm/mach-s3c2440/mach-rx3715.c               |    3 ++
>>   arch/arm/mach-s3c2440/mach-smdk2440.c             |    3 ++
>>   arch/arm/mach-s3c2440/s3c2440.c                   |    9 +++++++
>>   arch/arm/plat-s3c24xx/cpu.c                       |    2 -
>>   25 files changed, 104 insertions(+), 35 deletions(-)
>>   create mode 100644 arch/arm/mach-s3c2410/common.h
>>   delete mode 100644 arch/arm/mach-s3c2410/include/mach/system-reset.h
>>   create mode 100644 arch/arm/mach-s3c2440/common.h
Russell King - ARM Linux Dec. 20, 2011, 9 p.m. UTC | #3
On Tue, Dec 20, 2011 at 09:48:24PM +0900, Kukjin Kim wrote:
> This patch introduces common.[ch] in each SAMSUNG mach- directories
> and implements using new restart hook for Samsung stuff.
> 
> This is against on rmk/devel-stable branch.
> 
> [PATCH 01/12] ARM: S3C64XX: introduce arch/arm/mach-s3c64xx/common.[ch]
> [PATCH 02/12] ARM: restart: S3C64XX: use new restart hook
> [PATCH 03/12] ARM: S5P64X0: introduce arch/arm/mach-s5p64x0/common.[ch]
> [PATCH 04/12] ARM: restart: S5P64X0: use new restart hook
> [PATCH 05/12] ARM: S5PC100: introduce arch/arm/mach-s5pc100/common.[ch]
> [PATCH 06/12] ARM: restart: S5PC100: use new restart hook
> [PATCH 07/12] ARM: S5PV210: introduce arch/arm/mach-s5pv210/common.[ch]
> [PATCH 08/12] ARM: restart: S5PV210: use new restart hook
> [PATCH 09/12] ARM: EXYNOS: introduce arch/arm/mach-exynos/common.[ch]
> [PATCH 10/12] ARM: restart: EXYNOS: use new restart hook
> [PATCH 11/12] ARM: restart: S3C24XX: move SWRST based S3C platforms
> [PATCH 12/12] ARM: restart: S3C24XX: use new restart hook

I think this series looks fine - I'd like the cleanups to be ordered before
any of the other changes (so that the cleanups can be applied to the
restart-cleanup branch and queued into devel-stable independently of the
rest of the restart changes.)

Please submit them to the patch system in a couple of days time (to give
some time for anyone to ack them.)

Thanks.
Kukjin Kim Dec. 21, 2011, 1:37 a.m. UTC | #4
Russell King - ARM Linux wrote:
> 
> On Tue, Dec 20, 2011 at 09:48:24PM +0900, Kukjin Kim wrote:
> > This patch introduces common.[ch] in each SAMSUNG mach- directories
> > and implements using new restart hook for Samsung stuff.
> >
> > This is against on rmk/devel-stable branch.
> >
> > [PATCH 01/12] ARM: S3C64XX: introduce arch/arm/mach-s3c64xx/common.[ch]
> > [PATCH 02/12] ARM: restart: S3C64XX: use new restart hook
> > [PATCH 03/12] ARM: S5P64X0: introduce arch/arm/mach-s5p64x0/common.[ch]
> > [PATCH 04/12] ARM: restart: S5P64X0: use new restart hook
> > [PATCH 05/12] ARM: S5PC100: introduce arch/arm/mach-s5pc100/common.[ch]
> > [PATCH 06/12] ARM: restart: S5PC100: use new restart hook
> > [PATCH 07/12] ARM: S5PV210: introduce arch/arm/mach-s5pv210/common.[ch]
> > [PATCH 08/12] ARM: restart: S5PV210: use new restart hook
> > [PATCH 09/12] ARM: EXYNOS: introduce arch/arm/mach-exynos/common.[ch]
> > [PATCH 10/12] ARM: restart: EXYNOS: use new restart hook
> > [PATCH 11/12] ARM: restart: S3C24XX: move SWRST based S3C platforms
> > [PATCH 12/12] ARM: restart: S3C24XX: use new restart hook
> 
> I think this series looks fine - I'd like the cleanups to be ordered
> before
> any of the other changes (so that the cleanups can be applied to the
> restart-cleanup branch and queued into devel-stable independently of the
> rest of the restart changes.)
> 
OK, let me re-ordered like following.

[PATCH 01/12] ARM: S3C64XX: introduce arch/arm/mach-s3c64xx/common.[ch]
[PATCH 03/12] ARM: S5P64X0: introduce arch/arm/mach-s5p64x0/common.[ch]
[PATCH 05/12] ARM: S5PC100: introduce arch/arm/mach-s5pc100/common.[ch]
[PATCH 07/12] ARM: S5PV210: introduce arch/arm/mach-s5pv210/common.[ch]
[PATCH 09/12] ARM: EXYNOS: introduce arch/arm/mach-exynos/common.[ch]

[PATCH 04/12] ARM: restart: S5P64X0: use new restart hook
[PATCH 06/12] ARM: restart: S5PC100: use new restart hook
[PATCH 08/12] ARM: restart: S5PV210: use new restart hook
[PATCH 10/12] ARM: restart: EXYNOS: use new restart hook
[PATCH 11/12] ARM: restart: S3C24XX: move SWRST based S3C platforms
[PATCH 12/12] ARM: restart: S3C24XX: use new restart hook
[PATCH 02/12] ARM: restart: S3C64XX: use new restart hook

> Please submit them to the patch system in a couple of days time (to give
> some time for anyone to ack them.)
> 
OK, this will be submitted to patch system on FRI and as a note, there were
mis-deleting so I fixed it.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Russell King - ARM Linux Dec. 23, 2011, 7:14 p.m. UTC | #5
On Tue, Dec 20, 2011 at 09:48:31PM +0900, Kukjin Kim wrote:
> This patch introduces common.[ch] which are used only in the
> arch/arm/mach-s5pv210/ directory. The common.c file merges
> the cpu.c and init.c which are used commonly on S5PCV210/S5PC100
> SoC and the common.h local header file replaces with plat/s5pv210.h
> file.

Note that the patch system does _not_ deal in any way with replacing
patch comments.  Comments added against a patch already submitted
to the patch system containing an attributation get _added_ to the
initial comment.

So, it ends up looking like this:

ARM: 7248/1: S5PV210: introduce arch/arm/mach-s5pv210/common.[ch

This patch introduces common.[ch] which are used only in the
arch/arm/mach-s5pv210/ directory. The common.c file merges
the cpu.c and init.c which are used commonly on S5PCV210/S5PC100
SoC and the common.h local header file replaces with plat/s5pv210.h
file.

Comments from Kukjin Kim:

 Subject: [PATCH 04/12] ARM: S5PV210: introduce arch/arm/mach-s5pv210/common.[ch]

 This patch introduces common.[ch] which are used only in the
 arch/arm/mach-s5pv210/ directory. The common.c file merges
 the cpu.c and init.c which are used commonly on S5PCV210/S5PC100
 SoC and the common.h local header file replaces with plat/s5pv210.h
 file.

 ---
 Changes: fixed missing ']' at the end of the subject

Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

which I think you can agree is not good.  If you want to _change_ the
initial comments, please resubmit the patch entirely.
Russell King - ARM Linux Dec. 23, 2011, 7:19 p.m. UTC | #6
On Tue, Dec 20, 2011 at 09:48:33PM +0900, Kukjin Kim wrote:
> This patch introduces common.[ch] which are used only in the
> arch/arm/mach-exynos/ directory. The common.c file merges
> the cpu.c, init.c, irq-combiner.c and irq-eint.c files which
> are used commonly on EXYNOS SoCs and the common.h file replaces
> with plat/exynos4.h file.
> 
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>

It looks like there's some changes made to exynos stuff between -rc1
(which my immutable restart-cleanup branch is based upon) and the base
for this patch which makes it hard to apply:

Patching 7249/1...
git apply --whitespace=fix -p1 --index --check > /tmp/pdb.2292 2>&1 exited with
non-zero status: 256
error: patch failed: arch/arm/mach-exynos/cpu.c:1
error: arch/arm/mach-exynos/cpu.c: patch does not apply

Trying with GNU patch gives:

Patching 7249/1...
patch -p1 -f -EF0 -N --dry-run > /tmp/pdb.2298 2>&1 exited with non-zero status: 256
patching file arch/arm/mach-exynos/Makefile
patching file arch/arm/mach-exynos/clock-exynos4210.c
patching file arch/arm/mach-exynos/clock-exynos4212.c
patching file arch/arm/mach-exynos/clock.c
patching file arch/arm/mach-exynos/common.c
patching file arch/arm/mach-exynos/common.h
patching file arch/arm/mach-exynos/cpu.c
Hunk #1 FAILED at 1.
File arch/arm/mach-exynos/cpu.c is not empty after patch, as expected
1 out of 1 hunk FAILED -- saving rejects to file arch/arm/mach-exynos/cpu.c.rej
patching file arch/arm/mach-exynos/include/mach/map.h
patching file arch/arm/mach-exynos/init.c
patching file arch/arm/mach-exynos/irq-combiner.c
patching file arch/arm/mach-exynos/irq-eint.c
patching file arch/arm/mach-exynos/mach-armlex4210.c
Hunk #1 succeeded at 20 (offset -1 lines).
Hunk #2 succeeded at 27 (offset -1 lines).
Hunk #3 succeeded at 188 (offset -1 lines).
patching file arch/arm/mach-exynos/mach-nuri.c
Hunk #1 succeeded at 37 (offset -1 lines).
Hunk #2 succeeded at 53 (offset -1 lines).
Hunk #3 succeeded at 1284 (offset -1 lines).
patching file arch/arm/mach-exynos/mach-origen.c
Hunk #1 succeeded at 28 (offset -1 lines).
Hunk #2 succeeded at 42 (offset -1 lines).
Hunk #3 succeeded at 639 (offset -1 lines).
patching file arch/arm/mach-exynos/mach-smdk4x12.c
Hunk #1 succeeded at 27 (offset -1 lines).
Hunk #2 succeeded at 35 (offset -1 lines).
Hunk #3 succeeded at 250 (offset -1 lines).
patching file arch/arm/mach-exynos/mach-smdkv310.c
Hunk #1 succeeded at 27 (offset -1 lines).
Hunk #2 succeeded at 42 (offset -1 lines).
Hunk #3 succeeded at 333 (offset -1 lines).
patching file arch/arm/mach-exynos/mach-universal_c210.c
Hunk #1 succeeded at 27 (offset -1 lines).
Hunk #2 succeeded at 46 (offset -1 lines).
Hunk #3 succeeded at 993 (offset -1 lines).
patching file arch/arm/plat-s5p/Makefile
patching file arch/arm/plat-s5p/cpu.c
patching file arch/arm/plat-samsung/include/plat/cpu.h
patching file arch/arm/plat-samsung/include/plat/exynos4.h

So I can't apply this, and this in turn means I can't provide Nicolas with
a tree this evening for his arch_idle changes.

Given the proximity to Christmas, and I'm _not_ planning to work from this
evening until after the new year, things will now have to just sit and wait
until after the festive period.

I'll push out what I have been able to merge later this evening, but it
will not include the exynos patches.
Kukjin Kim Dec. 24, 2011, 1:10 a.m. UTC | #7
Russell King - ARM Linux wrote:
> 
> On Tue, Dec 20, 2011 at 09:48:33PM +0900, Kukjin Kim wrote:
> > This patch introduces common.[ch] which are used only in the
> > arch/arm/mach-exynos/ directory. The common.c file merges
> > the cpu.c, init.c, irq-combiner.c and irq-eint.c files which
> > are used commonly on EXYNOS SoCs and the common.h file replaces
> > with plat/exynos4.h file.
> >
> > Cc: Ben Dooks <ben-linux@fluff.org>
> > Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> 
Hi Russell,

Sorry for my late following up the restart work :(

> It looks like there's some changes made to exynos stuff between -rc1

Yes, some bug has been fixed after -rc1...

> (which my immutable restart-cleanup branch is based upon) and the base
> for this patch which makes it hard to apply:
> 
Oops, I created this based on your devel-stable as per your suggestion and I
couldn't look at 'restart-cleanup' and 'restart' branches in your git,
'http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm.git'
.

> Patching 7249/1...
> git apply --whitespace=fix -p1 --index --check > /tmp/pdb.2292 2>&1 exited
> with
> non-zero status: 256
> error: patch failed: arch/arm/mach-exynos/cpu.c:1
> error: arch/arm/mach-exynos/cpu.c: patch does not apply
> 
> Trying with GNU patch gives:
> 
> Patching 7249/1...
> patch -p1 -f -EF0 -N --dry-run > /tmp/pdb.2298 2>&1 exited with non-zero
> status: 256
> patching file arch/arm/mach-exynos/Makefile
> patching file arch/arm/mach-exynos/clock-exynos4210.c
> patching file arch/arm/mach-exynos/clock-exynos4212.c
> patching file arch/arm/mach-exynos/clock.c
> patching file arch/arm/mach-exynos/common.c
> patching file arch/arm/mach-exynos/common.h
> patching file arch/arm/mach-exynos/cpu.c
> Hunk #1 FAILED at 1.
> File arch/arm/mach-exynos/cpu.c is not empty after patch, as expected
> 1 out of 1 hunk FAILED -- saving rejects to file arch/arm/mach-
> exynos/cpu.c.rej
> patching file arch/arm/mach-exynos/include/mach/map.h
> patching file arch/arm/mach-exynos/init.c
> patching file arch/arm/mach-exynos/irq-combiner.c
> patching file arch/arm/mach-exynos/irq-eint.c
> patching file arch/arm/mach-exynos/mach-armlex4210.c
> Hunk #1 succeeded at 20 (offset -1 lines).
> Hunk #2 succeeded at 27 (offset -1 lines).
> Hunk #3 succeeded at 188 (offset -1 lines).
> patching file arch/arm/mach-exynos/mach-nuri.c
> Hunk #1 succeeded at 37 (offset -1 lines).
> Hunk #2 succeeded at 53 (offset -1 lines).
> Hunk #3 succeeded at 1284 (offset -1 lines).
> patching file arch/arm/mach-exynos/mach-origen.c
> Hunk #1 succeeded at 28 (offset -1 lines).
> Hunk #2 succeeded at 42 (offset -1 lines).
> Hunk #3 succeeded at 639 (offset -1 lines).
> patching file arch/arm/mach-exynos/mach-smdk4x12.c
> Hunk #1 succeeded at 27 (offset -1 lines).
> Hunk #2 succeeded at 35 (offset -1 lines).
> Hunk #3 succeeded at 250 (offset -1 lines).
> patching file arch/arm/mach-exynos/mach-smdkv310.c
> Hunk #1 succeeded at 27 (offset -1 lines).
> Hunk #2 succeeded at 42 (offset -1 lines).
> Hunk #3 succeeded at 333 (offset -1 lines).
> patching file arch/arm/mach-exynos/mach-universal_c210.c
> Hunk #1 succeeded at 27 (offset -1 lines).
> Hunk #2 succeeded at 46 (offset -1 lines).
> Hunk #3 succeeded at 993 (offset -1 lines).
> patching file arch/arm/plat-s5p/Makefile
> patching file arch/arm/plat-s5p/cpu.c
> patching file arch/arm/plat-samsung/include/plat/cpu.h
> patching file arch/arm/plat-samsung/include/plat/exynos4.h
> 
> So I can't apply this, and this in turn means I can't provide Nicolas with
> a tree this evening for his arch_idle changes.
> 
So, isn't there any required my effort for it?

> Given the proximity to Christmas, and I'm _not_ planning to work from this
> evening until after the new year, things will now have to just sit and
> wait
> until after the festive period.

Hmm...yeah...
Anyway, Russell, Merry Christmas to you and your family ;)

> 
> I'll push out what I have been able to merge later this evening, but it
> will not include the exynos patches.

How should I do for including exynos-restart? Please kindly let me know.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Kukjin Kim Dec. 27, 2011, 7:31 a.m. UTC | #8
Kukjin Kim wrote:
> 
> Russell King - ARM Linux wrote:
> >

> > It looks like there's some changes made to exynos stuff between -rc1
> 
> Yes, some bug has been fixed after -rc1...
> 

Hi Russell,

It is not a bug fix after -rc1 in mainline and the changes are from Marc's
commit db0d4db2 ("ARM: gic: allow GIC to support non-banked setups") and
Axel's bug fixes on Marc's patch which are in your devel-stable branch.

If this patch is not on top of Marc's patch, you can meet conflicts when you
merge the reset branch. Nevertheless, I'm sending the cleaned patch(7257/1
and 7258/1) which can be applied based on your restart-cleanup so that you
can apply this easily anyway and in addition, you can apply other
patches(7254/1, 7255/1 and 7256/1) as well.

I think, expected conflicts when you merge your branches can be fixed and if
any problems, please let me know.

As a note, since local common.[ch] which are not based on current samsung
tree have been introduced, we will meet conflicts between this series and my
tree and of course, I will fix then.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Heiko Stübner Jan. 2, 2012, 1:14 p.m. UTC | #9
Hi Kgene,

Am Dienstag, 20. Dezember 2011, 14:34:58 schrieb Kukjin Kim:
> On 12/20/11 22:18, Heiko Stübner wrote:
> > Am Dienstag, 20. Dezember 2011, 13:48:36 schrieb Kukjin Kim:
> >> Hook these platforms restart code into the new restart hook rather
> >> than using arch_reset().
> >> And adds local header file, common.h in arch/arm/mach-s3c2410/ and
> >> arch/arm/mach-s3c2440/ directories.
> >> 
> >> Cc: Ben Dooks<ben-linux@fluff.org>
> >> Cc: Russell King<rmk+kernel@arm.linux.org.uk>
> >> Signed-off-by: Kukjin Kim<kgene.kim@samsung.com>
> > 
> > just for my understanding would it not also be possible to move the
> > function prototype to plat-samsung/include/plat/s3c2410.h and s3c244x.h?
> 
> Yeah, we have many choices about that and I will sort out the
> mach-s3c24.. directories to mach-s3c24xx or just mach-s3c...
> 
> > Or should these files vanish in the long run?
> 
> Yes, as per Russell's suggestion, I think we don't need that and as a
> note, I'm working on removing plat-s3c24xx and plat-s5p, just keeping
> one plat-samsung.

I'm currently working on introducing a power-domain for the usb-phy of the 
S3C2443/S3C2416/S3C2450. This is one step mimicing the work of Mark Brown to 
get better idle handling later on, and also again reduces the number of 
architecture-calls the hsudc driver does, as requested by Felipe Balbi.

Therefore I'm introducing a new s3c2443-pm-common.c. Question now is, should 
this move directly to plat-samsung?

Thanks
Heiko
Mark Brown Jan. 2, 2012, 1:26 p.m. UTC | #10
On Mon, Jan 02, 2012 at 02:14:16PM +0100, Heiko St?bner wrote:

> Therefore I'm introducing a new s3c2443-pm-common.c. Question now is, should 
> this move directly to plat-samsung?

If it's s3c2443 specific I'd expect it'd end up in the relevant mach
directory?
Heiko Stübner Jan. 2, 2012, 1:33 p.m. UTC | #11
Am Montag, 2. Januar 2012, 14:26:31 schrieb Mark Brown:
> On Mon, Jan 02, 2012 at 02:14:16PM +0100, Heiko St?bner wrote:
> > Therefore I'm introducing a new s3c2443-pm-common.c. Question now is,
> > should this move directly to plat-samsung?
> 
> If it's s3c2443 specific I'd expect it'd end up in the relevant mach
> directory?
nope, it's specific to 2443, 2416 and 2450. These three SoCs seem to share a 
lot of features and it seems other common code (i.e. plat-s3c24xx/s3c2443-
clock.c) has got its name from the first SoC that had this feature (the 
S3C2443 in 2007).

Therefore I just continue this naming scheme, as I also don't have a better 
idea on how to identify all three of them at once.

Heiko
Mark Brown Jan. 2, 2012, 1:39 p.m. UTC | #12
On Mon, Jan 02, 2012 at 02:33:57PM +0100, Heiko Stübner wrote:
> Am Montag, 2. Januar 2012, 14:26:31 schrieb Mark Brown:
> > On Mon, Jan 02, 2012 at 02:14:16PM +0100, Heiko St?bner wrote:

> > > Therefore I'm introducing a new s3c2443-pm-common.c. Question now is,
> > > should this move directly to plat-samsung?

> > If it's s3c2443 specific I'd expect it'd end up in the relevant mach
> > directory?

> nope, it's specific to 2443, 2416 and 2450. These three SoCs seem to share a 
> lot of features and it seems other common code (i.e. plat-s3c24xx/s3c2443-
> clock.c) has got its name from the first SoC that had this feature (the 
> S3C2443 in 2007).

Oh, right - that's not terribly clear but I guess.
Kukjin Kim Jan. 3, 2012, 6:08 a.m. UTC | #13
Mark Brown wrote:
> 
> On Mon, Jan 02, 2012 at 02:33:57PM +0100, Heiko Stübner wrote:
> > Am Montag, 2. Januar 2012, 14:26:31 schrieb Mark Brown:
> > > On Mon, Jan 02, 2012 at 02:14:16PM +0100, Heiko St?bner wrote:
> 
> > > > Therefore I'm introducing a new s3c2443-pm-common.c. Question now
is,
> > > > should this move directly to plat-samsung?
> 
> > > If it's s3c2443 specific I'd expect it'd end up in the relevant mach
> > > directory?
> 
> > nope, it's specific to 2443, 2416 and 2450. These three SoCs seem to
> share a
> > lot of features and it seems other common code (i.e. plat-
> s3c24xx/s3c2443-
> > clock.c) has got its name from the first SoC that had this feature (the
> > S3C2443 in 2007).
> 
> Oh, right - that's not terribly clear but I guess.

Heiko, I think your file can be placed in plat-s3c24xx/ now and if required,
I will move them into plat-samsung or just mach-s3c24xx. I mean I'm sorting
out the mach-s3c2410/, mach-s3c2412/, mach-s3c2416/, mach-s3c2440/ and
mach-s3c2443 directories too.

As a note, the working of one plat-samsung will be finished next time for
v3.4.

Happy New Year.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Russell King - ARM Linux Jan. 3, 2012, 10:41 a.m. UTC | #14
On Tue, Dec 27, 2011 at 04:31:52PM +0900, Kukjin Kim wrote:
> Kukjin Kim wrote:
> > 
> > Russell King - ARM Linux wrote:
> > >
> 
> > > It looks like there's some changes made to exynos stuff between -rc1
> > 
> > Yes, some bug has been fixed after -rc1...
> > 
> 
> Hi Russell,
> 
> It is not a bug fix after -rc1 in mainline and the changes are from Marc's
> commit db0d4db2 ("ARM: gic: allow GIC to support non-banked setups") and
> Axel's bug fixes on Marc's patch which are in your devel-stable branch.
> 
> If this patch is not on top of Marc's patch, you can meet conflicts when you
> merge the reset branch. Nevertheless, I'm sending the cleaned patch(7257/1
> and 7258/1) which can be applied based on your restart-cleanup so that you
> can apply this easily anyway and in addition, you can apply other
> patches(7254/1, 7255/1 and 7256/1) as well.
> 
> I think, expected conflicts when you merge your branches can be fixed and if
> any problems, please let me know.
> 
> As a note, since local common.[ch] which are not based on current samsung
> tree have been introduced, we will meet conflicts between this series and my
> tree and of course, I will fix then.

Right, so this is _still_ giving me problems.  7257/1 now applies.  7258/1
combines my patch "ARM: restart: exynos4: use new restart hook XXX WIP XXX
WHY IS THERE NO LOCAL HEADERS IN arch/arm/mach-exynos4 XXX" with an update
from you for the new common.h header, and my "ARM: restart: plat-samsung:
remove plat/reset.h and s5p_reset_hook" patch.

This is wrong - s5p_reset_hook is used by other Samsung platforms as well,
and its removal can only happen after _all_ the other platforms have been
converted.  If I place your exynos patchs before the other Samsung patches
(I'm keeping the platforms in alphabetical order) then things will break.

Please regenerate 7258/1 without my "ARM: restart: plat-samsung:
remove plat/reset.h and s5p_reset_hook" patch combined.

Thanks.
Kukjin Kim Jan. 3, 2012, 10:49 a.m. UTC | #15
Russell King - ARM Linux wrote:
> 
> On Tue, Dec 27, 2011 at 04:31:52PM +0900, Kukjin Kim wrote:
> > Kukjin Kim wrote:
> > >
> > > Russell King - ARM Linux wrote:
> > > >
> >
> > > > It looks like there's some changes made to exynos stuff between -rc1
> > >
> > > Yes, some bug has been fixed after -rc1...
> > >
> >
> > Hi Russell,
> >
> > It is not a bug fix after -rc1 in mainline and the changes are from
> Marc's
> > commit db0d4db2 ("ARM: gic: allow GIC to support non-banked setups") and
> > Axel's bug fixes on Marc's patch which are in your devel-stable branch.
> >
> > If this patch is not on top of Marc's patch, you can meet conflicts when
> you
> > merge the reset branch. Nevertheless, I'm sending the cleaned
> patch(7257/1
> > and 7258/1) which can be applied based on your restart-cleanup so that
> you
> > can apply this easily anyway and in addition, you can apply other
> > patches(7254/1, 7255/1 and 7256/1) as well.
> >
> > I think, expected conflicts when you merge your branches can be fixed
> and if
> > any problems, please let me know.
> >
> > As a note, since local common.[ch] which are not based on current
> samsung
> > tree have been introduced, we will meet conflicts between this series
> and my
> > tree and of course, I will fix then.
> 
> Right, so this is _still_ giving me problems.  7257/1 now applies.  7258/1
> combines my patch "ARM: restart: exynos4: use new restart hook XXX WIP XXX
> WHY IS THERE NO LOCAL HEADERS IN arch/arm/mach-exynos4 XXX" with an update
> from you for the new common.h header, and my "ARM: restart: plat-samsung:
> remove plat/reset.h and s5p_reset_hook" patch.
> 
> This is wrong - s5p_reset_hook is used by other Samsung platforms as well,

Hmm..I thought the s5p_reset_hook() is not used more on other S5P SoCs,
because it has been already cleaned up for S5P64X0, S5PC100 and S5PV210.
Anyway, either way ok to me :)

> and its removal can only happen after _all_ the other platforms have been
> converted.  If I place your exynos patchs before the other Samsung patches
> (I'm keeping the platforms in alphabetical order) then things will break.
> 
> Please regenerate 7258/1 without my "ARM: restart: plat-samsung:
> remove plat/reset.h and s5p_reset_hook" patch combined.
> 

OK, let me do it soon.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Russell King - ARM Linux Jan. 3, 2012, 10:54 a.m. UTC | #16
On Tue, Jan 03, 2012 at 07:49:18PM +0900, Kukjin Kim wrote:
> Russell King - ARM Linux wrote:
> > Right, so this is _still_ giving me problems.  7257/1 now applies.  7258/1
> > combines my patch "ARM: restart: exynos4: use new restart hook XXX WIP XXX
> > WHY IS THERE NO LOCAL HEADERS IN arch/arm/mach-exynos4 XXX" with an update
> > from you for the new common.h header, and my "ARM: restart: plat-samsung:
> > remove plat/reset.h and s5p_reset_hook" patch.
> > 
> > This is wrong - s5p_reset_hook is used by other Samsung platforms as well,
> 
> Hmm..I thought the s5p_reset_hook() is not used more on other S5P SoCs,
> because it has been already cleaned up for S5P64X0, S5PC100 and S5PV210.
> Anyway, either way ok to me :)

It's removed by 7252/1 (s5pv210) - what I'm saying is that 'alphabetical'
means that the exynos change should come before 7252/1, and because exynos
removes the s5p_reset_hook (which is shared between s5pv210 and exynos)
things break.

This is exactly why I kept the change separate: it means that the ordering
of the platform specific patches is irrelevant: what matters is that the
ordering of platform specific patches to the common patches.  It means
you don't have to remember that one of the platform specific patches also
touches common code and must be last.

> > and its removal can only happen after _all_ the other platforms have been
> > converted.  If I place your exynos patchs before the other Samsung patches
> > (I'm keeping the platforms in alphabetical order) then things will break.
> > 
> > Please regenerate 7258/1 without my "ARM: restart: plat-samsung:
> > remove plat/reset.h and s5p_reset_hook" patch combined.
> 
> OK, let me do it soon.

Thanks.
Kukjin Kim Jan. 3, 2012, 11:01 a.m. UTC | #17
Russell King - ARM Linux wrote:
> 
> On Tue, Jan 03, 2012 at 07:49:18PM +0900, Kukjin Kim wrote:
> > Russell King - ARM Linux wrote:
> > > Right, so this is _still_ giving me problems.  7257/1 now applies.
> 7258/1
> > > combines my patch "ARM: restart: exynos4: use new restart hook XXX WIP
> XXX
> > > WHY IS THERE NO LOCAL HEADERS IN arch/arm/mach-exynos4 XXX" with an
> update
> > > from you for the new common.h header, and my "ARM: restart: plat-
> samsung:
> > > remove plat/reset.h and s5p_reset_hook" patch.
> > >
> > > This is wrong - s5p_reset_hook is used by other Samsung platforms as
> well,
> >
> > Hmm..I thought the s5p_reset_hook() is not used more on other S5P SoCs,
> > because it has been already cleaned up for S5P64X0, S5PC100 and S5PV210.
> > Anyway, either way ok to me :)
> 
> It's removed by 7252/1 (s5pv210) - what I'm saying is that 'alphabetical'
> means that the exynos change should come before 7252/1, and because exynos
> removes the s5p_reset_hook (which is shared between s5pv210 and exynos)
> things break.
> 
Ah ha :)

> This is exactly why I kept the change separate: it means that the ordering
> of the platform specific patches is irrelevant: what matters is that the
> ordering of platform specific patches to the common patches.  It means
> you don't have to remember that one of the platform specific patches also
> touches common code and must be last.
> 
OK, I see. This approach is good.

> > > and its removal can only happen after _all_ the other platforms have
> been
> > > converted.  If I place your exynos patchs before the other Samsung
> patches
> > > (I'm keeping the platforms in alphabetical order) then things will
> break.
> > >
> > > Please regenerate 7258/1 without my "ARM: restart: plat-samsung:
> > > remove plat/reset.h and s5p_reset_hook" patch combined.
> >
> > OK, let me do it soon.
> 
> Thanks.

I sent updated one to patch system.
If any problems, please kindly let me know.

Happy New Year!
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Russell King - ARM Linux Jan. 3, 2012, 11:20 a.m. UTC | #18
On Tue, Jan 03, 2012 at 08:01:15PM +0900, Kukjin Kim wrote:
> If any problems, please kindly let me know.

Right, this looks better.  I'm now left with one remaining bit:

arch/arm/mach-exynos/include/mach/system.h:#include <plat/system-reset.h>
arch/arm/plat-s3c24xx/cpu.c:#include <plat/system-reset.h>
arch/arm/mach-s3c64xx/include/mach/system.h:#include <plat/system-reset.h>
arch/arm/mach-s3c2410/include/mach/system.h:#include <plat/system-reset.h>

and:

arch/arm/plat-samsung/include/plat/system-reset.h:
...
#include <plat/watchdog-reset.h>

static void arch_reset(char mode, const char *cmd)
{
        arch_wdt_reset();
}

I assume that with all the patches I now have merged, arch_reset()
should never be called on any Samsung platform, and so the include of
plat/watchdog-reset.h and call of arch_wdt_reset() can be removed in
my "ARM: restart: plat-samsung: remove plat/reset.h and s5p_reset_hook"
patch?

What about arch/arm/plat-s3c24xx/cpu.c's include of system-reset.h?
Does that need to be replaced with watchdog-reset.h?

That then leads to "ARM: restart: remove the now empty arch_reset()"
removing system-reset.h and all includes of that file?
Russell King - ARM Linux Jan. 3, 2012, 11:51 a.m. UTC | #19
On Tue, Dec 20, 2011 at 09:48:26PM +0900, Kukjin Kim wrote:
> diff --git a/arch/arm/mach-s3c64xx/include/mach/system.h b/arch/arm/mach-s3c64xx/include/mach/system.h
> index d8ca578..353ed43 100644
> --- a/arch/arm/mach-s3c64xx/include/mach/system.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/system.h
> @@ -11,20 +11,9 @@
>  #ifndef __ASM_ARCH_SYSTEM_H
>  #define __ASM_ARCH_SYSTEM_H __FILE__
>  
> -#include <plat/watchdog-reset.h>
> -
>  static void arch_idle(void)
>  {
>  	/* nothing here yet */
>  }
>  
> -static void arch_reset(char mode, const char *cmd)
> -{
> -	if (mode != 's')
> -		arch_wdt_reset();
> -
> -	/* if all else fails, or mode was for soft, jump to 0 */
> -	soft_restart(0);
> -}
> -

I just noticed this: if this comes before "ARM: restart: remove the now
empty arch_reset()" (which it has to) then this will induce a build
error.

If you have added all the necessary .restart hooks, then this patch should
remove the _contents_ of arch_reset() but leave the function there.  The
"ARM: restart: remove the now empty arch_reset()" is the earliest point
at which arch_reset() can be safely removed from any platform (and that
can only happen _after_ platforms we care about have been converted.)

The dependency chain is:

1. Base restart changes + restart cleanups.
2. Platforms adding their .restart hooks, emptying arch_reset() as they're
   fully converted.
Then, once all platforms we care about are converted:
3. Removal of code calling arch_reset().
4. Removal of all empty arch_reset() functions and any header files left
   empty at this point.

So, a patch combining (2) and (4) really doesn't work.
Kukjin Kim Jan. 3, 2012, 11:54 a.m. UTC | #20
Russell King - ARM Linux wrote:
> 
> On Tue, Jan 03, 2012 at 08:01:15PM +0900, Kukjin Kim wrote:
> > If any problems, please kindly let me know.
> 
> Right, this looks better.  I'm now left with one remaining bit:
> 
> arch/arm/mach-exynos/include/mach/system.h:#include <plat/system-reset.h>
> arch/arm/plat-s3c24xx/cpu.c:#include <plat/system-reset.h>
> arch/arm/mach-s3c64xx/include/mach/system.h:#include <plat/system-reset.h>
> arch/arm/mach-s3c2410/include/mach/system.h:#include <plat/system-reset.h>
> 

And,

arch/arm/mach-s5p64x0/include/mach/system.h:#include <plat/system-reset.h>
arch/arm/mach-s5pc100/include/mach/system.h:#include <plat/system-reset.h>
arch/arm/mach-s5pv210/include/mach/system.h:#include <plat/system-reset.h>

> and:
> 
> arch/arm/plat-samsung/include/plat/system-reset.h:
> ...
> #include <plat/watchdog-reset.h>
> 
> static void arch_reset(char mode, const char *cmd)
> {
>         arch_wdt_reset();
> }
> 
> I assume that with all the patches I now have merged, arch_reset()
> should never be called on any Samsung platform, and so the include of
> plat/watchdog-reset.h and call of arch_wdt_reset() can be removed in
> my "ARM: restart: plat-samsung: remove plat/reset.h and s5p_reset_hook"
> patch?
> 
Yes, if we don't need arch_reset() anymore, we can remove them in your
patch.

But I'm not sure, because happened following build error. Russell, don't we
need arch_reset()?

arch/arm/kernel/process.c: In function 'arm_machine_restart':
arch/arm/kernel/process.c:127: error: implicit declaration of function
'arch_reset'

> What about arch/arm/plat-s3c24xx/cpu.c's include of system-reset.h?
> Does that need to be replaced with watchdog-reset.h?
> 
> That then leads to "ARM: restart: remove the now empty arch_reset()"
> removing system-reset.h and all includes of that file?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Kukjin Kim Jan. 3, 2012, 12:07 p.m. UTC | #21
Russell King - ARM Linux wrote:
> 
> On Tue, Jan 03, 2012 at 08:54:17PM +0900, Kukjin Kim wrote:
> > Russell King - ARM Linux wrote:
> > >
> > > On Tue, Jan 03, 2012 at 08:01:15PM +0900, Kukjin Kim wrote:
> > > > If any problems, please kindly let me know.
> > >
> > > Right, this looks better.  I'm now left with one remaining bit:
> > >
> > > arch/arm/mach-exynos/include/mach/system.h:#include <plat/system-
> reset.h>
> > > arch/arm/plat-s3c24xx/cpu.c:#include <plat/system-reset.h>
> > > arch/arm/mach-s3c64xx/include/mach/system.h:#include <plat/system-
> reset.h>
> > > arch/arm/mach-s3c2410/include/mach/system.h:#include <plat/system-
> reset.h>
> > >
> >
> > And,
> >
> > arch/arm/mach-s5p64x0/include/mach/system.h:#include <plat/system-
> reset.h>
> > arch/arm/mach-s5pc100/include/mach/system.h:#include <plat/system-
> reset.h>
> > arch/arm/mach-s5pv210/include/mach/system.h:#include <plat/system-
> reset.h>
> >
> > > and:
> > >
> > > arch/arm/plat-samsung/include/plat/system-reset.h:
> > > ...
> > > #include <plat/watchdog-reset.h>
> > >
> > > static void arch_reset(char mode, const char *cmd)
> > > {
> > >         arch_wdt_reset();
> > > }
> > >
> > > I assume that with all the patches I now have merged, arch_reset()
> > > should never be called on any Samsung platform, and so the include of
> > > plat/watchdog-reset.h and call of arch_wdt_reset() can be removed in
> > > my "ARM: restart: plat-samsung: remove plat/reset.h and
> s5p_reset_hook"
> > > patch?
> > >
> > Yes, if we don't need arch_reset() anymore, we can remove them in your
> > patch.
> >
> > But I'm not sure, because happened following build error. Russell, don't
> we
> > need arch_reset()?
> >
> > arch/arm/kernel/process.c: In function 'arm_machine_restart':
> > arch/arm/kernel/process.c:127: error: implicit declaration of function
> > 'arch_reset'
> >
> > > What about arch/arm/plat-s3c24xx/cpu.c's include of system-reset.h?
> > > Does that need to be replaced with watchdog-reset.h?
> > >
> > > That then leads to "ARM: restart: remove the now empty arch_reset()"
> > > removing system-reset.h and all includes of that file?
> >
> > Thanks.
> 
> Oh god, I see what you've done.
> 
> ARM: 7256/1: restart: S3C64XX: use new restart hook
> 
> --- a/arch/arm/mach-s3c64xx/include/mach/system.h
> +++ b/arch/arm/mach-s3c64xx/include/mach/system.h
> ...
> -#include <plat/watchdog-reset.h>
> +#include <plat/system-reset.h>
> ...
> -static void arch_reset(char mode, const char *cmd)
> -{
> -       if (mode != 's')
> -               arch_wdt_reset();
> -
> -       /* if all else fails, or mode was for soft, jump to 0 */
> -       soft_restart(0);
> -}
> 
> So we're making everything depend on plat/system-reset.h.  Why?  The
> end result is to remove arch_reset() entirely, and making it depend
> on some common definition in some shared header file makes things
> more complicated and is error prone.  How do I know when everything
> is fixed up as far as the shared header file goes?
> 
> It would be _far_ better if the s3c64xx changes to add the .restart
> method to _all_ s3c64xx platforms also removed the _contents_ and
> only the _contents_ of arch_reset(), leaving an empty function there.

Ooooops :( I see. Let me fix.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.