From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon, 9 Jan 2012 22:28:38 +0000 (-0800)
Subject: Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
X-Git-Tag: v3.3-rc1~143
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dfc1ebe76663d582a01c9dc572395cf8086d01de;p=users%2Fjedix%2Flinux-maple.git

Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Device tree conversions for samsung and tegra

Both platforms had some initial device tree support, but this adds
much more to actually make it usable.

* tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (45 commits)
  ARM: dts: Add intial dts file for EXYNOS4210 SoC, SMDKV310 and ORIGEN
  ARM: EXYNOS: Add Exynos4 device tree enabled board file
  rtc: rtc-s3c: Add device tree support
  input: samsung-keypad: Add device tree support
  ARM: S5PV210: Modify platform data for pl330 driver
  ARM: S5PC100: Modify platform data for pl330 driver
  ARM: S5P64x0: Modify platform data for pl330 driver
  ARM: EXYNOS: Add a alias for pdma clocks
  ARM: EXYNOS: Limit usage of pl330 device instance to non-dt build
  ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers
  DMA: PL330: Add device tree support
  ARM: EXYNOS: Modify platform data for pl330 driver
  DMA: PL330: Infer transfer direction from transfer request instead of platform data
  DMA: PL330: move filter function into driver
  serial: samsung: Fix build for non-Exynos4210 devices
  serial: samsung: add device tree support
  serial: samsung: merge probe() function from all SoC specific extensions
  serial: samsung: merge all SoC specific port reset functions
  ARM: SAMSUNG: register uart clocks to clock lookup list
  serial: samsung: remove all uses of get_clksrc and set_clksrc
  ...

Fix up fairly trivial conflicts in arch/arm/mach-s3c2440/clock.c and
drivers/tty/serial/Kconfig both due to just adding code close to
changes.
---

dfc1ebe76663d582a01c9dc572395cf8086d01de
diff --cc arch/arm/mach-exynos/common.c
index 647c8434610c,b4beb7e2b5b8..c59e18871006
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@@ -457,18 -470,9 +471,9 @@@ int __init exynos_init(void
  	/* set idle function */
  	pm_idle = exynos_idle;
  
 -	return sysdev_register(&exynos4_sysdev);
 +	return device_register(&exynos4_dev);
  }
  
- static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = {
- 	[0] = {
- 		.name		= "uclk1",
- 		.divisor	= 1,
- 		.min_baud	= 0,
- 		.max_baud	= 0,
- 	},
- };
- 
  /* uart registration process */
  
  void __init exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no)
diff --cc arch/arm/mach-s3c2410/s3c2410.c
index eea559ec7a58,dad596332c5e..061b6bb1a557
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@@ -130,11 -135,11 +135,12 @@@ void __init s3c2410_init_clocks(int xta
  	s3c2410_setup_clocks();
  	s3c2410_baseclk_add();
  	s3c24xx_register_clock(&s3c2410_armclk);
+ 	clkdev_add_table(s3c2410_clk_lookup, ARRAY_SIZE(s3c2410_clk_lookup));
  }
  
 -struct sysdev_class s3c2410_sysclass = {
 +struct bus_type s3c2410_subsys = {
  	.name = "s3c2410-core",
 +	.dev_name = "s3c2410-core",
  };
  
  /* Note, we would have liked to name this s3c2410-core, but we cannot
diff --cc arch/arm/mach-s3c2440/clock.c
index d8957592fdc4,c9879af42b08..bedbc87a3426
--- a/arch/arm/mach-s3c2440/clock.c
+++ b/arch/arm/mach-s3c2440/clock.c
@@@ -107,7 -110,47 +109,47 @@@ static struct clk s3c2440_clk_ac97 = 
  	.ctrlbit	= S3C2440_CLKCON_CAMERA,
  };
  
+ static unsigned long  s3c2440_fclk_n_getrate(struct clk *clk)
+ {
+ 	unsigned long ucon0, ucon1, ucon2, divisor;
+ 
+ 	/* the fun of calculating the uart divisors on the s3c2440 */
+ 	ucon0 = __raw_readl(S3C24XX_VA_UART0 + S3C2410_UCON);
+ 	ucon1 = __raw_readl(S3C24XX_VA_UART1 + S3C2410_UCON);
+ 	ucon2 = __raw_readl(S3C24XX_VA_UART2 + S3C2410_UCON);
+ 
+ 	ucon0 &= S3C2440_UCON0_DIVMASK;
+ 	ucon1 &= S3C2440_UCON1_DIVMASK;
+ 	ucon2 &= S3C2440_UCON2_DIVMASK;
+ 
+ 	if (ucon0 != 0)
+ 		divisor = (ucon0 >> S3C2440_UCON_DIVSHIFT) + 6;
+ 	else if (ucon1 != 0)
+ 		divisor = (ucon1 >> S3C2440_UCON_DIVSHIFT) + 21;
+ 	else if (ucon2 != 0)
+ 		divisor = (ucon2 >> S3C2440_UCON_DIVSHIFT) + 36;
+ 	else
+ 		/* manual calims 44, seems to be 9 */
+ 		divisor = 9;
+ 
+ 	return clk_get_rate(clk->parent) / divisor;
+ }
+ 
+ static struct clk s3c2440_clk_fclk_n = {
+ 	.name		= "fclk_n",
+ 	.parent		= &clk_f,
+ 	.ops		= &(struct clk_ops) {
+ 		.get_rate	= s3c2440_fclk_n_getrate,
+ 	},
+ };
+ 
+ static struct clk_lookup s3c2440_clk_lookup[] = {
+ 	CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk),
+ 	CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
+ 	CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n),
+ };
+ 
 -static int s3c2440_clk_add(struct sys_device *sysdev)
 +static int s3c2440_clk_add(struct device *dev)
  {
  	struct clk *clock_upll;
  	struct clk *clock_h;
diff --cc arch/arm/mach-s5p64x0/common.c
index 28d0b918cd4b,fcf0778ae5c4..0d50e79fb9fc
--- a/arch/arm/mach-s5p64x0/common.c
+++ b/arch/arm/mach-s5p64x0/common.c
@@@ -279,39 -278,10 +279,10 @@@ int __init s5p64x0_init(void
  	/* set idle function */
  	pm_idle = s5p64x0_idle;
  
 -	return sysdev_register(&s5p64x0_sysdev);
 +	return device_register(&s5p64x0_dev);
  }
  
- static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = {
- 	[0] = {
- 		.name		= "pclk_low",
- 		.divisor	= 1,
- 		.min_baud	= 0,
- 		.max_baud	= 0,
- 	},
- 	[1] = {
- 		.name		= "uclk1",
- 		.divisor	= 1,
- 		.min_baud	= 0,
- 		.max_baud	= 0,
- 	},
- };
- 
  /* uart registration process */
- 
- void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
- {
- 	struct s3c2410_uartcfg *tcfg = cfg;
- 	u32 ucnt;
- 
- 	for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
- 		if (!tcfg->clocks) {
- 			tcfg->clocks = s5p64x0_serial_clocks;
- 			tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks);
- 		}
- 	}
- }
- 
  void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
  {
  	int uart;
diff --cc arch/arm/mach-s5pv210/common.c
index 0ec393305d7c,b9adefd9838e..9c1bcdcc12c3
--- a/arch/arm/mach-s5pv210/common.c
+++ b/arch/arm/mach-s5pv210/common.c
@@@ -251,18 -250,9 +251,9 @@@ int __init s5pv210_init(void
  	/* set idle function */
  	pm_idle = s5pv210_idle;
  
 -	return sysdev_register(&s5pv210_sysdev);
 +	return device_register(&s5pv210_dev);
  }
  
- static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = {
- 	[0] = {
- 		.name		= "pclk",
- 		.divisor	= 1,
- 		.min_baud	= 0,
- 		.max_baud	= 0,
- 	},
- };
- 
  /* uart registration process */
  
  void __init s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no)
diff --cc drivers/gpio/gpio-samsung.c
index ab098ba9f1dd,6b4d23fd158e..a7661773c052
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@@ -22,8 -22,11 +22,11 @@@
  #include <linux/spinlock.h>
  #include <linux/module.h>
  #include <linux/interrupt.h>
 -#include <linux/sysdev.h>
 +#include <linux/device.h>
  #include <linux/ioport.h>
+ #include <linux/of.h>
+ #include <linux/slab.h>
+ #include <linux/of_address.h>
  
  #include <asm/irq.h>
  
diff --cc drivers/tty/serial/Kconfig
index 113fccf82517,fb89b85d0d81..f32a2ea70100
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@@ -500,68 -495,6 +500,28 @@@ config SERIAL_SAMSUNG_CONSOL
  	  your boot loader about how to pass options to the kernel at
  	  boot time.)
  
- config SERIAL_S3C2410
- 	tristate "Samsung S3C2410 Serial port support"
- 	depends on SERIAL_SAMSUNG && CPU_S3C2410
- 	default y if CPU_S3C2410
- 	help
- 	  Serial port support for the Samsung S3C2410 SoC
- 
- config SERIAL_S3C2412
- 	tristate "Samsung S3C2412/S3C2413 Serial port support"
- 	depends on SERIAL_SAMSUNG && CPU_S3C2412
- 	default y if CPU_S3C2412
- 	help
- 	  Serial port support for the Samsung S3C2412 and S3C2413 SoC
- 
- config SERIAL_S3C2440
- 	tristate "Samsung S3C2440/S3C2442/S3C2416 Serial port support"
- 	depends on SERIAL_SAMSUNG && (CPU_S3C2440 || CPU_S3C2442 || CPU_S3C2416)
- 	default y if CPU_S3C2440
- 	default y if CPU_S3C2442
- 	select SERIAL_SAMSUNG_UARTS_4 if CPU_S3C2416
- 	help
- 	  Serial port support for the Samsung S3C2440, S3C2416 and S3C2442 SoC
- 
- config SERIAL_S3C6400
- 	tristate "Samsung S3C6400/S3C6410/S5P6440/S5P6450/S5PC100 Serial port support"
- 	depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 || CPU_S5P6450 || CPU_S5PC100)
- 	select SERIAL_SAMSUNG_UARTS_4
- 	default y
- 	help
- 	  Serial port support for the Samsung S3C6400, S3C6410, S5P6440, S5P6450
- 	  and S5PC100 SoCs
- 
- config SERIAL_S5PV210
- 	tristate "Samsung S5PV210 Serial port support"
- 	depends on SERIAL_SAMSUNG && (CPU_S5PV210 || CPU_EXYNOS4210 || SOC_EXYNOS4212)
- 	select SERIAL_SAMSUNG_UARTS_4 if (CPU_S5PV210 || CPU_EXYNOS4210 || SOC_EXYNOS4212)
- 	default y
- 	help
- 	  Serial port support for Samsung's S5P Family of SoC's
- 
 +config SERIAL_SIRFSOC
 +        tristate "SiRF SoC Platform Serial port support"
 +        depends on ARM && ARCH_PRIMA2
 +        select SERIAL_CORE
 +        help
 +          Support for the on-chip UART on the CSR SiRFprimaII series,
 +          providing /dev/ttySiRF0, 1 and 2 (note, some machines may not
 +          provide all of these ports, depending on how the serial port
 +          pins are configured).
 +
 +config SERIAL_SIRFSOC_CONSOLE
 +        bool "Support for console on SiRF SoC serial port"
 +        depends on SERIAL_SIRFSOC=y
 +        select SERIAL_CORE_CONSOLE
 +        help
 +          Even if you say Y here, the currently visible virtual console
 +          (/dev/tty0) will still be used as the system console by default, but
 +          you can alter that using a kernel command line option such as
 +          "console=ttySiRFx". (Try "man bootparam" or see the documentation of
 +          your boot loader about how to pass options to the kernel at
 +          boot time.)
 +
  config SERIAL_MAX3100
  	tristate "MAX3100 support"
  	depends on SPI