ARM: OMAP2+: craneboard: support NAND device
[deliverable/linux.git] / arch / arm / mach-omap2 / board-am3517crane.c
CommitLineData
1cb125ca
S
1/*
2 * Support for AM3517/05 Craneboard
3 * http://www.mistralsolutions.com/products/craneboard.php
4 *
5 * Copyright (C) 2010 Mistral Solutions Pvt Ltd. <www.mistralsolutions.com>
6 * Author: R.Srinath <srinath@mistralsolutions.com>
7 *
8 * Based on mach-omap2/board-am3517evm.c
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation version 2.
13 *
14 * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
15 * whether express or implied; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
840b9296 22#include <linux/gpio.h>
d58eb6b5
KM
23#include <linux/mtd/mtd.h>
24#include <linux/mtd/nand.h>
25#include <linux/mtd/partitions.h>
1cb125ca 26
1cb125ca
S
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/map.h>
30
4e65331c 31#include "common.h"
d58eb6b5
KM
32#include "common-board-devices.h"
33#include "board-flash.h"
1cb125ca 34
a0fcda3e 35#include "am35xx-emac.h"
1cb125ca 36#include "mux.h"
840b9296
S
37#include "control.h"
38
39#define GPIO_USB_POWER 35
40#define GPIO_USB_NRESET 38
41
1cb125ca
S
42#ifdef CONFIG_OMAP_MUX
43static struct omap_board_mux board_mux[] __initdata = {
44 { .reg_offset = OMAP_MUX_TERMINATOR },
45};
1cb125ca
S
46#endif
47
181b250c
KM
48static struct usbhs_omap_board_data usbhs_bdata __initdata = {
49 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
50 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
51 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
840b9296
S
52
53 .phy_reset = true,
54 .reset_gpio_port[0] = GPIO_USB_NRESET,
55 .reset_gpio_port[1] = -EINVAL,
56 .reset_gpio_port[2] = -EINVAL
57};
58
d58eb6b5
KM
59static struct mtd_partition crane_nand_partitions[] = {
60 {
61 .name = "X-Loader",
62 .offset = 0,
63 .size = 4 * NAND_BLOCK_SIZE,
64 .mask_flags = MTD_WRITEABLE,
65 },
66 {
67 .name = "U-Boot",
68 .offset = MTDPART_OFS_APPEND,
69 .size = 14 * NAND_BLOCK_SIZE,
70 .mask_flags = MTD_WRITEABLE,
71 },
72 {
73 .name = "U-Boot Env",
74 .offset = MTDPART_OFS_APPEND,
75 .size = 2 * NAND_BLOCK_SIZE,
76 },
77 {
78 .name = "Kernel",
79 .offset = MTDPART_OFS_APPEND,
80 .size = 40 * NAND_BLOCK_SIZE,
81 },
82 {
83 .name = "File System",
84 .offset = MTDPART_OFS_APPEND,
85 .size = MTDPART_SIZ_FULL,
86 },
87};
88
1cb125ca
S
89static void __init am3517_crane_init(void)
90{
840b9296
S
91 int ret;
92
1cb125ca
S
93 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
94 omap_serial_init();
a4ca9dbe 95 omap_sdrc_init(NULL, NULL);
d58eb6b5
KM
96 board_nand_init(crane_nand_partitions,
97 ARRAY_SIZE(crane_nand_partitions), 0,
98 NAND_BUSWIDTH_16, NULL);
840b9296
S
99
100 /* Configure GPIO for EHCI port */
101 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) {
102 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n",
103 GPIO_USB_NRESET);
104 return;
105 }
106
107 if (omap_mux_init_gpio(GPIO_USB_POWER, OMAP_PIN_OUTPUT)) {
108 pr_err("Can not configure mux for GPIO_USB_POWER %d\n",
109 GPIO_USB_POWER);
110 return;
111 }
112
bc593f5d
IG
113 ret = gpio_request_one(GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH,
114 "usb_ehci_enable");
840b9296
S
115 if (ret < 0) {
116 pr_err("Can not request GPIO %d\n", GPIO_USB_POWER);
117 return;
118 }
119
9e64bb1e 120 usbhs_init(&usbhs_bdata);
a0fcda3e 121 am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1);
1cb125ca
S
122}
123
124MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
5e52b435 125 .atag_offset = 0x100,
1cb125ca 126 .reserve = omap_reserve,
3dc3bad6 127 .map_io = omap3_map_io,
8f5b5a41 128 .init_early = am35xx_init_early,
741e3a89 129 .init_irq = omap3_init_irq,
6b2f55d7 130 .handle_irq = omap3_intc_handle_irq,
1cb125ca 131 .init_machine = am3517_crane_init,
bbd707ac 132 .init_late = am35xx_init_late,
e74984e4 133 .timer = &omap3_timer,
187e3e06 134 .restart = omap3xxx_restart,
1cb125ca 135MACHINE_END
This page took 0.127426 seconds and 5 git commands to generate.