17 #include <linux/kernel.h>
19 #include <linux/module.h>
22 #include <linux/serial_core.h>
32 #include <asm/system_misc.h>
35 #include <mach/hardware.h>
36 #include <mach/regs-gpio.h>
39 #include <plat/clock.h>
60 static const char name_s3c6400[] =
"S3C6400";
61 static const char name_s3c6410[] =
"S3C6410";
69 .init_uarts = s3c64xx_init_uarts,
77 .init_uarts = s3c64xx_init_uarts,
86 #define UART_OFFS (S3C_PA_UART & 0xfffff)
88 static struct map_desc s3c_iodesc[] __initdata = {
142 static struct bus_type s3c64xx_subsys = {
143 .name =
"s3c64xx-core",
144 .dev_name =
"s3c64xx-core",
147 static struct device s3c64xx_dev = {
148 .bus = &s3c64xx_subsys,
158 init_consistent_dma_size(
SZ_8M);
166 static __init int s3c64xx_dev_init(
void)
178 #define IRQ_VIC0_RESUME (1 << (IRQ_RTC_TIC - IRQ_VIC0_BASE))
179 #define IRQ_VIC1_RESUME (1 << (IRQ_RTC_ALARM - IRQ_VIC1_BASE) | \
180 1 << (IRQ_PENDN - IRQ_VIC1_BASE) | \
181 1 << (IRQ_HSMMC0 - IRQ_VIC1_BASE) | \
182 1 << (IRQ_HSMMC1 - IRQ_VIC1_BASE) | \
183 1 << (IRQ_HSMMC2 - IRQ_VIC1_BASE))
197 #define eint_offset(irq) ((irq) - IRQ_EINT(0))
198 #define eint_irq_to_bit(irq) ((u32)(1 << eint_offset(irq)))
200 static inline void s3c_irq_eint_mask(
struct irq_data *
data)
218 static inline void s3c_irq_eint_ack(
struct irq_data *
data)
223 static void s3c_irq_eint_maskack(
struct irq_data *data)
226 s3c_irq_eint_mask(data);
227 s3c_irq_eint_ack(data);
230 static int s3c_irq_eint_set_type(
struct irq_data *data,
unsigned int type)
278 shift = (offs / 2) * 4;
280 shift = ((offs - 16) / 2) * 4;
285 ctrl |= newvalue << shift;
293 }
else if (offs < 23) {
306 static struct irq_chip s3c_irq_eint = {
308 .irq_mask = s3c_irq_eint_mask,
309 .irq_unmask = s3c_irq_eint_unmask,
310 .irq_mask_ack = s3c_irq_eint_maskack,
311 .irq_ack = s3c_irq_eint_ack,
312 .irq_set_type = s3c_irq_eint_set_type,
322 static inline void s3c_irq_demux_eint(
unsigned int start,
unsigned int end)
330 status &= (1 << (end - start + 1)) - 1;
340 static void s3c_irq_demux_eint0_3(
unsigned int irq,
struct irq_desc *
desc)
342 s3c_irq_demux_eint(0, 3);
345 static void s3c_irq_demux_eint4_11(
unsigned int irq,
struct irq_desc *
desc)
347 s3c_irq_demux_eint(4, 11);
350 static void s3c_irq_demux_eint12_19(
unsigned int irq,
struct irq_desc *
desc)
352 s3c_irq_demux_eint(12, 19);
355 static void s3c_irq_demux_eint20_27(
unsigned int irq,
struct irq_desc *
desc)
357 s3c_irq_demux_eint(20, 27);
360 static int __init s3c64xx_init_irq_eint(
void)
370 irq_set_chained_handler(
IRQ_EINT0_3, s3c_irq_demux_eint0_3);
371 irq_set_chained_handler(
IRQ_EINT4_11, s3c_irq_demux_eint4_11);
372 irq_set_chained_handler(
IRQ_EINT12_19, s3c_irq_demux_eint12_19);
373 irq_set_chained_handler(
IRQ_EINT20_27, s3c_irq_demux_eint20_27);