aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-pxa
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-pxa')
-rw-r--r--arch/arm/plat-pxa/dma.c3
-rw-r--r--arch/arm/plat-pxa/include/plat/pxa3xx_nand.h63
-rw-r--r--arch/arm/plat-pxa/pwm.c9
3 files changed, 70 insertions, 5 deletions
diff --git a/arch/arm/plat-pxa/dma.c b/arch/arm/plat-pxa/dma.c
index 2975798d411f..2d3c19d7c7b1 100644
--- a/arch/arm/plat-pxa/dma.c
+++ b/arch/arm/plat-pxa/dma.c
@@ -14,6 +14,7 @@
14 14
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/slab.h>
17#include <linux/kernel.h> 18#include <linux/kernel.h>
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19#include <linux/errno.h> 20#include <linux/errno.h>
@@ -244,7 +245,7 @@ static void pxa_dma_init_debugfs(void)
244 245
245 dbgfs_chan = kmalloc(sizeof(*dbgfs_state) * num_dma_channels, 246 dbgfs_chan = kmalloc(sizeof(*dbgfs_state) * num_dma_channels,
246 GFP_KERNEL); 247 GFP_KERNEL);
247 if (!dbgfs_state) 248 if (!dbgfs_chan)
248 goto err_alloc; 249 goto err_alloc;
249 250
250 chandir = debugfs_create_dir("channels", dbgfs_root); 251 chandir = debugfs_create_dir("channels", dbgfs_root);
diff --git a/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h b/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
new file mode 100644
index 000000000000..3478eae32d8a
--- /dev/null
+++ b/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
@@ -0,0 +1,63 @@
1#ifndef __ASM_ARCH_PXA3XX_NAND_H
2#define __ASM_ARCH_PXA3XX_NAND_H
3
4#include <linux/mtd/mtd.h>
5#include <linux/mtd/partitions.h>
6
7struct pxa3xx_nand_timing {
8 unsigned int tCH; /* Enable signal hold time */
9 unsigned int tCS; /* Enable signal setup time */
10 unsigned int tWH; /* ND_nWE high duration */
11 unsigned int tWP; /* ND_nWE pulse time */
12 unsigned int tRH; /* ND_nRE high duration */
13 unsigned int tRP; /* ND_nRE pulse width */
14 unsigned int tR; /* ND_nWE high to ND_nRE low for read */
15 unsigned int tWHR; /* ND_nWE high to ND_nRE low for status read */
16 unsigned int tAR; /* ND_ALE low to ND_nRE low delay */
17};
18
19struct pxa3xx_nand_cmdset {
20 uint16_t read1;
21 uint16_t read2;
22 uint16_t program;
23 uint16_t read_status;
24 uint16_t read_id;
25 uint16_t erase;
26 uint16_t reset;
27 uint16_t lock;
28 uint16_t unlock;
29 uint16_t lock_status;
30};
31
32struct pxa3xx_nand_flash {
33 const struct pxa3xx_nand_timing *timing; /* NAND Flash timing */
34 const struct pxa3xx_nand_cmdset *cmdset;
35
36 uint32_t page_per_block;/* Pages per block (PG_PER_BLK) */
37 uint32_t page_size; /* Page size in bytes (PAGE_SZ) */
38 uint32_t flash_width; /* Width of Flash memory (DWIDTH_M) */
39 uint32_t dfc_width; /* Width of flash controller(DWIDTH_C) */
40 uint32_t num_blocks; /* Number of physical blocks in Flash */
41 uint32_t chip_id;
42};
43
44struct pxa3xx_nand_platform_data {
45
46 /* the data flash bus is shared between the Static Memory
47 * Controller and the Data Flash Controller, the arbiter
48 * controls the ownership of the bus
49 */
50 int enable_arbiter;
51
52 /* allow platform code to keep OBM/bootloader defined NFC config */
53 int keep_config;
54
55 const struct mtd_partition *parts;
56 unsigned int nr_parts;
57
58 const struct pxa3xx_nand_flash * flash;
59 size_t num_flash;
60};
61
62extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info);
63#endif /* __ASM_ARCH_PXA3XX_NAND_H */
diff --git a/arch/arm/plat-pxa/pwm.c b/arch/arm/plat-pxa/pwm.c
index a9eabdcfa163..0732c6c8d511 100644
--- a/arch/arm/plat-pxa/pwm.c
+++ b/arch/arm/plat-pxa/pwm.c
@@ -14,6 +14,7 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/slab.h>
17#include <linux/err.h> 18#include <linux/err.h>
18#include <linux/clk.h> 19#include <linux/clk.h>
19#include <linux/io.h> 20#include <linux/io.h>
@@ -204,14 +205,14 @@ static int __devinit pwm_probe(struct platform_device *pdev)
204 goto err_free_clk; 205 goto err_free_clk;
205 } 206 }
206 207
207 r = request_mem_region(r->start, r->end - r->start + 1, pdev->name); 208 r = request_mem_region(r->start, resource_size(r), pdev->name);
208 if (r == NULL) { 209 if (r == NULL) {
209 dev_err(&pdev->dev, "failed to request memory resource\n"); 210 dev_err(&pdev->dev, "failed to request memory resource\n");
210 ret = -EBUSY; 211 ret = -EBUSY;
211 goto err_free_clk; 212 goto err_free_clk;
212 } 213 }
213 214
214 pwm->mmio_base = ioremap(r->start, r->end - r->start + 1); 215 pwm->mmio_base = ioremap(r->start, resource_size(r));
215 if (pwm->mmio_base == NULL) { 216 if (pwm->mmio_base == NULL) {
216 dev_err(&pdev->dev, "failed to ioremap() registers\n"); 217 dev_err(&pdev->dev, "failed to ioremap() registers\n");
217 ret = -ENODEV; 218 ret = -ENODEV;
@@ -241,7 +242,7 @@ static int __devinit pwm_probe(struct platform_device *pdev)
241 return 0; 242 return 0;
242 243
243err_free_mem: 244err_free_mem:
244 release_mem_region(r->start, r->end - r->start + 1); 245 release_mem_region(r->start, resource_size(r));
245err_free_clk: 246err_free_clk:
246 clk_put(pwm->clk); 247 clk_put(pwm->clk);
247err_free: 248err_free:
@@ -271,7 +272,7 @@ static int __devexit pwm_remove(struct platform_device *pdev)
271 iounmap(pwm->mmio_base); 272 iounmap(pwm->mmio_base);
272 273
273 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 274 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
274 release_mem_region(r->start, r->end - r->start + 1); 275 release_mem_region(r->start, resource_size(r));
275 276
276 clk_put(pwm->clk); 277 clk_put(pwm->clk);
277 kfree(pwm); 278 kfree(pwm);