aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c41
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c19
-rw-r--r--arch/sh/include/mach-common/mach/romimage.h2
-rw-r--r--arch/sh/include/mach-ecovec24/mach/romimage.h2
-rw-r--r--arch/sh/include/mach-kfr2r09/mach/romimage.h2
-rw-r--r--include/linux/mmc/sh_mmcif.h26
6 files changed, 66 insertions, 26 deletions
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index 7336a00c34e7..d4c82bd42524 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -33,6 +33,8 @@
33#include <linux/input.h> 33#include <linux/input.h>
34#include <linux/input/sh_keysc.h> 34#include <linux/input/sh_keysc.h>
35 35
36#include <sound/sh_fsi.h>
37
36#include <mach/hardware.h> 38#include <mach/hardware.h>
37#include <mach/sh73a0.h> 39#include <mach/sh73a0.h>
38#include <mach/common.h> 40#include <mach/common.h>
@@ -113,9 +115,41 @@ static struct platform_device keysc_device = {
113 }, 115 },
114}; 116};
115 117
118/* FSI A */
119static struct sh_fsi_platform_info fsi_info = {
120 .porta_flags = SH_FSI_OUT_SLAVE_MODE |
121 SH_FSI_IN_SLAVE_MODE |
122 SH_FSI_OFMT(I2S) |
123 SH_FSI_IFMT(I2S),
124};
125
126static struct resource fsi_resources[] = {
127 [0] = {
128 .name = "FSI",
129 .start = 0xEC230000,
130 .end = 0xEC230400 - 1,
131 .flags = IORESOURCE_MEM,
132 },
133 [1] = {
134 .start = gic_spi(146),
135 .flags = IORESOURCE_IRQ,
136 },
137};
138
139static struct platform_device fsi_device = {
140 .name = "sh_fsi2",
141 .id = -1,
142 .num_resources = ARRAY_SIZE(fsi_resources),
143 .resource = fsi_resources,
144 .dev = {
145 .platform_data = &fsi_info,
146 },
147};
148
116static struct platform_device *ag5evm_devices[] __initdata = { 149static struct platform_device *ag5evm_devices[] __initdata = {
117 &eth_device, 150 &eth_device,
118 &keysc_device, 151 &keysc_device,
152 &fsi_device,
119}; 153};
120 154
121static struct map_desc ag5evm_io_desc[] __initdata = { 155static struct map_desc ag5evm_io_desc[] __initdata = {
@@ -195,6 +229,13 @@ static void __init ag5evm_init(void)
195 gpio_request(GPIO_PORT145, NULL); /* RESET */ 229 gpio_request(GPIO_PORT145, NULL); /* RESET */
196 gpio_direction_output(GPIO_PORT145, 1); 230 gpio_direction_output(GPIO_PORT145, 1);
197 231
232 /* FSI A */
233 gpio_request(GPIO_FN_FSIACK, NULL);
234 gpio_request(GPIO_FN_FSIAILR, NULL);
235 gpio_request(GPIO_FN_FSIAIBT, NULL);
236 gpio_request(GPIO_FN_FSIAISLD, NULL);
237 gpio_request(GPIO_FN_FSIAOSLD, NULL);
238
198#ifdef CONFIG_CACHE_L2X0 239#ifdef CONFIG_CACHE_L2X0
199 /* Shared attribute override enable, 64K*8way */ 240 /* Shared attribute override enable, 64K*8way */
200 l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff); 241 l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 6e48aaefbab1..81fd429c3c24 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -51,10 +51,11 @@ static struct clk *main_clks[] = {
51 &hp_clk, 51 &hp_clk,
52}; 52};
53 53
54enum { MSTP219, 54enum { MSTP001,
55 MSTP001, MSTP116, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, 55 MSTP116,
56 MSTP201, MSTP200, MSTP323, MSTP331, MSTP329, MSTP312, MSTP411, 56 MSTP219, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
57 MSTP410, MSTP403, 57 MSTP331, MSTP329, MSTP323,
58 MSTP411, MSTP410, MSTP403,
58 MSTP_NR }; 59 MSTP_NR };
59 60
60#define MSTP(_parent, _reg, _bit, _flags) \ 61#define MSTP(_parent, _reg, _bit, _flags) \
@@ -62,8 +63,8 @@ enum { MSTP219,
62 63
63static struct clk mstp_clks[MSTP_NR] = { 64static struct clk mstp_clks[MSTP_NR] = {
64 [MSTP001] = MSTP(&hp_clk, SMSTPCR0, 1, 0), /* I2C2 */ 65 [MSTP001] = MSTP(&hp_clk, SMSTPCR0, 1, 0), /* I2C2 */
65 [MSTP219] = MSTP(&sub_clk, SMSTPCR2, 19, 0), /* SCIFA7 */
66 [MSTP116] = MSTP(&hp_clk, SMSTPCR1, 16, 0), /* I2C0 */ 66 [MSTP116] = MSTP(&hp_clk, SMSTPCR1, 16, 0), /* I2C0 */
67 [MSTP219] = MSTP(&sub_clk, SMSTPCR2, 19, 0), /* SCIFA7 */
67 [MSTP207] = MSTP(&sub_clk, SMSTPCR2, 7, 0), /* SCIFA5 */ 68 [MSTP207] = MSTP(&sub_clk, SMSTPCR2, 7, 0), /* SCIFA5 */
68 [MSTP206] = MSTP(&sub_clk, SMSTPCR2, 6, 0), /* SCIFB */ 69 [MSTP206] = MSTP(&sub_clk, SMSTPCR2, 6, 0), /* SCIFB */
69 [MSTP204] = MSTP(&sub_clk, SMSTPCR2, 4, 0), /* SCIFA0 */ 70 [MSTP204] = MSTP(&sub_clk, SMSTPCR2, 4, 0), /* SCIFA0 */
@@ -74,15 +75,17 @@ static struct clk mstp_clks[MSTP_NR] = {
74 [MSTP331] = MSTP(&sub_clk, SMSTPCR3, 31, 0), /* SCIFA6 */ 75 [MSTP331] = MSTP(&sub_clk, SMSTPCR3, 31, 0), /* SCIFA6 */
75 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ 76 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
76 [MSTP323] = MSTP(&hp_clk, SMSTPCR3, 23, 0), /* I2C1 */ 77 [MSTP323] = MSTP(&hp_clk, SMSTPCR3, 23, 0), /* I2C1 */
77 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 0, 0), /* KEYSC0 */
78 [MSTP411] = MSTP(&hp_clk, SMSTPCR4, 11, 0), /* I2C3 */ 78 [MSTP411] = MSTP(&hp_clk, SMSTPCR4, 11, 0), /* I2C3 */
79 [MSTP410] = MSTP(&hp_clk, SMSTPCR4, 10, 0), /* I2C4 */ 79 [MSTP410] = MSTP(&hp_clk, SMSTPCR4, 10, 0), /* I2C4 */
80 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 0, 0), /* KEYSC0 */
80}; 81};
81 82
82#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk } 83#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
83 84
84static struct clk_lookup lookups[] = { 85static struct clk_lookup lookups[] = {
85 /* MSTP32 clocks */ 86 /* MSTP32 clocks */
87 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
88 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
86 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ 89 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
87 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 90 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
88 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ 91 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */
@@ -93,12 +96,10 @@ static struct clk_lookup lookups[] = {
93 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ 96 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
94 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ 97 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
95 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ 98 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
96 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC0 */
97 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
98 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ 99 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
99 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
100 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ 100 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
101 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */ 101 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
102 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC0 */
102}; 103};
103 104
104void __init sh73a0_clock_init(void) 105void __init sh73a0_clock_init(void)
diff --git a/arch/sh/include/mach-common/mach/romimage.h b/arch/sh/include/mach-common/mach/romimage.h
index 08fb42269ecd..3670455faaac 100644
--- a/arch/sh/include/mach-common/mach/romimage.h
+++ b/arch/sh/include/mach-common/mach/romimage.h
@@ -4,7 +4,7 @@
4 4
5#else /* __ASSEMBLY__ */ 5#else /* __ASSEMBLY__ */
6 6
7extern inline void mmcif_update_progress(int nr) 7static inline void mmcif_update_progress(int nr)
8{ 8{
9} 9}
10 10
diff --git a/arch/sh/include/mach-ecovec24/mach/romimage.h b/arch/sh/include/mach-ecovec24/mach/romimage.h
index 1dcf5e6c8d83..d63ef51ec186 100644
--- a/arch/sh/include/mach-ecovec24/mach/romimage.h
+++ b/arch/sh/include/mach-ecovec24/mach/romimage.h
@@ -35,7 +35,7 @@
35#define HIZCRA 0xa4050158 35#define HIZCRA 0xa4050158
36#define PGDR 0xa405012c 36#define PGDR 0xa405012c
37 37
38extern inline void mmcif_update_progress(int nr) 38static inline void mmcif_update_progress(int nr)
39{ 39{
40 /* disable Hi-Z for LED pins */ 40 /* disable Hi-Z for LED pins */
41 __raw_writew(__raw_readw(HIZCRA) & ~(1 << 1), HIZCRA); 41 __raw_writew(__raw_readw(HIZCRA) & ~(1 << 1), HIZCRA);
diff --git a/arch/sh/include/mach-kfr2r09/mach/romimage.h b/arch/sh/include/mach-kfr2r09/mach/romimage.h
index 976256a323f2..7a883167c846 100644
--- a/arch/sh/include/mach-kfr2r09/mach/romimage.h
+++ b/arch/sh/include/mach-kfr2r09/mach/romimage.h
@@ -23,7 +23,7 @@
23 23
24#else /* __ASSEMBLY__ */ 24#else /* __ASSEMBLY__ */
25 25
26extern inline void mmcif_update_progress(int nr) 26static inline void mmcif_update_progress(int nr)
27{ 27{
28} 28}
29 29
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index f216a8879b58..44fc5348fd5d 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -77,6 +77,9 @@ struct sh_mmcif_plat_data {
77#define CLK_ENABLE (1 << 24) /* 1: output mmc clock */ 77#define CLK_ENABLE (1 << 24) /* 1: output mmc clock */
78#define CLK_CLEAR ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16)) 78#define CLK_CLEAR ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
79#define CLK_SUP_PCLK ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16)) 79#define CLK_SUP_PCLK ((1 << 19) | (1 << 18) | (1 << 17) | (1 << 16))
80#define CLKDIV_4 (1<<16) /* mmc clock frequency.
81 * n: bus clock/(2^(n+1)) */
82#define CLKDIV_256 (7<<16) /* mmc clock frequency. (see above) */
80#define SRSPTO_256 ((1 << 13) | (0 << 12)) /* resp timeout */ 83#define SRSPTO_256 ((1 << 13) | (0 << 12)) /* resp timeout */
81#define SRBSYTO_29 ((1 << 11) | (1 << 10) | \ 84#define SRBSYTO_29 ((1 << 11) | (1 << 10) | \
82 (1 << 9) | (1 << 8)) /* resp busy timeout */ 85 (1 << 9) | (1 << 8)) /* resp busy timeout */
@@ -87,7 +90,7 @@ struct sh_mmcif_plat_data {
87 90
88/* CE_VERSION */ 91/* CE_VERSION */
89#define SOFT_RST_ON (1 << 31) 92#define SOFT_RST_ON (1 << 31)
90#define SOFT_RST_OFF ~SOFT_RST_ON 93#define SOFT_RST_OFF 0
91 94
92static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) 95static inline u32 sh_mmcif_readl(void __iomem *addr, int reg)
93{ 96{
@@ -175,12 +178,9 @@ static inline int sh_mmcif_boot_do_read(void __iomem *base,
175 178
176static inline void sh_mmcif_boot_init(void __iomem *base) 179static inline void sh_mmcif_boot_init(void __iomem *base)
177{ 180{
178 unsigned long tmp;
179
180 /* reset */ 181 /* reset */
181 tmp = sh_mmcif_readl(base, MMCIF_CE_VERSION); 182 sh_mmcif_writel(base, MMCIF_CE_VERSION, SOFT_RST_ON);
182 sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp | SOFT_RST_ON); 183 sh_mmcif_writel(base, MMCIF_CE_VERSION, SOFT_RST_OFF);
183 sh_mmcif_writel(base, MMCIF_CE_VERSION, tmp & SOFT_RST_OFF);
184 184
185 /* byte swap */ 185 /* byte swap */
186 sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, BUF_ACC_ATYP); 186 sh_mmcif_writel(base, MMCIF_CE_BUF_ACC, BUF_ACC_ATYP);
@@ -188,14 +188,10 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
188 /* Set block size in MMCIF hardware */ 188 /* Set block size in MMCIF hardware */
189 sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS); 189 sh_mmcif_writel(base, MMCIF_CE_BLOCK_SET, SH_MMCIF_BBS);
190 190
191 /* Enable the clock, set it to Bus clock/256 (about 325Khz). 191 /* Enable the clock, set it to Bus clock/256 (about 325Khz). */
192 * It is unclear where 0x70000 comes from or if it is even needed.
193 * It is there for byte-compatibility with code that is known to
194 * work.
195 */
196 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 192 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
197 CLK_ENABLE | SRSPTO_256 | SRBSYTO_29 | SRWDTO_29 | 193 CLK_ENABLE | CLKDIV_256 | SRSPTO_256 |
198 SCCSTO_29 | 0x70000); 194 SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
199 195
200 /* CMD0 */ 196 /* CMD0 */
201 sh_mmcif_boot_cmd(base, 0x00000040, 0); 197 sh_mmcif_boot_cmd(base, 0x00000040, 0);
@@ -220,7 +216,9 @@ static inline void sh_mmcif_boot_slurp(void __iomem *base,
220 unsigned long tmp; 216 unsigned long tmp;
221 217
222 /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */ 218 /* In data transfer mode: Set clock to Bus clock/4 (about 20Mhz) */
223 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL, 0x01012fff); 219 sh_mmcif_writel(base, MMCIF_CE_CLK_CTRL,
220 CLK_ENABLE | CLKDIV_4 | SRSPTO_256 |
221 SRBSYTO_29 | SRWDTO_29 | SCCSTO_29);
224 222
225 /* CMD9 - Get CSD */ 223 /* CMD9 - Get CSD */
226 sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000); 224 sh_mmcif_boot_cmd(base, 0x09806000, 0x00010000);