diff options
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/board-rx51-peripherals.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/gpmc-onenand.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-omap2/id.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-omap2/mailbox.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/mcbsp.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/mmc-twl4030.c | 13 |
6 files changed, 57 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index da93b86234ed..9a0bf6744a05 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -362,6 +362,7 @@ static struct omap_onenand_platform_data board_onenand_data = { | |||
362 | .gpio_irq = 65, | 362 | .gpio_irq = 65, |
363 | .parts = onenand_partitions, | 363 | .parts = onenand_partitions, |
364 | .nr_parts = ARRAY_SIZE(onenand_partitions), | 364 | .nr_parts = ARRAY_SIZE(onenand_partitions), |
365 | .flags = ONENAND_SYNC_READWRITE, | ||
365 | }; | 366 | }; |
366 | 367 | ||
367 | static void __init board_onenand_init(void) | 368 | static void __init board_onenand_init(void) |
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c index 2fd22f9c5f0e..54fec53a48e7 100644 --- a/arch/arm/mach-omap2/gpmc-onenand.c +++ b/arch/arm/mach-omap2/gpmc-onenand.c | |||
@@ -31,6 +31,8 @@ static struct platform_device gpmc_onenand_device = { | |||
31 | static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) | 31 | static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) |
32 | { | 32 | { |
33 | struct gpmc_timings t; | 33 | struct gpmc_timings t; |
34 | u32 reg; | ||
35 | int err; | ||
34 | 36 | ||
35 | const int t_cer = 15; | 37 | const int t_cer = 15; |
36 | const int t_avdp = 12; | 38 | const int t_avdp = 12; |
@@ -43,6 +45,11 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) | |||
43 | const int t_wpl = 40; | 45 | const int t_wpl = 40; |
44 | const int t_wph = 30; | 46 | const int t_wph = 30; |
45 | 47 | ||
48 | /* Ensure sync read and sync write are disabled */ | ||
49 | reg = readw(onenand_base + ONENAND_REG_SYS_CFG1); | ||
50 | reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE; | ||
51 | writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); | ||
52 | |||
46 | memset(&t, 0, sizeof(t)); | 53 | memset(&t, 0, sizeof(t)); |
47 | t.sync_clk = 0; | 54 | t.sync_clk = 0; |
48 | t.cs_on = 0; | 55 | t.cs_on = 0; |
@@ -74,7 +81,16 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base) | |||
74 | GPMC_CONFIG1_DEVICESIZE_16 | | 81 | GPMC_CONFIG1_DEVICESIZE_16 | |
75 | GPMC_CONFIG1_MUXADDDATA); | 82 | GPMC_CONFIG1_MUXADDDATA); |
76 | 83 | ||
77 | return gpmc_cs_set_timings(cs, &t); | 84 | err = gpmc_cs_set_timings(cs, &t); |
85 | if (err) | ||
86 | return err; | ||
87 | |||
88 | /* Ensure sync read and sync write are disabled */ | ||
89 | reg = readw(onenand_base + ONENAND_REG_SYS_CFG1); | ||
90 | reg &= ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE; | ||
91 | writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); | ||
92 | |||
93 | return 0; | ||
78 | } | 94 | } |
79 | 95 | ||
80 | static void set_onenand_cfg(void __iomem *onenand_base, int latency, | 96 | static void set_onenand_cfg(void __iomem *onenand_base, int latency, |
@@ -124,7 +140,8 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, | |||
124 | } else if (cfg->flags & ONENAND_SYNC_READWRITE) { | 140 | } else if (cfg->flags & ONENAND_SYNC_READWRITE) { |
125 | sync_read = 1; | 141 | sync_read = 1; |
126 | sync_write = 1; | 142 | sync_write = 1; |
127 | } | 143 | } else |
144 | return omap2_onenand_set_async_mode(cs, onenand_base); | ||
128 | 145 | ||
129 | if (!freq) { | 146 | if (!freq) { |
130 | /* Very first call freq is not known */ | 147 | /* Very first call freq is not known */ |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 458990e20c60..a98201cc265c 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -48,6 +48,28 @@ int omap_chip_is(struct omap_chip_id oci) | |||
48 | } | 48 | } |
49 | EXPORT_SYMBOL(omap_chip_is); | 49 | EXPORT_SYMBOL(omap_chip_is); |
50 | 50 | ||
51 | int omap_type(void) | ||
52 | { | ||
53 | u32 val = 0; | ||
54 | |||
55 | if (cpu_is_omap24xx()) | ||
56 | val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); | ||
57 | else if (cpu_is_omap34xx()) | ||
58 | val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); | ||
59 | else { | ||
60 | pr_err("Cannot detect omap type!\n"); | ||
61 | goto out; | ||
62 | } | ||
63 | |||
64 | val &= OMAP2_DEVICETYPE_MASK; | ||
65 | val >>= 8; | ||
66 | |||
67 | out: | ||
68 | return val; | ||
69 | } | ||
70 | EXPORT_SYMBOL(omap_type); | ||
71 | |||
72 | |||
51 | /*----------------------------------------------------------------------------*/ | 73 | /*----------------------------------------------------------------------------*/ |
52 | 74 | ||
53 | #define OMAP_TAP_IDCODE 0x0204 | 75 | #define OMAP_TAP_IDCODE 0x0204 |
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index fd5b8a5925cc..6f71f3730c97 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c | |||
@@ -282,12 +282,12 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev) | |||
282 | return -ENOMEM; | 282 | return -ENOMEM; |
283 | 283 | ||
284 | /* DSP or IVA2 IRQ */ | 284 | /* DSP or IVA2 IRQ */ |
285 | mbox_dsp_info.irq = platform_get_irq(pdev, 0); | 285 | ret = platform_get_irq(pdev, 0); |
286 | if (mbox_dsp_info.irq < 0) { | 286 | if (ret < 0) { |
287 | dev_err(&pdev->dev, "invalid irq resource\n"); | 287 | dev_err(&pdev->dev, "invalid irq resource\n"); |
288 | ret = -ENODEV; | ||
289 | goto err_dsp; | 288 | goto err_dsp; |
290 | } | 289 | } |
290 | mbox_dsp_info.irq = ret; | ||
291 | 291 | ||
292 | ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); | 292 | ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); |
293 | if (ret) | 293 | if (ret) |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index a5c0f0435cd6..99b6e1546311 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -19,7 +19,6 @@ | |||
19 | 19 | ||
20 | #include <mach/irqs.h> | 20 | #include <mach/irqs.h> |
21 | #include <mach/dma.h> | 21 | #include <mach/dma.h> |
22 | #include <mach/irqs.h> | ||
23 | #include <mach/mux.h> | 22 | #include <mach/mux.h> |
24 | #include <mach/cpu.h> | 23 | #include <mach/cpu.h> |
25 | #include <mach/mcbsp.h> | 24 | #include <mach/mcbsp.h> |
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 9756a878fd90..1541fd4c8d0f 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c | |||
@@ -263,8 +263,19 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, | |||
263 | static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd) | 263 | static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd) |
264 | { | 264 | { |
265 | int ret = 0; | 265 | int ret = 0; |
266 | struct twl_mmc_controller *c = &hsmmc[1]; | 266 | struct twl_mmc_controller *c = NULL; |
267 | struct omap_mmc_platform_data *mmc = dev->platform_data; | 267 | struct omap_mmc_platform_data *mmc = dev->platform_data; |
268 | int i; | ||
269 | |||
270 | for (i = 1; i < ARRAY_SIZE(hsmmc); i++) { | ||
271 | if (mmc == hsmmc[i].mmc) { | ||
272 | c = &hsmmc[i]; | ||
273 | break; | ||
274 | } | ||
275 | } | ||
276 | |||
277 | if (c == NULL) | ||
278 | return -ENODEV; | ||
268 | 279 | ||
269 | /* If we don't see a Vcc regulator, assume it's a fixed | 280 | /* If we don't see a Vcc regulator, assume it's a fixed |
270 | * voltage always-on regulator. | 281 | * voltage always-on regulator. |