diff options
Diffstat (limited to 'arch/arm/plat-s3c/include')
-rw-r--r-- | arch/arm/plat-s3c/include/plat/adc.h | 10 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/clock.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/cpu.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/devs.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/dma-core.h | 22 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/dma.h | 127 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/gpio-core.h | 30 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/pm.h | 15 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/regs-serial.h | 5 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h | 50 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h | 377 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/sdhci.h | 50 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/udc-hs.h | 29 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/watchdog-reset.h | 49 |
14 files changed, 760 insertions, 9 deletions
diff --git a/arch/arm/plat-s3c/include/plat/adc.h b/arch/arm/plat-s3c/include/plat/adc.h index 43df2a404b0..d847bd476b6 100644 --- a/arch/arm/plat-s3c/include/plat/adc.h +++ b/arch/arm/plat-s3c/include/plat/adc.h | |||
@@ -19,10 +19,12 @@ struct s3c_adc_client; | |||
19 | extern int s3c_adc_start(struct s3c_adc_client *client, | 19 | extern int s3c_adc_start(struct s3c_adc_client *client, |
20 | unsigned int channel, unsigned int nr_samples); | 20 | unsigned int channel, unsigned int nr_samples); |
21 | 21 | ||
22 | extern struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, | 22 | extern struct s3c_adc_client * |
23 | void (*select)(unsigned selected), | 23 | s3c_adc_register(struct platform_device *pdev, |
24 | void (*conv)(unsigned d0, unsigned d1), | 24 | void (*select)(unsigned selected), |
25 | unsigned int is_ts); | 25 | void (*conv)(unsigned d0, unsigned d1, |
26 | unsigned *samples_left), | ||
27 | unsigned int is_ts); | ||
26 | 28 | ||
27 | extern void s3c_adc_release(struct s3c_adc_client *client); | 29 | extern void s3c_adc_release(struct s3c_adc_client *client); |
28 | 30 | ||
diff --git a/arch/arm/plat-s3c/include/plat/clock.h b/arch/arm/plat-s3c/include/plat/clock.h index a10622eed43..d86af84b5b8 100644 --- a/arch/arm/plat-s3c/include/plat/clock.h +++ b/arch/arm/plat-s3c/include/plat/clock.h | |||
@@ -50,6 +50,7 @@ extern struct clk clk_xtal; | |||
50 | extern struct clk clk_ext; | 50 | extern struct clk clk_ext; |
51 | 51 | ||
52 | /* S3C64XX specific clocks */ | 52 | /* S3C64XX specific clocks */ |
53 | extern struct clk clk_h2; | ||
53 | extern struct clk clk_27m; | 54 | extern struct clk clk_27m; |
54 | extern struct clk clk_48m; | 55 | extern struct clk clk_48m; |
55 | 56 | ||
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h b/arch/arm/plat-s3c/include/plat/cpu.h index e62ae0fcfe5..be541cbba07 100644 --- a/arch/arm/plat-s3c/include/plat/cpu.h +++ b/arch/arm/plat-s3c/include/plat/cpu.h | |||
@@ -69,3 +69,6 @@ extern struct sysdev_class s3c2412_sysclass; | |||
69 | extern struct sysdev_class s3c2440_sysclass; | 69 | extern struct sysdev_class s3c2440_sysclass; |
70 | extern struct sysdev_class s3c2442_sysclass; | 70 | extern struct sysdev_class s3c2442_sysclass; |
71 | extern struct sysdev_class s3c2443_sysclass; | 71 | extern struct sysdev_class s3c2443_sysclass; |
72 | extern struct sysdev_class s3c6410_sysclass; | ||
73 | extern struct sysdev_class s3c64xx_sysclass; | ||
74 | |||
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h index 26f0cec3ac0..a0b6768fddc 100644 --- a/arch/arm/plat-s3c/include/plat/devs.h +++ b/arch/arm/plat-s3c/include/plat/devs.h | |||
@@ -45,6 +45,7 @@ extern struct platform_device s3c_device_spi1; | |||
45 | extern struct platform_device s3c_device_nand; | 45 | extern struct platform_device s3c_device_nand; |
46 | 46 | ||
47 | extern struct platform_device s3c_device_usbgadget; | 47 | extern struct platform_device s3c_device_usbgadget; |
48 | extern struct platform_device s3c_device_usb_hsotg; | ||
48 | 49 | ||
49 | /* s3c2440 specific devices */ | 50 | /* s3c2440 specific devices */ |
50 | 51 | ||
diff --git a/arch/arm/plat-s3c/include/plat/dma-core.h b/arch/arm/plat-s3c/include/plat/dma-core.h new file mode 100644 index 00000000000..32ff2a92cb3 --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/dma-core.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/dma.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 | * Samsung S3C DMA core support | ||
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 | extern struct s3c2410_dma_chan *s3c_dma_lookup_channel(unsigned int channel); | ||
16 | |||
17 | extern struct s3c2410_dma_chan *s3c_dma_chan_map[]; | ||
18 | |||
19 | /* the currently allocated channel information */ | ||
20 | extern struct s3c2410_dma_chan s3c2410_chans[]; | ||
21 | |||
22 | |||
diff --git a/arch/arm/plat-s3c/include/plat/dma.h b/arch/arm/plat-s3c/include/plat/dma.h new file mode 100644 index 00000000000..34dba98f08e --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/dma.h | |||
@@ -0,0 +1,127 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/dma.h | ||
2 | * | ||
3 | * Copyright (C) 2003,2004,2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Samsung S3C DMA 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 | enum s3c2410_dma_buffresult { | ||
14 | S3C2410_RES_OK, | ||
15 | S3C2410_RES_ERR, | ||
16 | S3C2410_RES_ABORT | ||
17 | }; | ||
18 | |||
19 | enum s3c2410_dmasrc { | ||
20 | S3C2410_DMASRC_HW, /* source is memory */ | ||
21 | S3C2410_DMASRC_MEM /* source is hardware */ | ||
22 | }; | ||
23 | |||
24 | /* enum s3c2410_chan_op | ||
25 | * | ||
26 | * operation codes passed to the DMA code by the user, and also used | ||
27 | * to inform the current channel owner of any changes to the system state | ||
28 | */ | ||
29 | |||
30 | enum s3c2410_chan_op { | ||
31 | S3C2410_DMAOP_START, | ||
32 | S3C2410_DMAOP_STOP, | ||
33 | S3C2410_DMAOP_PAUSE, | ||
34 | S3C2410_DMAOP_RESUME, | ||
35 | S3C2410_DMAOP_FLUSH, | ||
36 | S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */ | ||
37 | S3C2410_DMAOP_STARTED, /* indicate channel started */ | ||
38 | }; | ||
39 | |||
40 | struct s3c2410_dma_client { | ||
41 | char *name; | ||
42 | }; | ||
43 | |||
44 | struct s3c2410_dma_chan; | ||
45 | |||
46 | /* s3c2410_dma_cbfn_t | ||
47 | * | ||
48 | * buffer callback routine type | ||
49 | */ | ||
50 | |||
51 | typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *, | ||
52 | void *buf, int size, | ||
53 | enum s3c2410_dma_buffresult result); | ||
54 | |||
55 | typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *, | ||
56 | enum s3c2410_chan_op ); | ||
57 | |||
58 | |||
59 | |||
60 | /* s3c2410_dma_request | ||
61 | * | ||
62 | * request a dma channel exclusivley | ||
63 | */ | ||
64 | |||
65 | extern int s3c2410_dma_request(unsigned int channel, | ||
66 | struct s3c2410_dma_client *, void *dev); | ||
67 | |||
68 | |||
69 | /* s3c2410_dma_ctrl | ||
70 | * | ||
71 | * change the state of the dma channel | ||
72 | */ | ||
73 | |||
74 | extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op); | ||
75 | |||
76 | /* s3c2410_dma_setflags | ||
77 | * | ||
78 | * set the channel's flags to a given state | ||
79 | */ | ||
80 | |||
81 | extern int s3c2410_dma_setflags(unsigned int channel, | ||
82 | unsigned int flags); | ||
83 | |||
84 | /* s3c2410_dma_free | ||
85 | * | ||
86 | * free the dma channel (will also abort any outstanding operations) | ||
87 | */ | ||
88 | |||
89 | extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); | ||
90 | |||
91 | /* s3c2410_dma_enqueue | ||
92 | * | ||
93 | * place the given buffer onto the queue of operations for the channel. | ||
94 | * The buffer must be allocated from dma coherent memory, or the Dcache/WB | ||
95 | * drained before the buffer is given to the DMA system. | ||
96 | */ | ||
97 | |||
98 | extern int s3c2410_dma_enqueue(unsigned int channel, void *id, | ||
99 | dma_addr_t data, int size); | ||
100 | |||
101 | /* s3c2410_dma_config | ||
102 | * | ||
103 | * configure the dma channel | ||
104 | */ | ||
105 | |||
106 | extern int s3c2410_dma_config(unsigned int channel, int xferunit); | ||
107 | |||
108 | /* s3c2410_dma_devconfig | ||
109 | * | ||
110 | * configure the device we're talking to | ||
111 | */ | ||
112 | |||
113 | extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source, | ||
114 | unsigned long devaddr); | ||
115 | |||
116 | /* s3c2410_dma_getposition | ||
117 | * | ||
118 | * get the position that the dma transfer is currently at | ||
119 | */ | ||
120 | |||
121 | extern int s3c2410_dma_getposition(unsigned int channel, | ||
122 | dma_addr_t *src, dma_addr_t *dest); | ||
123 | |||
124 | extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn); | ||
125 | extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn); | ||
126 | |||
127 | |||
diff --git a/arch/arm/plat-s3c/include/plat/gpio-core.h b/arch/arm/plat-s3c/include/plat/gpio-core.h index 2fc60a580ac..32af612767a 100644 --- a/arch/arm/plat-s3c/include/plat/gpio-core.h +++ b/arch/arm/plat-s3c/include/plat/gpio-core.h | |||
@@ -20,6 +20,18 @@ | |||
20 | * specific code. | 20 | * specific code. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | struct s3c_gpio_chip; | ||
24 | |||
25 | /** | ||
26 | * struct s3c_gpio_pm - power management (suspend/resume) information | ||
27 | * @save: Routine to save the state of the GPIO block | ||
28 | * @resume: Routine to resume the GPIO block. | ||
29 | */ | ||
30 | struct s3c_gpio_pm { | ||
31 | void (*save)(struct s3c_gpio_chip *chip); | ||
32 | void (*resume)(struct s3c_gpio_chip *chip); | ||
33 | }; | ||
34 | |||
23 | struct s3c_gpio_cfg; | 35 | struct s3c_gpio_cfg; |
24 | 36 | ||
25 | /** | 37 | /** |
@@ -27,6 +39,7 @@ struct s3c_gpio_cfg; | |||
27 | * @chip: The chip structure to be exported via gpiolib. | 39 | * @chip: The chip structure to be exported via gpiolib. |
28 | * @base: The base pointer to the gpio configuration registers. | 40 | * @base: The base pointer to the gpio configuration registers. |
29 | * @config: special function and pull-resistor control information. | 41 | * @config: special function and pull-resistor control information. |
42 | * @pm_save: Save information for suspend/resume support. | ||
30 | * | 43 | * |
31 | * This wrapper provides the necessary information for the Samsung | 44 | * This wrapper provides the necessary information for the Samsung |
32 | * specific gpios being registered with gpiolib. | 45 | * specific gpios being registered with gpiolib. |
@@ -34,7 +47,11 @@ struct s3c_gpio_cfg; | |||
34 | struct s3c_gpio_chip { | 47 | struct s3c_gpio_chip { |
35 | struct gpio_chip chip; | 48 | struct gpio_chip chip; |
36 | struct s3c_gpio_cfg *config; | 49 | struct s3c_gpio_cfg *config; |
50 | struct s3c_gpio_pm *pm; | ||
37 | void __iomem *base; | 51 | void __iomem *base; |
52 | #ifdef CONFIG_PM | ||
53 | u32 pm_save[4]; | ||
54 | #endif | ||
38 | }; | 55 | }; |
39 | 56 | ||
40 | static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc) | 57 | static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc) |
@@ -75,3 +92,16 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int chip) | |||
75 | 92 | ||
76 | static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { } | 93 | static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { } |
77 | #endif | 94 | #endif |
95 | |||
96 | #ifdef CONFIG_PM | ||
97 | extern struct s3c_gpio_pm s3c_gpio_pm_1bit; | ||
98 | extern struct s3c_gpio_pm s3c_gpio_pm_2bit; | ||
99 | extern struct s3c_gpio_pm s3c_gpio_pm_4bit; | ||
100 | #define __gpio_pm(x) x | ||
101 | #else | ||
102 | #define s3c_gpio_pm_1bit NULL | ||
103 | #define s3c_gpio_pm_2bit NULL | ||
104 | #define s3c_gpio_pm_4bit NULL | ||
105 | #define __gpio_pm(x) NULL | ||
106 | |||
107 | #endif /* CONFIG_PM */ | ||
diff --git a/arch/arm/plat-s3c/include/plat/pm.h b/arch/arm/plat-s3c/include/plat/pm.h index 3779775133a..7a797192fcf 100644 --- a/arch/arm/plat-s3c/include/plat/pm.h +++ b/arch/arm/plat-s3c/include/plat/pm.h | |||
@@ -44,6 +44,8 @@ extern void (*pm_cpu_sleep)(void); | |||
44 | 44 | ||
45 | extern unsigned long s3c_pm_flags; | 45 | extern unsigned long s3c_pm_flags; |
46 | 46 | ||
47 | extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */ | ||
48 | |||
47 | /* from sleep.S */ | 49 | /* from sleep.S */ |
48 | 50 | ||
49 | extern int s3c_cpu_save(unsigned long *saveblk); | 51 | extern int s3c_cpu_save(unsigned long *saveblk); |
@@ -88,6 +90,7 @@ struct pm_uart_save { | |||
88 | u32 ufcon; | 90 | u32 ufcon; |
89 | u32 umcon; | 91 | u32 umcon; |
90 | u32 ubrdiv; | 92 | u32 ubrdiv; |
93 | u32 udivslot; | ||
91 | }; | 94 | }; |
92 | 95 | ||
93 | /* helper functions to save/restore lists of registers. */ | 96 | /* helper functions to save/restore lists of registers. */ |
@@ -124,6 +127,18 @@ extern void s3c_pm_dbg(const char *msg, ...); | |||
124 | #define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt) | 127 | #define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt) |
125 | #endif | 128 | #endif |
126 | 129 | ||
130 | #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK | ||
131 | /** | ||
132 | * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs | ||
133 | * @set: set bits for the state of the LEDs | ||
134 | * @clear: clear bits for the state of the LEDs. | ||
135 | */ | ||
136 | extern void s3c_pm_debug_smdkled(u32 set, u32 clear); | ||
137 | |||
138 | #else | ||
139 | static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { } | ||
140 | #endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */ | ||
141 | |||
127 | /* suspend memory checking */ | 142 | /* suspend memory checking */ |
128 | 143 | ||
129 | #ifdef CONFIG_S3C2410_PM_CHECK | 144 | #ifdef CONFIG_S3C2410_PM_CHECK |
diff --git a/arch/arm/plat-s3c/include/plat/regs-serial.h b/arch/arm/plat-s3c/include/plat/regs-serial.h index 487d7d2a7e1..66af75a5cdd 100644 --- a/arch/arm/plat-s3c/include/plat/regs-serial.h +++ b/arch/arm/plat-s3c/include/plat/regs-serial.h | |||
@@ -189,6 +189,11 @@ | |||
189 | 189 | ||
190 | #define S3C2443_DIVSLOT (0x2C) | 190 | #define S3C2443_DIVSLOT (0x2C) |
191 | 191 | ||
192 | /* S3C64XX interrupt registers. */ | ||
193 | #define S3C64XX_UINTP 0x30 | ||
194 | #define S3C64XX_UINTSP 0x34 | ||
195 | #define S3C64XX_UINTM 0x38 | ||
196 | |||
192 | #ifndef __ASSEMBLY__ | 197 | #ifndef __ASSEMBLY__ |
193 | 198 | ||
194 | /* struct s3c24xx_uart_clksrc | 199 | /* struct s3c24xx_uart_clksrc |
diff --git a/arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h b/arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h new file mode 100644 index 00000000000..36a85f5000c --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h | ||
2 | * | ||
3 | * Copyright 2008 Openmoko, Inc. | ||
4 | * Copyright 2008 Simtec Electronics | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * Ben Dooks <ben@simtec.co.uk> | ||
7 | * | ||
8 | * S3C - USB2.0 Highspeed/OtG device PHY registers | ||
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 | /* Note, this is a seperate header file as some of the clock framework | ||
16 | * needs to touch this if the clk_48m is used as the USB OHCI or other | ||
17 | * peripheral source. | ||
18 | */ | ||
19 | |||
20 | #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H | ||
21 | #define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__ | ||
22 | |||
23 | /* S3C64XX_PA_USB_HSPHY */ | ||
24 | |||
25 | #define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY) | ||
26 | |||
27 | #define S3C_PHYPWR S3C_HSOTG_PHYREG(0x00) | ||
28 | #define SRC_PHYPWR_OTG_DISABLE (1 << 4) | ||
29 | #define SRC_PHYPWR_ANALOG_POWERDOWN (1 << 3) | ||
30 | #define SRC_PHYPWR_FORCE_SUSPEND (1 << 1) | ||
31 | |||
32 | #define S3C_PHYCLK S3C_HSOTG_PHYREG(0x04) | ||
33 | #define S3C_PHYCLK_MODE_USB11 (1 << 6) | ||
34 | #define S3C_PHYCLK_EXT_OSC (1 << 5) | ||
35 | #define S3C_PHYCLK_CLK_FORCE (1 << 4) | ||
36 | #define S3C_PHYCLK_ID_PULL (1 << 2) | ||
37 | #define S3C_PHYCLK_CLKSEL_MASK (0x3 << 0) | ||
38 | #define S3C_PHYCLK_CLKSEL_SHIFT (0) | ||
39 | #define S3C_PHYCLK_CLKSEL_48M (0x0 << 0) | ||
40 | #define S3C_PHYCLK_CLKSEL_12M (0x2 << 0) | ||
41 | #define S3C_PHYCLK_CLKSEL_24M (0x3 << 0) | ||
42 | |||
43 | #define S3C_RSTCON S3C_HSOTG_PHYREG(0x08) | ||
44 | #define S3C_RSTCON_PHYCLK (1 << 2) | ||
45 | #define S3C_RSTCON_HCLK (1 << 2) | ||
46 | #define S3C_RSTCON_PHY (1 << 0) | ||
47 | |||
48 | #define S3C_PHYTUNE S3C_HSOTG_PHYREG(0x20) | ||
49 | |||
50 | #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */ | ||
diff --git a/arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h b/arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h new file mode 100644 index 00000000000..8d18d9d4d14 --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h | |||
@@ -0,0 +1,377 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h | ||
2 | * | ||
3 | * Copyright 2008 Openmoko, Inc. | ||
4 | * Copyright 2008 Simtec Electronics | ||
5 | * http://armlinux.simtec.co.uk/ | ||
6 | * Ben Dooks <ben@simtec.co.uk> | ||
7 | * | ||
8 | * S3C - USB2.0 Highspeed/OtG device block registers | ||
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 | #ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_H | ||
16 | #define __PLAT_S3C64XX_REGS_USB_HSOTG_H __FILE__ | ||
17 | |||
18 | #define S3C_HSOTG_REG(x) (x) | ||
19 | |||
20 | #define S3C_GOTGCTL S3C_HSOTG_REG(0x000) | ||
21 | #define S3C_GOTGCTL_BSESVLD (1 << 19) | ||
22 | #define S3C_GOTGCTL_ASESVLD (1 << 18) | ||
23 | #define S3C_GOTGCTL_DBNC_SHORT (1 << 17) | ||
24 | #define S3C_GOTGCTL_CONID_B (1 << 16) | ||
25 | #define S3C_GOTGCTL_DEVHNPEN (1 << 11) | ||
26 | #define S3C_GOTGCTL_HSSETHNPEN (1 << 10) | ||
27 | #define S3C_GOTGCTL_HNPREQ (1 << 9) | ||
28 | #define S3C_GOTGCTL_HSTNEGSCS (1 << 8) | ||
29 | #define S3C_GOTGCTL_SESREQ (1 << 1) | ||
30 | #define S3C_GOTGCTL_SESREQSCS (1 << 0) | ||
31 | |||
32 | #define S3C_GOTGINT S3C_HSOTG_REG(0x004) | ||
33 | #define S3C_GOTGINT_DbnceDone (1 << 19) | ||
34 | #define S3C_GOTGINT_ADevTOUTChg (1 << 18) | ||
35 | #define S3C_GOTGINT_HstNegDet (1 << 17) | ||
36 | #define S3C_GOTGINT_HstnegSucStsChng (1 << 9) | ||
37 | #define S3C_GOTGINT_SesReqSucStsChng (1 << 8) | ||
38 | #define S3C_GOTGINT_SesEndDet (1 << 2) | ||
39 | |||
40 | #define S3C_GAHBCFG S3C_HSOTG_REG(0x008) | ||
41 | #define S3C_GAHBCFG_PTxFEmpLvl (1 << 8) | ||
42 | #define S3C_GAHBCFG_NPTxFEmpLvl (1 << 7) | ||
43 | #define S3C_GAHBCFG_DMAEn (1 << 5) | ||
44 | #define S3C_GAHBCFG_HBstLen_MASK (0xf << 1) | ||
45 | #define S3C_GAHBCFG_HBstLen_SHIFT (1) | ||
46 | #define S3C_GAHBCFG_HBstLen_Single (0x0 << 1) | ||
47 | #define S3C_GAHBCFG_HBstLen_Incr (0x1 << 1) | ||
48 | #define S3C_GAHBCFG_HBstLen_Incr4 (0x3 << 1) | ||
49 | #define S3C_GAHBCFG_HBstLen_Incr8 (0x5 << 1) | ||
50 | #define S3C_GAHBCFG_HBstLen_Incr16 (0x7 << 1) | ||
51 | #define S3C_GAHBCFG_GlblIntrEn (1 << 0) | ||
52 | |||
53 | #define S3C_GUSBCFG S3C_HSOTG_REG(0x00C) | ||
54 | #define S3C_GUSBCFG_PHYLPClkSel (1 << 15) | ||
55 | #define S3C_GUSBCFG_HNPCap (1 << 9) | ||
56 | #define S3C_GUSBCFG_SRPCap (1 << 8) | ||
57 | #define S3C_GUSBCFG_PHYIf16 (1 << 3) | ||
58 | #define S3C_GUSBCFG_TOutCal_MASK (0x7 << 0) | ||
59 | #define S3C_GUSBCFG_TOutCal_SHIFT (0) | ||
60 | #define S3C_GUSBCFG_TOutCal_LIMIT (0x7) | ||
61 | #define S3C_GUSBCFG_TOutCal(_x) ((_x) << 0) | ||
62 | |||
63 | #define S3C_GRSTCTL S3C_HSOTG_REG(0x010) | ||
64 | |||
65 | #define S3C_GRSTCTL_AHBIdle (1 << 31) | ||
66 | #define S3C_GRSTCTL_DMAReq (1 << 30) | ||
67 | #define S3C_GRSTCTL_TxFNum_MASK (0x1f << 6) | ||
68 | #define S3C_GRSTCTL_TxFNum_SHIFT (6) | ||
69 | #define S3C_GRSTCTL_TxFNum_LIMIT (0x1f) | ||
70 | #define S3C_GRSTCTL_TxFNum(_x) ((_x) << 6) | ||
71 | #define S3C_GRSTCTL_TxFFlsh (1 << 5) | ||
72 | #define S3C_GRSTCTL_RxFFlsh (1 << 4) | ||
73 | #define S3C_GRSTCTL_INTknQFlsh (1 << 3) | ||
74 | #define S3C_GRSTCTL_FrmCntrRst (1 << 2) | ||
75 | #define S3C_GRSTCTL_HSftRst (1 << 1) | ||
76 | #define S3C_GRSTCTL_CSftRst (1 << 0) | ||
77 | |||
78 | #define S3C_GINTSTS S3C_HSOTG_REG(0x014) | ||
79 | #define S3C_GINTMSK S3C_HSOTG_REG(0x018) | ||
80 | |||
81 | #define S3C_GINTSTS_WkUpInt (1 << 31) | ||
82 | #define S3C_GINTSTS_SessReqInt (1 << 30) | ||
83 | #define S3C_GINTSTS_DisconnInt (1 << 29) | ||
84 | #define S3C_GINTSTS_ConIDStsChng (1 << 28) | ||
85 | #define S3C_GINTSTS_PTxFEmp (1 << 26) | ||
86 | #define S3C_GINTSTS_HChInt (1 << 25) | ||
87 | #define S3C_GINTSTS_PrtInt (1 << 24) | ||
88 | #define S3C_GINTSTS_FetSusp (1 << 22) | ||
89 | #define S3C_GINTSTS_incompIP (1 << 21) | ||
90 | #define S3C_GINTSTS_IncomplSOIN (1 << 20) | ||
91 | #define S3C_GINTSTS_OEPInt (1 << 19) | ||
92 | #define S3C_GINTSTS_IEPInt (1 << 18) | ||
93 | #define S3C_GINTSTS_EPMis (1 << 17) | ||
94 | #define S3C_GINTSTS_EOPF (1 << 15) | ||
95 | #define S3C_GINTSTS_ISOutDrop (1 << 14) | ||
96 | #define S3C_GINTSTS_EnumDone (1 << 13) | ||
97 | #define S3C_GINTSTS_USBRst (1 << 12) | ||
98 | #define S3C_GINTSTS_USBSusp (1 << 11) | ||
99 | #define S3C_GINTSTS_ErlySusp (1 << 10) | ||
100 | #define S3C_GINTSTS_GOUTNakEff (1 << 7) | ||
101 | #define S3C_GINTSTS_GINNakEff (1 << 6) | ||
102 | #define S3C_GINTSTS_NPTxFEmp (1 << 5) | ||
103 | #define S3C_GINTSTS_RxFLvl (1 << 4) | ||
104 | #define S3C_GINTSTS_SOF (1 << 3) | ||
105 | #define S3C_GINTSTS_OTGInt (1 << 2) | ||
106 | #define S3C_GINTSTS_ModeMis (1 << 1) | ||
107 | #define S3C_GINTSTS_CurMod_Host (1 << 0) | ||
108 | |||
109 | #define S3C_GRXSTSR S3C_HSOTG_REG(0x01C) | ||
110 | #define S3C_GRXSTSP S3C_HSOTG_REG(0x020) | ||
111 | |||
112 | #define S3C_GRXSTS_FN_MASK (0x7f << 25) | ||
113 | #define S3C_GRXSTS_FN_SHIFT (25) | ||
114 | |||
115 | #define S3C_GRXSTS_PktSts_MASK (0xf << 17) | ||
116 | #define S3C_GRXSTS_PktSts_SHIFT (17) | ||
117 | #define S3C_GRXSTS_PktSts_GlobalOutNAK (0x1 << 17) | ||
118 | #define S3C_GRXSTS_PktSts_OutRX (0x2 << 17) | ||
119 | #define S3C_GRXSTS_PktSts_OutDone (0x3 << 17) | ||
120 | #define S3C_GRXSTS_PktSts_SetupDone (0x4 << 17) | ||
121 | #define S3C_GRXSTS_PktSts_SetupRX (0x6 << 17) | ||
122 | |||
123 | #define S3C_GRXSTS_DPID_MASK (0x3 << 15) | ||
124 | #define S3C_GRXSTS_DPID_SHIFT (15) | ||
125 | #define S3C_GRXSTS_ByteCnt_MASK (0x7ff << 4) | ||
126 | #define S3C_GRXSTS_ByteCnt_SHIFT (4) | ||
127 | #define S3C_GRXSTS_EPNum_MASK (0xf << 0) | ||
128 | #define S3C_GRXSTS_EPNum_SHIFT (0) | ||
129 | |||
130 | #define S3C_GRXFSIZ S3C_HSOTG_REG(0x024) | ||
131 | |||
132 | #define S3C_GNPTXFSIZ S3C_HSOTG_REG(0x028) | ||
133 | |||
134 | #define S3C_GNPTXFSIZ_NPTxFDep_MASK (0xffff << 16) | ||
135 | #define S3C_GNPTXFSIZ_NPTxFDep_SHIFT (16) | ||
136 | #define S3C_GNPTXFSIZ_NPTxFDep_LIMIT (0xffff) | ||
137 | #define S3C_GNPTXFSIZ_NPTxFDep(_x) ((_x) << 16) | ||
138 | #define S3C_GNPTXFSIZ_NPTxFStAddr_MASK (0xffff << 0) | ||
139 | #define S3C_GNPTXFSIZ_NPTxFStAddr_SHIFT (0) | ||
140 | #define S3C_GNPTXFSIZ_NPTxFStAddr_LIMIT (0xffff) | ||
141 | #define S3C_GNPTXFSIZ_NPTxFStAddr(_x) ((_x) << 0) | ||
142 | |||
143 | #define S3C_GNPTXSTS S3C_HSOTG_REG(0x02C) | ||
144 | |||
145 | #define S3C_GNPTXSTS_NPtxQTop_MASK (0x7f << 24) | ||
146 | #define S3C_GNPTXSTS_NPtxQTop_SHIFT (24) | ||
147 | |||
148 | #define S3C_GNPTXSTS_NPTxQSpcAvail_MASK (0xff << 16) | ||
149 | #define S3C_GNPTXSTS_NPTxQSpcAvail_SHIFT (16) | ||
150 | #define S3C_GNPTXSTS_NPTxQSpcAvail_GET(_v) (((_v) >> 16) & 0xff) | ||
151 | |||
152 | #define S3C_GNPTXSTS_NPTxFSpcAvail_MASK (0xffff << 0) | ||
153 | #define S3C_GNPTXSTS_NPTxFSpcAvail_SHIFT (0) | ||
154 | #define S3C_GNPTXSTS_NPTxFSpcAvail_GET(_v) (((_v) >> 0) & 0xffff) | ||
155 | |||
156 | |||
157 | #define S3C_HPTXFSIZ S3C_HSOTG_REG(0x100) | ||
158 | |||
159 | #define S3C_DPTXFSIZn(_a) S3C_HSOTG_REG(0x104 + (((_a) - 1) * 4)) | ||
160 | |||
161 | #define S3C_DPTXFSIZn_DPTxFSize_MASK (0xffff << 16) | ||
162 | #define S3C_DPTXFSIZn_DPTxFSize_SHIFT (16) | ||
163 | #define S3C_DPTXFSIZn_DPTxFSize_GET(_v) (((_v) >> 16) & 0xffff) | ||
164 | #define S3C_DPTXFSIZn_DPTxFSize_LIMIT (0xffff) | ||
165 | #define S3C_DPTXFSIZn_DPTxFSize(_x) ((_x) << 16) | ||
166 | |||
167 | #define S3C_DPTXFSIZn_DPTxFStAddr_MASK (0xffff << 0) | ||
168 | #define S3C_DPTXFSIZn_DPTxFStAddr_SHIFT (0) | ||
169 | |||
170 | /* Device mode registers */ | ||
171 | #define S3C_DCFG S3C_HSOTG_REG(0x800) | ||
172 | |||
173 | #define S3C_DCFG_EPMisCnt_MASK (0x1f << 18) | ||
174 | #define S3C_DCFG_EPMisCnt_SHIFT (18) | ||
175 | #define S3C_DCFG_EPMisCnt_LIMIT (0x1f) | ||
176 | #define S3C_DCFG_EPMisCnt(_x) ((_x) << 18) | ||
177 | |||
178 | #define S3C_DCFG_PerFrInt_MASK (0x3 << 11) | ||
179 | #define S3C_DCFG_PerFrInt_SHIFT (11) | ||
180 | #define S3C_DCFG_PerFrInt_LIMIT (0x3) | ||
181 | #define S3C_DCFG_PerFrInt(_x) ((_x) << 11) | ||
182 | |||
183 | #define S3C_DCFG_DevAddr_MASK (0x7f << 4) | ||
184 | #define S3C_DCFG_DevAddr_SHIFT (4) | ||
185 | #define S3C_DCFG_DevAddr_LIMIT (0x7f) | ||
186 | #define S3C_DCFG_DevAddr(_x) ((_x) << 4) | ||
187 | |||
188 | #define S3C_DCFG_NZStsOUTHShk (1 << 2) | ||
189 | |||
190 | #define S3C_DCFG_DevSpd_MASK (0x3 << 0) | ||
191 | #define S3C_DCFG_DevSpd_SHIFT (0) | ||
192 | #define S3C_DCFG_DevSpd_HS (0x0 << 0) | ||
193 | #define S3C_DCFG_DevSpd_FS (0x1 << 0) | ||
194 | #define S3C_DCFG_DevSpd_LS (0x2 << 0) | ||
195 | #define S3C_DCFG_DevSpd_FS48 (0x3 << 0) | ||
196 | |||
197 | #define S3C_DCTL S3C_HSOTG_REG(0x804) | ||
198 | |||
199 | #define S3C_DCTL_PWROnPrgDone (1 << 11) | ||
200 | #define S3C_DCTL_CGOUTNak (1 << 10) | ||
201 | #define S3C_DCTL_SGOUTNak (1 << 9) | ||
202 | #define S3C_DCTL_CGNPInNAK (1 << 8) | ||
203 | #define S3C_DCTL_SGNPInNAK (1 << 7) | ||
204 | #define S3C_DCTL_TstCtl_MASK (0x7 << 4) | ||
205 | #define S3C_DCTL_TstCtl_SHIFT (4) | ||
206 | #define S3C_DCTL_GOUTNakSts (1 << 3) | ||
207 | #define S3C_DCTL_GNPINNakSts (1 << 2) | ||
208 | #define S3C_DCTL_SftDiscon (1 << 1) | ||
209 | #define S3C_DCTL_RmtWkUpSig (1 << 0) | ||
210 | |||
211 | #define S3C_DSTS S3C_HSOTG_REG(0x808) | ||
212 | |||
213 | #define S3C_DSTS_SOFFN_MASK (0x3fff << 8) | ||
214 | #define S3C_DSTS_SOFFN_SHIFT (8) | ||
215 | #define S3C_DSTS_SOFFN_LIMIT (0x3fff) | ||
216 | #define S3C_DSTS_SOFFN(_x) ((_x) << 8) | ||
217 | #define S3C_DSTS_ErraticErr (1 << 3) | ||
218 | #define S3C_DSTS_EnumSpd_MASK (0x3 << 1) | ||
219 | #define S3C_DSTS_EnumSpd_SHIFT (1) | ||
220 | #define S3C_DSTS_EnumSpd_HS (0x0 << 1) | ||
221 | #define S3C_DSTS_EnumSpd_FS (0x1 << 1) | ||
222 | #define S3C_DSTS_EnumSpd_LS (0x2 << 1) | ||
223 | #define S3C_DSTS_EnumSpd_FS48 (0x3 << 1) | ||
224 | |||
225 | #define S3C_DSTS_SuspSts (1 << 0) | ||
226 | |||
227 | #define S3C_DIEPMSK S3C_HSOTG_REG(0x810) | ||
228 | |||
229 | #define S3C_DIEPMSK_INEPNakEffMsk (1 << 6) | ||
230 | #define S3C_DIEPMSK_INTknEPMisMsk (1 << 5) | ||
231 | #define S3C_DIEPMSK_INTknTXFEmpMsk (1 << 4) | ||
232 | #define S3C_DIEPMSK_TimeOUTMsk (1 << 3) | ||
233 | #define S3C_DIEPMSK_AHBErrMsk (1 << 2) | ||
234 | #define S3C_DIEPMSK_EPDisbldMsk (1 << 1) | ||
235 | #define S3C_DIEPMSK_XferComplMsk (1 << 0) | ||
236 | |||
237 | #define S3C_DOEPMSK S3C_HSOTG_REG(0x814) | ||
238 | |||
239 | #define S3C_DOEPMSK_Back2BackSetup (1 << 6) | ||
240 | #define S3C_DOEPMSK_OUTTknEPdisMsk (1 << 4) | ||
241 | #define S3C_DOEPMSK_SetupMsk (1 << 3) | ||
242 | #define S3C_DOEPMSK_AHBErrMsk (1 << 2) | ||
243 | #define S3C_DOEPMSK_EPDisbldMsk (1 << 1) | ||
244 | #define S3C_DOEPMSK_XferComplMsk (1 << 0) | ||
245 | |||
246 | #define S3C_DAINT S3C_HSOTG_REG(0x818) | ||
247 | #define S3C_DAINTMSK S3C_HSOTG_REG(0x81C) | ||
248 | |||
249 | #define S3C_DAINT_OutEP_SHIFT (16) | ||
250 | #define S3C_DAINT_OutEP(x) (1 << ((x) + 16)) | ||
251 | #define S3C_DAINT_InEP(x) (1 << (x)) | ||
252 | |||
253 | #define S3C_DTKNQR1 S3C_HSOTG_REG(0x820) | ||
254 | #define S3C_DTKNQR2 S3C_HSOTG_REG(0x824) | ||
255 | #define S3C_DTKNQR3 S3C_HSOTG_REG(0x830) | ||
256 | #define S3C_DTKNQR4 S3C_HSOTG_REG(0x834) | ||
257 | |||
258 | #define S3C_DVBUSDIS S3C_HSOTG_REG(0x828) | ||
259 | #define S3C_DVBUSPULSE S3C_HSOTG_REG(0x82C) | ||
260 | |||
261 | #define S3C_DIEPCTL0 S3C_HSOTG_REG(0x900) | ||
262 | #define S3C_DOEPCTL0 S3C_HSOTG_REG(0xB00) | ||
263 | #define S3C_DIEPCTL(_a) S3C_HSOTG_REG(0x900 + ((_a) * 0x20)) | ||
264 | #define S3C_DOEPCTL(_a) S3C_HSOTG_REG(0xB00 + ((_a) * 0x20)) | ||
265 | |||
266 | /* EP0 specialness: | ||
267 | * bits[29..28] - reserved (no SetD0PID, SetD1PID) | ||
268 | * bits[25..22] - should always be zero, this isn't a periodic endpoint | ||
269 | * bits[10..0] - MPS setting differenct for EP0 | ||
270 | */ | ||
271 | #define S3C_D0EPCTL_MPS_MASK (0x3 << 0) | ||
272 | #define S3C_D0EPCTL_MPS_SHIFT (0) | ||
273 | #define S3C_D0EPCTL_MPS_64 (0x0 << 0) | ||
274 | #define S3C_D0EPCTL_MPS_32 (0x1 << 0) | ||
275 | #define S3C_D0EPCTL_MPS_16 (0x2 << 0) | ||
276 | #define S3C_D0EPCTL_MPS_8 (0x3 << 0) | ||
277 | |||
278 | #define S3C_DxEPCTL_EPEna (1 << 31) | ||
279 | #define S3C_DxEPCTL_EPDis (1 << 30) | ||
280 | #define S3C_DxEPCTL_SetD1PID (1 << 29) | ||
281 | #define S3C_DxEPCTL_SetOddFr (1 << 29) | ||
282 | #define S3C_DxEPCTL_SetD0PID (1 << 28) | ||
283 | #define S3C_DxEPCTL_SetEvenFr (1 << 28) | ||
284 | #define S3C_DxEPCTL_SNAK (1 << 27) | ||
285 | #define S3C_DxEPCTL_CNAK (1 << 26) | ||
286 | #define S3C_DxEPCTL_TxFNum_MASK (0xf << 22) | ||
287 | #define S3C_DxEPCTL_TxFNum_SHIFT (22) | ||
288 | #define S3C_DxEPCTL_TxFNum_LIMIT (0xf) | ||
289 | #define S3C_DxEPCTL_TxFNum(_x) ((_x) << 22) | ||
290 | |||
291 | #define S3C_DxEPCTL_Stall (1 << 21) | ||
292 | #define S3C_DxEPCTL_Snp (1 << 20) | ||
293 | #define S3C_DxEPCTL_EPType_MASK (0x3 << 18) | ||
294 | #define S3C_DxEPCTL_EPType_SHIFT (18) | ||
295 | #define S3C_DxEPCTL_EPType_Control (0x0 << 18) | ||
296 | #define S3C_DxEPCTL_EPType_Iso (0x1 << 18) | ||
297 | #define S3C_DxEPCTL_EPType_Bulk (0x2 << 18) | ||
298 | #define S3C_DxEPCTL_EPType_Intterupt (0x3 << 18) | ||
299 | |||
300 | #define S3C_DxEPCTL_NAKsts (1 << 17) | ||
301 | #define S3C_DxEPCTL_DPID (1 << 16) | ||
302 | #define S3C_DxEPCTL_EOFrNum (1 << 16) | ||
303 | #define S3C_DxEPCTL_USBActEp (1 << 15) | ||
304 | #define S3C_DxEPCTL_NextEp_MASK (0xf << 11) | ||
305 | #define S3C_DxEPCTL_NextEp_SHIFT (11) | ||
306 | #define S3C_DxEPCTL_NextEp_LIMIT (0xf) | ||
307 | #define S3C_DxEPCTL_NextEp(_x) ((_x) << 11) | ||
308 | |||
309 | #define S3C_DxEPCTL_MPS_MASK (0x7ff << 0) | ||
310 | #define S3C_DxEPCTL_MPS_SHIFT (0) | ||
311 | #define S3C_DxEPCTL_MPS_LIMIT (0x7ff) | ||
312 | #define S3C_DxEPCTL_MPS(_x) ((_x) << 0) | ||
313 | |||
314 | #define S3C_DIEPINT(_a) S3C_HSOTG_REG(0x908 + ((_a) * 0x20)) | ||
315 | #define S3C_DOEPINT(_a) S3C_HSOTG_REG(0xB08 + ((_a) * 0x20)) | ||
316 | |||
317 | #define S3C_DxEPINT_INEPNakEff (1 << 6) | ||
318 | #define S3C_DxEPINT_Back2BackSetup (1 << 6) | ||
319 | #define S3C_DxEPINT_INTknEPMis (1 << 5) | ||
320 | #define S3C_DxEPINT_INTknTXFEmp (1 << 4) | ||
321 | #define S3C_DxEPINT_OUTTknEPdis (1 << 4) | ||
322 | #define S3C_DxEPINT_Timeout (1 << 3) | ||
323 | #define S3C_DxEPINT_Setup (1 << 3) | ||
324 | #define S3C_DxEPINT_AHBErr (1 << 2) | ||
325 | #define S3C_DxEPINT_EPDisbld (1 << 1) | ||
326 | #define S3C_DxEPINT_XferCompl (1 << 0) | ||
327 | |||
328 | #define S3C_DIEPTSIZ0 S3C_HSOTG_REG(0x910) | ||
329 | |||
330 | #define S3C_DIEPTSIZ0_PktCnt_MASK (0x3 << 19) | ||
331 | #define S3C_DIEPTSIZ0_PktCnt_SHIFT (19) | ||
332 | #define S3C_DIEPTSIZ0_PktCnt_LIMIT (0x3) | ||
333 | #define S3C_DIEPTSIZ0_PktCnt(_x) ((_x) << 19) | ||
334 | |||
335 | #define S3C_DIEPTSIZ0_XferSize_MASK (0x7f << 0) | ||
336 | #define S3C_DIEPTSIZ0_XferSize_SHIFT (0) | ||
337 | #define S3C_DIEPTSIZ0_XferSize_LIMIT (0x7f) | ||
338 | #define S3C_DIEPTSIZ0_XferSize(_x) ((_x) << 0) | ||
339 | |||
340 | |||
341 | #define DOEPTSIZ0 S3C_HSOTG_REG(0xB10) | ||
342 | #define S3C_DOEPTSIZ0_SUPCnt_MASK (0x3 << 29) | ||
343 | #define S3C_DOEPTSIZ0_SUPCnt_SHIFT (29) | ||
344 | #define S3C_DOEPTSIZ0_SUPCnt_LIMIT (0x3) | ||
345 | #define S3C_DOEPTSIZ0_SUPCnt(_x) ((_x) << 29) | ||
346 | |||
347 | #define S3C_DOEPTSIZ0_PktCnt (1 << 19) | ||
348 | #define S3C_DOEPTSIZ0_XferSize_MASK (0x7f << 0) | ||
349 | #define S3C_DOEPTSIZ0_XferSize_SHIFT (0) | ||
350 | |||
351 | #define S3C_DIEPTSIZ(_a) S3C_HSOTG_REG(0x910 + ((_a) * 0x20)) | ||
352 | #define S3C_DOEPTSIZ(_a) S3C_HSOTG_REG(0xB10 + ((_a) * 0x20)) | ||
353 | |||
354 | #define S3C_DxEPTSIZ_MC_MASK (0x3 << 29) | ||
355 | #define S3C_DxEPTSIZ_MC_SHIFT (29) | ||
356 | #define S3C_DxEPTSIZ_MC_LIMIT (0x3) | ||
357 | #define S3C_DxEPTSIZ_MC(_x) ((_x) << 29) | ||
358 | |||
359 | #define S3C_DxEPTSIZ_PktCnt_MASK (0x3ff << 19) | ||
360 | #define S3C_DxEPTSIZ_PktCnt_SHIFT (19) | ||
361 | #define S3C_DxEPTSIZ_PktCnt_GET(_v) (((_v) >> 19) & 0x3ff) | ||
362 | #define S3C_DxEPTSIZ_PktCnt_LIMIT (0x3ff) | ||
363 | #define S3C_DxEPTSIZ_PktCnt(_x) ((_x) << 19) | ||
364 | |||
365 | #define S3C_DxEPTSIZ_XferSize_MASK (0x7ffff << 0) | ||
366 | #define S3C_DxEPTSIZ_XferSize_SHIFT (0) | ||
367 | #define S3C_DxEPTSIZ_XferSize_GET(_v) (((_v) >> 0) & 0x7ffff) | ||
368 | #define S3C_DxEPTSIZ_XferSize_LIMIT (0x7ffff) | ||
369 | #define S3C_DxEPTSIZ_XferSize(_x) ((_x) << 0) | ||
370 | |||
371 | |||
372 | #define S3C_DIEPDMA(_a) S3C_HSOTG_REG(0x914 + ((_a) * 0x20)) | ||
373 | #define S3C_DOEPDMA(_a) S3C_HSOTG_REG(0xB14 + ((_a) * 0x20)) | ||
374 | |||
375 | #define S3C_EPFIFO(_a) S3C_HSOTG_REG(0x1000 + ((_a) * 0x1000)) | ||
376 | |||
377 | #endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_H */ | ||
diff --git a/arch/arm/plat-s3c/include/plat/sdhci.h b/arch/arm/plat-s3c/include/plat/sdhci.h index c4ca3920ca4..f615308ccdf 100644 --- a/arch/arm/plat-s3c/include/plat/sdhci.h +++ b/arch/arm/plat-s3c/include/plat/sdhci.h | |||
@@ -67,12 +67,52 @@ extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata; | |||
67 | 67 | ||
68 | /* Helper function availablity */ | 68 | /* Helper function availablity */ |
69 | 69 | ||
70 | extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); | ||
71 | extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); | ||
72 | |||
73 | /* S3C6400 SDHCI setup */ | ||
74 | |||
75 | #ifdef CONFIG_S3C6400_SETUP_SDHCI | ||
76 | extern char *s3c6400_hsmmc_clksrcs[4]; | ||
77 | |||
78 | #ifdef CONFIG_S3C_DEV_HSMMC | ||
79 | extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev, | ||
80 | void __iomem *r, | ||
81 | struct mmc_ios *ios, | ||
82 | struct mmc_card *card); | ||
83 | |||
84 | static inline void s3c6400_default_sdhci0(void) | ||
85 | { | ||
86 | s3c_hsmmc0_def_platdata.clocks = s3c6400_hsmmc_clksrcs; | ||
87 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; | ||
88 | s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; | ||
89 | } | ||
90 | |||
91 | #else | ||
92 | static inline void s3c6400_default_sdhci0(void) { } | ||
93 | #endif /* CONFIG_S3C_DEV_HSMMC */ | ||
94 | |||
95 | #ifdef CONFIG_S3C_DEV_HSMMC1 | ||
96 | static inline void s3c6400_default_sdhci1(void) | ||
97 | { | ||
98 | s3c_hsmmc1_def_platdata.clocks = s3c6400_hsmmc_clksrcs; | ||
99 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; | ||
100 | s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; | ||
101 | } | ||
102 | #else | ||
103 | static inline void s3c6400_default_sdhci1(void) { } | ||
104 | #endif /* CONFIG_S3C_DEV_HSMMC1 */ | ||
105 | |||
106 | #else | ||
107 | static inline void s3c6400_default_sdhci0(void) { } | ||
108 | static inline void s3c6400_default_sdhci1(void) { } | ||
109 | #endif /* CONFIG_S3C6400_SETUP_SDHCI */ | ||
110 | |||
111 | /* S3C6410 SDHCI setup */ | ||
112 | |||
70 | #ifdef CONFIG_S3C6410_SETUP_SDHCI | 113 | #ifdef CONFIG_S3C6410_SETUP_SDHCI |
71 | extern char *s3c6410_hsmmc_clksrcs[4]; | 114 | extern char *s3c6410_hsmmc_clksrcs[4]; |
72 | 115 | ||
73 | extern void s3c6410_setup_sdhci0_cfg_gpio(struct platform_device *, int w); | ||
74 | extern void s3c6410_setup_sdhci1_cfg_gpio(struct platform_device *, int w); | ||
75 | |||
76 | extern void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, | 116 | extern void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, |
77 | void __iomem *r, | 117 | void __iomem *r, |
78 | struct mmc_ios *ios, | 118 | struct mmc_ios *ios, |
@@ -82,7 +122,7 @@ extern void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, | |||
82 | static inline void s3c6410_default_sdhci0(void) | 122 | static inline void s3c6410_default_sdhci0(void) |
83 | { | 123 | { |
84 | s3c_hsmmc0_def_platdata.clocks = s3c6410_hsmmc_clksrcs; | 124 | s3c_hsmmc0_def_platdata.clocks = s3c6410_hsmmc_clksrcs; |
85 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c6410_setup_sdhci0_cfg_gpio; | 125 | s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; |
86 | s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; | 126 | s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; |
87 | } | 127 | } |
88 | #else | 128 | #else |
@@ -93,7 +133,7 @@ static inline void s3c6410_default_sdhci0(void) { } | |||
93 | static inline void s3c6410_default_sdhci1(void) | 133 | static inline void s3c6410_default_sdhci1(void) |
94 | { | 134 | { |
95 | s3c_hsmmc1_def_platdata.clocks = s3c6410_hsmmc_clksrcs; | 135 | s3c_hsmmc1_def_platdata.clocks = s3c6410_hsmmc_clksrcs; |
96 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c6410_setup_sdhci1_cfg_gpio; | 136 | s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; |
97 | s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; | 137 | s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; |
98 | } | 138 | } |
99 | #else | 139 | #else |
diff --git a/arch/arm/plat-s3c/include/plat/udc-hs.h b/arch/arm/plat-s3c/include/plat/udc-hs.h new file mode 100644 index 00000000000..dd04db04310 --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/udc-hs.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/udc-hs.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 | * S3C USB2.0 High-speed / OtG platform information | ||
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 | enum s3c_hostg_dmamode { | ||
16 | S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ | ||
17 | S3C_HSOTG_DMA_ONLY, /* always use DMA */ | ||
18 | S3C_HSOTG_DMA_DRV, /* DMA is chosen by driver */ | ||
19 | }; | ||
20 | |||
21 | /** | ||
22 | * struct s3c_hsotg_plat - platform data for high-speed otg/udc | ||
23 | * @dma: Whether to use DMA or not. | ||
24 | * @is_osc: The clock source is an oscillator, not a crystal | ||
25 | */ | ||
26 | struct s3c_hsotg_plat { | ||
27 | enum s3c_hostg_dmamode dma; | ||
28 | unsigned int is_osc : 1; | ||
29 | }; | ||
diff --git a/arch/arm/plat-s3c/include/plat/watchdog-reset.h b/arch/arm/plat-s3c/include/plat/watchdog-reset.h new file mode 100644 index 00000000000..54b762acb5a --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/watchdog-reset.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/watchdog-reset.h | ||
2 | * | ||
3 | * Copyright (c) 2008 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2410 - System define for arch_reset() function | ||
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 | #include <plat/regs-watchdog.h> | ||
14 | #include <mach/map.h> | ||
15 | |||
16 | #include <linux/clk.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/io.h> | ||
19 | |||
20 | static inline void arch_wdt_reset(void) | ||
21 | { | ||
22 | struct clk *wdtclk; | ||
23 | |||
24 | printk("arch_reset: attempting watchdog reset\n"); | ||
25 | |||
26 | __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ | ||
27 | |||
28 | wdtclk = clk_get(NULL, "watchdog"); | ||
29 | if (!IS_ERR(wdtclk)) { | ||
30 | clk_enable(wdtclk); | ||
31 | } else | ||
32 | printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__); | ||
33 | |||
34 | /* put initial values into count and data */ | ||
35 | __raw_writel(0x80, S3C2410_WTCNT); | ||
36 | __raw_writel(0x80, S3C2410_WTDAT); | ||
37 | |||
38 | /* set the watchdog to go and reset... */ | ||
39 | __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN | | ||
40 | S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON); | ||
41 | |||
42 | /* wait for reset to assert... */ | ||
43 | mdelay(500); | ||
44 | |||
45 | printk(KERN_ERR "Watchdog reset failed to assert reset\n"); | ||
46 | |||
47 | /* delay to allow the serial port to show the message */ | ||
48 | mdelay(50); | ||
49 | } | ||