Commit a3d93584 authored by Kukjin Kim's avatar Kukjin Kim

ARM: S5P64X0: Use soc_is_s5p64x0() to distinguish cpu at runtime

Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent c06af3cc
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <mach/regs-clock.h> #include <mach/regs-clock.h>
#include <mach/spi-clocks.h> #include <mach/spi-clocks.h>
#include <plat/cpu.h>
#include <plat/s3c64xx-spi.h> #include <plat/s3c64xx-spi.h>
#include <plat/gpio-cfg.h> #include <plat/gpio-cfg.h>
...@@ -185,11 +186,8 @@ struct platform_device s5p64x0_device_spi1 = { ...@@ -185,11 +186,8 @@ struct platform_device s5p64x0_device_spi1 = {
void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs) void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
{ {
unsigned int id;
struct s3c64xx_spi_info *pd; struct s3c64xx_spi_info *pd;
id = __raw_readl(S5P64X0_SYS_ID) & 0xFF000;
/* Reject invalid configuration */ /* Reject invalid configuration */
if (!num_cs || src_clk_nr < 0 if (!num_cs || src_clk_nr < 0
|| src_clk_nr > S5P64X0_SPI_SRCCLK_SCLK) { || src_clk_nr > S5P64X0_SPI_SRCCLK_SCLK) {
...@@ -199,7 +197,7 @@ void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs) ...@@ -199,7 +197,7 @@ void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
switch (cntrlr) { switch (cntrlr) {
case 0: case 0:
if (id == 0x50000) if (soc_is_s5p6450())
pd = &s5p6450_spi0_pdata; pd = &s5p6450_spi0_pdata;
else else
pd = &s5p6440_spi0_pdata; pd = &s5p6440_spi0_pdata;
...@@ -207,7 +205,7 @@ void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs) ...@@ -207,7 +205,7 @@ void __init s5p64x0_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
s5p64x0_device_spi0.dev.platform_data = pd; s5p64x0_device_spi0.dev.platform_data = pd;
break; break;
case 1: case 1:
if (id == 0x50000) if (soc_is_s5p6450())
pd = &s5p6450_spi1_pdata; pd = &s5p6450_spi1_pdata;
else else
pd = &s5p6440_spi1_pdata; pd = &s5p6440_spi1_pdata;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <mach/irqs.h> #include <mach/irqs.h>
#include <mach/regs-clock.h> #include <mach/regs-clock.h>
#include <plat/cpu.h>
#include <plat/devs.h> #include <plat/devs.h>
#include <plat/s3c-pl330-pdata.h> #include <plat/s3c-pl330-pdata.h>
...@@ -133,11 +134,7 @@ static struct platform_device s5p64x0_device_pdma = { ...@@ -133,11 +134,7 @@ static struct platform_device s5p64x0_device_pdma = {
static int __init s5p64x0_dma_init(void) static int __init s5p64x0_dma_init(void)
{ {
unsigned int id; if (soc_is_s5p6450())
id = __raw_readl(S5P64X0_SYS_ID) & 0xFF000;
if (id == 0x50000)
s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata; s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata;
else else
s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata; s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <mach/regs-gpio.h> #include <mach/regs-gpio.h>
#include <mach/regs-clock.h> #include <mach/regs-clock.h>
#include <plat/cpu.h>
#include <plat/gpio-core.h> #include <plat/gpio-core.h>
#include <plat/gpio-cfg.h> #include <plat/gpio-cfg.h>
#include <plat/gpio-cfg-helpers.h> #include <plat/gpio-cfg-helpers.h>
...@@ -473,14 +474,10 @@ static void __init s5p64x0_gpio_add_rbank_4bit2(struct s3c_gpio_chip *chip, ...@@ -473,14 +474,10 @@ static void __init s5p64x0_gpio_add_rbank_4bit2(struct s3c_gpio_chip *chip,
static int __init s5p64x0_gpiolib_init(void) static int __init s5p64x0_gpiolib_init(void)
{ {
unsigned int chipid;
chipid = __raw_readl(S5P64X0_SYS_ID);
s5p64x0_gpiolib_set_cfg(s5p64x0_gpio_cfgs, s5p64x0_gpiolib_set_cfg(s5p64x0_gpio_cfgs,
ARRAY_SIZE(s5p64x0_gpio_cfgs)); ARRAY_SIZE(s5p64x0_gpio_cfgs));
if ((chipid & 0xff000) == 0x50000) { if (soc_is_s5p6450()) {
samsung_gpiolib_add_2bit_chips(s5p6450_gpio_2bit, samsung_gpiolib_add_2bit_chips(s5p6450_gpio_2bit,
ARRAY_SIZE(s5p6450_gpio_2bit)); ARRAY_SIZE(s5p6450_gpio_2bit));
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/io.h> #include <linux/io.h>
#include <plat/cpu.h>
#include <plat/regs-irqtype.h> #include <plat/regs-irqtype.h>
#include <plat/gpio-cfg.h> #include <plat/gpio-cfg.h>
...@@ -67,7 +68,7 @@ static int s5p64x0_irq_eint_set_type(struct irq_data *data, unsigned int type) ...@@ -67,7 +68,7 @@ static int s5p64x0_irq_eint_set_type(struct irq_data *data, unsigned int type)
__raw_writel(ctrl, S5P64X0_EINT0CON0); __raw_writel(ctrl, S5P64X0_EINT0CON0);
/* Configure the GPIO pin for 6450 or 6440 based on CPU ID */ /* Configure the GPIO pin for 6450 or 6440 based on CPU ID */
if (0x50000 == (__raw_readl(S5P64X0_SYS_ID) & 0xFF000)) if (soc_is_s5p6450())
s3c_gpio_cfgpin(S5P6450_GPN(offs), S3C_GPIO_SFN(2)); s3c_gpio_cfgpin(S5P6450_GPN(offs), S3C_GPIO_SFN(2));
else else
s3c_gpio_cfgpin(S5P6440_GPN(offs), S3C_GPIO_SFN(2)); s3c_gpio_cfgpin(S5P6440_GPN(offs), S3C_GPIO_SFN(2));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment