Commit d48562ab authored by Ben Dooks's avatar Ben Dooks

ARM: Merge for-2635-4/s5pc1xx-removal

Merge branch 'for-2635-4/s5pc1xx-removal' into for-2635-4/partial1
parents 0df04f82 a73e3e6f
...@@ -699,14 +699,14 @@ config ARCH_S5P6442 ...@@ -699,14 +699,14 @@ config ARCH_S5P6442
help help
Samsung S5P6442 CPU based systems Samsung S5P6442 CPU based systems
config ARCH_S5PC1XX config ARCH_S5PC100
bool "Samsung S5PC1XX" bool "Samsung S5PC100"
select GENERIC_GPIO select GENERIC_GPIO
select HAVE_CLK select HAVE_CLK
select CPU_V7 select CPU_V7
select ARM_L1_CACHE_SHIFT_6 select ARM_L1_CACHE_SHIFT_6
help help
Samsung S5PC1XX series based systems Samsung S5PC100 series based systems
config ARCH_S5PV210 config ARCH_S5PV210
bool "Samsung S5PV210/S5PC110" bool "Samsung S5PV210/S5PC110"
...@@ -890,7 +890,6 @@ source "arch/arm/mach-sa1100/Kconfig" ...@@ -890,7 +890,6 @@ source "arch/arm/mach-sa1100/Kconfig"
source "arch/arm/plat-samsung/Kconfig" source "arch/arm/plat-samsung/Kconfig"
source "arch/arm/plat-s3c24xx/Kconfig" source "arch/arm/plat-s3c24xx/Kconfig"
source "arch/arm/plat-s5p/Kconfig" source "arch/arm/plat-s5p/Kconfig"
source "arch/arm/plat-s5pc1xx/Kconfig"
if ARCH_S3C2410 if ARCH_S3C2410
source "arch/arm/mach-s3c2400/Kconfig" source "arch/arm/mach-s3c2400/Kconfig"
...@@ -909,9 +908,7 @@ source "arch/arm/mach-s5p6440/Kconfig" ...@@ -909,9 +908,7 @@ source "arch/arm/mach-s5p6440/Kconfig"
source "arch/arm/mach-s5p6442/Kconfig" source "arch/arm/mach-s5p6442/Kconfig"
if ARCH_S5PC1XX
source "arch/arm/mach-s5pc100/Kconfig" source "arch/arm/mach-s5pc100/Kconfig"
endif
source "arch/arm/mach-s5pv210/Kconfig" source "arch/arm/mach-s5pv210/Kconfig"
......
...@@ -167,7 +167,7 @@ machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 ...@@ -167,7 +167,7 @@ machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0
machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx
machine-$(CONFIG_ARCH_S5P6440) := s5p6440 machine-$(CONFIG_ARCH_S5P6440) := s5p6440
machine-$(CONFIG_ARCH_S5P6442) := s5p6442 machine-$(CONFIG_ARCH_S5P6442) := s5p6442
machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100 machine-$(CONFIG_ARCH_S5PC100) := s5pc100
machine-$(CONFIG_ARCH_S5PV210) := s5pv210 machine-$(CONFIG_ARCH_S5PV210) := s5pv210
machine-$(CONFIG_ARCH_SA1100) := sa1100 machine-$(CONFIG_ARCH_SA1100) := sa1100
machine-$(CONFIG_ARCH_SHARK) := shark machine-$(CONFIG_ARCH_SHARK) := shark
...@@ -192,7 +192,6 @@ plat-$(CONFIG_PLAT_NOMADIK) := nomadik ...@@ -192,7 +192,6 @@ plat-$(CONFIG_PLAT_NOMADIK) := nomadik
plat-$(CONFIG_PLAT_ORION) := orion plat-$(CONFIG_PLAT_ORION) := orion
plat-$(CONFIG_PLAT_PXA) := pxa plat-$(CONFIG_PLAT_PXA) := pxa
plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung
plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung
plat-$(CONFIG_PLAT_S5P) := s5p samsung plat-$(CONFIG_PLAT_S5P) := s5p samsung
ifeq ($(CONFIG_ARCH_EBSA110),y) ifeq ($(CONFIG_ARCH_EBSA110),y)
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
# Configuration options for the S5PC100 CPU # Configuration options for the S5PC100 CPU
if ARCH_S5PC100
config CPU_S5PC100 config CPU_S5PC100
bool bool
select CPU_S5PC100_INIT select PLAT_S5P
select CPU_S5PC100_CLOCK select S5P_EXT_INT
help help
Enable S5PC100 CPU support Enable S5PC100 CPU support
...@@ -17,17 +19,22 @@ config S5PC100_SETUP_FB_24BPP ...@@ -17,17 +19,22 @@ config S5PC100_SETUP_FB_24BPP
help help
Common setup code for S5PC1XX with an 24bpp RGB display helper. Common setup code for S5PC1XX with an 24bpp RGB display helper.
config S5PC100_SETUP_SDHCI
bool
select S5PC1XX_SETUP_SDHCI_GPIO
help
Internal helper functions for S5PC100 based SDHCI systems
config S5PC100_SETUP_I2C1 config S5PC100_SETUP_I2C1
bool bool
help help
Common setup code for i2c bus 1. Common setup code for i2c bus 1.
config S5PC100_SETUP_SDHCI
bool
select S5PC100_SETUP_SDHCI_GPIO
help
Internal helper functions for S5PC100 based SDHCI systems
config S5PC100_SETUP_SDHCI_GPIO
bool
help
Common setup code for SDHCI gpio.
config MACH_SMDKC100 config MACH_SMDKC100
bool "SMDKC100" bool "SMDKC100"
select CPU_S5PC100 select CPU_S5PC100
...@@ -41,3 +48,5 @@ config MACH_SMDKC100 ...@@ -41,3 +48,5 @@ config MACH_SMDKC100
select S5PC100_SETUP_SDHCI select S5PC100_SETUP_SDHCI
help help
Machine support for the Samsung SMDKC100 Machine support for the Samsung SMDKC100
endif
...@@ -11,14 +11,16 @@ obj- := ...@@ -11,14 +11,16 @@ obj- :=
# Core support for S5PC100 system # Core support for S5PC100 system
obj-$(CONFIG_CPU_S5PC100) += cpu.o gpiolib.o obj-$(CONFIG_CPU_S5PC100) += cpu.o init.o clock.o gpiolib.o irq-gpio.o
obj-$(CONFIG_CPU_S5PC100) += setup-i2c0.o obj-$(CONFIG_CPU_S5PC100) += setup-i2c0.o
# Helper and device support # Helper and device support
obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o
obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
# machine support # machine support
obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o
...@@ -22,47 +22,53 @@ ...@@ -22,47 +22,53 @@
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <asm/proc-fns.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/irq.h> #include <asm/mach/irq.h>
#include <asm/proc-fns.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/map.h> #include <mach/map.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <plat/cpu-freq.h>
#include <plat/regs-serial.h> #include <plat/regs-serial.h>
#include <plat/regs-power.h> #include <mach/regs-clock.h>
#include <plat/cpu.h> #include <plat/cpu.h>
#include <plat/devs.h> #include <plat/devs.h>
#include <plat/clock.h> #include <plat/clock.h>
#include <plat/sdhci.h>
#include <plat/iic-core.h> #include <plat/iic-core.h>
#include <plat/sdhci.h>
#include <plat/s5pc100.h> #include <plat/s5pc100.h>
/* Initial IO mappings */ /* Initial IO mappings */
static struct map_desc s5pc100_iodesc[] __initdata = { static struct map_desc s5pc100_iodesc[] __initdata = {
{
.virtual = (unsigned long)S5P_VA_SYSTIMER,
.pfn = __phys_to_pfn(S5PC100_PA_SYSTIMER),
.length = SZ_16K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)VA_VIC2,
.pfn = __phys_to_pfn(S5PC100_PA_VIC2),
.length = SZ_16K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC100_VA_OTHERS,
.pfn = __phys_to_pfn(S5PC100_PA_OTHERS),
.length = SZ_4K,
.type = MT_DEVICE,
}
}; };
static void s5pc100_idle(void) static void s5pc100_idle(void)
{ {
unsigned long tmp; if (!need_resched())
cpu_do_idle();
tmp = __raw_readl(S5PC100_PWR_CFG);
tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE;
tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK;
tmp |= S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE;
__raw_writel(tmp, S5PC100_PWR_CFG);
tmp = __raw_readl(S5PC100_OTHERS); local_irq_enable();
tmp |= S5PC100_PMU_INT_DISABLE;
__raw_writel(tmp, S5PC100_OTHERS);
cpu_do_idle();
} }
/* s5pc100_map_io /* s5pc100_map_io
...@@ -86,22 +92,23 @@ void __init s5pc100_map_io(void) ...@@ -86,22 +92,23 @@ void __init s5pc100_map_io(void)
void __init s5pc100_init_clocks(int xtal) void __init s5pc100_init_clocks(int xtal)
{ {
printk(KERN_DEBUG "%s: initialising clocks\n", __func__); printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
s3c24xx_register_baseclocks(xtal); s3c24xx_register_baseclocks(xtal);
s5pc1xx_register_clocks(); s5p_register_clocks(xtal);
s5pc100_register_clocks(); s5pc100_register_clocks();
s5pc100_setup_clocks(); s5pc100_setup_clocks();
} }
void __init s5pc100_init_irq(void) void __init s5pc100_init_irq(void)
{ {
u32 vic_valid[] = {~0, ~0, ~0}; u32 vic[] = {~0, ~0, ~0};
/* VIC0, VIC1, and VIC2 are fully populated. */ /* VIC0, VIC1, and VIC2 are fully populated. */
s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid)); s5p_init_irq(vic, ARRAY_SIZE(vic));
} }
struct sysdev_class s5pc100_sysclass = { static struct sysdev_class s5pc100_sysclass = {
.name = "s5pc100-core", .name = "s5pc100-core",
}; };
...@@ -118,9 +125,10 @@ core_initcall(s5pc100_core_init); ...@@ -118,9 +125,10 @@ core_initcall(s5pc100_core_init);
int __init s5pc100_init(void) int __init s5pc100_init(void)
{ {
printk(KERN_DEBUG "S5PC100: Initialising architecture\n"); printk(KERN_INFO "S5PC100: Initializing architecture\n");
s5pc1xx_idle = s5pc100_idle; /* set idle function */
pm_idle = s5pc100_idle;
return sysdev_register(&s5pc100_sysdev); return sysdev_register(&s5pc100_sysdev);
} }
/* /*
* arch/arm/plat-s5pc1xx/gpiolib.c * arch/arm/plat-s5pc100/gpiolib.c
* *
* Copyright 2009 Samsung Electronics Co * Copyright 2009 Samsung Electronics Co
* Kyungmin Park <kyungmin.park@samsung.com> * Kyungmin Park <kyungmin.park@samsung.com>
* *
* S5PC1XX - GPIOlib support * S5PC100 - GPIOlib support
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -61,13 +61,12 @@ ...@@ -61,13 +61,12 @@
* L3 8 4Bit None * L3 8 4Bit None
*/ */
#if 0 static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
{ {
return S3C_IRQ_GPIO(chip->base + offset); return S3C_IRQ_GPIO(chip->base + offset);
} }
static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset) static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
{ {
int base; int base;
...@@ -85,7 +84,7 @@ static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset) ...@@ -85,7 +84,7 @@ static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
return IRQ_EINT(24 + offset); return IRQ_EINT(24 + offset);
return -EINVAL; return -EINVAL;
} }
#endif
static struct s3c_gpio_cfg gpio_cfg = { static struct s3c_gpio_cfg gpio_cfg = {
.set_config = s3c_gpio_setcfg_s3c64xx_4bit, .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
.set_pull = s3c_gpio_setpull_updown, .set_pull = s3c_gpio_setpull_updown,
...@@ -382,31 +381,30 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = { ...@@ -382,31 +381,30 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = {
}; };
/* FIXME move from irq-gpio.c */ /* FIXME move from irq-gpio.c */
extern struct irq_chip s5pc1xx_gpioint; extern struct irq_chip s5pc100_gpioint;
extern void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc); extern void s5pc100_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc);
static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip) static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
{ {
#if 0
/* Interrupt */ /* Interrupt */
if (chip->config == &gpio_cfg) { if (chip->config == &gpio_cfg) {
int i, irq; int i, irq;
chip->chip.to_irq = s5pc1xx_gpiolib_to_irq; chip->chip.to_irq = s5pc100_gpiolib_to_irq;
for (i = 0; i < chip->chip.ngpio; i++) { for (i = 0; i < chip->chip.ngpio; i++) {
irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i; irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i;
set_irq_chip(irq, &s5pc1xx_gpioint); set_irq_chip(irq, &s5pc100_gpioint);
set_irq_data(irq, &chip->chip); set_irq_data(irq, &chip->chip);
set_irq_handler(irq, handle_level_irq); set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID); set_irq_flags(irq, IRQF_VALID);
} }
} else if (chip->config == &gpio_cfg_eint) } else if (chip->config == &gpio_cfg_eint) {
chip->chip.to_irq = s5pc1xx_gpiolib_to_eint; chip->chip.to_irq = s5pc100_gpiolib_to_eint;
#endif }
} }
static __init int s5pc1xx_gpiolib_init(void) static __init int s5pc100_gpiolib_init(void)
{ {
struct s3c_gpio_chip *chip; struct s3c_gpio_chip *chip;
int nr_chips; int nr_chips;
...@@ -419,10 +417,10 @@ static __init int s5pc1xx_gpiolib_init(void) ...@@ -419,10 +417,10 @@ static __init int s5pc1xx_gpiolib_init(void)
samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips, samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips,
ARRAY_SIZE(s5pc100_gpio_chips)); ARRAY_SIZE(s5pc100_gpio_chips));
#if 0
/* Interrupt */ /* Interrupt */
set_irq_chained_handler(IRQ_GPIOINT, s5pc1xx_irq_gpioint_handler); set_irq_chained_handler(IRQ_GPIOINT, s5pc100_irq_gpioint_handler);
#endif
return 0; return 0;
} }
core_initcall(s5pc1xx_gpiolib_init); core_initcall(s5pc100_gpiolib_init);
...@@ -22,12 +22,14 @@ ...@@ -22,12 +22,14 @@
* aligned and add in the offset when we load the value here. * aligned and add in the offset when we load the value here.
*/ */
.macro addruart, rx, tmp .macro addruart, rx, rtmp
mrc p15, 0, \rx, c1, c0 mrc p15, 0, \rx, c1, c0
tst \rx, #1 tst \rx, #1
ldreq \rx, = S3C_PA_UART ldreq \rx, = S3C_PA_UART
ldrne \rx, = (S3C_VA_UART + S3C_PA_UART & 0xfffff) ldrne \rx, = S3C_VA_UART
#if CONFIG_DEBUG_S3C_UART != 0
add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART) add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
#endif
.endm .endm
/* include the reset of the code which will do the work, we're only /* include the reset of the code which will do the work, we're only
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.endm .endm
.macro get_irqnr_preamble, base, tmp .macro get_irqnr_preamble, base, tmp
ldr \base, =S3C_VA_VIC0 ldr \base, =VA_VIC0
.endm .endm
.macro arch_ret_to_user, tmp1, tmp2 .macro arch_ret_to_user, tmp1, tmp2
...@@ -29,18 +29,18 @@ ...@@ -29,18 +29,18 @@
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
@ check the vic0 @ check the vic0
mov \irqnr, # S3C_IRQ_OFFSET + 31 mov \irqnr, # S5P_IRQ_OFFSET + 31
ldr \irqstat, [ \base, # VIC_IRQ_STATUS ] ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
teq \irqstat, #0 teq \irqstat, #0
@ otherwise try vic1 @ otherwise try vic1
addeq \tmp, \base, #(S3C_VA_VIC1 - S3C_VA_VIC0) addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
addeq \irqnr, \irqnr, #32 addeq \irqnr, \irqnr, #32
ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ] ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
teqeq \irqstat, #0 teqeq \irqstat, #0
@ otherwise try vic2 @ otherwise try vic2
addeq \tmp, \base, #(S3C_VA_VIC2 - S3C_VA_VIC0) addeq \tmp, \base, #(VA_VIC2 - VA_VIC0)
addeq \irqnr, \irqnr, #32 addeq \irqnr, \irqnr, #32
ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ] ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
teqeq \irqstat, #0 teqeq \irqstat, #0
......
...@@ -146,6 +146,13 @@ enum s5p_gpio_number { ...@@ -146,6 +146,13 @@ enum s5p_gpio_number {
/* define the number of gpios we need to the one after the MP04() range */ /* define the number of gpios we need to the one after the MP04() range */
#define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1) #define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1)
#define EINT_MODE S3C_GPIO_SFN(0x2)
#define EINT_GPIO_0(x) S5PC100_GPH0(x)
#define EINT_GPIO_1(x) S5PC100_GPH1(x)
#define EINT_GPIO_2(x) S5PC100_GPH2(x)
#define EINT_GPIO_3(x) S5PC100_GPH3(x)
#include <asm-generic/gpio.h> #include <asm-generic/gpio.h>
#endif /* __ASM_ARCH_GPIO_H */ #endif /* __ASM_ARCH_GPIO_H */
...@@ -11,9 +11,104 @@ ...@@ -11,9 +11,104 @@
#include <plat/irqs.h> #include <plat/irqs.h>
/* LCD */ /* VIC0: system, DMA, timer */
#define IRQ_EINT16_31 S5P_IRQ_VIC0(16)
#define IRQ_BATF S5P_IRQ_VIC0(17)
#define IRQ_MDMA S5P_IRQ_VIC0(18)
#define IRQ_PDMA0 S5P_IRQ_VIC0(19)
#define IRQ_PDMA1 S5P_IRQ_VIC0(20)
#define IRQ_TIMER0_VIC S5P_IRQ_VIC0(21)
#define IRQ_TIMER1_VIC S5P_IRQ_VIC0(22)
#define IRQ_TIMER2_VIC S5P_IRQ_VIC0(23)
#define IRQ_TIMER3_VIC S5P_IRQ_VIC0(24)
#define IRQ_TIMER4_VIC S5P_IRQ_VIC0(25)
#define IRQ_SYSTIMER S5P_IRQ_VIC0(26)
#define IRQ_WDT S5P_IRQ_VIC0(27)
#define IRQ_RTC_ALARM S5P_IRQ_VIC0(28)
#define IRQ_RTC_TIC S5P_IRQ_VIC0(29)
#define IRQ_GPIOINT S5P_IRQ_VIC0(30)
/* VIC1: ARM, power, memory, connectivity */
#define IRQ_CORTEX0 S5P_IRQ_VIC1(0)
#define IRQ_CORTEX1 S5P_IRQ_VIC1(1)
#define IRQ_CORTEX2 S5P_IRQ_VIC1(2)
#define IRQ_CORTEX3 S5P_IRQ_VIC1(3)
#define IRQ_CORTEX4 S5P_IRQ_VIC1(4)
#define IRQ_IEMAPC S5P_IRQ_VIC1(5)
#define IRQ_IEMIEC S5P_IRQ_VIC1(6)
#define IRQ_ONENAND S5P_IRQ_VIC1(7)
#define IRQ_NFC S5P_IRQ_VIC1(8)
#define IRQ_CFC S5P_IRQ_VIC1(9)
#define IRQ_UART0 S5P_IRQ_VIC1(10)
#define IRQ_UART1 S5P_IRQ_VIC1(11)
#define IRQ_UART2 S5P_IRQ_VIC1(12)
#define IRQ_UART3 S5P_IRQ_VIC1(13)
#define IRQ_IIC S5P_IRQ_VIC1(14)
#define IRQ_SPI0 S5P_IRQ_VIC1(15)
#define IRQ_SPI1 S5P_IRQ_VIC1(16)
#define IRQ_SPI2 S5P_IRQ_VIC1(17)
#define IRQ_IRDA S5P_IRQ_VIC1(18)
#define IRQ_CAN0 S5P_IRQ_VIC1(19)
#define IRQ_CAN1 S5P_IRQ_VIC1(20)
#define IRQ_HSIRX S5P_IRQ_VIC1(21)
#define IRQ_HSITX S5P_IRQ_VIC1(22)
#define IRQ_UHOST S5P_IRQ_VIC1(23)
#define IRQ_OTG S5P_IRQ_VIC1(24)
#define IRQ_MSM S5P_IRQ_VIC1(25)
#define IRQ_HSMMC0 S5P_IRQ_VIC1(26)
#define IRQ_HSMMC1 S5P_IRQ_VIC1(27)
#define IRQ_HSMMC2 S5P_IRQ_VIC1(28)
#define IRQ_MIPICSI S5P_IRQ_VIC1(29)
#define IRQ_MIPIDSI S5P_IRQ_VIC1(30)
/* VIC2: multimedia, audio, security */
#define IRQ_LCD0 S5P_IRQ_VIC2(0)
#define IRQ_LCD1 S5P_IRQ_VIC2(1)
#define IRQ_LCD2 S5P_IRQ_VIC2(2)
#define IRQ_LCD3 S5P_IRQ_VIC2(3)
#define IRQ_ROTATOR S5P_IRQ_VIC2(4)
#define IRQ_FIMC0 S5P_IRQ_VIC2(5)
#define IRQ_FIMC1 S5P_IRQ_VIC2(6)
#define IRQ_FIMC2 S5P_IRQ_VIC2(7)
#define IRQ_JPEG S5P_IRQ_VIC2(8)
#define IRQ_2D S5P_IRQ_VIC2(9)
#define IRQ_3D S5P_IRQ_VIC2(10)
#define IRQ_MIXER S5P_IRQ_VIC2(11)
#define IRQ_HDMI S5P_IRQ_VIC2(12)
#define IRQ_IIC1 S5P_IRQ_VIC2(13)
#define IRQ_MFC S5P_IRQ_VIC2(14)
#define IRQ_TVENC S5P_IRQ_VIC2(15)
#define IRQ_I2S0 S5P_IRQ_VIC2(16)
#define IRQ_I2S1 S5P_IRQ_VIC2(17)
#define IRQ_I2S2 S5P_IRQ_VIC2(18)
#define IRQ_AC97 S5P_IRQ_VIC2(19)
#define IRQ_PCM0 S5P_IRQ_VIC2(20)
#define IRQ_PCM1 S5P_IRQ_VIC2(21)
#define IRQ_SPDIF S5P_IRQ_VIC2(22)
#define IRQ_ADC S5P_IRQ_VIC2(23)
#define IRQ_PENDN S5P_IRQ_VIC2(24)
#define IRQ_TC IRQ_PENDN
#define IRQ_KEYPAD S5P_IRQ_VIC2(25)
#define IRQ_CG S5P_IRQ_VIC2(26)
#define IRQ_SEC S5P_IRQ_VIC2(27)
#define IRQ_SECRX S5P_IRQ_VIC2(28)
#define IRQ_SECTX S5P_IRQ_VIC2(29)
#define IRQ_SDMIRQ S5P_IRQ_VIC2(30)
#define IRQ_SDMFIQ S5P_IRQ_VIC2(31)
#define IRQ_VIC_END S5P_IRQ_VIC2(31)
#define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0))
#define S5P_EINT_BASE2 (IRQ_VIC_END + 1)
#define S3C_IRQ_GPIO_BASE (IRQ_EINT(31) + 1)
#define S3C_IRQ_GPIO(x) (S3C_IRQ_GPIO_BASE + (x))
/* Until MP04 Groups -> 40 (exactly 39) Groups * 8 ~= 320 GPIOs */
#define NR_IRQS (S3C_IRQ_GPIO(320) + 1)
/* Compatibility */
#define IRQ_LCD_FIFO IRQ_LCD0 #define IRQ_LCD_FIFO IRQ_LCD0
#define IRQ_LCD_VSYNC IRQ_LCD1 #define IRQ_LCD_VSYNC IRQ_LCD1
#define IRQ_LCD_SYSTEM IRQ_LCD2 #define IRQ_LCD_SYSTEM IRQ_LCD2
#endif /* __ASM_ARCH_IRQ_H */ #endif /* __ASM_ARCH_IRQS_H */
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
* Copyright 2009 Samsung Electronics Co. * Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com> * Byungho Min <bhmin@samsung.com>
* *
* Based on mach-s3c6400/include/mach/map.h * S5PC100 - Memory map definitions
*
* S5PC1XX - Memory map definitions
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -16,135 +14,59 @@ ...@@ -16,135 +14,59 @@
#define __ASM_ARCH_MAP_H __FILE__ #define __ASM_ARCH_MAP_H __FILE__
#include <plat/map-base.h> #include <plat/map-base.h>
#include <plat/map-s5p.h>
/*
* map-base.h has already defined virtual memory address
* S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s)
* S3C_VA_SYS S3C_ADDR(0x00100000) system control
* S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used)
* S3C_VA_TIMER S3C_ADDR(0x00300000) timer block
* S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog
* S3C_VA_UART S3C_ADDR(0x01000000) UART
*
* S5PC100 specific virtual memory address can be defined here
* S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO
*
*/
/* Chip ID */
#define S5PC100_PA_CHIPID (0xE0000000) #define S5PC100_PA_CHIPID (0xE0000000)
#define S5PC1XX_PA_CHIPID S5PC100_PA_CHIPID #define S5P_PA_CHIPID S5PC100_PA_CHIPID
#define S5PC1XX_VA_CHIPID S3C_VA_SYS
#define S5PC100_PA_SYSCON (0xE0100000)
/* System */ #define S5P_PA_SYSCON S5PC100_PA_SYSCON
#define S5PC100_PA_CLK (0xE0100000)
#define S5PC100_PA_CLK_OTHER (0xE0200000) #define S5PC100_PA_OTHERS (0xE0200000)
#define S5PC100_PA_PWR (0xE0108000) #define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000)
#define S5PC1XX_PA_CLK S5PC100_PA_CLK
#define S5PC1XX_PA_PWR S5PC100_PA_PWR
#define S5PC1XX_PA_CLK_OTHER S5PC100_PA_CLK_OTHER
#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000)
#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000)
#define S5PC1XX_VA_CLK_OTHER (S3C_VA_SYS + 0x30000)
/* GPIO */
#define S5PC100_PA_GPIO (0xE0300000) #define S5PC100_PA_GPIO (0xE0300000)
#define S5PC1XX_PA_GPIO S5PC100_PA_GPIO #define S5P_PA_GPIO S5PC100_PA_GPIO
#define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000)
/* Interrupt */
#define S5PC100_PA_VIC (0xE4000000)
#define S5PC100_VA_VIC S3C_VA_IRQ
#define S5PC100_PA_VIC_OFFSET 0x100000
#define S5PC100_VA_VIC_OFFSET 0x10000
#define S5PC1XX_PA_VIC(x) (S5PC100_PA_VIC + ((x) * S5PC100_PA_VIC_OFFSET))
#define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET))
/* DMA */
#define S5PC100_PA_MDMA (0xE8100000)
#define S5PC100_PA_PDMA0 (0xE9000000)
#define S5PC100_PA_PDMA1 (0xE9200000)
/* Timer */
#define S5PC100_PA_TIMER (0xEA000000)
#define S5PC1XX_PA_TIMER S5PC100_PA_TIMER
#define S5PC1XX_VA_TIMER S3C_VA_TIMER
/* RTC */ #define S5PC100_PA_VIC0 (0xE4000000)
#define S5PC100_PA_RTC (0xEA300000) #define S5P_PA_VIC0 S5PC100_PA_VIC0
/* UART */ #define S5PC100_PA_VIC1 (0xE4100000)
#define S5PC100_PA_UART (0xEC000000) #define S5P_PA_VIC1 S5PC100_PA_VIC1
#define S5PC1XX_PA_UART S5PC100_PA_UART
#define S5PC1XX_VA_UART S3C_VA_UART
/* I2C */ #define S5PC100_PA_VIC2 (0xE4200000)
#define S5PC100_PA_I2C (0xEC100000) #define S5P_PA_VIC2 S5PC100_PA_VIC2
#define S5PC100_PA_I2C1 (0xEC200000)
/* USB HS OTG */ #define S5PC100_PA_TIMER (0xEA000000)
#define S5PC100_PA_USB_HSOTG (0xED200000) #define S5P_PA_TIMER S5PC100_PA_TIMER
#define S5PC100_PA_USB_HSPHY (0xED300000)
/* SD/MMC */ #define S5PC100_PA_SYSTIMER (0xEA100000)
#define S5PC100_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000))
#define S5PC100_PA_HSMMC0 S5PC100_PA_HSMMC(0)
#define S5PC100_PA_HSMMC1 S5PC100_PA_HSMMC(1)
#define S5PC100_PA_HSMMC2 S5PC100_PA_HSMMC(2)
/* LCD */ #define S5PC100_PA_UART (0xEC000000)
#define S5PC100_PA_FB (0xEE000000)
/* Multimedia */ #define S5P_PA_UART0 (S5PC100_PA_UART + 0x0)
#define S5PC100_PA_G2D (0xEE800000) #define S5P_PA_UART1 (S5PC100_PA_UART + 0x400)
#define S5PC100_PA_JPEG (0xEE500000) #define S5P_PA_UART2 (S5PC100_PA_UART + 0x800)
#define S5PC100_PA_ROTATOR (0xEE100000) #define S5P_PA_UART3 (S5PC100_PA_UART + 0xC00)
#define S5PC100_PA_G3D (0xEF000000) #define S5P_SZ_UART SZ_256
/* I2S */ #define S5PC100_PA_IIC0 (0xEC100000)
#define S5PC100_PA_I2S0 (0xF2000000) #define S5PC100_PA_IIC1 (0xEC200000)
#define S5PC100_PA_I2S1 (0xF2100000)
#define S5PC100_PA_I2S2 (0xF2200000)
/* KEYPAD */ #define S5PC100_PA_FB (0xEE000000)
#define S5PC100_PA_KEYPAD (0xF3100000)
/* ADC & TouchScreen */ #define S5PC100_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000))
#define S5PC100_PA_TSADC (0xF3000000)
/* ETC */
#define S5PC100_PA_SDRAM (0x20000000) #define S5PC100_PA_SDRAM (0x20000000)
#define S5PC1XX_PA_SDRAM S5PC100_PA_SDRAM #define S5P_PA_SDRAM S5PC100_PA_SDRAM
/* compatibility defines. */ /* compatibiltiy defines. */
#define S3C_PA_RTC S5PC100_PA_RTC
#define S3C_PA_UART S5PC100_PA_UART #define S3C_PA_UART S5PC100_PA_UART
#define S3C_PA_UART0 (S5PC100_PA_UART + 0x0) #define S3C_PA_IIC S5PC100_PA_IIC0
#define S3C_PA_UART1 (S5PC100_PA_UART + 0x400) #define S3C_PA_IIC1 S5PC100_PA_IIC1
#define S3C_PA_UART2 (S5PC100_PA_UART + 0x800)
#define S3C_PA_UART3 (S5PC100_PA_UART + 0xC00)
#define S3C_VA_UART0 (S3C_VA_UART + 0x0)
#define S3C_VA_UART1 (S3C_VA_UART + 0x400)
#define S3C_VA_UART2 (S3C_VA_UART + 0x800)
#define S3C_VA_UART3 (S3C_VA_UART + 0xC00)
#define S3C_UART_OFFSET 0x400
#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
#define S3C_PA_FB S5PC100_PA_FB #define S3C_PA_FB S5PC100_PA_FB
#define S3C_PA_G2D S5PC100_PA_G2D #define S3C_PA_HSMMC0 S5PC100_PA_HSMMC(0)
#define S3C_PA_G3D S5PC100_PA_G3D #define S3C_PA_HSMMC1 S5PC100_PA_HSMMC(1)
#define S3C_PA_JPEG S5PC100_PA_JPEG #define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2)
#define S3C_PA_ROTATOR S5PC100_PA_ROTATOR
#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0) #endif /* __ASM_ARCH_MAP_H */
#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000)
#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000)
#define S3C_PA_IIC S5PC100_PA_I2C
#define S3C_PA_IIC1 S5PC100_PA_I2C1
#define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG
#define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY
#define S3C_PA_HSMMC0 S5PC100_PA_HSMMC0
#define S3C_PA_HSMMC1 S5PC100_PA_HSMMC1
#define S3C_PA_HSMMC2 S5PC100_PA_HSMMC2
#define S3C_PA_KEYPAD S5PC100_PA_KEYPAD
#define S3C_PA_TSADC S5PC100_PA_TSADC
#endif /* __ASM_ARCH_C100_MAP_H */
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#define S5P_CLKREG(x) (S3C_VA_SYS + (x)) #define S5P_CLKREG(x) (S3C_VA_SYS + (x))
#define S5PC100_REG_OTHERS(x) (S5PC100_VA_OTHERS + (x))
#define S5P_APLL_LOCK S5P_CLKREG(0x00) #define S5P_APLL_LOCK S5P_CLKREG(0x00)
#define S5P_MPLL_LOCK S5P_CLKREG(0x04) #define S5P_MPLL_LOCK S5P_CLKREG(0x04)
#define S5P_EPLL_LOCK S5P_CLKREG(0x08) #define S5P_EPLL_LOCK S5P_CLKREG(0x08)
...@@ -68,4 +70,8 @@ ...@@ -68,4 +70,8 @@
#define S5P_CLKDIV1_PCLKD1_MASK (0x7<<16) #define S5P_CLKDIV1_PCLKD1_MASK (0x7<<16)
#define S5P_CLKDIV1_PCLKD1_SHIFT (16) #define S5P_CLKDIV1_PCLKD1_SHIFT (16)
#define S5PC100_SWRESET S5PC100_REG_OTHERS(0x000)
#define S5PC100_SWRESET_RESETVAL 0xc100
#endif /* __ASM_ARCH_REGS_CLOCK_H */ #endif /* __ASM_ARCH_REGS_CLOCK_H */
/* linux/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h /* linux/arch/arm/plat-s5pc100/include/plat/regs-gpio.h
* *
* Copyright 2009 Samsung Electronics Co. * Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com> * Byungho Min <bhmin@samsung.com>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <mach/map.h> #include <mach/map.h>
/* S5PC100 */ /* S5PC100 */
#define S5PC100_GPIO_BASE S5PC1XX_VA_GPIO #define S5PC100_GPIO_BASE S5P_VA_GPIO
#define S5PC100_GPA0_BASE (S5PC100_GPIO_BASE + 0x0000) #define S5PC100_GPA0_BASE (S5PC100_GPIO_BASE + 0x0000)
#define S5PC100_GPA1_BASE (S5PC100_GPIO_BASE + 0x0020) #define S5PC100_GPA1_BASE (S5PC100_GPIO_BASE + 0x0020)
#define S5PC100_GPB_BASE (S5PC100_GPIO_BASE + 0x0040) #define S5PC100_GPB_BASE (S5PC100_GPIO_BASE + 0x0040)
...@@ -47,24 +47,29 @@ ...@@ -47,24 +47,29 @@
#define S5PC100_GPL2_BASE (S5PC100_GPIO_BASE + 0x0360) #define S5PC100_GPL2_BASE (S5PC100_GPIO_BASE + 0x0360)
#define S5PC100_GPL3_BASE (S5PC100_GPIO_BASE + 0x0380) #define S5PC100_GPL3_BASE (S5PC100_GPIO_BASE + 0x0380)
#define S5PC100_GPL4_BASE (S5PC100_GPIO_BASE + 0x03A0) #define S5PC100_GPL4_BASE (S5PC100_GPIO_BASE + 0x03A0)
#define S5PC100_EINT_BASE (S5PC100_GPIO_BASE + 0x0E00)
#define S5PC100_UHOST (S5PC100_GPIO_BASE + 0x0B68) #define S5PC100EINT30CON (S5P_VA_GPIO + 0xE00)
#define S5PC100_PDNEN (S5PC100_GPIO_BASE + 0x0F80) #define S5P_EINT_CON(x) (S5PC100EINT30CON + ((x) * 0x4))
/* PDNEN */ #define S5PC100EINT30FLTCON0 (S5P_VA_GPIO + 0xE80)
#define S5PC100_PDNEN_CFG_PDNEN (1 << 1) #define S5P_EINT_FLTCON(x) (S5PC100EINT30FLTCON0 + ((x) * 0x4))
#define S5PC100_PDNEN_CFG_AUTO (0 << 1)
#define S5PC100_PDNEN_POWERDOWN (1 << 0)
#define S5PC100_PDNEN_NORMAL (0 << 0)
/* Common part */ #define S5PC100EINT30MASK (S5P_VA_GPIO + 0xF00)
/* External interrupt base is same at both s5pc100 and s5pc110 */ #define S5P_EINT_MASK(x) (S5PC100EINT30MASK + ((x) * 0x4))
#define S5PC1XX_EINT_BASE (S5PC100_EINT_BASE)
#define S5PC100_GPx_INPUT(__gpio) (0x0 << ((__gpio) * 4)) #define S5PC100EINT30PEND (S5P_VA_GPIO + 0xF40)
#define S5PC100_GPx_OUTPUT(__gpio) (0x1 << ((__gpio) * 4)) #define S5P_EINT_PEND(x) (S5PC100EINT30PEND + ((x) * 0x4))
#define S5PC100_GPx_CONMASK(__gpio) (0xf << ((__gpio) * 4))
#define EINT_REG_NR(x) (EINT_OFFSET(x) >> 3)
#define eint_irq_to_bit(irq) (1 << (EINT_OFFSET(irq) & 0x7))
/* values for S5P_EXTINT0 */
#define S5P_EXTINT_LOWLEV (0x00)
#define S5P_EXTINT_HILEV (0x01)
#define S5P_EXTINT_FALLEDGE (0x02)
#define S5P_EXTINT_RISEEDGE (0x03)
#define S5P_EXTINT_BOTHEDGE (0x04)
#endif /* __ASM_MACH_S5PC100_REGS_GPIO_H */ #endif /* __ASM_MACH_S5PC100_REGS_GPIO_H */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Copyright 2009 Samsung Electronics Co. * Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com> * Byungho Min <bhmin@samsung.com>
* *
* S5PC1XX - IRQ register definitions * S5PC100 - IRQ register definitions
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -16,9 +16,4 @@ ...@@ -16,9 +16,4 @@
#include <mach/map.h> #include <mach/map.h>
#include <asm/hardware/vic.h> #include <asm/hardware/vic.h>
/* interrupt controller */
#define S5PC1XX_VIC0REG(x) ((x) + S5PC1XX_VA_VIC(0))
#define S5PC1XX_VIC1REG(x) ((x) + S5PC1XX_VA_VIC(1))
#define S5PC1XX_VIC2REG(x) ((x) + S5PC1XX_VA_VIC(2))
#endif /* __ASM_ARCH_REGS_IRQ_H */ #endif /* __ASM_ARCH_REGS_IRQ_H */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Copyright 2009 Samsung Electronics Co. * Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com> * Byungho Min <bhmin@samsung.com>
* *
* S5PC1XX - system implementation * S5PC100 - system implementation
* *
* Based on mach-s3c6400/include/mach/system.h * Based on mach-s3c6400/include/mach/system.h
*/ */
...@@ -13,14 +13,11 @@ ...@@ -13,14 +13,11 @@
#include <linux/io.h> #include <linux/io.h>
#include <mach/map.h> #include <mach/map.h>
#include <plat/regs-clock.h> #include <mach/regs-clock.h>
void (*s5pc1xx_idle)(void);
static void arch_idle(void) static void arch_idle(void)
{ {
if (s5pc1xx_idle) /* nothing here yet */
s5pc1xx_idle();
} }
static void arch_reset(char mode, const char *cmd) static void arch_reset(char mode, const char *cmd)
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
*/ */
static inline u32 s3c24xx_ostimer_pending(void) static inline u32 s3c24xx_ostimer_pending(void)
{ {
u32 pend = __raw_readl(S3C_VA_VIC0 + VIC_RAW_STATUS); u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
return pend & 1 << (IRQ_TIMER4_VIC - S5PC1XX_IRQ_VIC0(0)); return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
} }
#define TICK_MAX (0xffffffff) #define TICK_MAX (0xffffffff)
......
/* linux/arch/arm/plat-s5pc1xx/s5pc100-init.c /* linux/arch/arm/plat-s5pc100/s5pc100-init.c
* *
* Copyright 2009 Samsung Electronics Co. * Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com> * Byungho Min <bhmin@samsung.com>
* *
* S5PC100 - CPU initialisation (common with other S5PC1XX chips)
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -19,9 +18,7 @@ ...@@ -19,9 +18,7 @@
#include <plat/s5pc100.h> #include <plat/s5pc100.h>
/* uart registration process */ /* uart registration process */
void __init s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) void __init s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
{ {
/* The driver name is s3c6400-uart to reuse s3c6400_serial_drv */ s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
s3c24xx_init_uartdevs("s3c6400-uart", s5pc1xx_uart_resources, cfg, no);
} }
/* /*
* arch/arm/plat-s5pc1xx/irq-gpio.c * arch/arm/mach-s5pc100/irq-gpio.c
* *
* Copyright (C) 2009 Samsung Electronics * Copyright (C) 2009 Samsung Electronics
* *
* S5PC1XX - Interrupt handling for IRQ_GPIO${group}(x) * S5PC100 - Interrupt handling for IRQ_GPIO${group}(x)
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <mach/map.h> #include <mach/map.h>
#include <plat/gpio-cfg.h> #include <plat/gpio-cfg.h>
#define S5PC1XX_GPIOREG(x) (S5PC1XX_VA_GPIO + (x)) #define S5P_GPIOREG(x) (S5P_VA_GPIO + (x))
#define CON_OFFSET 0x700 #define CON_OFFSET 0x700
#define MASK_OFFSET 0x900 #define MASK_OFFSET 0x900
...@@ -49,7 +49,7 @@ static int group_to_pend_offset(int group) ...@@ -49,7 +49,7 @@ static int group_to_pend_offset(int group)
return group << 2; return group << 2;
} }
static int s5pc1xx_get_start(unsigned int group) static int s5pc100_get_start(unsigned int group)
{ {
switch (group) { switch (group) {
case 0: return S5PC100_GPIO_A0_START; case 0: return S5PC100_GPIO_A0_START;
...@@ -80,7 +80,7 @@ static int s5pc1xx_get_start(unsigned int group) ...@@ -80,7 +80,7 @@ static int s5pc1xx_get_start(unsigned int group)
return -EINVAL; return -EINVAL;
} }
static int s5pc1xx_get_group(unsigned int irq) static int s5pc100_get_group(unsigned int irq)
{ {
irq -= S3C_IRQ_GPIO(0); irq -= S3C_IRQ_GPIO(0);
...@@ -134,67 +134,67 @@ static int s5pc1xx_get_group(unsigned int irq) ...@@ -134,67 +134,67 @@ static int s5pc1xx_get_group(unsigned int irq)
return -EINVAL; return -EINVAL;
} }
static int s5pc1xx_get_offset(unsigned int irq) static int s5pc100_get_offset(unsigned int irq)
{ {
struct gpio_chip *chip = get_irq_data(irq); struct gpio_chip *chip = get_irq_data(irq);
return irq - S3C_IRQ_GPIO(chip->base); return irq - S3C_IRQ_GPIO(chip->base);
} }
static void s5pc1xx_gpioint_ack(unsigned int irq) static void s5pc100_gpioint_ack(unsigned int irq)
{ {
int group, offset, pend_offset; int group, offset, pend_offset;
unsigned int value; unsigned int value;
group = s5pc1xx_get_group(irq); group = s5pc100_get_group(irq);
offset = s5pc1xx_get_offset(irq); offset = s5pc100_get_offset(irq);
pend_offset = group_to_pend_offset(group); pend_offset = group_to_pend_offset(group);
value = __raw_readl(S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset); value = __raw_readl(S5P_GPIOREG(PEND_OFFSET) + pend_offset);
value |= 1 << offset; value |= 1 << offset;
__raw_writel(value, S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset); __raw_writel(value, S5P_GPIOREG(PEND_OFFSET) + pend_offset);
} }
static void s5pc1xx_gpioint_mask(unsigned int irq) static void s5pc100_gpioint_mask(unsigned int irq)
{ {
int group, offset, mask_offset; int group, offset, mask_offset;
unsigned int value; unsigned int value;
group = s5pc1xx_get_group(irq); group = s5pc100_get_group(irq);
offset = s5pc1xx_get_offset(irq); offset = s5pc100_get_offset(irq);
mask_offset = group_to_mask_offset(group); mask_offset = group_to_mask_offset(group);
value = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset); value = __raw_readl(S5P_GPIOREG(MASK_OFFSET) + mask_offset);
value |= 1 << offset; value |= 1 << offset;
__raw_writel(value, S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset); __raw_writel(value, S5P_GPIOREG(MASK_OFFSET) + mask_offset);
} }
static void s5pc1xx_gpioint_unmask(unsigned int irq) static void s5pc100_gpioint_unmask(unsigned int irq)
{ {
int group, offset, mask_offset; int group, offset, mask_offset;
unsigned int value; unsigned int value;
group = s5pc1xx_get_group(irq); group = s5pc100_get_group(irq);
offset = s5pc1xx_get_offset(irq); offset = s5pc100_get_offset(irq);
mask_offset = group_to_mask_offset(group); mask_offset = group_to_mask_offset(group);
value = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset); value = __raw_readl(S5P_GPIOREG(MASK_OFFSET) + mask_offset);
value &= ~(1 << offset); value &= ~(1 << offset);
__raw_writel(value, S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset); __raw_writel(value, S5P_GPIOREG(MASK_OFFSET) + mask_offset);
} }
static void s5pc1xx_gpioint_mask_ack(unsigned int irq) static void s5pc100_gpioint_mask_ack(unsigned int irq)
{ {
s5pc1xx_gpioint_mask(irq); s5pc100_gpioint_mask(irq);
s5pc1xx_gpioint_ack(irq); s5pc100_gpioint_ack(irq);
} }
static int s5pc1xx_gpioint_set_type(unsigned int irq, unsigned int type) static int s5pc100_gpioint_set_type(unsigned int irq, unsigned int type)
{ {
int group, offset, con_offset; int group, offset, con_offset;
unsigned int value; unsigned int value;
group = s5pc1xx_get_group(irq); group = s5pc100_get_group(irq);
offset = s5pc1xx_get_offset(irq); offset = s5pc100_get_offset(irq);
con_offset = group_to_con_offset(group); con_offset = group_to_con_offset(group);
switch (type) { switch (type) {
...@@ -221,24 +221,24 @@ static int s5pc1xx_gpioint_set_type(unsigned int irq, unsigned int type) ...@@ -221,24 +221,24 @@ static int s5pc1xx_gpioint_set_type(unsigned int irq, unsigned int type)
} }
value = __raw_readl(S5PC1XX_GPIOREG(CON_OFFSET) + con_offset); value = __raw_readl(S5P_GPIOREG(CON_OFFSET) + con_offset);
value &= ~(0xf << (offset * 0x4)); value &= ~(0xf << (offset * 0x4));
value |= (type << (offset * 0x4)); value |= (type << (offset * 0x4));
__raw_writel(value, S5PC1XX_GPIOREG(CON_OFFSET) + con_offset); __raw_writel(value, S5P_GPIOREG(CON_OFFSET) + con_offset);
return 0; return 0;
} }
struct irq_chip s5pc1xx_gpioint = { struct irq_chip s5pc100_gpioint = {
.name = "GPIO", .name = "GPIO",
.ack = s5pc1xx_gpioint_ack, .ack = s5pc100_gpioint_ack,
.mask = s5pc1xx_gpioint_mask, .mask = s5pc100_gpioint_mask,
.mask_ack = s5pc1xx_gpioint_mask_ack, .mask_ack = s5pc100_gpioint_mask_ack,
.unmask = s5pc1xx_gpioint_unmask, .unmask = s5pc100_gpioint_unmask,
.set_type = s5pc1xx_gpioint_set_type, .set_type = s5pc100_gpioint_set_type,
}; };
void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc) void s5pc100_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc)
{ {
int group, offset, pend_offset, mask_offset; int group, offset, pend_offset, mask_offset;
int real_irq, group_end; int real_irq, group_end;
...@@ -248,17 +248,17 @@ void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc) ...@@ -248,17 +248,17 @@ void s5pc1xx_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc)
for (group = 0; group < group_end; group++) { for (group = 0; group < group_end; group++) {
pend_offset = group_to_pend_offset(group); pend_offset = group_to_pend_offset(group);
pend = __raw_readl(S5PC1XX_GPIOREG(PEND_OFFSET) + pend_offset); pend = __raw_readl(S5P_GPIOREG(PEND_OFFSET) + pend_offset);
if (!pend) if (!pend)
continue; continue;
mask_offset = group_to_mask_offset(group); mask_offset = group_to_mask_offset(group);
mask = __raw_readl(S5PC1XX_GPIOREG(MASK_OFFSET) + mask_offset); mask = __raw_readl(S5P_GPIOREG(MASK_OFFSET) + mask_offset);
pend &= ~mask; pend &= ~mask;
for (offset = 0; offset < 8; offset++) { for (offset = 0; offset < 8; offset++) {
if (pend & (1 << offset)) { if (pend & (1 << offset)) {
real_irq = s5pc1xx_get_start(group) + offset; real_irq = s5pc100_get_start(group) + offset;
generic_handle_irq(S3C_IRQ_GPIO(real_irq)); generic_handle_irq(S3C_IRQ_GPIO(real_irq));
} }
} }
......
...@@ -43,38 +43,48 @@ ...@@ -43,38 +43,48 @@
#include <plat/fb.h> #include <plat/fb.h>
#include <plat/iic.h> #include <plat/iic.h>
#define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK) /* Following are default values for UCON, ULCON and UFCON UART registers */
#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB) #define S5PC100_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) S3C2410_UCON_RXILEVEL | \
S3C2410_UCON_TXIRQMODE | \
S3C2410_UCON_RXIRQMODE | \
S3C2410_UCON_RXFIFO_TOI | \
S3C2443_UCON_RXERR_IRQEN)
#define S5PC100_ULCON_DEFAULT S3C2410_LCON_CS8
#define S5PC100_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
S3C2440_UFCON_RXTRIG8 | \
S3C2440_UFCON_TXTRIG16)
static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = { static struct s3c2410_uartcfg smdkc100_uartcfgs[] __initdata = {
[0] = { [0] = {
.hwport = 0, .hwport = 0,
.flags = 0, .flags = 0,
.ucon = 0x3c5, .ucon = S5PC100_UCON_DEFAULT,
.ulcon = 0x03, .ulcon = S5PC100_ULCON_DEFAULT,
.ufcon = 0x51, .ufcon = S5PC100_UFCON_DEFAULT,
}, },
[1] = { [1] = {
.hwport = 1, .hwport = 1,
.flags = 0, .flags = 0,
.ucon = 0x3c5, .ucon = S5PC100_UCON_DEFAULT,
.ulcon = 0x03, .ulcon = S5PC100_ULCON_DEFAULT,
.ufcon = 0x51, .ufcon = S5PC100_UFCON_DEFAULT,
}, },
[2] = { [2] = {
.hwport = 2, .hwport = 2,
.flags = 0, .flags = 0,
.ucon = 0x3c5, .ucon = S5PC100_UCON_DEFAULT,
.ulcon = 0x03, .ulcon = S5PC100_ULCON_DEFAULT,
.ufcon = 0x51, .ufcon = S5PC100_UFCON_DEFAULT,
}, },
[3] = { [3] = {
.hwport = 3, .hwport = 3,
.flags = 0, .flags = 0,
.ucon = 0x3c5, .ucon = S5PC100_UCON_DEFAULT,
.ulcon = 0x03, .ulcon = S5PC100_ULCON_DEFAULT,
.ufcon = 0x51, .ufcon = S5PC100_UFCON_DEFAULT,
}, },
}; };
...@@ -118,8 +128,7 @@ static struct platform_device smdkc100_lcd_powerdev = { ...@@ -118,8 +128,7 @@ static struct platform_device smdkc100_lcd_powerdev = {
static struct s3c_fb_pd_win smdkc100_fb_win0 = { static struct s3c_fb_pd_win smdkc100_fb_win0 = {
/* this is to ensure we use win0 */ /* this is to ensure we use win0 */
.win_mode = { .win_mode = {
.refresh = 70, .pixclock = 1000000000000ULL / ((8+13+3+800)*(7+5+1+480)*80),
.pixclock = (8+13+3+800)*(7+5+1+480),
.left_margin = 8, .left_margin = 8,
.right_margin = 13, .right_margin = 13,
.upper_margin = 7, .upper_margin = 7,
...@@ -140,8 +149,6 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = { ...@@ -140,8 +149,6 @@ static struct s3c_fb_platdata smdkc100_lcd_pdata __initdata = {
.setup_gpio = s5pc100_fb_gpio_setup_24bpp, .setup_gpio = s5pc100_fb_gpio_setup_24bpp,
}; };
static struct map_desc smdkc100_iodesc[] = {};
static struct platform_device *smdkc100_devices[] __initdata = { static struct platform_device *smdkc100_devices[] __initdata = {
&s3c_device_i2c0, &s3c_device_i2c0,
&s3c_device_i2c1, &s3c_device_i2c1,
...@@ -154,7 +161,7 @@ static struct platform_device *smdkc100_devices[] __initdata = { ...@@ -154,7 +161,7 @@ static struct platform_device *smdkc100_devices[] __initdata = {
static void __init smdkc100_map_io(void) static void __init smdkc100_map_io(void)
{ {
s5pc1xx_init_io(smdkc100_iodesc, ARRAY_SIZE(smdkc100_iodesc)); s5p_init_io(NULL, 0, S5P_VA_CHIPID);
s3c24xx_init_clocks(12000000); s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs)); s3c24xx_init_uarts(smdkc100_uartcfgs, ARRAY_SIZE(smdkc100_uartcfgs));
} }
...@@ -178,10 +185,9 @@ static void __init smdkc100_machine_init(void) ...@@ -178,10 +185,9 @@ static void __init smdkc100_machine_init(void)
MACHINE_START(SMDKC100, "SMDKC100") MACHINE_START(SMDKC100, "SMDKC100")
/* Maintainer: Byungho Min <bhmin@samsung.com> */ /* Maintainer: Byungho Min <bhmin@samsung.com> */
.phys_io = S5PC100_PA_UART & 0xfff00000, .phys_io = S3C_PA_UART & 0xfff00000,
.io_pg_offst = (((u32)S5PC1XX_VA_UART) >> 18) & 0xfffc, .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
.boot_params = S5PC100_PA_SDRAM + 0x100, .boot_params = S5P_PA_SDRAM + 0x100,
.init_irq = s5pc100_init_irq, .init_irq = s5pc100_init_irq,
.map_io = smdkc100_map_io, .map_io = smdkc100_map_io,
.init_machine = smdkc100_machine_init, .init_machine = smdkc100_machine_init,
......
/* linux/arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c /* linux/arch/arm/plat-s5pc100/setup-sdhci-gpio.c
* *
* Copyright 2009 Samsung Eletronics * Copyright 2009 Samsung Eletronics
* *
* S5PC1XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) * S5PC100 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 as
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
config PLAT_S5P config PLAT_S5P
bool bool
depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210) depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PC100 || ARCH_S5PV210)
default y default y
select ARM_VIC select ARM_VIC
select NO_IOPORT select NO_IOPORT
......
...@@ -19,12 +19,14 @@ ...@@ -19,12 +19,14 @@
#include <plat/cpu.h> #include <plat/cpu.h>
#include <plat/s5p6440.h> #include <plat/s5p6440.h>
#include <plat/s5p6442.h> #include <plat/s5p6442.h>
#include <plat/s5pc100.h>
#include <plat/s5pv210.h> #include <plat/s5pv210.h>
/* table of supported CPUs */ /* table of supported CPUs */
static const char name_s5p6440[] = "S5P6440"; static const char name_s5p6440[] = "S5P6440";
static const char name_s5p6442[] = "S5P6442"; static const char name_s5p6442[] = "S5P6442";
static const char name_s5pc100[] = "S5PC100";
static const char name_s5pv210[] = "S5PV210/S5PC110"; static const char name_s5pv210[] = "S5PV210/S5PC110";
static struct cpu_table cpu_ids[] __initdata = { static struct cpu_table cpu_ids[] __initdata = {
...@@ -44,6 +46,14 @@ static struct cpu_table cpu_ids[] __initdata = { ...@@ -44,6 +46,14 @@ static struct cpu_table cpu_ids[] __initdata = {
.init_uarts = s5p6442_init_uarts, .init_uarts = s5p6442_init_uarts,
.init = s5p6442_init, .init = s5p6442_init,
.name = name_s5p6442, .name = name_s5p6442,
}, {
.idcode = 0x43100000,
.idmask = 0xfffff000,
.map_io = s5pc100_map_io,
.init_clocks = s5pc100_init_clocks,
.init_uarts = s5pc100_init_uarts,
.init = s5pc100_init,
.name = name_s5pc100,
}, { }, {
.idcode = 0x43110000, .idcode = 0x43110000,
.idmask = 0xfffff000, .idmask = 0xfffff000,
......
/* arch/arm/plat-s5p/include/plat/s5pc100.h
*
* Copyright (c) 2010 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* Header file for s5pc100 cpu support
*
* 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.
*/
/* Common init code for S5PC100 related SoCs */
extern void s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
extern void s5pc100_register_clocks(void);
extern void s5pc100_setup_clocks(void);
#ifdef CONFIG_CPU_S5PC100
extern int s5pc100_init(void);
extern void s5pc100_init_irq(void);
extern void s5pc100_map_io(void);
extern void s5pc100_init_clocks(int xtal);
#define s5pc100_init_uarts s5pc100_common_init_uarts
#else
#define s5pc100_init_clocks NULL
#define s5pc100_init_uarts NULL
#define s5pc100_map_io NULL
#define s5pc100_init NULL
#endif
# Copyright 2009 Samsung Electronics Co.
# Byungho Min <bhmin@samsung.com>
#
# Licensed under GPLv2
config PLAT_S5PC1XX
bool
depends on ARCH_S5PC1XX
default y
select PLAT_S3C
select ARM_VIC
select NO_IOPORT
select ARCH_REQUIRE_GPIOLIB
select SAMSUNG_CLKSRC
select SAMSUNG_IRQ_UART
select SAMSUNG_IRQ_VIC_TIMER
select S3C_GPIO_TRACK
select S3C_GPIO_PULL_UPDOWN
select S5P_GPIO_DRVSTR
select S3C_GPIO_CFG_S3C24XX
select S3C_GPIO_CFG_S3C64XX
select SAMSUNG_GPIOLIB_4BIT
help
Base platform code for any Samsung S5PC1XX device
if PLAT_S5PC1XX
# Configuration options shared by all S3C64XX implementations
config CPU_S5PC100_INIT
bool
help
Common initialisation code for the S5PC1XX
config CPU_S5PC100_CLOCK
bool
help
Common clock support code for the S5PC1XX
# platform specific device setup
config S5PC1XX_SETUP_SDHCI_GPIO
bool
help
Common setup code for SDHCI gpio.
endif
# arch/arm/plat-s5pc1xx/Makefile
#
# Copyright 2009 Samsung Electronics Co.
#
# Licensed under GPLv2
obj-y :=
obj-m :=
obj-n := dummy.o
obj- :=
# Core files
obj-y += dev-uart.o
obj-y += cpu.o
obj-y += irq.o
obj-y += clock.o
# CPU support
obj-$(CONFIG_CPU_S5PC100_INIT) += s5pc100-init.o
obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o
# Device setup
obj-$(CONFIG_S5PC1XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
This diff is collapsed.
/* linux/arch/arm/plat-s5pc1xx/cpu.c
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
*
* S5PC1XX CPU Support
*
* Based on plat-s3c64xx/cpu.c
*
* 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 <linux/init.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/serial_core.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <mach/hardware.h>
#include <mach/map.h>
#include <asm/mach/map.h>
#include <plat/regs-serial.h>
#include <plat/cpu.h>
#include <plat/devs.h>
#include <plat/clock.h>
#include <plat/s5pc100.h>
/* table of supported CPUs */
static const char name_s5pc100[] = "S5PC100";
static struct cpu_table cpu_ids[] __initdata = {
{
.idcode = 0x43100000,
.idmask = 0xfffff000,
.map_io = s5pc100_map_io,
.init_clocks = s5pc100_init_clocks,
.init_uarts = s5pc100_init_uarts,
.init = s5pc100_init,
.name = name_s5pc100,
},
};
/* minimal IO mapping */
/* see notes on uart map in arch/arm/mach-s5pc100/include/mach/debug-macro.S */
#define UART_OFFS (S3C_PA_UART & 0xffff)
static struct map_desc s5pc1xx_iodesc[] __initdata = {
{
.virtual = (unsigned long)S5PC1XX_VA_CLK_OTHER,
.pfn = __phys_to_pfn(S5PC1XX_PA_CLK_OTHER),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC1XX_VA_GPIO,
.pfn = __phys_to_pfn(S5PC100_PA_GPIO),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC1XX_VA_CHIPID,
.pfn = __phys_to_pfn(S5PC1XX_PA_CHIPID),
.length = SZ_16,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC1XX_VA_CLK,
.pfn = __phys_to_pfn(S5PC1XX_PA_CLK),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC1XX_VA_PWR,
.pfn = __phys_to_pfn(S5PC1XX_PA_PWR),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)(S5PC1XX_VA_UART),
.pfn = __phys_to_pfn(S5PC1XX_PA_UART),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC1XX_VA_VIC(0),
.pfn = __phys_to_pfn(S5PC1XX_PA_VIC(0)),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC1XX_VA_VIC(1),
.pfn = __phys_to_pfn(S5PC1XX_PA_VIC(1)),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC1XX_VA_VIC(2),
.pfn = __phys_to_pfn(S5PC1XX_PA_VIC(2)),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC1XX_VA_TIMER,
.pfn = __phys_to_pfn(S5PC1XX_PA_TIMER),
.length = SZ_256,
.type = MT_DEVICE,
},
};
/* read cpu identification code */
void __init s5pc1xx_init_io(struct map_desc *mach_desc, int size)
{
unsigned long idcode;
/* initialise the io descriptors we need for initialisation */
iotable_init(s5pc1xx_iodesc, ARRAY_SIZE(s5pc1xx_iodesc));
iotable_init(mach_desc, size);
idcode = __raw_readl(S5PC1XX_VA_CHIPID);
s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
}
/* linux/arch/arm/plat-s5pc1xx/dev-uart.c
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
*
* Based on plat-s3c64xx/dev-uart.c
*
* 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 <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/platform_device.h>
#include <asm/mach/arch.h>
#include <asm/mach/irq.h>
#include <mach/hardware.h>
#include <mach/map.h>
#include <plat/devs.h>
/* Serial port registrations */
/* 64xx uarts are closer together */
static struct resource s5pc1xx_uart0_resource[] = {
[0] = {
.start = S3C_PA_UART0,
.end = S3C_PA_UART0 + 0x100,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_S3CUART_RX0,
.end = IRQ_S3CUART_RX0,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = IRQ_S3CUART_TX0,
.end = IRQ_S3CUART_TX0,
.flags = IORESOURCE_IRQ,
},
[3] = {
.start = IRQ_S3CUART_ERR0,
.end = IRQ_S3CUART_ERR0,
.flags = IORESOURCE_IRQ,
}
};
static struct resource s5pc1xx_uart1_resource[] = {
[0] = {
.start = S3C_PA_UART1,
.end = S3C_PA_UART1 + 0x100,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_S3CUART_RX1,
.end = IRQ_S3CUART_RX1,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = IRQ_S3CUART_TX1,
.end = IRQ_S3CUART_TX1,
.flags = IORESOURCE_IRQ,
},
[3] = {
.start = IRQ_S3CUART_ERR1,
.end = IRQ_S3CUART_ERR1,
.flags = IORESOURCE_IRQ,
},
};
static struct resource s5pc1xx_uart2_resource[] = {
[0] = {
.start = S3C_PA_UART2,
.end = S3C_PA_UART2 + 0x100,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_S3CUART_RX2,
.end = IRQ_S3CUART_RX2,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = IRQ_S3CUART_TX2,
.end = IRQ_S3CUART_TX2,
.flags = IORESOURCE_IRQ,
},
[3] = {
.start = IRQ_S3CUART_ERR2,
.end = IRQ_S3CUART_ERR2,
.flags = IORESOURCE_IRQ,
},
};
static struct resource s5pc1xx_uart3_resource[] = {
[0] = {
.start = S3C_PA_UART3,
.end = S3C_PA_UART3 + 0x100,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_S3CUART_RX3,
.end = IRQ_S3CUART_RX3,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = IRQ_S3CUART_TX3,
.end = IRQ_S3CUART_TX3,
.flags = IORESOURCE_IRQ,
},
[3] = {
.start = IRQ_S3CUART_ERR3,
.end = IRQ_S3CUART_ERR3,
.flags = IORESOURCE_IRQ,
},
};
struct s3c24xx_uart_resources s5pc1xx_uart_resources[] __initdata = {
[0] = {
.resources = s5pc1xx_uart0_resource,
.nr_resources = ARRAY_SIZE(s5pc1xx_uart0_resource),
},
[1] = {
.resources = s5pc1xx_uart1_resource,
.nr_resources = ARRAY_SIZE(s5pc1xx_uart1_resource),
},
[2] = {
.resources = s5pc1xx_uart2_resource,
.nr_resources = ARRAY_SIZE(s5pc1xx_uart2_resource),
},
[3] = {
.resources = s5pc1xx_uart3_resource,
.nr_resources = ARRAY_SIZE(s5pc1xx_uart3_resource),
},
};
/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-eint.h
*
* Copyright 2009 Samsung Electronics Co.
*
* External Interrupt (GPH0 ~ GPH3) control register definitions
*
* 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.
*/
#define S5PC1XX_WKUP_INT_CON0_7 (S5PC1XX_EINT_BASE + 0x0)
#define S5PC1XX_WKUP_INT_CON8_15 (S5PC1XX_EINT_BASE + 0x4)
#define S5PC1XX_WKUP_INT_CON16_23 (S5PC1XX_EINT_BASE + 0x8)
#define S5PC1XX_WKUP_INT_CON24_31 (S5PC1XX_EINT_BASE + 0xC)
#define S5PC1XX_WKUP_INT_CON(x) (S5PC1XX_WKUP_INT_CON0_7 + (x * 0x4))
#define S5PC1XX_WKUP_INT_FLTCON0_3 (S5PC1XX_EINT_BASE + 0x80)
#define S5PC1XX_WKUP_INT_FLTCON4_7 (S5PC1XX_EINT_BASE + 0x84)
#define S5PC1XX_WKUP_INT_FLTCON8_11 (S5PC1XX_EINT_BASE + 0x88)
#define S5PC1XX_WKUP_INT_FLTCON12_15 (S5PC1XX_EINT_BASE + 0x8C)
#define S5PC1XX_WKUP_INT_FLTCON16_19 (S5PC1XX_EINT_BASE + 0x90)
#define S5PC1XX_WKUP_INT_FLTCON20_23 (S5PC1XX_EINT_BASE + 0x94)
#define S5PC1XX_WKUP_INT_FLTCON24_27 (S5PC1XX_EINT_BASE + 0x98)
#define S5PC1XX_WKUP_INT_FLTCON28_31 (S5PC1XX_EINT_BASE + 0x9C)
#define S5PC1XX_WKUP_INT_FLTCON(x) (S5PC1XX_WKUP_INT_FLTCON0_3 + (x * 0x4))
#define S5PC1XX_WKUP_INT_MASK0_7 (S5PC1XX_EINT_BASE + 0x100)
#define S5PC1XX_WKUP_INT_MASK8_15 (S5PC1XX_EINT_BASE + 0x104)
#define S5PC1XX_WKUP_INT_MASK16_23 (S5PC1XX_EINT_BASE + 0x108)
#define S5PC1XX_WKUP_INT_MASK24_31 (S5PC1XX_EINT_BASE + 0x10C)
#define S5PC1XX_WKUP_INT_MASK(x) (S5PC1XX_WKUP_INT_MASK0_7 + (x * 0x4))
#define S5PC1XX_WKUP_INT_PEND0_7 (S5PC1XX_EINT_BASE + 0x140)
#define S5PC1XX_WKUP_INT_PEND8_15 (S5PC1XX_EINT_BASE + 0x144)
#define S5PC1XX_WKUP_INT_PEND16_23 (S5PC1XX_EINT_BASE + 0x148)
#define S5PC1XX_WKUP_INT_PEND24_31 (S5PC1XX_EINT_BASE + 0x14C)
#define S5PC1XX_WKUP_INT_PEND(x) (S5PC1XX_WKUP_INT_PEND0_7 + (x * 0x4))
#define S5PC1XX_WKUP_INT_LOWLEV (0x00)
#define S5PC1XX_WKUP_INT_HILEV (0x01)
#define S5PC1XX_WKUP_INT_FALLEDGE (0x02)
#define S5PC1XX_WKUP_INT_RISEEDGE (0x03)
#define S5PC1XX_WKUP_INT_BOTHEDGE (0x04)
/* linux/arch/arm/plat-s5pc1xx/include/plat/irqs.h
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
*
* S5PC1XX - Common IRQ support
*
* Based on plat-s3c64xx/include/plat/irqs.h
*/
#ifndef __ASM_PLAT_S5PC1XX_IRQS_H
#define __ASM_PLAT_S5PC1XX_IRQS_H __FILE__
/* we keep the first set of CPU IRQs out of the range of
* the ISA space, so that the PC104 has them to itself
* and we don't end up having to do horrible things to the
* standard ISA drivers....
*
* note, since we're using the VICs, our start must be a
* mulitple of 32 to allow the common code to work
*/
#define S3C_IRQ_OFFSET (32)
#define S3C_IRQ(x) ((x) + S3C_IRQ_OFFSET)
#define S3C_VIC0_BASE S3C_IRQ(0)
#define S3C_VIC1_BASE S3C_IRQ(32)
#define S3C_VIC2_BASE S3C_IRQ(64)
/* UART interrupts, each UART has 4 intterupts per channel so
* use the space between the ISA and S3C main interrupts. Note, these
* are not in the same order as the S3C24XX series! */
#define IRQ_S3CUART_BASE0 (16)
#define IRQ_S3CUART_BASE1 (20)
#define IRQ_S3CUART_BASE2 (24)
#define IRQ_S3CUART_BASE3 (28)
#define UART_IRQ_RXD (0)
#define UART_IRQ_ERR (1)
#define UART_IRQ_TXD (2)
#define UART_IRQ_MODEM (3)
#define IRQ_S3CUART_RX0 (IRQ_S3CUART_BASE0 + UART_IRQ_RXD)
#define IRQ_S3CUART_TX0 (IRQ_S3CUART_BASE0 + UART_IRQ_TXD)
#define IRQ_S3CUART_ERR0 (IRQ_S3CUART_BASE0 + UART_IRQ_ERR)
#define IRQ_S3CUART_RX1 (IRQ_S3CUART_BASE1 + UART_IRQ_RXD)
#define IRQ_S3CUART_TX1 (IRQ_S3CUART_BASE1 + UART_IRQ_TXD)
#define IRQ_S3CUART_ERR1 (IRQ_S3CUART_BASE1 + UART_IRQ_ERR)
#define IRQ_S3CUART_RX2 (IRQ_S3CUART_BASE2 + UART_IRQ_RXD)
#define IRQ_S3CUART_TX2 (IRQ_S3CUART_BASE2 + UART_IRQ_TXD)
#define IRQ_S3CUART_ERR2 (IRQ_S3CUART_BASE2 + UART_IRQ_ERR)
#define IRQ_S3CUART_RX3 (IRQ_S3CUART_BASE3 + UART_IRQ_RXD)
#define IRQ_S3CUART_TX3 (IRQ_S3CUART_BASE3 + UART_IRQ_TXD)
#define IRQ_S3CUART_ERR3 (IRQ_S3CUART_BASE3 + UART_IRQ_ERR)
/* VIC based IRQs */
#define S5PC1XX_IRQ_VIC0(x) (S3C_VIC0_BASE + (x))
#define S5PC1XX_IRQ_VIC1(x) (S3C_VIC1_BASE + (x))
#define S5PC1XX_IRQ_VIC2(x) (S3C_VIC2_BASE + (x))
/*
* VIC0: system, DMA, timer
*/
#define IRQ_EINT0 S5PC1XX_IRQ_VIC0(0)
#define IRQ_EINT1 S5PC1XX_IRQ_VIC0(1)
#define IRQ_EINT2 S5PC1XX_IRQ_VIC0(2)
#define IRQ_EINT3 S5PC1XX_IRQ_VIC0(3)
#define IRQ_EINT4 S5PC1XX_IRQ_VIC0(4)
#define IRQ_EINT5 S5PC1XX_IRQ_VIC0(5)
#define IRQ_EINT6 S5PC1XX_IRQ_VIC0(6)
#define IRQ_EINT7 S5PC1XX_IRQ_VIC0(7)
#define IRQ_EINT8 S5PC1XX_IRQ_VIC0(8)
#define IRQ_EINT9 S5PC1XX_IRQ_VIC0(9)
#define IRQ_EINT10 S5PC1XX_IRQ_VIC0(10)
#define IRQ_EINT11 S5PC1XX_IRQ_VIC0(11)
#define IRQ_EINT12 S5PC1XX_IRQ_VIC0(12)
#define IRQ_EINT13 S5PC1XX_IRQ_VIC0(13)
#define IRQ_EINT14 S5PC1XX_IRQ_VIC0(14)
#define IRQ_EINT15 S5PC1XX_IRQ_VIC0(15)
#define IRQ_EINT16_31 S5PC1XX_IRQ_VIC0(16)
#define IRQ_BATF S5PC1XX_IRQ_VIC0(17)
#define IRQ_MDMA S5PC1XX_IRQ_VIC0(18)
#define IRQ_PDMA0 S5PC1XX_IRQ_VIC0(19)
#define IRQ_PDMA1 S5PC1XX_IRQ_VIC0(20)
#define IRQ_TIMER0_VIC S5PC1XX_IRQ_VIC0(21)
#define IRQ_TIMER1_VIC S5PC1XX_IRQ_VIC0(22)
#define IRQ_TIMER2_VIC S5PC1XX_IRQ_VIC0(23)
#define IRQ_TIMER3_VIC S5PC1XX_IRQ_VIC0(24)
#define IRQ_TIMER4_VIC S5PC1XX_IRQ_VIC0(25)
#define IRQ_SYSTIMER S5PC1XX_IRQ_VIC0(26)
#define IRQ_WDT S5PC1XX_IRQ_VIC0(27)
#define IRQ_RTC_ALARM S5PC1XX_IRQ_VIC0(28)
#define IRQ_RTC_TIC S5PC1XX_IRQ_VIC0(29)
#define IRQ_GPIOINT S5PC1XX_IRQ_VIC0(30)
/*
* VIC1: ARM, power, memory, connectivity
*/
#define IRQ_CORTEX0 S5PC1XX_IRQ_VIC1(0)
#define IRQ_CORTEX1 S5PC1XX_IRQ_VIC1(1)
#define IRQ_CORTEX2 S5PC1XX_IRQ_VIC1(2)
#define IRQ_CORTEX3 S5PC1XX_IRQ_VIC1(3)
#define IRQ_CORTEX4 S5PC1XX_IRQ_VIC1(4)
#define IRQ_IEMAPC S5PC1XX_IRQ_VIC1(5)
#define IRQ_IEMIEC S5PC1XX_IRQ_VIC1(6)
#define IRQ_ONENAND S5PC1XX_IRQ_VIC1(7)
#define IRQ_NFC S5PC1XX_IRQ_VIC1(8)
#define IRQ_CFC S5PC1XX_IRQ_VIC1(9)
#define IRQ_UART0 S5PC1XX_IRQ_VIC1(10)
#define IRQ_UART1 S5PC1XX_IRQ_VIC1(11)
#define IRQ_UART2 S5PC1XX_IRQ_VIC1(12)
#define IRQ_UART3 S5PC1XX_IRQ_VIC1(13)
#define IRQ_IIC S5PC1XX_IRQ_VIC1(14)
#define IRQ_SPI0 S5PC1XX_IRQ_VIC1(15)
#define IRQ_SPI1 S5PC1XX_IRQ_VIC1(16)
#define IRQ_SPI2 S5PC1XX_IRQ_VIC1(17)
#define IRQ_IRDA S5PC1XX_IRQ_VIC1(18)
#define IRQ_CAN0 S5PC1XX_IRQ_VIC1(19)
#define IRQ_CAN1 S5PC1XX_IRQ_VIC1(20)
#define IRQ_HSIRX S5PC1XX_IRQ_VIC1(21)
#define IRQ_HSITX S5PC1XX_IRQ_VIC1(22)
#define IRQ_UHOST S5PC1XX_IRQ_VIC1(23)
#define IRQ_OTG S5PC1XX_IRQ_VIC1(24)
#define IRQ_MSM S5PC1XX_IRQ_VIC1(25)
#define IRQ_HSMMC0 S5PC1XX_IRQ_VIC1(26)
#define IRQ_HSMMC1 S5PC1XX_IRQ_VIC1(27)
#define IRQ_HSMMC2 S5PC1XX_IRQ_VIC1(28)
#define IRQ_MIPICSI S5PC1XX_IRQ_VIC1(29)
#define IRQ_MIPIDSI S5PC1XX_IRQ_VIC1(30)
/*
* VIC2: multimedia, audio, security
*/
#define IRQ_LCD0 S5PC1XX_IRQ_VIC2(0)
#define IRQ_LCD1 S5PC1XX_IRQ_VIC2(1)
#define IRQ_LCD2 S5PC1XX_IRQ_VIC2(2)
#define IRQ_LCD3 S5PC1XX_IRQ_VIC2(3)
#define IRQ_ROTATOR S5PC1XX_IRQ_VIC2(4)
#define IRQ_FIMC0 S5PC1XX_IRQ_VIC2(5)
#define IRQ_FIMC1 S5PC1XX_IRQ_VIC2(6)
#define IRQ_FIMC2 S5PC1XX_IRQ_VIC2(7)
#define IRQ_JPEG S5PC1XX_IRQ_VIC2(8)
#define IRQ_2D S5PC1XX_IRQ_VIC2(9)
#define IRQ_3D S5PC1XX_IRQ_VIC2(10)
#define IRQ_MIXER S5PC1XX_IRQ_VIC2(11)
#define IRQ_HDMI S5PC1XX_IRQ_VIC2(12)
#define IRQ_IIC1 S5PC1XX_IRQ_VIC2(13)
#define IRQ_MFC S5PC1XX_IRQ_VIC2(14)
#define IRQ_TVENC S5PC1XX_IRQ_VIC2(15)
#define IRQ_I2S0 S5PC1XX_IRQ_VIC2(16)
#define IRQ_I2S1 S5PC1XX_IRQ_VIC2(17)
#define IRQ_I2S2 S5PC1XX_IRQ_VIC2(18)
#define IRQ_AC97 S5PC1XX_IRQ_VIC2(19)
#define IRQ_PCM0 S5PC1XX_IRQ_VIC2(20)
#define IRQ_PCM1 S5PC1XX_IRQ_VIC2(21)
#define IRQ_SPDIF S5PC1XX_IRQ_VIC2(22)
#define IRQ_ADC S5PC1XX_IRQ_VIC2(23)
#define IRQ_PENDN S5PC1XX_IRQ_VIC2(24)
#define IRQ_TC IRQ_PENDN
#define IRQ_KEYPAD S5PC1XX_IRQ_VIC2(25)
#define IRQ_CG S5PC1XX_IRQ_VIC2(26)
#define IRQ_SEC S5PC1XX_IRQ_VIC2(27)
#define IRQ_SECRX S5PC1XX_IRQ_VIC2(28)
#define IRQ_SECTX S5PC1XX_IRQ_VIC2(29)
#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30)
#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31)
#define IRQ_TIMER(x) (IRQ_SDMFIQ + 1 + (x))
#define IRQ_TIMER0 IRQ_TIMER(0)
#define IRQ_TIMER1 IRQ_TIMER(1)
#define IRQ_TIMER2 IRQ_TIMER(2)
#define IRQ_TIMER3 IRQ_TIMER(3)
#define IRQ_TIMER4 IRQ_TIMER(4)
/* External interrupt */
#define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 6)
#define S3C_EINT(x) (S3C_IRQ_EINT_BASE + (x - 16))
#define IRQ_EINT(x) (x < 16 ? IRQ_EINT0 + x : S3C_EINT(x))
#define IRQ_EINT_BIT(x) (x < IRQ_EINT16_31 ? x - IRQ_EINT0 : x - S3C_EINT(0))
/* GPIO interrupt */
#define S3C_IRQ_GPIO_BASE (IRQ_EINT(31) + 1)
#define S3C_IRQ_GPIO(x) (S3C_IRQ_GPIO_BASE + (x))
/*
* Until MP04 Groups -> 40 (exactly 39) Groups * 8 ~= 320 GPIOs
*/
#define NR_IRQS (S3C_IRQ_GPIO(320) + 1)
#endif /* __ASM_PLAT_S5PC1XX_IRQS_H */
/* arch/arm/plat-s5pc1xx/include/plat/pll.h
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
*
* S5PC1XX PLL code
*
* Based on plat-s3c64xx/include/plat/pll.h
*
* 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.
*/
#define S5P_PLL_MDIV_MASK ((1 << (25-16+1)) - 1)
#define S5P_PLL_PDIV_MASK ((1 << (13-8+1)) - 1)
#define S5P_PLL_SDIV_MASK ((1 << (2-0+1)) - 1)
#define S5P_PLL_MDIV_SHIFT (16)
#define S5P_PLL_PDIV_SHIFT (8)
#define S5P_PLL_SDIV_SHIFT (0)
#include <asm/div64.h>
static inline unsigned long s5pc1xx_get_pll(unsigned long baseclk,
u32 pllcon)
{
u32 mdiv, pdiv, sdiv;
u64 fvco = baseclk;
mdiv = (pllcon >> S5P_PLL_MDIV_SHIFT) & S5P_PLL_MDIV_MASK;
pdiv = (pllcon >> S5P_PLL_PDIV_SHIFT) & S5P_PLL_PDIV_MASK;
sdiv = (pllcon >> S5P_PLL_SDIV_SHIFT) & S5P_PLL_SDIV_MASK;
fvco *= mdiv;
do_div(fvco, (pdiv << sdiv));
return (unsigned long)fvco;
}
/* arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
*
* S5PC1XX clock register definitions
*
* 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 __PLAT_REGS_CLOCK_H
#define __PLAT_REGS_CLOCK_H __FILE__
#define S5PC100_CLKREG(x) (S5PC1XX_VA_CLK + (x))
#define S5PC100_CLKREG_OTHER(x) (S5PC1XX_VA_CLK_OTHER + (x))
/* s5pc100 register for clock */
#define S5PC100_APLL_LOCK S5PC100_CLKREG(0x00)
#define S5PC100_MPLL_LOCK S5PC100_CLKREG(0x04)
#define S5PC100_EPLL_LOCK S5PC100_CLKREG(0x08)
#define S5PC100_HPLL_LOCK S5PC100_CLKREG(0x0C)
#define S5PC100_APLL_CON S5PC100_CLKREG(0x100)
#define S5PC100_MPLL_CON S5PC100_CLKREG(0x104)
#define S5PC100_EPLL_CON S5PC100_CLKREG(0x108)
#define S5PC100_HPLL_CON S5PC100_CLKREG(0x10C)
#define S5PC100_CLKSRC0 S5PC100_CLKREG(0x200)
#define S5PC100_CLKSRC1 S5PC100_CLKREG(0x204)
#define S5PC100_CLKSRC2 S5PC100_CLKREG(0x208)
#define S5PC100_CLKSRC3 S5PC100_CLKREG(0x20C)
#define S5PC100_CLKDIV0 S5PC100_CLKREG(0x300)
#define S5PC100_CLKDIV1 S5PC100_CLKREG(0x304)
#define S5PC100_CLKDIV2 S5PC100_CLKREG(0x308)
#define S5PC100_CLKDIV3 S5PC100_CLKREG(0x30C)
#define S5PC100_CLKDIV4 S5PC100_CLKREG(0x310)
#define S5PC100_CLK_OUT S5PC100_CLKREG(0x400)
#define S5PC100_CLKGATE_D00 S5PC100_CLKREG(0x500)
#define S5PC100_CLKGATE_D01 S5PC100_CLKREG(0x504)
#define S5PC100_CLKGATE_D02 S5PC100_CLKREG(0x508)
#define S5PC100_CLKGATE_D10 S5PC100_CLKREG(0x520)
#define S5PC100_CLKGATE_D11 S5PC100_CLKREG(0x524)
#define S5PC100_CLKGATE_D12 S5PC100_CLKREG(0x528)
#define S5PC100_CLKGATE_D13 S5PC100_CLKREG(0x52C)
#define S5PC100_CLKGATE_D14 S5PC100_CLKREG(0x530)
#define S5PC100_CLKGATE_D15 S5PC100_CLKREG(0x534)
#define S5PC100_CLKGATE_D20 S5PC100_CLKREG(0x540)
#define S5PC100_SCLKGATE0 S5PC100_CLKREG(0x560)
#define S5PC100_SCLKGATE1 S5PC100_CLKREG(0x564)
/* EPLL_CON */
#define S5PC100_EPLL_EN (1<<31)
#define S5PC100_EPLL_MASK 0xffffffff
#define S5PC100_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s)))
/* CLKSRC0..CLKSRC3 -> mostly removed due to clksrc updates */
#define S5PC100_CLKSRC1_CLK48M_MASK (0x1<<24)
#define S5PC100_CLKSRC1_CLK48M_SHIFT (24)
/* CLKDIV0 */
#define S5PC100_CLKDIV0_APLL_MASK (0x1<<0)
#define S5PC100_CLKDIV0_APLL_SHIFT (0)
#define S5PC100_CLKDIV0_ARM_MASK (0x7<<4)
#define S5PC100_CLKDIV0_ARM_SHIFT (4)
#define S5PC100_CLKDIV0_D0_MASK (0x7<<8)
#define S5PC100_CLKDIV0_D0_SHIFT (8)
#define S5PC100_CLKDIV0_PCLKD0_MASK (0x7<<12)
#define S5PC100_CLKDIV0_PCLKD0_SHIFT (12)
#define S5PC100_CLKDIV0_SECSS_MASK (0x7<<16)
#define S5PC100_CLKDIV0_SECSS_SHIFT (16)
/* CLKDIV1 (OneNAND clock only used in one place, removed) */
#define S5PC100_CLKDIV1_APLL2_MASK (0x7<<0)
#define S5PC100_CLKDIV1_APLL2_SHIFT (0)
#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4)
#define S5PC100_CLKDIV1_MPLL_SHIFT (4)
#define S5PC100_CLKDIV1_MPLL2_MASK (0x1<<8)
#define S5PC100_CLKDIV1_MPLL2_SHIFT (8)
#define S5PC100_CLKDIV1_D1_MASK (0x7<<12)
#define S5PC100_CLKDIV1_D1_SHIFT (12)
#define S5PC100_CLKDIV1_PCLKD1_MASK (0x7<<16)
#define S5PC100_CLKDIV1_PCLKD1_SHIFT (16)
#define S5PC100_CLKDIV1_CAM_MASK (0x1F<<24)
#define S5PC100_CLKDIV1_CAM_SHIFT (24)
/* CLKDIV2 => removed in clksrc update */
/* CLKDIV3 => removed in clksrc update, or not needed */
/* CLKDIV4 => removed in clksrc update, or not needed */
/* HCLKD0/PCLKD0 Clock Gate 0 Registers */
#define S5PC100_CLKGATE_D00_INTC (1<<0)
#define S5PC100_CLKGATE_D00_TZIC (1<<1)
#define S5PC100_CLKGATE_D00_CFCON (1<<2)
#define S5PC100_CLKGATE_D00_MDMA (1<<3)
#define S5PC100_CLKGATE_D00_G2D (1<<4)
#define S5PC100_CLKGATE_D00_SECSS (1<<5)
#define S5PC100_CLKGATE_D00_CSSYS (1<<6)
/* HCLKD0/PCLKD0 Clock Gate 1 Registers */
#define S5PC100_CLKGATE_D01_DMC (1<<0)
#define S5PC100_CLKGATE_D01_SROMC (1<<1)
#define S5PC100_CLKGATE_D01_ONENAND (1<<2)
#define S5PC100_CLKGATE_D01_NFCON (1<<3)
#define S5PC100_CLKGATE_D01_INTMEM (1<<4)
#define S5PC100_CLKGATE_D01_EBI (1<<5)
/* PCLKD0 Clock Gate 2 Registers */
#define S5PC100_CLKGATE_D02_SECKEY (1<<1)
#define S5PC100_CLKGATE_D02_SDM (1<<2)
/* HCLKD1/PCLKD1 Clock Gate 0 Registers */
#define S5PC100_CLKGATE_D10_PDMA0 (1<<0)
#define S5PC100_CLKGATE_D10_PDMA1 (1<<1)
#define S5PC100_CLKGATE_D10_USBHOST (1<<2)
#define S5PC100_CLKGATE_D10_USBOTG (1<<3)
#define S5PC100_CLKGATE_D10_MODEMIF (1<<4)
#define S5PC100_CLKGATE_D10_HSMMC0 (1<<5)
#define S5PC100_CLKGATE_D10_HSMMC1 (1<<6)
#define S5PC100_CLKGATE_D10_HSMMC2 (1<<7)
/* HCLKD1/PCLKD1 Clock Gate 1 Registers */
#define S5PC100_CLKGATE_D11_LCD (1<<0)
#define S5PC100_CLKGATE_D11_ROTATOR (1<<1)
#define S5PC100_CLKGATE_D11_FIMC0 (1<<2)
#define S5PC100_CLKGATE_D11_FIMC1 (1<<3)
#define S5PC100_CLKGATE_D11_FIMC2 (1<<4)
#define S5PC100_CLKGATE_D11_JPEG (1<<5)
#define S5PC100_CLKGATE_D11_DSI (1<<6)
#define S5PC100_CLKGATE_D11_CSI (1<<7)
#define S5PC100_CLKGATE_D11_G3D (1<<8)
/* HCLKD1/PCLKD1 Clock Gate 2 Registers */
#define S5PC100_CLKGATE_D12_TV (1<<0)
#define S5PC100_CLKGATE_D12_VP (1<<1)
#define S5PC100_CLKGATE_D12_MIXER (1<<2)
#define S5PC100_CLKGATE_D12_HDMI (1<<3)
#define S5PC100_CLKGATE_D12_MFC (1<<4)
/* HCLKD1/PCLKD1 Clock Gate 3 Registers */
#define S5PC100_CLKGATE_D13_CHIPID (1<<0)
#define S5PC100_CLKGATE_D13_GPIO (1<<1)
#define S5PC100_CLKGATE_D13_APC (1<<2)
#define S5PC100_CLKGATE_D13_IEC (1<<3)
#define S5PC100_CLKGATE_D13_PWM (1<<6)
#define S5PC100_CLKGATE_D13_SYSTIMER (1<<7)
#define S5PC100_CLKGATE_D13_WDT (1<<8)
#define S5PC100_CLKGATE_D13_RTC (1<<9)
/* HCLKD1/PCLKD1 Clock Gate 4 Registers */
#define S5PC100_CLKGATE_D14_UART0 (1<<0)
#define S5PC100_CLKGATE_D14_UART1 (1<<1)
#define S5PC100_CLKGATE_D14_UART2 (1<<2)
#define S5PC100_CLKGATE_D14_UART3 (1<<3)
#define S5PC100_CLKGATE_D14_IIC (1<<4)
#define S5PC100_CLKGATE_D14_HDMI_IIC (1<<5)
#define S5PC100_CLKGATE_D14_SPI0 (1<<6)
#define S5PC100_CLKGATE_D14_SPI1 (1<<7)
#define S5PC100_CLKGATE_D14_SPI2 (1<<8)
#define S5PC100_CLKGATE_D14_IRDA (1<<9)
#define S5PC100_CLKGATE_D14_CCAN0 (1<<10)
#define S5PC100_CLKGATE_D14_CCAN1 (1<<11)
#define S5PC100_CLKGATE_D14_HSITX (1<<12)
#define S5PC100_CLKGATE_D14_HSIRX (1<<13)
/* HCLKD1/PCLKD1 Clock Gate 5 Registers */
#define S5PC100_CLKGATE_D15_IIS0 (1<<0)
#define S5PC100_CLKGATE_D15_IIS1 (1<<1)
#define S5PC100_CLKGATE_D15_IIS2 (1<<2)
#define S5PC100_CLKGATE_D15_AC97 (1<<3)
#define S5PC100_CLKGATE_D15_PCM0 (1<<4)
#define S5PC100_CLKGATE_D15_PCM1 (1<<5)
#define S5PC100_CLKGATE_D15_SPDIF (1<<6)
#define S5PC100_CLKGATE_D15_TSADC (1<<7)
#define S5PC100_CLKGATE_D15_KEYIF (1<<8)
#define S5PC100_CLKGATE_D15_CG (1<<9)
/* HCLKD2 Clock Gate 0 Registers */
#define S5PC100_CLKGATE_D20_HCLKD2 (1<<0)
#define S5PC100_CLKGATE_D20_I2SD2 (1<<1)
/* Special Clock Gate 0 Registers */
#define S5PC100_CLKGATE_SCLK0_HPM (1<<0)
#define S5PC100_CLKGATE_SCLK0_PWI (1<<1)
#define S5PC100_CLKGATE_SCLK0_ONENAND (1<<2)
#define S5PC100_CLKGATE_SCLK0_UART (1<<3)
#define S5PC100_CLKGATE_SCLK0_SPI0 (1<<4)
#define S5PC100_CLKGATE_SCLK0_SPI1 (1<<5)
#define S5PC100_CLKGATE_SCLK0_SPI2 (1<<6)
#define S5PC100_CLKGATE_SCLK0_SPI0_48 (1<<7)
#define S5PC100_CLKGATE_SCLK0_SPI1_48 (1<<8)
#define S5PC100_CLKGATE_SCLK0_SPI2_48 (1<<9)
#define S5PC100_CLKGATE_SCLK0_IRDA (1<<10)
#define S5PC100_CLKGATE_SCLK0_USBHOST (1<<11)
#define S5PC100_CLKGATE_SCLK0_MMC0 (1<<12)
#define S5PC100_CLKGATE_SCLK0_MMC1 (1<<13)
#define S5PC100_CLKGATE_SCLK0_MMC2 (1<<14)
#define S5PC100_CLKGATE_SCLK0_MMC0_48 (1<<15)
#define S5PC100_CLKGATE_SCLK0_MMC1_48 (1<<16)
#define S5PC100_CLKGATE_SCLK0_MMC2_48 (1<<17)
/* Special Clock Gate 1 Registers */
#define S5PC100_CLKGATE_SCLK1_LCD (1<<0)
#define S5PC100_CLKGATE_SCLK1_FIMC0 (1<<1)
#define S5PC100_CLKGATE_SCLK1_FIMC1 (1<<2)
#define S5PC100_CLKGATE_SCLK1_FIMC2 (1<<3)
#define S5PC100_CLKGATE_SCLK1_TV54 (1<<4)
#define S5PC100_CLKGATE_SCLK1_VDAC54 (1<<5)
#define S5PC100_CLKGATE_SCLK1_MIXER (1<<6)
#define S5PC100_CLKGATE_SCLK1_HDMI (1<<7)
#define S5PC100_CLKGATE_SCLK1_AUDIO0 (1<<8)
#define S5PC100_CLKGATE_SCLK1_AUDIO1 (1<<9)
#define S5PC100_CLKGATE_SCLK1_AUDIO2 (1<<10)
#define S5PC100_CLKGATE_SCLK1_SPDIF (1<<11)
#define S5PC100_CLKGATE_SCLK1_CAM (1<<12)
#define S5PC100_SWRESET S5PC100_CLKREG_OTHER(0x000)
#define S5PC100_OND_SWRESET S5PC100_CLKREG_OTHER(0x008)
#define S5PC100_GEN_CTRL S5PC100_CLKREG_OTHER(0x100)
#define S5PC100_GEN_STATUS S5PC100_CLKREG_OTHER(0x104)
#define S5PC100_MEM_SYS_CFG S5PC100_CLKREG_OTHER(0x200)
#define S5PC100_CAM_MUX_SEL S5PC100_CLKREG_OTHER(0x300)
#define S5PC100_MIXER_OUT_SEL S5PC100_CLKREG_OTHER(0x304)
#define S5PC100_LPMP_MODE_SEL S5PC100_CLKREG_OTHER(0x308)
#define S5PC100_MIPI_PHY_CON0 S5PC100_CLKREG_OTHER(0x400)
#define S5PC100_MIPI_PHY_CON1 S5PC100_CLKREG_OTHER(0x414)
#define S5PC100_HDMI_PHY_CON0 S5PC100_CLKREG_OTHER(0x420)
#define S5PC100_SWRESET_RESETVAL 0xc100
#define S5PC100_OTHER_SYS_INT 24
#define S5PC100_OTHER_STA_TYPE 23
#define STA_TYPE_EXPON 0
#define STA_TYPE_SFR 1
#define S5PC100_SLEEP_CFG_OSC_EN 0
/* OTHERS Resgister */
#define S5PC100_OTHERS_USB_SIG_MASK (1 << 16)
#define S5PC100_OTHERS_MIPI_DPHY_EN (1 << 28)
/* MIPI D-PHY Control Register 0 */
#define S5PC100_MIPI_PHY_CON0_M_RESETN (1 << 1)
#define S5PC100_MIPI_PHY_CON0_S_RESETN (1 << 0)
#endif /* _PLAT_REGS_CLOCK_H */
/* arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
*
* Copyright 2009 Samsung Electronics Co.
* Jongse Won <jongse.won@samsung.com>
*
* S5PC1XX clock register definitions
*
* 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 __ASM_ARM_REGS_PWR
#define __ASM_ARM_REGS_PWR __FILE__
#define S5PC1XX_PWRREG(x) (S5PC1XX_VA_PWR + (x))
/* s5pc100 (0xE0108000) register for power management */
#define S5PC100_PWR_CFG S5PC1XX_PWRREG(0x0)
#define S5PC100_EINT_WAKEUP_MASK S5PC1XX_PWRREG(0x4)
#define S5PC100_NORMAL_CFG S5PC1XX_PWRREG(0x10)
#define S5PC100_STOP_CFG S5PC1XX_PWRREG(0x14)
#define S5PC100_SLEEP_CFG S5PC1XX_PWRREG(0x18)
#define S5PC100_STOP_MEM_CFG S5PC1XX_PWRREG(0x1C)
#define S5PC100_OSC_FREQ S5PC1XX_PWRREG(0x100)
#define S5PC100_OSC_STABLE S5PC1XX_PWRREG(0x104)
#define S5PC100_PWR_STABLE S5PC1XX_PWRREG(0x108)
#define S5PC100_MTC_STABLE S5PC1XX_PWRREG(0x110)
#define S5PC100_CLAMP_STABLE S5PC1XX_PWRREG(0x114)
#define S5PC100_OTHERS S5PC1XX_PWRREG(0x200)
#define S5PC100_RST_STAT S5PC1XX_PWRREG(0x300)
#define S5PC100_WAKEUP_STAT S5PC1XX_PWRREG(0x304)
#define S5PC100_BLK_PWR_STAT S5PC1XX_PWRREG(0x308)
#define S5PC100_INFORM0 S5PC1XX_PWRREG(0x400)
#define S5PC100_INFORM1 S5PC1XX_PWRREG(0x404)
#define S5PC100_INFORM2 S5PC1XX_PWRREG(0x408)
#define S5PC100_INFORM3 S5PC1XX_PWRREG(0x40C)
#define S5PC100_INFORM4 S5PC1XX_PWRREG(0x410)
#define S5PC100_INFORM5 S5PC1XX_PWRREG(0x414)
#define S5PC100_INFORM6 S5PC1XX_PWRREG(0x418)
#define S5PC100_INFORM7 S5PC1XX_PWRREG(0x41C)
#define S5PC100_DCGIDX_MAP0 S5PC1XX_PWRREG(0x500)
#define S5PC100_DCGIDX_MAP1 S5PC1XX_PWRREG(0x504)
#define S5PC100_DCGIDX_MAP2 S5PC1XX_PWRREG(0x508)
#define S5PC100_DCGPERF_MAP0 S5PC1XX_PWRREG(0x50C)
#define S5PC100_DCGPERF_MAP1 S5PC1XX_PWRREG(0x510)
#define S5PC100_DVCIDX_MAP S5PC1XX_PWRREG(0x514)
#define S5PC100_FREQ_CPU S5PC1XX_PWRREG(0x518)
#define S5PC100_FREQ_DPM S5PC1XX_PWRREG(0x51C)
#define S5PC100_DVSEMCLK_EN S5PC1XX_PWRREG(0x520)
#define S5PC100_APLL_CON_L8 S5PC1XX_PWRREG(0x600)
#define S5PC100_APLL_CON_L7 S5PC1XX_PWRREG(0x604)
#define S5PC100_APLL_CON_L6 S5PC1XX_PWRREG(0x608)
#define S5PC100_APLL_CON_L5 S5PC1XX_PWRREG(0x60C)
#define S5PC100_APLL_CON_L4 S5PC1XX_PWRREG(0x610)
#define S5PC100_APLL_CON_L3 S5PC1XX_PWRREG(0x614)
#define S5PC100_APLL_CON_L2 S5PC1XX_PWRREG(0x618)
#define S5PC100_APLL_CON_L1 S5PC1XX_PWRREG(0x61C)
#define S5PC100_IEM_CONTROL S5PC1XX_PWRREG(0x620)
#define S5PC100_CLKDIV_IEM_L8 S5PC1XX_PWRREG(0x700)
#define S5PC100_CLKDIV_IEM_L7 S5PC1XX_PWRREG(0x704)
#define S5PC100_CLKDIV_IEM_L6 S5PC1XX_PWRREG(0x708)
#define S5PC100_CLKDIV_IEM_L5 S5PC1XX_PWRREG(0x70C)
#define S5PC100_CLKDIV_IEM_L4 S5PC1XX_PWRREG(0x710)
#define S5PC100_CLKDIV_IEM_L3 S5PC1XX_PWRREG(0x714)
#define S5PC100_CLKDIV_IEM_L2 S5PC1XX_PWRREG(0x718)
#define S5PC100_CLKDIV_IEM_L1 S5PC1XX_PWRREG(0x71C)
#define S5PC100_IEM_HPMCLK_DIV S5PC1XX_PWRREG(0x724)
/* PWR_CFG */
#define S5PC100_PWRCFG_CFG_DEEP_IDLE (1 << 31)
#define S5PC100_PWRCFG_CFG_WFI_MASK (3 << 5)
#define S5PC100_PWRCFG_CFG_WFI_IDLE (0 << 5)
#define S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE (1 << 5)
#define S5PC100_PWRCFG_CFG_WFI_STOP (2 << 5)
#define S5PC100_PWRCFG_CFG_WFI_SLEEP (3 << 5)
/* SLEEP_CFG */
#define S5PC100_SLEEP_OSC_EN_SLEEP (1 << 0)
/* OTHERS */
#define S5PC100_PMU_INT_DISABLE (1 << 24)
#endif /* __ASM_ARM_REGS_PWR */
/* arch/arm/plat-s5pc1xx/include/plat/s5pc100.h
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
*
* Header file for s5pc100 cpu support
*
* Based on plat-s3c64xx/include/plat/s3c6400.h
*
* 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.
*/
/* Common init code for S5PC100 related SoCs */
extern int s5pc100_init(void);
extern void s5pc100_map_io(void);
extern void s5pc100_init_clocks(int xtal);
extern int s5pc100_register_baseclocks(unsigned long xtal);
extern void s5pc100_init_irq(void);
extern void s5pc100_init_io(struct map_desc *mach_desc, int size);
extern void s5pc100_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
extern void s5pc100_register_clocks(void);
extern void s5pc100_setup_clocks(void);
extern struct sysdev_class s5pc100_sysclass;
#define s5pc100_init_uarts s5pc100_common_init_uarts
/* Some day, belows will be moved to plat-s5pc/include/plat/cpu.h */
extern void s5pc1xx_init_irq(u32 *vic_valid, int num);
extern void s5pc1xx_init_io(struct map_desc *mach_desc, int size);
/* Some day, belows will be moved to plat-s5pc/include/plat/clock.h */
extern struct clk clk_hpll;
extern struct clk clk_hd0;
extern struct clk clk_pd0;
extern struct clk clk_54m;
extern void s5pc1xx_register_clocks(void);
extern int s5pc100_sclk0_ctrl(struct clk *clk, int enable);
extern int s5pc100_sclk1_ctrl(struct clk *clk, int enable);
/* Some day, belows will be moved to plat-s5pc/include/plat/devs.h */
extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[];
extern struct platform_device s3c_device_g2d;
extern struct platform_device s3c_device_g3d;
extern struct platform_device s3c_device_vpp;
extern struct platform_device s3c_device_tvenc;
extern struct platform_device s3c_device_tvscaler;
extern struct platform_device s3c_device_rotator;
extern struct platform_device s3c_device_jpeg;
extern struct platform_device s3c_device_onenand;
extern struct platform_device s3c_device_usb_otghcd;
extern struct platform_device s3c_device_keypad;
extern struct platform_device s3c_device_ts;
extern struct platform_device s3c_device_g3d;
extern struct platform_device s3c_device_smc911x;
extern struct platform_device s3c_device_fimc0;
extern struct platform_device s3c_device_fimc1;
extern struct platform_device s3c_device_mfc;
extern struct platform_device s3c_device_ac97;
extern struct platform_device s3c_device_fimc0;
extern struct platform_device s3c_device_fimc1;
extern struct platform_device s3c_device_fimc2;
/*
* linux/arch/arm/plat-s5pc1xx/irq-eint.c
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
* Kyungin Park <kyungmin.park@samsung.com>
*
* Based on plat-s3c64xx/irq-eint.c
*
* S5PC1XX - Interrupt handling for IRQ_EINT(x)
*
* 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 <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/sysdev.h>
#include <linux/pm.h>
#include <linux/gpio.h>
#include <asm/hardware/vic.h>
#include <mach/map.h>
#include <plat/gpio-cfg.h>
#include <plat/gpio-ext.h>
#include <plat/pm.h>
#include <plat/regs-gpio.h>
#include <plat/regs-irqtype.h>
/*
* bank is a group of external interrupt
* bank0 means EINT0 ... EINT7
* bank1 means EINT8 ... EINT15
* bank2 means EINT16 ... EINT23
* bank3 means EINT24 ... EINT31
*/
static inline int s3c_get_eint(unsigned int irq)
{
int real;
if (irq < IRQ_EINT16_31)
real = (irq - IRQ_EINT0);
else
real = (irq - S3C_IRQ_EINT_BASE) + IRQ_EINT16_31 - IRQ_EINT0;
return real;
}
static inline int s3c_get_bank(unsigned int irq)
{
return s3c_get_eint(irq) >> 3;
}
static inline int s3c_eint_to_bit(unsigned int irq)
{
int real, bit;
real = s3c_get_eint(irq);
bit = 1 << (real & (8 - 1));
return bit;
}
static inline void s3c_irq_eint_mask(unsigned int irq)
{
u32 mask;
u32 bank = s3c_get_bank(irq);
mask = __raw_readl(S5PC1XX_WKUP_INT_MASK(bank));
mask |= s3c_eint_to_bit(irq);
__raw_writel(mask, S5PC1XX_WKUP_INT_MASK(bank));
}
static void s3c_irq_eint_unmask(unsigned int irq)
{
u32 mask;
u32 bank = s3c_get_bank(irq);
mask = __raw_readl(S5PC1XX_WKUP_INT_MASK(bank));
mask &= ~(s3c_eint_to_bit(irq));
__raw_writel(mask, S5PC1XX_WKUP_INT_MASK(bank));
}
static inline void s3c_irq_eint_ack(unsigned int irq)
{
u32 bank = s3c_get_bank(irq);
__raw_writel(s3c_eint_to_bit(irq), S5PC1XX_WKUP_INT_PEND(bank));
}
static void s3c_irq_eint_maskack(unsigned int irq)
{
/* compiler should in-line these */
s3c_irq_eint_mask(irq);
s3c_irq_eint_ack(irq);
}
static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
{
u32 bank = s3c_get_bank(irq);
int real = s3c_get_eint(irq);
int gpio, shift, sfn;
u32 ctrl, con = 0;
switch (type) {
case IRQ_TYPE_NONE:
printk(KERN_WARNING "No edge setting!\n");
break;
case IRQ_TYPE_EDGE_RISING:
con = S5PC1XX_WKUP_INT_RISEEDGE;
break;
case IRQ_TYPE_EDGE_FALLING:
con = S5PC1XX_WKUP_INT_FALLEDGE;
break;
case IRQ_TYPE_EDGE_BOTH:
con = S5PC1XX_WKUP_INT_BOTHEDGE;
break;
case IRQ_TYPE_LEVEL_LOW:
con = S5PC1XX_WKUP_INT_LOWLEV;
break;
case IRQ_TYPE_LEVEL_HIGH:
con = S5PC1XX_WKUP_INT_HILEV;
break;
default:
printk(KERN_ERR "No such irq type %d", type);
return -EINVAL;
}
gpio = real & (8 - 1);
shift = gpio << 2;
ctrl = __raw_readl(S5PC1XX_WKUP_INT_CON(bank));
ctrl &= ~(0x7 << shift);
ctrl |= con << shift;
__raw_writel(ctrl, S5PC1XX_WKUP_INT_CON(bank));
switch (real) {
case 0 ... 7:
gpio = S5PC100_GPH0(gpio);
break;
case 8 ... 15:
gpio = S5PC100_GPH1(gpio);
break;
case 16 ... 23:
gpio = S5PC100_GPH2(gpio);
break;
case 24 ... 31:
gpio = S5PC100_GPH3(gpio);
break;
default:
return -EINVAL;
}
sfn = S3C_GPIO_SFN(0x2);
s3c_gpio_cfgpin(gpio, sfn);
return 0;
}
static struct irq_chip s3c_irq_eint = {
.name = "EINT",
.mask = s3c_irq_eint_mask,
.unmask = s3c_irq_eint_unmask,
.mask_ack = s3c_irq_eint_maskack,
.ack = s3c_irq_eint_ack,
.set_type = s3c_irq_eint_set_type,
.set_wake = s3c_irqext_wake,
};
/* s3c_irq_demux_eint
*
* This function demuxes the IRQ from external interrupts,
* from IRQ_EINT(16) to IRQ_EINT(31). It is designed to be inlined into
* the specific handlers s3c_irq_demux_eintX_Y.
*/
static inline void s3c_irq_demux_eint(unsigned int start, unsigned int end)
{
u32 status = __raw_readl(S5PC1XX_WKUP_INT_PEND((start >> 3)));
u32 mask = __raw_readl(S5PC1XX_WKUP_INT_MASK((start >> 3)));
unsigned int irq;
status &= ~mask;
status &= (1 << (end - start + 1)) - 1;
for (irq = IRQ_EINT(start); irq <= IRQ_EINT(end); irq++) {
if (status & 1)
generic_handle_irq(irq);
status >>= 1;
}
}
static void s3c_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
{
s3c_irq_demux_eint(16, 23);
s3c_irq_demux_eint(24, 31);
}
/*
* Handle EINT0 ... EINT15 at VIC directly
*/
static void s3c_irq_vic_eint_mask(unsigned int irq)
{
void __iomem *base = get_irq_chip_data(irq);
unsigned int real;
s3c_irq_eint_mask(irq);
real = s3c_get_eint(irq);
writel(1 << real, base + VIC_INT_ENABLE_CLEAR);
}
static void s3c_irq_vic_eint_unmask(unsigned int irq)
{
void __iomem *base = get_irq_chip_data(irq);
unsigned int real;
s3c_irq_eint_unmask(irq);
real = s3c_get_eint(irq);
writel(1 << real, base + VIC_INT_ENABLE);
}
static inline void s3c_irq_vic_eint_ack(unsigned int irq)
{
u32 bit;
u32 bank = s3c_get_bank(irq);
bit = s3c_eint_to_bit(irq);
__raw_writel(bit, S5PC1XX_WKUP_INT_PEND(bank));
}
static void s3c_irq_vic_eint_maskack(unsigned int irq)
{
/* compiler should in-line these */
s3c_irq_vic_eint_mask(irq);
s3c_irq_vic_eint_ack(irq);
}
static struct irq_chip s3c_irq_vic_eint = {
.name = "EINT",
.mask = s3c_irq_vic_eint_mask,
.unmask = s3c_irq_vic_eint_unmask,
.mask_ack = s3c_irq_vic_eint_maskack,
.ack = s3c_irq_vic_eint_ack,
.set_type = s3c_irq_eint_set_type,
.set_wake = s3c_irqext_wake,
};
static int __init s5pc1xx_init_irq_eint(void)
{
int irq;
for (irq = IRQ_EINT0; irq <= IRQ_EINT15; irq++) {
set_irq_chip(irq, &s3c_irq_vic_eint);
set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID);
}
for (irq = IRQ_EINT(16); irq <= IRQ_EINT(31); irq++) {
set_irq_chip(irq, &s3c_irq_eint);
set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID);
}
set_irq_chained_handler(IRQ_EINT16_31, s3c_irq_demux_eint16_31);
return 0;
}
arch_initcall(s5pc1xx_init_irq_eint);
/* arch/arm/plat-s5pc1xx/irq.c
*
* Copyright 2009 Samsung Electronics Co.
* Byungho Min <bhmin@samsung.com>
*
* S5PC1XX - Interrupt handling
*
* Based on plat-s3c64xx/irq.c
*
* 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 <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <asm/hardware/vic.h>
#include <mach/map.h>
#include <plat/irq-vic-timer.h>
#include <plat/irq-uart.h>
#include <plat/cpu.h>
/* Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3]
* are consecutive when looking up the interrupt in the demux routines.
*/
static struct s3c_uart_irq uart_irqs[] = {
[0] = {
.regs = (void *)S3C_VA_UART0,
.base_irq = IRQ_S3CUART_BASE0,
.parent_irq = IRQ_UART0,
},
[1] = {
.regs = (void *)S3C_VA_UART1,
.base_irq = IRQ_S3CUART_BASE1,
.parent_irq = IRQ_UART1,
},
[2] = {
.regs = (void *)S3C_VA_UART2,
.base_irq = IRQ_S3CUART_BASE2,
.parent_irq = IRQ_UART2,
},
[3] = {
.regs = (void *)S3C_VA_UART3,
.base_irq = IRQ_S3CUART_BASE3,
.parent_irq = IRQ_UART3,
},
};
void __init s5pc1xx_init_irq(u32 *vic_valid, int num)
{
int i;
printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
/* initialise the pair of VICs */
for (i = 0; i < num; i++)
vic_init((void *)S5PC1XX_VA_VIC(i), S3C_IRQ(i * S3C_IRQ_OFFSET),
vic_valid[i], 0);
/* add the timer sub-irqs */
s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0);
s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1);
s3c_init_vic_timer_irq(IRQ_TIMER2_VIC, IRQ_TIMER2);
s3c_init_vic_timer_irq(IRQ_TIMER3_VIC, IRQ_TIMER3);
s3c_init_vic_timer_irq(IRQ_TIMER4_VIC, IRQ_TIMER4);
s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs));
}
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
config PLAT_SAMSUNG config PLAT_SAMSUNG
bool bool
depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX || ARCH_S5PC1XX depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX
select NO_IOPORT select NO_IOPORT
default y default y
help help
......
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