aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-igep0020.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 16:32:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 16:32:53 -0400
commitf6a26ae7699416d86bea8cb68ce413571e9cab3c (patch)
treee91b7a7c7513151fe583721f7435cc9f5cdc4f42 /arch/arm/mach-omap2/board-igep0020.c
parentcdd3a354a05b0c33fe33ab11a0fb0838396cad19 (diff)
parent48a5765e5104f1afd22c75c5030af3a6cf24b4c3 (diff)
Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull arm-soc board specific changes from Olof Johansson: "While we generally attempt to get rid of board specific files and replace them with device tree based descriptions, a lot of platforms have not come that far: In shmobile, we add two new board files because their recently started effort to add DT support has not proceeded enough to use it for all of the important hardware. In Kirkwood, we are adding support for new boards with a combination of DT and board file contents in multiple cases. pxa/mmp and imx are extending support for existing board files but not adding new ones." Fix up trivial conflicts in arch/arm/mach-{mmp/ttc_dkb.c,shmobile/{Kconfig,Makefile}} * tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (94 commits) ARM: shmobile: fix smp build ARM: kirkwood: Add support for RaidSonic IB-NAS6210/6220 using devicetree kirkwood: Add iconnect support orion/kirkwood: create a generic function for gpio led blinking kirkwood/orion: fix orion_gpio_set_blink ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt kirkwood: Allow nand to be configured via. devicetree mtd: Add orion_nand devicetree bindings ARM: kirkwood: Basic support for DNS-320 and DNS-325 ARM: mach-shmobile: Use DT_MACHINE for armadillo 800 eva ARM: mach-shmobile: Use DT_MACHINE for KZM9G ARM: pxa: hx4700: Add Synaptics NavPoint touchpad ARM: pxa: Use REGULATOR_SUPPLY macro ARM: mach-shmobile: kzm9g: enable SMP boot ARM: mach-shmobile: kzm9g: defconfig update ARM: mach-shmobile: kzm9g: add PCF8757 gpio-key ARM: mach-shmobile: kzm9g: add SDHI support ARM: mach-shmobile: kzm9g: add MMCIF support ARM: mach-shmobile: kzm9g: correct screen direction ARM: mach-shmobile: sh73a0.h: add GPIO_NR ...
Diffstat (limited to 'arch/arm/mach-omap2/board-igep0020.c')
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c74
1 files changed, 31 insertions, 43 deletions
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 4c1acecce93f..7a274098f67b 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -24,6 +24,8 @@
24#include <linux/i2c/twl.h> 24#include <linux/i2c/twl.h>
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26 26
27#include <linux/mtd/nand.h>
28
27#include <asm/mach-types.h> 29#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
29 31
@@ -39,6 +41,8 @@
39#include "hsmmc.h" 41#include "hsmmc.h"
40#include "sdram-numonyx-m65kxxxxam.h" 42#include "sdram-numonyx-m65kxxxxam.h"
41#include "common-board-devices.h" 43#include "common-board-devices.h"
44#include "board-flash.h"
45#include "control.h"
42 46
43#define IGEP2_SMSC911X_CS 5 47#define IGEP2_SMSC911X_CS 5
44#define IGEP2_SMSC911X_GPIO 176 48#define IGEP2_SMSC911X_GPIO 176
@@ -60,6 +64,10 @@
60#define IGEP3_GPIO_LED1_RED 16 64#define IGEP3_GPIO_LED1_RED 16
61#define IGEP3_GPIO_USBH_NRESET 183 65#define IGEP3_GPIO_USBH_NRESET 183
62 66
67#define IGEP_SYSBOOT_MASK 0x1f
68#define IGEP_SYSBOOT_NAND 0x0f
69#define IGEP_SYSBOOT_ONENAND 0x10
70
63/* 71/*
64 * IGEP2 Hardware Revision Table 72 * IGEP2 Hardware Revision Table
65 * 73 *
@@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)
110 gpio_free(IGEP2_GPIO_LED1_RED); 118 gpio_free(IGEP2_GPIO_LED1_RED);
111} 119}
112 120
113#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 121#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
114 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) 122 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || \
123 defined(CONFIG_MTD_NAND_OMAP2) || \
124 defined(CONFIG_MTD_NAND_OMAP2_MODULE)
115 125
116#define ONENAND_MAP 0x20000000 126#define ONENAND_MAP 0x20000000
117 127
@@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)
123 * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048) 133 * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
124 */ 134 */
125 135
126static struct mtd_partition igep_onenand_partitions[] = { 136static struct mtd_partition igep_flash_partitions[] = {
127 { 137 {
128 .name = "X-Loader", 138 .name = "X-Loader",
129 .offset = 0, 139 .offset = 0,
@@ -151,50 +161,28 @@ static struct mtd_partition igep_onenand_partitions[] = {
151 }, 161 },
152}; 162};
153 163
154static struct omap_onenand_platform_data igep_onenand_data = { 164static inline u32 igep_get_sysboot_value(void)
155 .parts = igep_onenand_partitions, 165{
156 .nr_parts = ARRAY_SIZE(igep_onenand_partitions), 166 return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
157 .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ 167}
158};
159
160static struct platform_device igep_onenand_device = {
161 .name = "omap2-onenand",
162 .id = -1,
163 .dev = {
164 .platform_data = &igep_onenand_data,
165 },
166};
167 168
168static void __init igep_flash_init(void) 169static void __init igep_flash_init(void)
169{ 170{
170 u8 cs = 0; 171 u32 mux;
171 u8 onenandcs = GPMC_CS_NUM + 1; 172 mux = igep_get_sysboot_value();
172 173
173 for (cs = 0; cs < GPMC_CS_NUM; cs++) { 174 if (mux == IGEP_SYSBOOT_NAND) {
174 u32 ret; 175 pr_info("IGEP: initializing NAND memory device\n");
175 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); 176 board_nand_init(igep_flash_partitions,
176 177 ARRAY_SIZE(igep_flash_partitions),
177 /* Check if NAND/oneNAND is configured */ 178 0, NAND_BUSWIDTH_16);
178 if ((ret & 0xC00) == 0x800) 179 } else if (mux == IGEP_SYSBOOT_ONENAND) {
179 /* NAND found */ 180 pr_info("IGEP: initializing OneNAND memory device\n");
180 pr_err("IGEP: Unsupported NAND found\n"); 181 board_onenand_init(igep_flash_partitions,
181 else { 182 ARRAY_SIZE(igep_flash_partitions), 0);
182 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); 183 } else {
183 if ((ret & 0x3F) == (ONENAND_MAP >> 24)) 184 pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
184 /* ONENAND found */
185 onenandcs = cs;
186 }
187 }
188
189 if (onenandcs > GPMC_CS_NUM) {
190 pr_err("IGEP: Unable to find configuration in GPMC\n");
191 return;
192 } 185 }
193
194 igep_onenand_data.cs = onenandcs;
195
196 if (platform_device_register(&igep_onenand_device) < 0)
197 pr_err("IGEP: Unable to register OneNAND device\n");
198} 186}
199 187
200#else 188#else