Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
platform-mxc_nand.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2010 Pengutronix
3  * Uwe Kleine-Koenig <[email protected]>
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 2 as published by the
7  * Free Software Foundation.
8  */
9 #include <asm/sizes.h>
10 #include <mach/hardware.h>
11 #include <mach/devices-common.h>
12 
13 #define imx_mxc_nand_data_entry_single(soc, _size) \
14  { \
15  .iobase = soc ## _NFC_BASE_ADDR, \
16  .iosize = _size, \
17  .irq = soc ## _INT_NFC \
18  }
19 
20 #define imx_mxc_nandv3_data_entry_single(soc, _size) \
21  { \
22  .id = -1, \
23  .iobase = soc ## _NFC_BASE_ADDR, \
24  .iosize = _size, \
25  .axibase = soc ## _NFC_AXI_BASE_ADDR, \
26  .irq = soc ## _INT_NFC \
27  }
28 
29 #ifdef CONFIG_SOC_IMX21
32 #endif /* ifdef CONFIG_SOC_IMX21 */
33 
34 #ifdef CONFIG_SOC_IMX25
35 const struct imx_mxc_nand_data imx25_mxc_nand_data __initconst =
37 #endif /* ifdef CONFIG_SOC_IMX25 */
38 
39 #ifdef CONFIG_SOC_IMX27
40 const struct imx_mxc_nand_data imx27_mxc_nand_data __initconst =
42 #endif /* ifdef CONFIG_SOC_IMX27 */
43 
44 #ifdef CONFIG_SOC_IMX31
45 const struct imx_mxc_nand_data imx31_mxc_nand_data __initconst =
47 #endif
48 
49 #ifdef CONFIG_SOC_IMX35
50 const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst =
52 #endif
53 
54 #ifdef CONFIG_SOC_IMX51
55 const struct imx_mxc_nand_data imx51_mxc_nand_data __initconst =
57 #endif
58 
60  const struct imx_mxc_nand_data *data,
61  const struct mxc_nand_platform_data *pdata)
62 {
63  /* AXI has to come first, that's how the mxc_nand driver expect it */
64  struct resource res[] = {
65  {
66  .start = data->iobase,
67  .end = data->iobase + data->iosize - 1,
68  .flags = IORESOURCE_MEM,
69  }, {
70  .start = data->irq,
71  .end = data->irq,
72  .flags = IORESOURCE_IRQ,
73  }, {
74  .start = data->axibase,
75  .end = data->axibase + SZ_16K - 1,
76  .flags = IORESOURCE_MEM,
77  },
78  };
79  return imx_add_platform_device("mxc_nand", data->id,
80  res, ARRAY_SIZE(res) - !data->axibase,
81  pdata, sizeof(*pdata));
82 }