diff options
Diffstat (limited to 'arch/arm/mach-davinci/board-da850-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-da850-evm.c | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index eb998ce6d465..62d37cb6f29d 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -18,6 +18,10 @@ | |||
18 | #include <linux/i2c.h> | 18 | #include <linux/i2c.h> |
19 | #include <linux/i2c/at24.h> | 19 | #include <linux/i2c/at24.h> |
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/mtd/mtd.h> | ||
23 | #include <linux/mtd/nand.h> | ||
24 | #include <linux/mtd/partitions.h> | ||
21 | 25 | ||
22 | #include <asm/mach-types.h> | 26 | #include <asm/mach-types.h> |
23 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
@@ -26,6 +30,7 @@ | |||
26 | #include <mach/irqs.h> | 30 | #include <mach/irqs.h> |
27 | #include <mach/cp_intc.h> | 31 | #include <mach/cp_intc.h> |
28 | #include <mach/da8xx.h> | 32 | #include <mach/da8xx.h> |
33 | #include <mach/nand.h> | ||
29 | 34 | ||
30 | #define DA850_EVM_PHY_MASK 0x1 | 35 | #define DA850_EVM_PHY_MASK 0x1 |
31 | #define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ | 36 | #define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */ |
@@ -36,6 +41,74 @@ | |||
36 | #define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0) | 41 | #define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0) |
37 | #define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1) | 42 | #define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1) |
38 | 43 | ||
44 | /* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash | ||
45 | * (128K blocks). It may be used instead of the (default) SPI flash | ||
46 | * to boot, using TI's tools to install the secondary boot loader | ||
47 | * (UBL) and U-Boot. | ||
48 | */ | ||
49 | struct mtd_partition da850_evm_nandflash_partition[] = { | ||
50 | { | ||
51 | .name = "u-boot env", | ||
52 | .offset = 0, | ||
53 | .size = SZ_128K, | ||
54 | .mask_flags = MTD_WRITEABLE, | ||
55 | }, | ||
56 | { | ||
57 | .name = "UBL", | ||
58 | .offset = MTDPART_OFS_APPEND, | ||
59 | .size = SZ_128K, | ||
60 | .mask_flags = MTD_WRITEABLE, | ||
61 | }, | ||
62 | { | ||
63 | .name = "u-boot", | ||
64 | .offset = MTDPART_OFS_APPEND, | ||
65 | .size = 4 * SZ_128K, | ||
66 | .mask_flags = MTD_WRITEABLE, | ||
67 | }, | ||
68 | { | ||
69 | .name = "kernel", | ||
70 | .offset = 0x200000, | ||
71 | .size = SZ_2M, | ||
72 | .mask_flags = 0, | ||
73 | }, | ||
74 | { | ||
75 | .name = "filesystem", | ||
76 | .offset = MTDPART_OFS_APPEND, | ||
77 | .size = MTDPART_SIZ_FULL, | ||
78 | .mask_flags = 0, | ||
79 | }, | ||
80 | }; | ||
81 | |||
82 | static struct davinci_nand_pdata da850_evm_nandflash_data = { | ||
83 | .parts = da850_evm_nandflash_partition, | ||
84 | .nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition), | ||
85 | .ecc_mode = NAND_ECC_HW, | ||
86 | .options = NAND_USE_FLASH_BBT, | ||
87 | }; | ||
88 | |||
89 | static struct resource da850_evm_nandflash_resource[] = { | ||
90 | { | ||
91 | .start = DA8XX_AEMIF_CS3_BASE, | ||
92 | .end = DA8XX_AEMIF_CS3_BASE + SZ_512K + 2 * SZ_1K - 1, | ||
93 | .flags = IORESOURCE_MEM, | ||
94 | }, | ||
95 | { | ||
96 | .start = DA8XX_AEMIF_CTL_BASE, | ||
97 | .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1, | ||
98 | .flags = IORESOURCE_MEM, | ||
99 | }, | ||
100 | }; | ||
101 | |||
102 | static struct platform_device da850_evm_nandflash_device = { | ||
103 | .name = "davinci_nand", | ||
104 | .id = 1, | ||
105 | .dev = { | ||
106 | .platform_data = &da850_evm_nandflash_data, | ||
107 | }, | ||
108 | .num_resources = ARRAY_SIZE(da850_evm_nandflash_resource), | ||
109 | .resource = da850_evm_nandflash_resource, | ||
110 | }; | ||
111 | |||
39 | static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { | 112 | static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { |
40 | .bus_freq = 100, /* kHz */ | 113 | .bus_freq = 100, /* kHz */ |
41 | .bus_delay = 0, /* usec */ | 114 | .bus_delay = 0, /* usec */ |
@@ -45,6 +118,10 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = { | |||
45 | .enabled_uarts = 0x7, | 118 | .enabled_uarts = 0x7, |
46 | }; | 119 | }; |
47 | 120 | ||
121 | static struct platform_device *da850_evm_devices[] __initdata = { | ||
122 | &da850_evm_nandflash_device, | ||
123 | }; | ||
124 | |||
48 | /* davinci da850 evm audio machine driver */ | 125 | /* davinci da850 evm audio machine driver */ |
49 | static u8 da850_iis_serializer_direction[] = { | 126 | static u8 da850_iis_serializer_direction[] = { |
50 | INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, | 127 | INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, |
@@ -120,6 +197,14 @@ static __init void da850_evm_init(void) | |||
120 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 197 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
121 | int ret; | 198 | int ret; |
122 | 199 | ||
200 | ret = da8xx_pinmux_setup(da850_nand_pins); | ||
201 | if (ret) | ||
202 | pr_warning("da850_evm_init: nand mux setup failed: %d\n", | ||
203 | ret); | ||
204 | |||
205 | platform_add_devices(da850_evm_devices, | ||
206 | ARRAY_SIZE(da850_evm_devices)); | ||
207 | |||
123 | ret = da8xx_register_edma(); | 208 | ret = da8xx_register_edma(); |
124 | if (ret) | 209 | if (ret) |
125 | pr_warning("da850_evm_init: edma registration failed: %d\n", | 210 | pr_warning("da850_evm_init: edma registration failed: %d\n", |