diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-06-10 17:40:55 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-06-10 17:41:06 -0400 |
commit | 547c32aeb5a24178ef20488ae0508efcc32ae8e4 (patch) | |
tree | fdc33154820cfddc845cef2f67380dace655b28f /arch/arm/plat-s3c64xx/include/plat | |
parent | b0efb42478c81ed0ed9aa0dc444db200c32624f0 (diff) | |
parent | 99ae99533a059750c4b0f76295625b8ac5ea751a (diff) |
Merge branch for-rmk-devel of git://aeryn.fluff.org.uk/bjdooks/linux into devel
Diffstat (limited to 'arch/arm/plat-s3c64xx/include/plat')
-rw-r--r-- | arch/arm/plat-s3c64xx/include/plat/dma-plat.h | 70 | ||||
-rw-r--r-- | arch/arm/plat-s3c64xx/include/plat/irqs.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c64xx/include/plat/pm-core.h | 98 | ||||
-rw-r--r-- | arch/arm/plat-s3c64xx/include/plat/regs-clock.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c64xx/include/plat/s3c6400.h | 3 |
5 files changed, 172 insertions, 1 deletions
diff --git a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h new file mode 100644 index 000000000000..0c30dd986725 --- /dev/null +++ b/arch/arm/plat-s3c64xx/include/plat/dma-plat.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* linux/arch/arm/plat-s3c64xx/include/plat/dma-plat.h | ||
2 | * | ||
3 | * Copyright 2009 Openmoko, Inc. | ||
4 | * Copyright 2009 Simtec Electronics | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * http://armlinux.simtec.co.uk/ | ||
7 | * | ||
8 | * S3C64XX DMA core | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ | ||
16 | |||
17 | struct s3c64xx_dma_buff; | ||
18 | |||
19 | /** s3c64xx_dma_buff - S3C64XX DMA buffer descriptor | ||
20 | * @next: Pointer to next buffer in queue or ring. | ||
21 | * @pw: Client provided identifier | ||
22 | * @lli: Pointer to hardware descriptor this buffer is associated with. | ||
23 | * @lli_dma: Hardare address of the descriptor. | ||
24 | */ | ||
25 | struct s3c64xx_dma_buff { | ||
26 | struct s3c64xx_dma_buff *next; | ||
27 | |||
28 | void *pw; | ||
29 | struct pl080_lli *lli; | ||
30 | dma_addr_t lli_dma; | ||
31 | }; | ||
32 | |||
33 | struct s3c64xx_dmac; | ||
34 | |||
35 | struct s3c2410_dma_chan { | ||
36 | unsigned char number; /* number of this dma channel */ | ||
37 | unsigned char in_use; /* channel allocated */ | ||
38 | unsigned char bit; /* bit for enable/disable/etc */ | ||
39 | unsigned char hw_width; | ||
40 | unsigned char peripheral; | ||
41 | |||
42 | unsigned int flags; | ||
43 | enum s3c2410_dmasrc source; | ||
44 | |||
45 | |||
46 | dma_addr_t dev_addr; | ||
47 | |||
48 | struct s3c2410_dma_client *client; | ||
49 | struct s3c64xx_dmac *dmac; /* pointer to controller */ | ||
50 | |||
51 | void __iomem *regs; | ||
52 | |||
53 | /* cdriver callbacks */ | ||
54 | s3c2410_dma_cbfn_t callback_fn; /* buffer done callback */ | ||
55 | s3c2410_dma_opfn_t op_fn; /* channel op callback */ | ||
56 | |||
57 | /* buffer list and information */ | ||
58 | struct s3c64xx_dma_buff *curr; /* current dma buffer */ | ||
59 | struct s3c64xx_dma_buff *next; /* next buffer to load */ | ||
60 | struct s3c64xx_dma_buff *end; /* end of queue */ | ||
61 | |||
62 | /* note, when channel is running in circular mode, curr is the | ||
63 | * first buffer enqueued, end is the last and curr is where the | ||
64 | * last buffer-done event is set-at. The buffers are not freed | ||
65 | * and the last buffer hardware descriptor points back to the | ||
66 | * first. | ||
67 | */ | ||
68 | }; | ||
69 | |||
70 | #include <plat/dma-core.h> | ||
diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/plat-s3c64xx/include/plat/irqs.h index f865bf4d709e..743a70094d04 100644 --- a/arch/arm/plat-s3c64xx/include/plat/irqs.h +++ b/arch/arm/plat-s3c64xx/include/plat/irqs.h | |||
@@ -157,6 +157,7 @@ | |||
157 | 157 | ||
158 | #define S3C_EINT(x) ((x) + S3C_IRQ_EINT_BASE) | 158 | #define S3C_EINT(x) ((x) + S3C_IRQ_EINT_BASE) |
159 | #define IRQ_EINT(x) S3C_EINT(x) | 159 | #define IRQ_EINT(x) S3C_EINT(x) |
160 | #define IRQ_EINT_BIT(x) ((x) - S3C_EINT(0)) | ||
160 | 161 | ||
161 | /* Next the external interrupt groups. These are similar to the IRQ_EINT(x) | 162 | /* Next the external interrupt groups. These are similar to the IRQ_EINT(x) |
162 | * that they are sourced from the GPIO pins but with a different scheme for | 163 | * that they are sourced from the GPIO pins but with a different scheme for |
diff --git a/arch/arm/plat-s3c64xx/include/plat/pm-core.h b/arch/arm/plat-s3c64xx/include/plat/pm-core.h new file mode 100644 index 000000000000..d347de3ba0dc --- /dev/null +++ b/arch/arm/plat-s3c64xx/include/plat/pm-core.h | |||
@@ -0,0 +1,98 @@ | |||
1 | /* linux/arch/arm/plat-s3c64xx/include/plat/pm-core.h | ||
2 | * | ||
3 | * Copyright 2008 Openmoko, Inc. | ||
4 | * Copyright 2008 Simtec Electronics | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * http://armlinux.simtec.co.uk/ | ||
7 | * | ||
8 | * S3C64XX - PM core support for arch/arm/plat-s3c/pm.c | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <plat/regs-gpio.h> | ||
16 | |||
17 | static inline void s3c_pm_debug_init_uart(void) | ||
18 | { | ||
19 | u32 tmp = __raw_readl(S3C_PCLK_GATE); | ||
20 | |||
21 | /* As a note, since the S3C64XX UARTs generally have multiple | ||
22 | * clock sources, we simply enable PCLK at the moment and hope | ||
23 | * that the resume settings for the UART are suitable for the | ||
24 | * use with PCLK. | ||
25 | */ | ||
26 | |||
27 | tmp |= S3C_CLKCON_PCLK_UART0; | ||
28 | tmp |= S3C_CLKCON_PCLK_UART1; | ||
29 | tmp |= S3C_CLKCON_PCLK_UART2; | ||
30 | tmp |= S3C_CLKCON_PCLK_UART3; | ||
31 | |||
32 | __raw_writel(tmp, S3C_PCLK_GATE); | ||
33 | udelay(10); | ||
34 | } | ||
35 | |||
36 | static inline void s3c_pm_arch_prepare_irqs(void) | ||
37 | { | ||
38 | /* VIC should have already been taken care of */ | ||
39 | |||
40 | /* clear any pending EINT0 interrupts */ | ||
41 | __raw_writel(__raw_readl(S3C64XX_EINT0PEND), S3C64XX_EINT0PEND); | ||
42 | } | ||
43 | |||
44 | static inline void s3c_pm_arch_stop_clocks(void) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | static inline void s3c_pm_arch_show_resume_irqs(void) | ||
49 | { | ||
50 | } | ||
51 | |||
52 | /* make these defines, we currently do not have any need to change | ||
53 | * the IRQ wake controls depending on the CPU we are running on */ | ||
54 | |||
55 | #define s3c_irqwake_eintallow ((1 << 28) - 1) | ||
56 | #define s3c_irqwake_intallow (0) | ||
57 | |||
58 | static inline void s3c_pm_arch_update_uart(void __iomem *regs, | ||
59 | struct pm_uart_save *save) | ||
60 | { | ||
61 | u32 ucon = __raw_readl(regs + S3C2410_UCON); | ||
62 | u32 ucon_clk = ucon & S3C6400_UCON_CLKMASK; | ||
63 | u32 save_clk = save->ucon & S3C6400_UCON_CLKMASK; | ||
64 | u32 new_ucon; | ||
65 | u32 delta; | ||
66 | |||
67 | /* S3C64XX UART blocks only support level interrupts, so ensure that | ||
68 | * when we restore unused UART blocks we force the level interrupt | ||
69 | * settigs. */ | ||
70 | save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL; | ||
71 | |||
72 | /* We have a constraint on changing the clock type of the UART | ||
73 | * between UCLKx and PCLK, so ensure that when we restore UCON | ||
74 | * that the CLK field is correctly modified if the bootloader | ||
75 | * has changed anything. | ||
76 | */ | ||
77 | if (ucon_clk != save_clk) { | ||
78 | new_ucon = save->ucon; | ||
79 | delta = ucon_clk ^ save_clk; | ||
80 | |||
81 | /* change from UCLKx => wrong PCLK, | ||
82 | * either UCLK can be tested for by a bit-test | ||
83 | * with UCLK0 */ | ||
84 | if (ucon_clk & S3C6400_UCON_UCLK0 && | ||
85 | !(save_clk & S3C6400_UCON_UCLK0) && | ||
86 | delta & S3C6400_UCON_PCLK2) { | ||
87 | new_ucon &= ~S3C6400_UCON_UCLK0; | ||
88 | } else if (delta == S3C6400_UCON_PCLK2) { | ||
89 | /* as an precaution, don't change from | ||
90 | * PCLK2 => PCLK or vice-versa */ | ||
91 | new_ucon ^= S3C6400_UCON_PCLK2; | ||
92 | } | ||
93 | |||
94 | S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n", | ||
95 | ucon, new_ucon, save->ucon); | ||
96 | save->ucon = new_ucon; | ||
97 | } | ||
98 | } | ||
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h index b1082c163247..52836d41e333 100644 --- a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h +++ b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #define S3C_HCLK_GATE S3C_CLKREG(0x30) | 32 | #define S3C_HCLK_GATE S3C_CLKREG(0x30) |
33 | #define S3C_PCLK_GATE S3C_CLKREG(0x34) | 33 | #define S3C_PCLK_GATE S3C_CLKREG(0x34) |
34 | #define S3C_SCLK_GATE S3C_CLKREG(0x38) | 34 | #define S3C_SCLK_GATE S3C_CLKREG(0x38) |
35 | #define S3C_MEM0_GATE S3C_CLKREG(0x3C) | ||
35 | 36 | ||
36 | /* CLKDIV0 */ | 37 | /* CLKDIV0 */ |
37 | #define S3C6400_CLKDIV0_MFC_MASK (0xf << 28) | 38 | #define S3C6400_CLKDIV0_MFC_MASK (0xf << 28) |
diff --git a/arch/arm/plat-s3c64xx/include/plat/s3c6400.h b/arch/arm/plat-s3c64xx/include/plat/s3c6400.h index 571eaa2e54f1..11f2e1e119b0 100644 --- a/arch/arm/plat-s3c64xx/include/plat/s3c6400.h +++ b/arch/arm/plat-s3c64xx/include/plat/s3c6400.h | |||
@@ -15,12 +15,13 @@ | |||
15 | /* Common init code for S3C6400 related SoCs */ | 15 | /* Common init code for S3C6400 related SoCs */ |
16 | 16 | ||
17 | extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); | 17 | extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
18 | extern void s3c6400_register_clocks(void); | 18 | extern void s3c6400_register_clocks(unsigned armclk_divlimit); |
19 | extern void s3c6400_setup_clocks(void); | 19 | extern void s3c6400_setup_clocks(void); |
20 | 20 | ||
21 | #ifdef CONFIG_CPU_S3C6400 | 21 | #ifdef CONFIG_CPU_S3C6400 |
22 | 22 | ||
23 | extern int s3c6400_init(void); | 23 | extern int s3c6400_init(void); |
24 | extern void s3c6400_init_irq(void); | ||
24 | extern void s3c6400_map_io(void); | 25 | extern void s3c6400_map_io(void); |
25 | extern void s3c6400_init_clocks(int xtal); | 26 | extern void s3c6400_init_clocks(int xtal); |
26 | 27 | ||