]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot-samsung
authorWolfgang Denk <wd@denx.de>
Tue, 7 Sep 2010 22:03:22 +0000 (00:03 +0200)
committerWolfgang Denk <wd@denx.de>
Tue, 7 Sep 2010 22:03:22 +0000 (00:03 +0200)
27 files changed:
Makefile
arch/arm/cpu/armv7/s5p-common/Makefile [new file with mode: 0644]
arch/arm/cpu/armv7/s5p-common/cpu_info.c [moved from arch/arm/cpu/armv7/s5pc1xx/cpu_info.c with 83% similarity]
arch/arm/cpu/armv7/s5p-common/timer.c [moved from arch/arm/cpu/armv7/s5pc1xx/timer.c with 86% similarity]
arch/arm/cpu/armv7/s5pc1xx/Makefile
arch/arm/cpu/armv7/s5pc1xx/clock.c
arch/arm/cpu/armv7/s5pc1xx/reset.S
arch/arm/cpu/armv7/s5pc1xx/sromc.c
arch/arm/include/asm/arch-s5pc1xx/clk.h
arch/arm/include/asm/arch-s5pc1xx/cpu.h
arch/arm/include/asm/arch-s5pc1xx/gpio.h
arch/arm/include/asm/arch-s5pc1xx/mmc.h
arch/arm/include/asm/arch-s5pc1xx/pwm.h
board/samsung/goni/goni.c
board/samsung/goni/lowlevel_init.S
board/samsung/smdkc100/lowlevel_init.S
board/samsung/smdkc100/onenand.c
board/samsung/smdkc100/smdkc100.c
common/serial.c
drivers/gpio/Makefile
drivers/mmc/s5p_mmc.c
drivers/mtd/onenand/samsung.c
drivers/serial/Makefile
drivers/serial/serial_s5p.c
include/configs/s5p_goni.h
include/configs/smdkc100.h
include/serial.h

index 4f1cb1b4d1acc531b5423840a0d1d3286dfabbd8..332c79a2bcf55219f0c0df605a67223eae76307d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -253,6 +253,13 @@ ifeq ($(SOC),omap4)
 LIBS += $(CPUDIR)/omap-common/libomap-common.a
 endif
 
+ifeq ($(SOC),s5pc1xx)
+LIBS += $(CPUDIR)/s5p-common/libs5p-common.a
+endif
+ifeq ($(SOC),s5pc2xx)
+LIBS += $(CPUDIR)/s5p-common/libs5p-common.a
+endif
+
 LIBS := $(addprefix $(obj),$(LIBS))
 .PHONY : $(LIBS) $(TIMESTAMP_FILE) $(VERSION_FILE)
 
diff --git a/arch/arm/cpu/armv7/s5p-common/Makefile b/arch/arm/cpu/armv7/s5p-common/Makefile
new file mode 100644 (file)
index 0000000..37371f6
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2009 Samsung Electronics
+# Minkyu Kang <mk7.kang@samsung.com>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)libs5p-common.a
+
+COBJS-y                += cpu_info.o
+COBJS-y                += timer.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y) $(SOBJS))
+
+all:    $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 83%
rename from arch/arm/cpu/armv7/s5pc1xx/cpu_info.c
rename to arch/arm/cpu/armv7/s5p-common/cpu_info.c
index f16c0ff1307dc64ea707aabfa8dd605a18a2db73..2f6c7085546af48580587d23f1847b5b09397801 100644 (file)
 #include <asm/arch/clk.h>
 
 /* Default is s5pc100 */
-unsigned int s5pc1xx_cpu_id = 0xC100;
+unsigned int s5p_cpu_id = 0xC100;
 
 #ifdef CONFIG_ARCH_CPU_INIT
 int arch_cpu_init(void)
 {
-       s5pc1xx_cpu_id = readl(S5PC1XX_PRO_ID);
-       s5pc1xx_cpu_id = 0xC000 | ((s5pc1xx_cpu_id & 0x00FFF000) >> 12);
+       s5p_set_cpu_id();
 
-       s5pc1xx_clock_init();
+       s5p_clock_init();
 
        return 0;
 }
@@ -41,7 +40,7 @@ int arch_cpu_init(void)
 
 u32 get_device_type(void)
 {
-       return s5pc1xx_cpu_id;
+       return s5p_cpu_id;
 }
 
 #ifdef CONFIG_DISPLAY_CPUINFO
@@ -50,7 +49,7 @@ int print_cpuinfo(void)
        char buf[32];
 
        printf("CPU:\tS5P%X@%sMHz\n",
-                       s5pc1xx_cpu_id, strmhz(buf, get_arm_clk()));
+                       s5p_cpu_id, strmhz(buf, get_arm_clk()));
 
        return 0;
 }
similarity index 86%
rename from arch/arm/cpu/armv7/s5pc1xx/timer.c
rename to arch/arm/cpu/armv7/s5p-common/timer.c
index c5df5c5ab53b7a641c64c33252d142cf66560a02..04906503e6e40332507211ac070a3d1054eb6301 100644 (file)
@@ -44,23 +44,20 @@ static unsigned long long timestamp;        /* Monotonic incrementing timer */
 static unsigned long lastdec;          /* Last decremneter snapshot */
 
 /* macro to read the 16 bit timer */
-static inline struct s5pc1xx_timer *s5pc1xx_get_base_timer(void)
+static inline struct s5p_timer *s5p_get_base_timer(void)
 {
-       if (cpu_is_s5pc110())
-               return (struct s5pc1xx_timer *)S5PC110_TIMER_BASE;
-       else
-               return (struct s5pc1xx_timer *)S5PC100_TIMER_BASE;
+       return (struct s5p_timer *)samsung_get_base_timer();
 }
 
 int timer_init(void)
 {
-       struct s5pc1xx_timer *const timer = s5pc1xx_get_base_timer();
+       struct s5p_timer *const timer = s5p_get_base_timer();
        u32 val;
 
        /*
         * @ PWM Timer 4
         * Timer Freq(HZ) =
-        *      PCLK / { (prescaler_value + 1) * (divider_value) }
+        *      PWM_CLK / { (prescaler_value + 1) * (divider_value) }
         */
 
        /* set prescaler : 16 */
@@ -71,7 +68,7 @@ int timer_init(void)
        if (count_value == 0) {
                /* reset initial value */
                /* count_value = 2085937.5(HZ) (per 1 sec)*/
-               count_value = get_pclk() / ((PRESCALER_1 + 1) *
+               count_value = get_pwm_clk() / ((PRESCALER_1 + 1) *
                                (MUX_DIV_2 + 1));
 
                /* count_value / 100 = 20859.375(HZ) (per 10 msec) */
@@ -83,13 +80,13 @@ int timer_init(void)
        lastdec = count_value;
 
        val = (readl(&timer->tcon) & ~(0x07 << TCON_TIMER4_SHIFT)) |
-               S5PC1XX_TCON4_AUTO_RELOAD;
+               TCON4_AUTO_RELOAD;
 
        /* auto reload & manual update */
-       writel(val | S5PC1XX_TCON4_UPDATE, &timer->tcon);
+       writel(val | TCON4_UPDATE, &timer->tcon);
 
        /* start PWM timer 4 */
-       writel(val | S5PC1XX_TCON4_START, &timer->tcon);
+       writel(val | TCON4_START, &timer->tcon);
 
        timestamp = 0;
 
@@ -154,7 +151,7 @@ void __udelay(unsigned long usec)
 
 void reset_timer_masked(void)
 {
-       struct s5pc1xx_timer *const timer = s5pc1xx_get_base_timer();
+       struct s5p_timer *const timer = s5p_get_base_timer();
 
        /* reset time */
        lastdec = readl(&timer->tcnto4);
@@ -163,7 +160,7 @@ void reset_timer_masked(void)
 
 unsigned long get_timer_masked(void)
 {
-       struct s5pc1xx_timer *const timer = s5pc1xx_get_base_timer();
+       struct s5p_timer *const timer = s5p_get_base_timer();
        unsigned long now = readl(&timer->tcnto4);
 
        if (lastdec >= now)
index 3785593d25a4aa9868c265c7d8746224efabe40b..263945f4e77d9b5d0ea8b250acfb4bf5c36efba7 100644 (file)
@@ -32,9 +32,7 @@ SOBJS = cache.o
 SOBJS  += reset.o
 
 COBJS  += clock.o
-COBJS  += cpu_info.o
 COBJS  += sromc.o
-COBJS  += timer.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
index 19619f92cd96bfbea16322ae7446973e3c64ceda..98a27e551dba5a5464e4663c2ead7112c803e5a0 100644 (file)
 #define CONFIG_SYS_CLK_FREQ_C110       24000000
 #endif
 
-unsigned long (*get_pclk)(void);
+unsigned long (*get_uart_clk)(int dev_index);
+unsigned long (*get_pwm_clk)(void);
 unsigned long (*get_arm_clk)(void);
 unsigned long (*get_pll_clk)(int);
 
 /* s5pc110: return pll clock frequency */
 static unsigned long s5pc100_get_pll_clk(int pllreg)
 {
-       struct s5pc100_clock *clk = (struct s5pc100_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc100_clock *clk =
+               (struct s5pc100_clock *)samsung_get_base_clock();
        unsigned long r, m, p, s, mask, fout;
        unsigned int freq;
 
@@ -95,7 +97,8 @@ static unsigned long s5pc100_get_pll_clk(int pllreg)
 /* s5pc100: return pll clock frequency */
 static unsigned long s5pc110_get_pll_clk(int pllreg)
 {
-       struct s5pc110_clock *clk = (struct s5pc110_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc110_clock *clk =
+               (struct s5pc110_clock *)samsung_get_base_clock();
        unsigned long r, m, p, s, mask, fout;
        unsigned int freq;
 
@@ -151,7 +154,8 @@ static unsigned long s5pc110_get_pll_clk(int pllreg)
 /* s5pc110: return ARM clock frequency */
 static unsigned long s5pc110_get_arm_clk(void)
 {
-       struct s5pc110_clock *clk = (struct s5pc110_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc110_clock *clk =
+               (struct s5pc110_clock *)samsung_get_base_clock();
        unsigned long div;
        unsigned long dout_apll, armclk;
        unsigned int apll_ratio;
@@ -170,7 +174,8 @@ static unsigned long s5pc110_get_arm_clk(void)
 /* s5pc100: return ARM clock frequency */
 static unsigned long s5pc100_get_arm_clk(void)
 {
-       struct s5pc100_clock *clk = (struct s5pc100_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc100_clock *clk =
+               (struct s5pc100_clock *)samsung_get_base_clock();
        unsigned long div;
        unsigned long dout_apll, armclk;
        unsigned int apll_ratio, arm_ratio;
@@ -191,7 +196,8 @@ static unsigned long s5pc100_get_arm_clk(void)
 /* s5pc100: return HCLKD0 frequency */
 static unsigned long get_hclk(void)
 {
-       struct s5pc100_clock *clk = (struct s5pc100_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc100_clock *clk =
+               (struct s5pc100_clock *)samsung_get_base_clock();
        unsigned long hclkd0;
        uint div, d0_bus_ratio;
 
@@ -207,7 +213,8 @@ static unsigned long get_hclk(void)
 /* s5pc100: return PCLKD1 frequency */
 static unsigned long get_pclkd1(void)
 {
-       struct s5pc100_clock *clk = (struct s5pc100_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc100_clock *clk =
+               (struct s5pc100_clock *)samsung_get_base_clock();
        unsigned long d1_bus, pclkd1;
        uint div, d1_bus_ratio, pclkd1_ratio;
 
@@ -227,7 +234,8 @@ static unsigned long get_pclkd1(void)
 /* s5pc110: return HCLKs frequency */
 static unsigned long get_hclk_sys(int dom)
 {
-       struct s5pc110_clock *clk = (struct s5pc110_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc110_clock *clk =
+               (struct s5pc110_clock *)samsung_get_base_clock();
        unsigned long hclk;
        unsigned int div;
        unsigned int offset;
@@ -255,7 +263,8 @@ static unsigned long get_hclk_sys(int dom)
 /* s5pc110: return PCLKs frequency */
 static unsigned long get_pclk_sys(int dom)
 {
-       struct s5pc110_clock *clk = (struct s5pc110_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc110_clock *clk =
+               (struct s5pc110_clock *)samsung_get_base_clock();
        unsigned long pclk;
        unsigned int div;
        unsigned int offset;
@@ -289,15 +298,33 @@ static unsigned long s5pc100_get_pclk(void)
        return get_pclkd1();
 }
 
-void s5pc1xx_clock_init(void)
+/* s5pc1xx: return uart clock frequency */
+static unsigned long s5pc1xx_get_uart_clk(int dev_index)
+{
+       if (cpu_is_s5pc110())
+               return s5pc110_get_pclk();
+       else
+               return s5pc100_get_pclk();
+}
+
+/* s5pc1xx: return pwm clock frequency */
+static unsigned long s5pc1xx_get_pwm_clk(void)
+{
+       if (cpu_is_s5pc110())
+               return s5pc110_get_pclk();
+       else
+               return s5pc100_get_pclk();
+}
+
+void s5p_clock_init(void)
 {
        if (cpu_is_s5pc110()) {
                get_pll_clk = s5pc110_get_pll_clk;
                get_arm_clk = s5pc110_get_arm_clk;
-               get_pclk = s5pc110_get_pclk;
        } else {
                get_pll_clk = s5pc100_get_pll_clk;
                get_arm_clk = s5pc100_get_arm_clk;
-               get_pclk = s5pc100_get_pclk;
        }
+       get_uart_clk = s5pc1xx_get_uart_clk;
+       get_pwm_clk = s5pc1xx_get_pwm_clk;
 }
index 7f6ff9c35f2be2fecc42920fc587787650b5a4d7..70fa146cf38501b76db5daa9c9caa7e6700f743f 100644 (file)
@@ -28,7 +28,7 @@
 
 .globl reset_cpu
 reset_cpu:
-       ldr     r1, =S5PC1XX_PRO_ID
+       ldr     r1, =S5PC100_PRO_ID
        ldr     r2, [r1]
        ldr     r4, =0x00010000
        and     r4, r2, r4
index 380be81be5e79921259e447c8b01db83b8aa9954..044d12298db3473ecb89af2d42633fb8ce42dea9 100644 (file)
 void s5pc1xx_config_sromc(u32 srom_bank, u32 smc_bw_conf, u32 smc_bc_conf)
 {
        u32 tmp;
-       struct s5pc1xx_smc *srom;
-
-       if (cpu_is_s5pc100())
-               srom = (struct s5pc1xx_smc *)S5PC100_SROMC_BASE;
-       else
-               srom = (struct s5pc1xx_smc *)S5PC110_SROMC_BASE;
+       struct s5pc1xx_smc *srom =
+               (struct s5pc1xx_smc *)samsung_get_base_sromc();
 
        /* Configure SMC_BW register to handle proper SROMC bank */
        tmp = srom->bw;
index 3e59abe78c65142b84aeb43353174eb4915d6d35..3488eb7c1574ec7b479e80be9169cdf3f022fa45 100644 (file)
 #define HPLL   3
 #define VPLL   4
 
-void s5pc1xx_clock_init(void);
+void s5p_clock_init(void);
 
 extern unsigned long (*get_pll_clk)(int pllreg);
 extern unsigned long (*get_arm_clk)(void);
-extern unsigned long (*get_pclk)(void);
+extern unsigned long (*get_pwm_clk)(void);
+extern unsigned long (*get_uart_clk)(int dev_index);
 
 #endif
index b3af8cc782af8ad52ea22acc818c1575ae007e7c..e74959fe222e464cb3054f253a8dd86e8b7b45a4 100644 (file)
@@ -25,9 +25,9 @@
 
 #define S5PC1XX_ADDR_BASE      0xE0000000
 
-#define S5PC1XX_CLOCK_BASE     0xE0100000
-
 /* S5PC100 */
+#define S5PC100_PRO_ID         0xE0000000
+#define S5PC100_CLOCK_BASE     0xE0100000
 #define S5PC100_GPIO_BASE      0xE0300000
 #define S5PC100_VIC0_BASE      0xE4000000
 #define S5PC100_VIC1_BASE      0xE4100000
@@ -41,6 +41,8 @@
 #define S5PC100_MMC_BASE       0xED800000
 
 /* S5PC110 */
+#define S5PC110_PRO_ID         0xE0000000
+#define S5PC110_CLOCK_BASE     0xE0100000
 #define S5PC110_GPIO_BASE      0xE0200000
 #define S5PC110_PWMTIMER_BASE  0xE2500000
 #define S5PC110_WATCHDOG_BASE  0xE2700000
 #define S5PC110_VIC2_BASE      0xF2200000
 #define S5PC110_VIC3_BASE      0xF2300000
 
-/* Chip ID */
-#define S5PC1XX_PRO_ID         0xE0000000
-
 #ifndef __ASSEMBLY__
+#include <asm/io.h>
 /* CPU detection macros */
-extern unsigned int s5pc1xx_cpu_id;
+extern unsigned int s5p_cpu_id;
+
+static inline void s5p_set_cpu_id(void)
+{
+       s5p_cpu_id = readl(S5PC100_PRO_ID);
+       s5p_cpu_id = 0xC000 | ((s5p_cpu_id & 0x00FFF000) >> 12);
+}
 
 #define IS_SAMSUNG_TYPE(type, id)                      \
 static inline int cpu_is_##type(void)                  \
 {                                                      \
-       return s5pc1xx_cpu_id == id ? 1 : 0;            \
+       return s5p_cpu_id == id ? 1 : 0;                \
 }
 
 IS_SAMSUNG_TYPE(s5pc100, 0xc100)
 IS_SAMSUNG_TYPE(s5pc110, 0xc110)
+
+#define SAMSUNG_BASE(device, base)                             \
+static inline unsigned int samsung_get_base_##device(void)     \
+{                                                              \
+       if (cpu_is_s5pc100())                                   \
+               return S5PC100_##base;                          \
+       else if (cpu_is_s5pc110())                              \
+               return S5PC110_##base;                          \
+       else                                                    \
+               return 0;                                       \
+}
+
+SAMSUNG_BASE(clock, CLOCK_BASE)
+SAMSUNG_BASE(gpio, GPIO_BASE)
+SAMSUNG_BASE(pro_id, PRO_ID)
+SAMSUNG_BASE(mmc, MMC_BASE)
+SAMSUNG_BASE(sromc, SROMC_BASE)
+SAMSUNG_BASE(timer, PWMTIMER_BASE)
+SAMSUNG_BASE(uart, UART_BASE)
 #endif
 
 #endif /* _S5PC1XX_CPU_H */
index 9a7faed319ee749593df6843eea1dd16b5936f43..2df33a607c0ac43a09a6d070fdc812461b68e640 100644 (file)
@@ -33,96 +33,96 @@ struct s5p_gpio_bank {
 };
 
 struct s5pc100_gpio {
-       struct s5p_gpio_bank gpio_a0;
-       struct s5p_gpio_bank gpio_a1;
-       struct s5p_gpio_bank gpio_b;
-       struct s5p_gpio_bank gpio_c;
-       struct s5p_gpio_bank gpio_d;
-       struct s5p_gpio_bank gpio_e0;
-       struct s5p_gpio_bank gpio_e1;
-       struct s5p_gpio_bank gpio_f0;
-       struct s5p_gpio_bank gpio_f1;
-       struct s5p_gpio_bank gpio_f2;
-       struct s5p_gpio_bank gpio_f3;
-       struct s5p_gpio_bank gpio_g0;
-       struct s5p_gpio_bank gpio_g1;
-       struct s5p_gpio_bank gpio_g2;
-       struct s5p_gpio_bank gpio_g3;
-       struct s5p_gpio_bank gpio_i;
-       struct s5p_gpio_bank gpio_j0;
-       struct s5p_gpio_bank gpio_j1;
-       struct s5p_gpio_bank gpio_j2;
-       struct s5p_gpio_bank gpio_j3;
-       struct s5p_gpio_bank gpio_j4;
-       struct s5p_gpio_bank gpio_k0;
-       struct s5p_gpio_bank gpio_k1;
-       struct s5p_gpio_bank gpio_k2;
-       struct s5p_gpio_bank gpio_k3;
-       struct s5p_gpio_bank gpio_l0;
-       struct s5p_gpio_bank gpio_l1;
-       struct s5p_gpio_bank gpio_l2;
-       struct s5p_gpio_bank gpio_l3;
-       struct s5p_gpio_bank gpio_l4;
-       struct s5p_gpio_bank gpio_h0;
-       struct s5p_gpio_bank gpio_h1;
-       struct s5p_gpio_bank gpio_h2;
-       struct s5p_gpio_bank gpio_h3;
+       struct s5p_gpio_bank a0;
+       struct s5p_gpio_bank a1;
+       struct s5p_gpio_bank b;
+       struct s5p_gpio_bank c;
+       struct s5p_gpio_bank d;
+       struct s5p_gpio_bank e0;
+       struct s5p_gpio_bank e1;
+       struct s5p_gpio_bank f0;
+       struct s5p_gpio_bank f1;
+       struct s5p_gpio_bank f2;
+       struct s5p_gpio_bank f3;
+       struct s5p_gpio_bank g0;
+       struct s5p_gpio_bank g1;
+       struct s5p_gpio_bank g2;
+       struct s5p_gpio_bank g3;
+       struct s5p_gpio_bank i;
+       struct s5p_gpio_bank j0;
+       struct s5p_gpio_bank j1;
+       struct s5p_gpio_bank j2;
+       struct s5p_gpio_bank j3;
+       struct s5p_gpio_bank j4;
+       struct s5p_gpio_bank k0;
+       struct s5p_gpio_bank k1;
+       struct s5p_gpio_bank k2;
+       struct s5p_gpio_bank k3;
+       struct s5p_gpio_bank l0;
+       struct s5p_gpio_bank l1;
+       struct s5p_gpio_bank l2;
+       struct s5p_gpio_bank l3;
+       struct s5p_gpio_bank l4;
+       struct s5p_gpio_bank h0;
+       struct s5p_gpio_bank h1;
+       struct s5p_gpio_bank h2;
+       struct s5p_gpio_bank h3;
 };
 
 struct s5pc110_gpio {
-       struct s5p_gpio_bank gpio_a0;
-       struct s5p_gpio_bank gpio_a1;
-       struct s5p_gpio_bank gpio_b;
-       struct s5p_gpio_bank gpio_c0;
-       struct s5p_gpio_bank gpio_c1;
-       struct s5p_gpio_bank gpio_d0;
-       struct s5p_gpio_bank gpio_d1;
-       struct s5p_gpio_bank gpio_e0;
-       struct s5p_gpio_bank gpio_e1;
-       struct s5p_gpio_bank gpio_f0;
-       struct s5p_gpio_bank gpio_f1;
-       struct s5p_gpio_bank gpio_f2;
-       struct s5p_gpio_bank gpio_f3;
-       struct s5p_gpio_bank gpio_g0;
-       struct s5p_gpio_bank gpio_g1;
-       struct s5p_gpio_bank gpio_g2;
-       struct s5p_gpio_bank gpio_g3;
-       struct s5p_gpio_bank gpio_i;
-       struct s5p_gpio_bank gpio_j0;
-       struct s5p_gpio_bank gpio_j1;
-       struct s5p_gpio_bank gpio_j2;
-       struct s5p_gpio_bank gpio_j3;
-       struct s5p_gpio_bank gpio_j4;
-       struct s5p_gpio_bank gpio_mp0_1;
-       struct s5p_gpio_bank gpio_mp0_2;
-       struct s5p_gpio_bank gpio_mp0_3;
-       struct s5p_gpio_bank gpio_mp0_4;
-       struct s5p_gpio_bank gpio_mp0_5;
-       struct s5p_gpio_bank gpio_mp0_6;
-       struct s5p_gpio_bank gpio_mp0_7;
-       struct s5p_gpio_bank gpio_mp1_0;
-       struct s5p_gpio_bank gpio_mp1_1;
-       struct s5p_gpio_bank gpio_mp1_2;
-       struct s5p_gpio_bank gpio_mp1_3;
-       struct s5p_gpio_bank gpio_mp1_4;
-       struct s5p_gpio_bank gpio_mp1_5;
-       struct s5p_gpio_bank gpio_mp1_6;
-       struct s5p_gpio_bank gpio_mp1_7;
-       struct s5p_gpio_bank gpio_mp1_8;
-       struct s5p_gpio_bank gpio_mp2_0;
-       struct s5p_gpio_bank gpio_mp2_1;
-       struct s5p_gpio_bank gpio_mp2_2;
-       struct s5p_gpio_bank gpio_mp2_3;
-       struct s5p_gpio_bank gpio_mp2_4;
-       struct s5p_gpio_bank gpio_mp2_5;
-       struct s5p_gpio_bank gpio_mp2_6;
-       struct s5p_gpio_bank gpio_mp2_7;
-       struct s5p_gpio_bank gpio_mp2_8;
+       struct s5p_gpio_bank a0;
+       struct s5p_gpio_bank a1;
+       struct s5p_gpio_bank b;
+       struct s5p_gpio_bank c0;
+       struct s5p_gpio_bank c1;
+       struct s5p_gpio_bank d0;
+       struct s5p_gpio_bank d1;
+       struct s5p_gpio_bank e0;
+       struct s5p_gpio_bank e1;
+       struct s5p_gpio_bank f0;
+       struct s5p_gpio_bank f1;
+       struct s5p_gpio_bank f2;
+       struct s5p_gpio_bank f3;
+       struct s5p_gpio_bank g0;
+       struct s5p_gpio_bank g1;
+       struct s5p_gpio_bank g2;
+       struct s5p_gpio_bank g3;
+       struct s5p_gpio_bank i;
+       struct s5p_gpio_bank j0;
+       struct s5p_gpio_bank j1;
+       struct s5p_gpio_bank j2;
+       struct s5p_gpio_bank j3;
+       struct s5p_gpio_bank j4;
+       struct s5p_gpio_bank mp0_1;
+       struct s5p_gpio_bank mp0_2;
+       struct s5p_gpio_bank mp0_3;
+       struct s5p_gpio_bank mp0_4;
+       struct s5p_gpio_bank mp0_5;
+       struct s5p_gpio_bank mp0_6;
+       struct s5p_gpio_bank mp0_7;
+       struct s5p_gpio_bank mp1_0;
+       struct s5p_gpio_bank mp1_1;
+       struct s5p_gpio_bank mp1_2;
+       struct s5p_gpio_bank mp1_3;
+       struct s5p_gpio_bank mp1_4;
+       struct s5p_gpio_bank mp1_5;
+       struct s5p_gpio_bank mp1_6;
+       struct s5p_gpio_bank mp1_7;
+       struct s5p_gpio_bank mp1_8;
+       struct s5p_gpio_bank mp2_0;
+       struct s5p_gpio_bank mp2_1;
+       struct s5p_gpio_bank mp2_2;
+       struct s5p_gpio_bank mp2_3;
+       struct s5p_gpio_bank mp2_4;
+       struct s5p_gpio_bank mp2_5;
+       struct s5p_gpio_bank mp2_6;
+       struct s5p_gpio_bank mp2_7;
+       struct s5p_gpio_bank mp2_8;
        struct s5p_gpio_bank res1[48];
-       struct s5p_gpio_bank gpio_h0;
-       struct s5p_gpio_bank gpio_h1;
-       struct s5p_gpio_bank gpio_h2;
-       struct s5p_gpio_bank gpio_h3;
+       struct s5p_gpio_bank h0;
+       struct s5p_gpio_bank h1;
+       struct s5p_gpio_bank h2;
+       struct s5p_gpio_bank h3;
 };
 
 /* functions */
index ac560c27046358fd30f76830230556731f241b91..68c59d13e3406223d73815220a7753153f010696 100644 (file)
@@ -56,7 +56,7 @@ struct s5p_mmc {
        unsigned int    control4;
        unsigned char   res4[0x6e];
        unsigned short  hcver;
-       unsigned char   res5[0xFFF00];
+       unsigned char   res5[0xFFF02];
 };
 
 struct mmc_host {
index e02a8d8fb3a44d1422501b4d0d75b49269ba6284..0369968d4a93c14d669b464de8afe25620e9a396 100644 (file)
 #ifndef __ASM_ARM_ARCH_PWM_H_
 #define __ASM_ARM_ARCH_PWM_H_
 
-/* PWM timer addressing */
-#define S5PC100_TIMER_BASE     S5PC100_PWMTIMER_BASE
-#define S5PC110_TIMER_BASE     S5PC110_PWMTIMER_BASE
-
 /* Interval mode(Auto Reload) of PWM Timer 4 */
-#define S5PC1XX_TCON4_AUTO_RELOAD      (1 << 22)
+#define TCON4_AUTO_RELOAD      (1 << 22)
 /* Update TCNTB4 */
-#define S5PC1XX_TCON4_UPDATE           (1 << 21)
+#define TCON4_UPDATE           (1 << 21)
 /* start bit of PWM Timer 4 */
-#define S5PC1XX_TCON4_START            (1 << 20)
+#define TCON4_START            (1 << 20)
 
 #ifndef __ASSEMBLY__
-struct s5pc1xx_timer {
+struct s5p_timer {
        unsigned int    tcfg0;
        unsigned int    tcfg1;
        unsigned int    tcon;
index 060d5d17c90ded26581ec94bf19b28847fc89298..43367291132f4b86c96e9160fa13e489b7e5d32a 100644 (file)
@@ -67,7 +67,7 @@ int board_mmc_init(bd_t *bis)
        int i;
 
        /* MASSMEMORY_EN: XMSMDATA7: GPJ2[7] output high */
-       gpio_direction_output(&s5pc110_gpio->gpio_j2, 7, 1);
+       gpio_direction_output(&s5pc110_gpio->j2, 7, 1);
 
        /*
         * MMC0 GPIO
@@ -80,11 +80,11 @@ int board_mmc_init(bd_t *bis)
                if (i == 2)
                        continue;
                /* GPG0[0:6] special function 2 */
-               gpio_cfg_pin(&s5pc110_gpio->gpio_g0, i, 0x2);
+               gpio_cfg_pin(&s5pc110_gpio->g0, i, 0x2);
                /* GPG0[0:6] pull disable */
-               gpio_set_pull(&s5pc110_gpio->gpio_g0, i, GPIO_PULL_NONE);
+               gpio_set_pull(&s5pc110_gpio->g0, i, GPIO_PULL_NONE);
                /* GPG0[0:6] drv 4x */
-               gpio_set_drv(&s5pc110_gpio->gpio_g0, i, GPIO_DRV_4X);
+               gpio_set_drv(&s5pc110_gpio->g0, i, GPIO_DRV_4X);
        }
 
        return s5p_mmc_init(0);
index 4b729927f42f6d8f2efcbfe8d7ce63afc3bf2c71..62737aba1ab3f3e0a2d334f15468f80a3f6df6b4 100644 (file)
@@ -51,7 +51,7 @@ lowlevel_init:
        ldr     r7, =S5PC100_GPIO_BASE
        ldr     r8, =S5PC100_GPIO_BASE
        /* Read CPU ID */
-       ldr     r2, =S5PC1XX_PRO_ID
+       ldr     r2, =S5PC110_PRO_ID
        ldr     r0, [r2]
        mov     r1, #0x00010000
        and     r0, r0, r1
@@ -377,7 +377,7 @@ lockloop:
  * void system_clock_init(void)
  */
 system_clock_init:
-       ldr     r0, =S5PC1XX_CLOCK_BASE         @ 0xE0100000
+       ldr     r0, =S5PC110_CLOCK_BASE         @ 0xE0100000
 
        /* Check S5PC100 */
        cmp     r7, r8
@@ -437,7 +437,7 @@ system_clock_init:
        ldr     r1, =0x3ff03ff
        str     r1, [r0, #0x114]                @ S5PC110_CLAMP_STABLE
 
-       ldr     r0, =S5PC1XX_CLOCK_BASE         @ 0xE0100000
+       ldr     r0, =S5PC110_CLOCK_BASE         @ 0xE0100000
 
        /* Set Clock divider */
        ldr     r1, =0x14131330                 @ 1:1:4:4, 1:4:5
index 32572c51da9ac155d00bf90b7258c616df3ecf1a..30d0d06a44072437b0e2d5d2877102711d72c34e 100644 (file)
@@ -131,7 +131,7 @@ wakeup_reset:
  * void system_clock_init(void)
  */
 system_clock_init:
-       ldr     r8, =S5PC1XX_CLOCK_BASE         @ 0xE0100000
+       ldr     r8, =S5PC100_CLOCK_BASE         @ 0xE0100000
 
        /* Set Clock divider */
        ldr     r1, =0x00011110
index c25869e5c402206d3e5451f607fa7aa187d44741..501855edd3812a63cc3d18e7879a990784be1ef3 100644 (file)
@@ -35,7 +35,8 @@
 void onenand_board_init(struct mtd_info *mtd)
 {
        struct onenand_chip *this = mtd->priv;
-       struct s5pc100_clock *clk = (struct s5pc100_clock *)S5PC1XX_CLOCK_BASE;
+       struct s5pc100_clock *clk =
+                       (struct s5pc100_clock *)samsung_get_base_clock();
        struct samsung_onenand *onenand;
        int value;
 
index fb466c6ece4fe43331ba86cfb9f6869c1f599145..31e8d9e0ec32d7617c40fa7cdfe14f00ce7c3374 100644 (file)
@@ -38,10 +38,10 @@ static void smc9115_pre_init(void)
        u32 smc_bw_conf, smc_bc_conf;
 
        struct s5pc100_gpio *const gpio =
-               (struct s5pc100_gpio *)S5PC100_GPIO_BASE;
+               (struct s5pc100_gpio *)samsung_get_base_gpio();
 
        /* gpio configuration GPK0CON */
-       gpio_cfg_pin(&gpio->gpio_k0, CONFIG_ENV_SROM_BANK, GPIO_FUNC(2));
+       gpio_cfg_pin(&gpio->k0, CONFIG_ENV_SROM_BANK, GPIO_FUNC(2));
 
        /* Ethernet needs bus width of 16 bits */
        smc_bw_conf = SMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
index 6718648d4e8b927f0d9e1c170f7c1df025c805c1..1345c08aefd6d68f9b05e1e926fe4463abd7abf4 100644 (file)
@@ -78,7 +78,7 @@ struct serial_device *__default_serial_console (void)
 #else
 #error "CONFIG_SERIAL? missing."
 #endif
-#elif defined(CONFIG_S5PC1XX)
+#elif defined(CONFIG_S5P)
 #if defined(CONFIG_SERIAL0)
        return &s5p_serial0_device;
 #elif defined(CONFIG_SERIAL1)
@@ -162,7 +162,7 @@ void serial_initialize (void)
        serial_register(&s3c24xx_serial1_device);
        serial_register(&s3c24xx_serial2_device);
 #endif
-#if defined(CONFIG_S5PC1XX)
+#if defined(CONFIG_S5P)
        serial_register(&s5p_serial0_device);
        serial_register(&s5p_serial1_device);
        serial_register(&s5p_serial2_device);
index 528ca2e99af78d87e3a80ed074e5818582455e46..07d395d898f58636fe8eb702994ffda401c59d0b 100644 (file)
@@ -29,7 +29,7 @@ COBJS-$(CONFIG_AT91_GPIO)     += at91_gpio.o
 COBJS-$(CONFIG_KIRKWOOD_GPIO)  += kw_gpio.o
 COBJS-$(CONFIG_MX31_GPIO)      += mx31_gpio.o
 COBJS-$(CONFIG_PCA953X)                += pca953x.o
-COBJS-$(CONFIG_S5PC1XX)                += s5p_gpio.o
+COBJS-$(CONFIG_S5P)            += s5p_gpio.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
index 669b1d0d2f91c2755689c9ce1d857761dc802c6a..1fd425cbb67467d4ae2e4c6443a5f73c0e72abc8 100644 (file)
 #include <asm/io.h>
 #include <asm/arch/mmc.h>
 
-#ifdef DEBUG_S5P_HSMMC
-#define dbg(x...)       printf(x)
-#else
-#define dbg(x...)       do { } while (0)
-#endif
-
 /* support 4 mmc hosts */
 struct mmc mmc_dev[4];
 struct mmc_host mmc_host[4];
@@ -36,18 +30,14 @@ struct mmc_host mmc_host[4];
 static inline struct s5p_mmc *s5p_get_base_mmc(int dev_index)
 {
        unsigned long offset = dev_index * sizeof(struct s5p_mmc);
-
-       if (cpu_is_s5pc100())
-               return (struct s5p_mmc *)(S5PC100_MMC_BASE + offset);
-       else
-               return (struct s5p_mmc *)(S5PC110_MMC_BASE + offset);
+       return (struct s5p_mmc *)(samsung_get_base_mmc() + offset);
 }
 
 static void mmc_prepare_data(struct mmc_host *host, struct mmc_data *data)
 {
        unsigned char ctrl;
 
-       dbg("data->dest: %08x\n", (u32)data->dest);
+       debug("data->dest: %08x\n", (u32)data->dest);
        writel((u32)data->dest, &host->reg->sysad);
        /*
         * DMASEL[4:3]
@@ -128,7 +118,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
        if (data)
                mmc_prepare_data(host, data);
 
-       dbg("cmd->arg: %08x\n", cmd->cmdarg);
+       debug("cmd->arg: %08x\n", cmd->cmdarg);
        writel(cmd->cmdarg, &host->reg->argument);
 
        if (data)
@@ -165,7 +155,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
        if (data)
                flags |= (1 << 5);
 
-       dbg("cmd: %d\n", cmd->cmdidx);
+       debug("cmd: %d\n", cmd->cmdidx);
 
        writew((cmd->cmdidx << 8) | flags, &host->reg->cmdreg);
 
@@ -186,11 +176,11 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 
        if (mask & (1 << 16)) {
                /* Timeout Error */
-               dbg("timeout: %08x cmd %d\n", mask, cmd->cmdidx);
+               debug("timeout: %08x cmd %d\n", mask, cmd->cmdidx);
                return TIMEOUT;
        } else if (mask & (1 << 15)) {
                /* Error Interrupt */
-               dbg("error: %08x cmd %d\n", mask, cmd->cmdidx);
+               debug("error: %08x cmd %d\n", mask, cmd->cmdidx);
                return -1;
        }
 
@@ -206,7 +196,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                                        cmd->response[i] |=
                                                readb(offset - 1);
                                }
-                               dbg("cmd->resp[%d]: %08x\n",
+                               debug("cmd->resp[%d]: %08x\n",
                                                i, cmd->response[i]);
                        }
                } else if (cmd->resp_type & MMC_RSP_BUSY) {
@@ -223,10 +213,10 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                        }
 
                        cmd->response[0] = readl(&host->reg->rspreg0);
-                       dbg("cmd->resp[0]: %08x\n", cmd->response[0]);
+                       debug("cmd->resp[0]: %08x\n", cmd->response[0]);
                } else {
                        cmd->response[0] = readl(&host->reg->rspreg0);
-                       dbg("cmd->resp[0]: %08x\n", cmd->response[0]);
+                       debug("cmd->resp[0]: %08x\n", cmd->response[0]);
                }
        }
 
@@ -242,11 +232,11 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
                                return -1;
                        } else if (mask & (1 << 3)) {
                                /* DMA Interrupt */
-                               dbg("DMA end\n");
+                               debug("DMA end\n");
                                break;
                        } else if (mask & (1 << 1)) {
                                /* Transfer Complete */
-                               dbg("r/w is done\n");
+                               debug("r/w is done\n");
                                break;
                        }
                }
@@ -288,7 +278,7 @@ static void mmc_change_clock(struct mmc_host *host, uint clock)
                div = 2;
        else
                div = 1;
-       dbg("div: %d\n", div);
+       debug("div: %d\n", div);
 
        div >>= 1;
        /*
@@ -325,7 +315,7 @@ static void mmc_set_ios(struct mmc *mmc)
        unsigned char ctrl;
        unsigned long val;
 
-       dbg("set_ios: bus_width: %x, clock: %d\n", mmc->bus_width, mmc->clock);
+       debug("bus_width: %x, clock: %d\n", mmc->bus_width, mmc->clock);
 
        /*
         * SELCLKPADDS[17:16]
index f2be687639bdd7d576c723157704ec337c5dfd9e..20b49124d5a4cdca3d19d3be3485ac83ec77ce5a 100644 (file)
@@ -67,7 +67,7 @@ do {                                                                  \
 #define MAP_01                         (0x1 << 24)
 #define MAP_10                         (0x2 << 24)
 #define MAP_11                         (0x3 << 24)
-#elif defined(CONFIG_S5PC1XX)
+#elif defined(CONFIG_S5P)
 #define MAP_00                         (0x0 << 26)
 #define MAP_01                         (0x1 << 26)
 #define MAP_10                         (0x2 << 26)
@@ -121,7 +121,7 @@ static unsigned int s3c_mem_addr(int fba, int fpa, int fsa)
 {
        return (fba << 12) | (fpa << 6) | (fsa << 4);
 }
-#elif defined(CONFIG_S5PC1XX)
+#elif defined(CONFIG_S5P)
 static unsigned int s3c_mem_addr(int fba, int fpa, int fsa)
 {
        return (fba << 13) | (fpa << 7) | (fsa << 5);
@@ -614,7 +614,7 @@ void s3c_onenand_init(struct mtd_info *mtd)
 #if defined(CONFIG_S3C64XX)
        onenand->base = (void *)0x70100000;
        onenand->ahb_addr = (void *)0x20000000;
-#elif defined(CONFIG_S5PC1XX)
+#elif defined(CONFIG_S5P)
        onenand->base = (void *)0xE7100000;
        onenand->ahb_addr = (void *)0xB0000000;
 #endif
index c731bfb594f1cbd04e0f6dfabf3c6d21a447698e..6d45a8ef5540591f94ce45fb61d7ea417889bec4 100644 (file)
@@ -36,7 +36,7 @@ COBJS-$(CONFIG_OPENCORES_YANU) += opencores_yanu.o
 COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
-COBJS-$(CONFIG_S5PC1XX) += serial_s5p.o
+COBJS-$(CONFIG_S5P) += serial_s5p.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
 COBJS-$(CONFIG_IMX_SERIAL) += serial_imx.o
index e0d4e8004dd01886b940933ea8551788fdef6f28..77096643f1f87a01eebab57727926bf5f42eea77 100644 (file)
 static inline struct s5p_uart *s5p_get_base_uart(int dev_index)
 {
        u32 offset = dev_index * sizeof(struct s5p_uart);
-
-       if (cpu_is_s5pc100())
-               return (struct s5p_uart *)(S5PC100_UART_BASE + offset);
-       else
-               return (struct s5p_uart *)(S5PC110_UART_BASE + offset);
+       return (struct s5p_uart *)(samsung_get_base_uart() + offset);
 }
 
 /*
@@ -67,11 +63,11 @@ void serial_setbrg_dev(const int dev_index)
 {
        DECLARE_GLOBAL_DATA_PTR;
        struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
-       u32 pclk = get_pclk();
+       u32 uclk = get_uart_clk(dev_index);
        u32 baudrate = gd->baudrate;
        u32 val;
 
-       val = pclk / baudrate;
+       val = uclk / baudrate;
 
        writel(val / 16 - 1, &uart->ubrdiv);
        writew(udivslot[val % 16], &uart->udivslot);
index c8ea8fda82b694077fcb3ddab2dee0f9d5d853e0..dc01ceb7b26a653075b92f4f00a9907953f36e2f 100644 (file)
@@ -30,7 +30,7 @@
 /* High Level Configuration Options */
 #define CONFIG_ARMV7           1       /* This is an ARM V7 CPU core */
 #define CONFIG_SAMSUNG         1       /* in a SAMSUNG core */
-#define CONFIG_S5PC1XX         1       /* which is in a S5PC1XX Family */
+#define CONFIG_S5P             1       /* which is in a S5P Family */
 #define CONFIG_S5PC110         1       /* which is in a S5PC110 */
 #define CONFIG_MACH_GONI       1       /* working with Goni */
 
index 76a47c4456f3dac7e9ad730ce2637dff71f1fc83..595d17400134174ca24fc372678eef482908c54b 100644 (file)
@@ -34,7 +34,7 @@
  */
 #define CONFIG_ARMV7           1       /* This is an ARM V7 CPU core */
 #define CONFIG_SAMSUNG         1       /* in a SAMSUNG core */
-#define CONFIG_S5PC1XX         1       /* which is in a S5PC1XX Family */
+#define CONFIG_S5P             1       /* which is in a S5P Family */
 #define CONFIG_S5PC100         1       /* which is in a S5PC100 */
 #define CONFIG_SMDKC100                1       /* working with SMDKC100 */
 
index fc384698196d89d82d95601297d89c5ece5a3e46..15ab73c13d99b97345486b5892c7fc41858b8b84 100644 (file)
@@ -52,7 +52,7 @@ extern struct serial_device s3c24xx_serial1_device;
 extern struct serial_device s3c24xx_serial2_device;
 #endif
 
-#if defined(CONFIG_S5PC1XX)
+#if defined(CONFIG_S5P)
 extern struct serial_device s5p_serial0_device;
 extern struct serial_device s5p_serial1_device;
 extern struct serial_device s5p_serial2_device;