diff options
Diffstat (limited to 'arch/arm/plat-s3c24xx/include/plat')
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/clock.h | 64 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/cpu.h | 54 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/devs.h | 49 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/map.h | 99 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/pll.h | 37 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/s3c2400.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/s3c2410.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/s3c2412.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/s3c2443.h | 2 |
9 files changed, 140 insertions, 171 deletions
diff --git a/arch/arm/plat-s3c24xx/include/plat/clock.h b/arch/arm/plat-s3c24xx/include/plat/clock.h deleted file mode 100644 index 235b753cd877..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/clock.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/clock.h | ||
2 | * linux/arch/arm/mach-s3c2410/clock.h | ||
3 | * | ||
4 | * Copyright (c) 2004-2005 Simtec Electronics | ||
5 | * http://www.simtec.co.uk/products/SWLINUX/ | ||
6 | * Written by Ben Dooks, <ben@simtec.co.uk> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | struct clk { | ||
14 | struct list_head list; | ||
15 | struct module *owner; | ||
16 | struct clk *parent; | ||
17 | const char *name; | ||
18 | int id; | ||
19 | int usage; | ||
20 | unsigned long rate; | ||
21 | unsigned long ctrlbit; | ||
22 | |||
23 | int (*enable)(struct clk *, int enable); | ||
24 | int (*set_rate)(struct clk *c, unsigned long rate); | ||
25 | unsigned long (*get_rate)(struct clk *c); | ||
26 | unsigned long (*round_rate)(struct clk *c, unsigned long rate); | ||
27 | int (*set_parent)(struct clk *c, struct clk *parent); | ||
28 | }; | ||
29 | |||
30 | /* other clocks which may be registered by board support */ | ||
31 | |||
32 | extern struct clk s3c24xx_dclk0; | ||
33 | extern struct clk s3c24xx_dclk1; | ||
34 | extern struct clk s3c24xx_clkout0; | ||
35 | extern struct clk s3c24xx_clkout1; | ||
36 | extern struct clk s3c24xx_uclk; | ||
37 | |||
38 | extern struct clk clk_usb_bus; | ||
39 | |||
40 | /* core clock support */ | ||
41 | |||
42 | extern struct clk clk_f; | ||
43 | extern struct clk clk_h; | ||
44 | extern struct clk clk_p; | ||
45 | extern struct clk clk_mpll; | ||
46 | extern struct clk clk_upll; | ||
47 | extern struct clk clk_xtal; | ||
48 | |||
49 | /* exports for arch/arm/mach-s3c2410 | ||
50 | * | ||
51 | * Please DO NOT use these outside of arch/arm/mach-s3c2410 | ||
52 | */ | ||
53 | |||
54 | extern struct mutex clocks_mutex; | ||
55 | |||
56 | extern int s3c2410_clkcon_enable(struct clk *clk, int enable); | ||
57 | |||
58 | extern int s3c24xx_register_clock(struct clk *clk); | ||
59 | extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks); | ||
60 | |||
61 | extern int s3c24xx_setup_clocks(unsigned long xtal, | ||
62 | unsigned long fclk, | ||
63 | unsigned long hclk, | ||
64 | unsigned long pclk); | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu.h b/arch/arm/plat-s3c24xx/include/plat/cpu.h deleted file mode 100644 index 23e420e8bd5b..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/cpu.h +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/cpu.h | ||
2 | * | ||
3 | * Copyright (c) 2004-2005 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for S3C24XX CPU support | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | /* todo - fix when rmk changes iodescs to use `void __iomem *` */ | ||
14 | |||
15 | #define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } | ||
16 | |||
17 | #ifndef MHZ | ||
18 | #define MHZ (1000*1000) | ||
19 | #endif | ||
20 | |||
21 | #define print_mhz(m) ((m) / MHZ), ((m / 1000) % 1000) | ||
22 | |||
23 | /* forward declaration */ | ||
24 | struct s3c24xx_uart_resources; | ||
25 | struct platform_device; | ||
26 | struct s3c2410_uartcfg; | ||
27 | struct map_desc; | ||
28 | |||
29 | /* core initialisation functions */ | ||
30 | |||
31 | extern void s3c24xx_init_irq(void); | ||
32 | |||
33 | extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); | ||
34 | |||
35 | extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
36 | |||
37 | extern void s3c24xx_init_clocks(int xtal); | ||
38 | |||
39 | extern void s3c24xx_init_uartdevs(char *name, | ||
40 | struct s3c24xx_uart_resources *res, | ||
41 | struct s3c2410_uartcfg *cfg, int no); | ||
42 | |||
43 | /* timer for 2410/2440 */ | ||
44 | |||
45 | struct sys_timer; | ||
46 | extern struct sys_timer s3c24xx_timer; | ||
47 | |||
48 | /* system device classes */ | ||
49 | |||
50 | extern struct sysdev_class s3c2410_sysclass; | ||
51 | extern struct sysdev_class s3c2412_sysclass; | ||
52 | extern struct sysdev_class s3c2440_sysclass; | ||
53 | extern struct sysdev_class s3c2442_sysclass; | ||
54 | extern struct sysdev_class s3c2443_sysclass; | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/devs.h b/arch/arm/plat-s3c24xx/include/plat/devs.h deleted file mode 100644 index badaac9d64a8..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/devs.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/devs.h | ||
2 | * | ||
3 | * Copyright (c) 2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for s3c2410 standard platform devices | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | struct s3c24xx_uart_resources { | ||
15 | struct resource *resources; | ||
16 | unsigned long nr_resources; | ||
17 | }; | ||
18 | |||
19 | extern struct s3c24xx_uart_resources s3c2410_uart_resources[]; | ||
20 | |||
21 | extern struct platform_device *s3c24xx_uart_devs[]; | ||
22 | extern struct platform_device *s3c24xx_uart_src[]; | ||
23 | |||
24 | extern struct platform_device s3c_device_timer[]; | ||
25 | |||
26 | extern struct platform_device s3c_device_usb; | ||
27 | extern struct platform_device s3c_device_lcd; | ||
28 | extern struct platform_device s3c_device_wdt; | ||
29 | extern struct platform_device s3c_device_i2c; | ||
30 | extern struct platform_device s3c_device_iis; | ||
31 | extern struct platform_device s3c_device_rtc; | ||
32 | extern struct platform_device s3c_device_adc; | ||
33 | extern struct platform_device s3c_device_sdi; | ||
34 | extern struct platform_device s3c_device_hsmmc; | ||
35 | |||
36 | extern struct platform_device s3c_device_spi0; | ||
37 | extern struct platform_device s3c_device_spi1; | ||
38 | |||
39 | extern struct platform_device s3c_device_nand; | ||
40 | |||
41 | extern struct platform_device s3c_device_usbgadget; | ||
42 | |||
43 | /* s3c2440 specific devices */ | ||
44 | |||
45 | #ifdef CONFIG_CPU_S3C2440 | ||
46 | |||
47 | extern struct platform_device s3c_device_camif; | ||
48 | |||
49 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/map.h b/arch/arm/plat-s3c24xx/include/plat/map.h new file mode 100644 index 000000000000..fef8ea8b8e1e --- /dev/null +++ b/arch/arm/plat-s3c24xx/include/plat/map.h | |||
@@ -0,0 +1,99 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/map.h | ||
2 | * | ||
3 | * Copyright (c) 2008 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C24XX - Memory map definitions | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_PLAT_S3C24XX_MAP_H | ||
14 | #define __ASM_PLAT_S3C24XX_MAP_H | ||
15 | |||
16 | /* interrupt controller is the first thing we put in, to make | ||
17 | * the assembly code for the irq detection easier | ||
18 | */ | ||
19 | #define S3C24XX_VA_IRQ S3C_VA_IRQ | ||
20 | #define S3C2410_PA_IRQ (0x4A000000) | ||
21 | #define S3C24XX_SZ_IRQ SZ_1M | ||
22 | |||
23 | /* memory controller registers */ | ||
24 | #define S3C24XX_VA_MEMCTRL S3C_VA_MEM | ||
25 | #define S3C2410_PA_MEMCTRL (0x48000000) | ||
26 | #define S3C24XX_SZ_MEMCTRL SZ_1M | ||
27 | |||
28 | /* UARTs */ | ||
29 | #define S3C24XX_VA_UART S3C_VA_UART | ||
30 | #define S3C2410_PA_UART (0x50000000) | ||
31 | #define S3C24XX_SZ_UART SZ_1M | ||
32 | #define S3C_UART_OFFSET (0x4000) | ||
33 | |||
34 | /* Timers */ | ||
35 | #define S3C24XX_VA_TIMER S3C_VA_TIMER | ||
36 | #define S3C2410_PA_TIMER (0x51000000) | ||
37 | #define S3C24XX_SZ_TIMER SZ_1M | ||
38 | |||
39 | /* Clock and Power management */ | ||
40 | #define S3C24XX_VA_CLKPWR S3C_VA_SYS | ||
41 | #define S3C24XX_SZ_CLKPWR SZ_1M | ||
42 | |||
43 | /* USB Device port */ | ||
44 | #define S3C2410_PA_USBDEV (0x52000000) | ||
45 | #define S3C24XX_SZ_USBDEV SZ_1M | ||
46 | |||
47 | /* Watchdog */ | ||
48 | #define S3C24XX_VA_WATCHDOG S3C_VA_WATCHDOG | ||
49 | #define S3C2410_PA_WATCHDOG (0x53000000) | ||
50 | #define S3C24XX_SZ_WATCHDOG SZ_1M | ||
51 | |||
52 | /* Standard size definitions for peripheral blocks. */ | ||
53 | |||
54 | #define S3C24XX_SZ_IIS SZ_1M | ||
55 | #define S3C24XX_SZ_ADC SZ_1M | ||
56 | #define S3C24XX_SZ_SPI SZ_1M | ||
57 | #define S3C24XX_SZ_SDI SZ_1M | ||
58 | #define S3C24XX_SZ_NAND SZ_1M | ||
59 | #define S3C24XX_SZ_USBHOST SZ_1M | ||
60 | |||
61 | /* GPIO ports */ | ||
62 | |||
63 | /* the calculation for the VA of this must ensure that | ||
64 | * it is the same distance apart from the UART in the | ||
65 | * phsyical address space, as the initial mapping for the IO | ||
66 | * is done as a 1:1 maping. This puts it (currently) at | ||
67 | * 0xFA800000, which is not in the way of any current mapping | ||
68 | * by the base system. | ||
69 | */ | ||
70 | |||
71 | #define S3C2410_PA_GPIO (0x56000000) | ||
72 | #define S3C24XX_VA_GPIO ((S3C24XX_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART) | ||
73 | #define S3C24XX_SZ_GPIO SZ_1M | ||
74 | |||
75 | |||
76 | /* ISA style IO, for each machine to sort out mappings for, if it | ||
77 | * implements it. We reserve two 16M regions for ISA. | ||
78 | */ | ||
79 | |||
80 | #define S3C24XX_VA_ISA_WORD S3C2410_ADDR(0x02000000) | ||
81 | #define S3C24XX_VA_ISA_BYTE S3C2410_ADDR(0x03000000) | ||
82 | |||
83 | /* deal with the registers that move under the 2412/2413 */ | ||
84 | |||
85 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) | ||
86 | #ifndef __ASSEMBLY__ | ||
87 | extern void __iomem *s3c24xx_va_gpio2; | ||
88 | #endif | ||
89 | #ifdef CONFIG_CPU_S3C2412_ONLY | ||
90 | #define S3C24XX_VA_GPIO2 (S3C24XX_VA_GPIO + 0x10) | ||
91 | #else | ||
92 | #define S3C24XX_VA_GPIO2 s3c24xx_va_gpio2 | ||
93 | #endif | ||
94 | #else | ||
95 | #define s3c24xx_va_gpio2 S3C24XX_VA_GPIO | ||
96 | #define S3C24XX_VA_GPIO2 S3C24XX_VA_GPIO | ||
97 | #endif | ||
98 | |||
99 | #endif /* __ASM_PLAT_S3C24XX_MAP_H */ | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/pll.h b/arch/arm/plat-s3c24xx/include/plat/pll.h new file mode 100644 index 000000000000..7ea8bffa7a9c --- /dev/null +++ b/arch/arm/plat-s3c24xx/include/plat/pll.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/include/plat/pll.h | ||
2 | * | ||
3 | * Copyright 2008 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * | ||
7 | * S3C24xx - common pll registers and code | ||
8 | */ | ||
9 | |||
10 | #define S3C24XX_PLLCON_MDIVSHIFT 12 | ||
11 | #define S3C24XX_PLLCON_PDIVSHIFT 4 | ||
12 | #define S3C24XX_PLLCON_SDIVSHIFT 0 | ||
13 | #define S3C24XX_PLLCON_MDIVMASK ((1<<(1+(19-12)))-1) | ||
14 | #define S3C24XX_PLLCON_PDIVMASK ((1<<5)-1) | ||
15 | #define S3C24XX_PLLCON_SDIVMASK 3 | ||
16 | |||
17 | #include <asm/div64.h> | ||
18 | |||
19 | static inline unsigned int | ||
20 | s3c24xx_get_pll(unsigned int pllval, unsigned int baseclk) | ||
21 | { | ||
22 | unsigned int mdiv, pdiv, sdiv; | ||
23 | uint64_t fvco; | ||
24 | |||
25 | mdiv = pllval >> S3C24XX_PLLCON_MDIVSHIFT; | ||
26 | pdiv = pllval >> S3C24XX_PLLCON_PDIVSHIFT; | ||
27 | sdiv = pllval >> S3C24XX_PLLCON_SDIVSHIFT; | ||
28 | |||
29 | mdiv &= S3C24XX_PLLCON_MDIVMASK; | ||
30 | pdiv &= S3C24XX_PLLCON_PDIVMASK; | ||
31 | sdiv &= S3C24XX_PLLCON_SDIVMASK; | ||
32 | |||
33 | fvco = (uint64_t)baseclk * (mdiv + 8); | ||
34 | do_div(fvco, (pdiv + 2) << sdiv); | ||
35 | |||
36 | return (unsigned int)fvco; | ||
37 | } | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2400.h b/arch/arm/plat-s3c24xx/include/plat/s3c2400.h index 3a5a16821af8..b3feaea5c70b 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2400.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2400.h | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | extern int s3c2400_init(void); | 18 | extern int s3c2400_init(void); |
19 | 19 | ||
20 | extern void s3c2400_map_io(struct map_desc *mach_desc, int size); | 20 | extern void s3c2400_map_io(void); |
21 | 21 | ||
22 | extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no); | 22 | extern void s3c2400_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
23 | 23 | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h index 3cd1ec677b3f..a9ac9e29759e 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | extern int s3c2410_init(void); | 16 | extern int s3c2410_init(void); |
17 | 17 | ||
18 | extern void s3c2410_map_io(struct map_desc *mach_desc, int size); | 18 | extern void s3c2410_map_io(void); |
19 | 19 | ||
20 | extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); | 20 | extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
21 | 21 | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2412.h b/arch/arm/plat-s3c24xx/include/plat/s3c2412.h index 3ec97685e781..bb15d3b68be5 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2412.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2412.h | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | extern int s3c2412_init(void); | 15 | extern int s3c2412_init(void); |
16 | 16 | ||
17 | extern void s3c2412_map_io(struct map_desc *mach_desc, int size); | 17 | extern void s3c2412_map_io(void); |
18 | 18 | ||
19 | extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no); | 19 | extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
20 | 20 | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h b/arch/arm/plat-s3c24xx/include/plat/s3c2443.h index 11d83b5c84e6..815b107ed890 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c2443.h | |||
@@ -16,7 +16,7 @@ struct s3c2410_uartcfg; | |||
16 | 16 | ||
17 | extern int s3c2443_init(void); | 17 | extern int s3c2443_init(void); |
18 | 18 | ||
19 | extern void s3c2443_map_io(struct map_desc *mach_desc, int size); | 19 | extern void s3c2443_map_io(void); |
20 | 20 | ||
21 | extern void s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no); | 21 | extern void s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
22 | 22 | ||