aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-cns3xxx
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-01-06 17:33:32 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-01-06 17:33:32 -0500
commit404a02cbd2ae8bf256a2fa1169bdfe86bb5ebb34 (patch)
tree99119edc53fdca73ed7586829b8ee736e09440b3 /arch/arm/mach-cns3xxx
parent28cdac6690cb113856293bf79b40de33dbd8f974 (diff)
parent1051b9f0f9eab8091fe3bf98320741adf36b4cfa (diff)
Merge branch 'devel-stable' into devel
Conflicts: arch/arm/mach-pxa/clock.c arch/arm/mach-pxa/clock.h
Diffstat (limited to 'arch/arm/mach-cns3xxx')
-rw-r--r--arch/arm/mach-cns3xxx/cns3420vb.c54
-rw-r--r--arch/arm/mach-cns3xxx/core.h2
-rw-r--r--arch/arm/mach-cns3xxx/devices.c1
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/cns3xxx.h2
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/pm.h23
-rw-r--r--arch/arm/mach-cns3xxx/pm.c23
6 files changed, 101 insertions, 4 deletions
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c
index 90fe9ab8591d..08e5c8759502 100644
--- a/arch/arm/mach-cns3xxx/cns3420vb.c
+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
@@ -17,6 +17,7 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/dma-mapping.h>
20#include <linux/serial_core.h> 21#include <linux/serial_core.h>
21#include <linux/serial_8250.h> 22#include <linux/serial_8250.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
@@ -108,10 +109,63 @@ static void __init cns3420_early_serial_setup(void)
108} 109}
109 110
110/* 111/*
112 * USB
113 */
114static struct resource cns3xxx_usb_ehci_resources[] = {
115 [0] = {
116 .start = CNS3XXX_USB_BASE,
117 .end = CNS3XXX_USB_BASE + SZ_16M - 1,
118 .flags = IORESOURCE_MEM,
119 },
120 [1] = {
121 .start = IRQ_CNS3XXX_USB_EHCI,
122 .flags = IORESOURCE_IRQ,
123 },
124};
125
126static u64 cns3xxx_usb_ehci_dma_mask = DMA_BIT_MASK(32);
127
128static struct platform_device cns3xxx_usb_ehci_device = {
129 .name = "cns3xxx-ehci",
130 .num_resources = ARRAY_SIZE(cns3xxx_usb_ehci_resources),
131 .resource = cns3xxx_usb_ehci_resources,
132 .dev = {
133 .dma_mask = &cns3xxx_usb_ehci_dma_mask,
134 .coherent_dma_mask = DMA_BIT_MASK(32),
135 },
136};
137
138static struct resource cns3xxx_usb_ohci_resources[] = {
139 [0] = {
140 .start = CNS3XXX_USB_OHCI_BASE,
141 .end = CNS3XXX_USB_OHCI_BASE + SZ_16M - 1,
142 .flags = IORESOURCE_MEM,
143 },
144 [1] = {
145 .start = IRQ_CNS3XXX_USB_OHCI,
146 .flags = IORESOURCE_IRQ,
147 },
148};
149
150static u64 cns3xxx_usb_ohci_dma_mask = DMA_BIT_MASK(32);
151
152static struct platform_device cns3xxx_usb_ohci_device = {
153 .name = "cns3xxx-ohci",
154 .num_resources = ARRAY_SIZE(cns3xxx_usb_ohci_resources),
155 .resource = cns3xxx_usb_ohci_resources,
156 .dev = {
157 .dma_mask = &cns3xxx_usb_ohci_dma_mask,
158 .coherent_dma_mask = DMA_BIT_MASK(32),
159 },
160};
161
162/*
111 * Initialization 163 * Initialization
112 */ 164 */
113static struct platform_device *cns3420_pdevs[] __initdata = { 165static struct platform_device *cns3420_pdevs[] __initdata = {
114 &cns3420_nor_pdev, 166 &cns3420_nor_pdev,
167 &cns3xxx_usb_ehci_device,
168 &cns3xxx_usb_ohci_device,
115}; 169};
116 170
117static void __init cns3420_init(void) 171static void __init cns3420_init(void)
diff --git a/arch/arm/mach-cns3xxx/core.h b/arch/arm/mach-cns3xxx/core.h
index ef9e5116b1a9..ffeb3a8b73ba 100644
--- a/arch/arm/mach-cns3xxx/core.h
+++ b/arch/arm/mach-cns3xxx/core.h
@@ -16,7 +16,5 @@ extern struct sys_timer cns3xxx_timer;
16void __init cns3xxx_map_io(void); 16void __init cns3xxx_map_io(void);
17void __init cns3xxx_init_irq(void); 17void __init cns3xxx_init_irq(void);
18void cns3xxx_power_off(void); 18void cns3xxx_power_off(void);
19void cns3xxx_pwr_power_up(unsigned int block);
20void cns3xxx_pwr_power_down(unsigned int block);
21 19
22#endif /* __CNS3XXX_CORE_H */ 20#endif /* __CNS3XXX_CORE_H */
diff --git a/arch/arm/mach-cns3xxx/devices.c b/arch/arm/mach-cns3xxx/devices.c
index 50b4d31c27c0..79d1fb02c23f 100644
--- a/arch/arm/mach-cns3xxx/devices.c
+++ b/arch/arm/mach-cns3xxx/devices.c
@@ -18,6 +18,7 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <mach/cns3xxx.h> 19#include <mach/cns3xxx.h>
20#include <mach/irqs.h> 20#include <mach/irqs.h>
21#include <mach/pm.h>
21#include "core.h" 22#include "core.h"
22#include "devices.h" 23#include "devices.h"
23 24
diff --git a/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h b/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h
index 6dbce13771ca..191c8e57f289 100644
--- a/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h
+++ b/arch/arm/mach-cns3xxx/include/mach/cns3xxx.h
@@ -165,7 +165,6 @@
165#define CNS3XXX_USBOTG_BASE_VIRT 0xFFF15000 165#define CNS3XXX_USBOTG_BASE_VIRT 0xFFF15000
166 166
167#define CNS3XXX_USB_BASE 0x82000000 /* USB Host Control */ 167#define CNS3XXX_USB_BASE 0x82000000 /* USB Host Control */
168#define CNS3XXX_USB_BASE_VIRT 0xFFF16000
169 168
170#define CNS3XXX_SATA2_BASE 0x83000000 /* SATA */ 169#define CNS3XXX_SATA2_BASE 0x83000000 /* SATA */
171#define CNS3XXX_SATA2_SIZE SZ_16M 170#define CNS3XXX_SATA2_SIZE SZ_16M
@@ -184,7 +183,6 @@
184#define CNS3XXX_2DG_BASE_VIRT 0xFFF1B000 183#define CNS3XXX_2DG_BASE_VIRT 0xFFF1B000
185 184
186#define CNS3XXX_USB_OHCI_BASE 0x88000000 /* USB OHCI */ 185#define CNS3XXX_USB_OHCI_BASE 0x88000000 /* USB OHCI */
187#define CNS3XXX_USB_OHCI_BASE_VIRT 0xFFF1C000
188 186
189#define CNS3XXX_L2C_BASE 0x92000000 /* L2 Cache Control */ 187#define CNS3XXX_L2C_BASE 0x92000000 /* L2 Cache Control */
190#define CNS3XXX_L2C_BASE_VIRT 0xFFF27000 188#define CNS3XXX_L2C_BASE_VIRT 0xFFF27000
diff --git a/arch/arm/mach-cns3xxx/include/mach/pm.h b/arch/arm/mach-cns3xxx/include/mach/pm.h
new file mode 100644
index 000000000000..6eae7f764d1d
--- /dev/null
+++ b/arch/arm/mach-cns3xxx/include/mach/pm.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright 2000 Deep Blue Solutions Ltd
3 * Copyright 2004 ARM Limited
4 * Copyright 2008 Cavium Networks
5 *
6 * This file is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, Version 2, as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __CNS3XXX_PM_H
12#define __CNS3XXX_PM_H
13
14#include <asm/atomic.h>
15
16void cns3xxx_pwr_clk_en(unsigned int block);
17void cns3xxx_pwr_clk_dis(unsigned int block);
18void cns3xxx_pwr_power_up(unsigned int block);
19void cns3xxx_pwr_power_down(unsigned int block);
20
21extern atomic_t usb_pwr_ref;
22
23#endif /* __CNS3XXX_PM_H */
diff --git a/arch/arm/mach-cns3xxx/pm.c b/arch/arm/mach-cns3xxx/pm.c
index 38e44706feab..5e579552aa54 100644
--- a/arch/arm/mach-cns3xxx/pm.c
+++ b/arch/arm/mach-cns3xxx/pm.c
@@ -6,10 +6,14 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <linux/init.h>
10#include <linux/module.h>
9#include <linux/io.h> 11#include <linux/io.h>
10#include <linux/delay.h> 12#include <linux/delay.h>
13#include <asm/atomic.h>
11#include <mach/system.h> 14#include <mach/system.h>
12#include <mach/cns3xxx.h> 15#include <mach/cns3xxx.h>
16#include <mach/pm.h>
13 17
14void cns3xxx_pwr_clk_en(unsigned int block) 18void cns3xxx_pwr_clk_en(unsigned int block)
15{ 19{
@@ -18,6 +22,16 @@ void cns3xxx_pwr_clk_en(unsigned int block)
18 reg |= (block & PM_CLK_GATE_REG_MASK); 22 reg |= (block & PM_CLK_GATE_REG_MASK);
19 __raw_writel(reg, PM_CLK_GATE_REG); 23 __raw_writel(reg, PM_CLK_GATE_REG);
20} 24}
25EXPORT_SYMBOL(cns3xxx_pwr_clk_en);
26
27void cns3xxx_pwr_clk_dis(unsigned int block)
28{
29 u32 reg = __raw_readl(PM_CLK_GATE_REG);
30
31 reg &= ~(block & PM_CLK_GATE_REG_MASK);
32 __raw_writel(reg, PM_CLK_GATE_REG);
33}
34EXPORT_SYMBOL(cns3xxx_pwr_clk_dis);
21 35
22void cns3xxx_pwr_power_up(unsigned int block) 36void cns3xxx_pwr_power_up(unsigned int block)
23{ 37{
@@ -29,6 +43,7 @@ void cns3xxx_pwr_power_up(unsigned int block)
29 /* Wait for 300us for the PLL output clock locked. */ 43 /* Wait for 300us for the PLL output clock locked. */
30 udelay(300); 44 udelay(300);
31}; 45};
46EXPORT_SYMBOL(cns3xxx_pwr_power_up);
32 47
33void cns3xxx_pwr_power_down(unsigned int block) 48void cns3xxx_pwr_power_down(unsigned int block)
34{ 49{
@@ -38,6 +53,7 @@ void cns3xxx_pwr_power_down(unsigned int block)
38 reg |= (block & CNS3XXX_PWR_PLL_ALL); 53 reg |= (block & CNS3XXX_PWR_PLL_ALL);
39 __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG); 54 __raw_writel(reg, PM_PLL_HM_PD_CTRL_REG);
40}; 55};
56EXPORT_SYMBOL(cns3xxx_pwr_power_down);
41 57
42static void cns3xxx_pwr_soft_rst_force(unsigned int block) 58static void cns3xxx_pwr_soft_rst_force(unsigned int block)
43{ 59{
@@ -51,11 +67,13 @@ static void cns3xxx_pwr_soft_rst_force(unsigned int block)
51 reg &= ~(block & PM_SOFT_RST_REG_MASK); 67 reg &= ~(block & PM_SOFT_RST_REG_MASK);
52 } else { 68 } else {
53 reg &= ~(block & PM_SOFT_RST_REG_MASK); 69 reg &= ~(block & PM_SOFT_RST_REG_MASK);
70 __raw_writel(reg, PM_SOFT_RST_REG);
54 reg |= (block & PM_SOFT_RST_REG_MASK); 71 reg |= (block & PM_SOFT_RST_REG_MASK);
55 } 72 }
56 73
57 __raw_writel(reg, PM_SOFT_RST_REG); 74 __raw_writel(reg, PM_SOFT_RST_REG);
58} 75}
76EXPORT_SYMBOL(cns3xxx_pwr_soft_rst_force);
59 77
60void cns3xxx_pwr_soft_rst(unsigned int block) 78void cns3xxx_pwr_soft_rst(unsigned int block)
61{ 79{
@@ -69,6 +87,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block)
69 } 87 }
70 cns3xxx_pwr_soft_rst_force(block); 88 cns3xxx_pwr_soft_rst_force(block);
71} 89}
90EXPORT_SYMBOL(cns3xxx_pwr_soft_rst);
72 91
73void arch_reset(char mode, const char *cmd) 92void arch_reset(char mode, const char *cmd)
74{ 93{
@@ -99,3 +118,7 @@ int cns3xxx_cpu_clock(void)
99 118
100 return cpu; 119 return cpu;
101} 120}
121EXPORT_SYMBOL(cns3xxx_cpu_clock);
122
123atomic_t usb_pwr_ref = ATOMIC_INIT(0);
124EXPORT_SYMBOL(usb_pwr_ref);