arm:omap:am33xx: Register HSMMC Platform on AM335x EVM
[sitara-epos/sitara-epos-kernel.git] / arch / arm / mach-omap2 / board-am335xevm.c
1 /*
2  * Code for AM335X EVM.
3  *
4  * Copyright (C) 2011 Texas Instruments, Inc. - http://www.ti.com/
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation version 2.
9  *
10  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11  * kind, whether express or implied; without even the implied warranty
12  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  */
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/i2c.h>
18 #include <linux/module.h>
19 #include <linux/i2c/at24.h>
20 #include <linux/gpio.h>
21 #include <linux/mtd/mtd.h>
22 #include <linux/mtd/nand.h>
23 #include <linux/mtd/partitions.h>
24 #include <linux/platform_device.h>
25 #include <linux/clk.h>
26 #include <linux/err.h>
28 /* LCD controller is similar to DA850 */
29 #include <video/da8xx-fb.h>
31 #include <mach/hardware.h>
32 #include <mach/board-am335xevm.h>
34 #include <asm/mach-types.h>
35 #include <asm/mach/arch.h>
36 #include <asm/mach/map.h>
37 #include <asm/hardware/asp.h>
39 #include <plat/irqs.h>
40 #include <plat/board.h>
41 #include <plat/common.h>
42 #include <plat/lcdc.h>
43 #include <plat/usb.h>
44 #include <plat/mmc.h>
46 #include "board-flash.h"
47 #include "mux.h"
48 #include "devices.h"
49 #include "hsmmc.h"
51 /* Convert GPIO signal to GPIO pin number */
52 #define GPIO_TO_PIN(bank, gpio) (32 * (bank) + (gpio))
54 static const struct display_panel disp_panel = {
55         WVGA,
56         32,
57         32,
58         COLOR_ACTIVE,
59 };
61 static struct lcd_ctrl_config lcd_cfg = {
62         &disp_panel,
63         .ac_bias                = 255,
64         .ac_bias_intrpt         = 0,
65         .dma_burst_sz           = 16,
66         .bpp                    = 32,
67         .fdd                    = 0x80,
68         .tft_alt_mode           = 0,
69         .stn_565_mode           = 0,
70         .mono_8bit_mode         = 0,
71         .invert_line_clock      = 1,
72         .invert_frm_clock       = 1,
73         .sync_edge              = 0,
74         .sync_ctrl              = 1,
75         .raster_order           = 0,
76 };
78 struct da8xx_lcdc_platform_data TFC_S9700RTWV35TR_01B_pdata = {
79         .manu_name              = "ThreeFive",
80         .controller_data        = &lcd_cfg,
81         .type                   = "TFC_S9700RTWV35TR_01B",
82 };
84 #include "common.h"
86 /* TSc controller */
87 #include <linux/input/ti_tscadc.h>
89 static struct resource tsc_resources[]  = {
90         [0] = {
91                 .start  = AM33XX_TSC_BASE,
92                 .end    = AM33XX_TSC_BASE + SZ_8K - 1,
93                 .flags  = IORESOURCE_MEM,
94         },
95         [1] = {
96                 .start  = AM33XX_IRQ_ADC_GEN,
97                 .end    = AM33XX_IRQ_ADC_GEN,
98                 .flags  = IORESOURCE_IRQ,
99         },
100 };
102 static struct tsc_data am335x_touchscreen_data  = {
103         .wires  = 4,
104         .x_plate_resistance = 200,
105 };
107 static struct platform_device tsc_device = {
108         .name   = "tsc",
109         .id     = -1,
110         .dev    = {
111                         .platform_data  = &am335x_touchscreen_data,
112         },
113         .num_resources  = ARRAY_SIZE(tsc_resources),
114         .resource       = tsc_resources,
115 };
117 static u8 am335x_iis_serializer_direction1[] = {
118         INACTIVE_MODE,  INACTIVE_MODE,  TX_MODE,        RX_MODE,
119         INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
120         INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
121         INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
122 };
124 static struct snd_platform_data am335x_evm_snd_data1 = {
125         .tx_dma_offset  = 0x46400000,   /* McASP1 */
126         .rx_dma_offset  = 0x46400000,
127         .op_mode        = DAVINCI_MCASP_IIS_MODE,
128         .num_serializer = ARRAY_SIZE(am335x_iis_serializer_direction1),
129         .tdm_slots      = 2,
130         .serial_dir     = am335x_iis_serializer_direction1,
131         .asp_chan_q     = EVENTQ_2,
132         .version        = MCASP_VERSION_3,
133         .txnumevt       = 1,
134         .rxnumevt       = 1,
135 };
137 static struct omap2_hsmmc_info am335x_mmc[] __initdata = {
138         {
139                 .mmc            = 1,
140                 .caps           = MMC_CAP_4_BIT_DATA,
141                 .gpio_cd        = GPIO_TO_PIN(0, 6),
142                 .gpio_wp        = GPIO_TO_PIN(3, 18),
143                 .ocr_mask       = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3V3 */
144         },
145         {
146                 .mmc            = 0,    /* will be set at runtime */
147         },
148         {
149                 .mmc            = 0,    /* will be set at runtime */
150         },
151         {}      /* Terminator */
152 };
155 #ifdef CONFIG_OMAP_MUX
156 static struct omap_board_mux board_mux[] __initdata = {
157         AM33XX_MUX(I2C0_SDA, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |
158                         AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),
159         AM33XX_MUX(I2C0_SCL, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |
160                         AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),
161         { .reg_offset = OMAP_MUX_TERMINATOR },
162 };
163 #else
164 #define board_mux       NULL
165 #endif
167 /* module pin mux structure */
168 struct pinmux_config {
169         const char *string_name; /* signal name format */
170         int val; /* Options for the mux register value */
171 };
173 struct evm_dev_cfg {
174         void (*device_init)(int evm_id, int profile);
176 /*
177 * If the device is required on both baseboard & daughter board (ex i2c),
178 * specify DEV_ON_BASEBOARD
179 */
180 #define DEV_ON_BASEBOARD        0
181 #define DEV_ON_DGHTR_BRD        1
182         u32 device_on;
184         u32 profile;    /* Profiles (0-7) in which the module is present */
185 };
187 /* AM335X - CPLD Register Offsets */
188 #define CPLD_DEVICE_HDR 0x00 /* CPLD Header */
189 #define CPLD_DEVICE_ID  0x04 /* CPLD identification */
190 #define CPLD_DEVICE_REV 0x0C /* Revision of the CPLD code */
191 #define CPLD_CFG_REG    0x10 /* Configuration Register */
193 static struct i2c_client *cpld_client;
194 static u32 am335x_evm_id;
195 static struct omap_board_config_kernel am335x_evm_config[] __initdata = {
196 };
198 /*
199 * EVM Config held in On-Board eeprom device.
201 * Header Format
203 *  Name                 Size    Contents
204 *                       (Bytes)
205 *-------------------------------------------------------------
206 *  Header               4       0xAA, 0x55, 0x33, 0xEE
208 *  Board Name           8       Name for board in ASCII.
209 *                               example "A33515BB" = "AM335X
210                                 Low Cost EVM board"
212 *  Version              4       Hardware version code for board in
213 *                               in ASCII. "1.0A" = rev.01.0A
215 *  Serial Number        12      Serial number of the board. This is a 12
216 *                               character string which is WWYY4P16nnnn, where
217 *                               WW = 2 digit week of the year of production
218 *                               YY = 2 digit year of production
219 *                               nnnn = incrementing board number
221 *  Configuration option 32      Codes(TBD) to show the configuration
222 *                               setup on this board.
224 *  Available            32720   Available space for other non-volatile
225 *                               data.
226 */
227 struct am335x_evm_eeprom_config {
228         u32     header;
229         u8      name[8];
230         u32     version;
231         u8      serial[12];
232         u8      opt[32];
233 };
235 static struct am335x_evm_eeprom_config config;
236 static bool daughter_brd_detected;
238 #define GP_EVM_REV_IS_1_0               0x1
239 #define GP_EVM_REV_IS_1_1A              0x2
240 #define GP_EVM_REV_IS_UNKNOWN           0xFF
241 static unsigned int gp_evm_revision = GP_EVM_REV_IS_UNKNOWN;
243 #define AM335X_EEPROM_HEADER            0xEE3355AA
245 /* current profile if exists else PROFILE_0 on error */
246 static u32 am335x_get_profile_selection(void)
248         int val = 0;
250         if (!cpld_client)
251                 /* error checking is not done in func's calling this routine.
252                 so return profile 0 on error */
253                 return 0;
255         val = i2c_smbus_read_word_data(cpld_client, CPLD_CFG_REG);
256         if (val < 0)
257                 return 0;       /* default to Profile 0 on Error */
258         else
259                 return val & 0x7;
262 /* Module pin mux for LCDC */
263 static struct pinmux_config lcdc_pin_mux[] = {
264         {"lcd_data0.lcd_data0",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
265                                                        | AM33XX_PULL_DISA},
266         {"lcd_data1.lcd_data1",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
267                                                        | AM33XX_PULL_DISA},
268         {"lcd_data2.lcd_data2",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
269                                                        | AM33XX_PULL_DISA},
270         {"lcd_data3.lcd_data3",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
271                                                        | AM33XX_PULL_DISA},
272         {"lcd_data4.lcd_data4",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
273                                                        | AM33XX_PULL_DISA},
274         {"lcd_data5.lcd_data5",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
275                                                        | AM33XX_PULL_DISA},
276         {"lcd_data6.lcd_data6",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
277                                                        | AM33XX_PULL_DISA},
278         {"lcd_data7.lcd_data7",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
279                                                        | AM33XX_PULL_DISA},
280         {"lcd_data8.lcd_data8",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
281                                                        | AM33XX_PULL_DISA},
282         {"lcd_data9.lcd_data9",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
283                                                        | AM33XX_PULL_DISA},
284         {"lcd_data10.lcd_data10",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
285                                                        | AM33XX_PULL_DISA},
286         {"lcd_data11.lcd_data11",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
287                                                        | AM33XX_PULL_DISA},
288         {"lcd_data12.lcd_data12",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
289                                                        | AM33XX_PULL_DISA},
290         {"lcd_data13.lcd_data13",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
291                                                        | AM33XX_PULL_DISA},
292         {"lcd_data14.lcd_data14",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
293                                                        | AM33XX_PULL_DISA},
294         {"lcd_data15.lcd_data15",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
295                                                        | AM33XX_PULL_DISA},
296         {"gpmc_ad8.lcd_data16",         OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
297         {"gpmc_ad9.lcd_data17",         OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
298         {"gpmc_ad10.lcd_data18",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
299         {"gpmc_ad11.lcd_data19",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
300         {"gpmc_ad12.lcd_data20",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
301         {"gpmc_ad13.lcd_data21",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
302         {"gpmc_ad14.lcd_data22",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
303         {"gpmc_ad15.lcd_data23",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
304         {"lcd_vsync.lcd_vsync",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
305         {"lcd_hsync.lcd_hsync",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
306         {"lcd_pclk.lcd_pclk",           OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
307         {"lcd_ac_bias_en.lcd_ac_bias_en", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
308         {NULL, 0},
309 };
311 static struct pinmux_config tsc_pin_mux[] = {
312         {"ain0.ain0",           OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
313         {"ain1.ain1",           OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
314         {"ain2.ain2",           OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
315         {"ain3.ain3",           OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
316         {"vrefp.vrefp",         OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
317         {"vrefn.vrefn",         OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
318         {NULL, 0},
319 };
321 /* Pin mux for nand flash module */
322 static struct pinmux_config nand_pin_mux[] = {
323         {"gpmc_ad0.gpmc_ad0",     OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
324         {"gpmc_ad1.gpmc_ad1",     OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
325         {"gpmc_ad2.gpmc_ad2",     OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
326         {"gpmc_ad3.gpmc_ad3",     OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
327         {"gpmc_ad4.gpmc_ad4",     OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
328         {"gpmc_ad5.gpmc_ad5",     OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
329         {"gpmc_ad6.gpmc_ad6",     OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
330         {"gpmc_ad7.gpmc_ad7",     OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
331         {"gpmc_wait0.gpmc_wait0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
332         {"gpmc_wpn.gpmc_wpn",     OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
333         {"gpmc_csn0.gpmc_csn0",   OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
334         {"gpmc_advn_ale.gpmc_advn_ale",  OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
335         {"gpmc_oen_ren.gpmc_oen_ren",    OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
336         {"gpmc_wen.gpmc_wen",     OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
337         {"gpmc_ben0_cle.gpmc_ben0_cle",  OMAP_MUX_MODE0 | AM33XX_PULL_DISA},
338         {NULL, 0},
339 };
342 /* Module pin mux for rgmii1 */
343 static struct pinmux_config rgmii1_pin_mux[] = {
344         {"mii1_txen.rgmii1_tctl", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
345         {"mii1_rxdv.rgmii1_rctl", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
346         {"mii1_txd3.rgmii1_td3", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
347         {"mii1_txd2.rgmii1_td2", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
348         {"mii1_txd1.rgmii1_td1", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
349         {"mii1_txd0.rgmii1_td0", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
350         {"mii1_txclk.rgmii1_tclk", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
351         {"mii1_rxclk.rgmii1_rclk", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
352         {"mii1_rxd3.rgmii1_rd3", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
353         {"mii1_rxd2.rgmii1_rd2", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
354         {"mii1_rxd1.rgmii1_rd1", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
355         {"mii1_rxd0.rgmii1_rd0", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
356         {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
357         {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP},
358         {NULL, 0},
359 };
361 /* Module pin mux for rgmii2 */
362 static struct pinmux_config rgmii2_pin_mux[] = {
363         {"gpmc_a0.rgmii2_tctl", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
364         {"gpmc_a1.rgmii2_rctl", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
365         {"gpmc_a2.rgmii2_td3", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
366         {"gpmc_a3.rgmii2_td2", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
367         {"gpmc_a4.rgmii2_td1", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
368         {"gpmc_a5.rgmii2_td0", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
369         {"gpmc_a6.rgmii2_tclk", OMAP_MUX_MODE2 | AM33XX_PIN_OUTPUT},
370         {"gpmc_a7.rgmii2_rclk", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
371         {"gpmc_a8.rgmii2_rd3", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
372         {"gpmc_a9.rgmii2_rd2", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
373         {"gpmc_a10.rgmii2_rd1", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
374         {"gpmc_a11.rgmii2_rd0", OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLDOWN},
375         {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
376         {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP},
377         {NULL, 0},
378 };
380 /* Module pin mux for mii1 */
381 static struct pinmux_config mii1_pin_mux[] = {
382         {"mii1_rxerr.mii1_rxerr", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
383         {"mii1_txen.mii1_txen", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
384         {"mii1_rxdv.mii1_rxdv", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
385         {"mii1_txd3.mii1_txd3", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
386         {"mii1_txd2.mii1_txd2", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
387         {"mii1_txd1.mii1_txd1", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
388         {"mii1_txd0.mii1_txd0", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
389         {"mii1_txclk.mii1_txclk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
390         {"mii1_rxclk.mii1_rxclk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
391         {"mii1_rxd3.mii1_rxd3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
392         {"mii1_rxd2.mii1_rxd2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
393         {"mii1_rxd1.mii1_rxd1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
394         {"mii1_rxd0.mii1_rxd0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
395         {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
396         {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP},
397         {NULL, 0},
398 };
400 static struct pinmux_config i2c1_pin_mux[] = {
401         {"spi0_d1.i2c1_sda",    OMAP_MUX_MODE2 | AM33XX_SLEWCTRL_SLOW |
402                                         AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
403         {"spi0_cs0.i2c1_scl",   OMAP_MUX_MODE2 | AM33XX_SLEWCTRL_SLOW |
404                                         AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
405         {NULL, 0},
406 };
408 /* Module pin mux for mcasp1 */
409 static struct pinmux_config mcasp1_pin_mux[] = {
410         {"mii1_crs.mcasp1_aclkx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
411         {"mii1_rxerr.mcasp1_fsx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
412         {"mii1_col.mcasp1_axr2", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
413         {"rmii1_refclk.mcasp1_axr3", OMAP_MUX_MODE4 |
414                                                 AM33XX_PIN_INPUT_PULLDOWN},
415         {NULL, 0},
416 };
419 /* Module pin mux for mmc0 */
420 static struct pinmux_config mmc0_pin_mux[] = {
421         {"mmc0_dat3.mmc0_dat3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
422         {"mmc0_dat2.mmc0_dat2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
423         {"mmc0_dat1.mmc0_dat1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
424         {"mmc0_dat0.mmc0_dat0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
425         {"mmc0_clk.mmc0_clk",   OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
426         {"mmc0_cmd.mmc0_cmd",   OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
427         {"mcasp0_aclkr.mmc0_sdwp", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
428         {"spi0_cs1.mmc0_sdcd",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
429         {NULL, 0},
430 };
432 static struct pinmux_config mmc0_no_cd_pin_mux[] = {
433         {"mmc0_dat3.mmc0_dat3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
434         {"mmc0_dat2.mmc0_dat2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
435         {"mmc0_dat1.mmc0_dat1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
436         {"mmc0_dat0.mmc0_dat0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
437         {"mmc0_clk.mmc0_clk",   OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
438         {"mmc0_cmd.mmc0_cmd",   OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
439         {"mcasp0_aclkr.mmc0_sdwp", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
440         {NULL, 0},
441 };
443 /* Module pin mux for mmc1 */
444 static struct pinmux_config mmc1_pin_mux[] = {
445         {"gpmc_ad7.mmc1_dat7",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
446         {"gpmc_ad6.mmc1_dat6",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
447         {"gpmc_ad5.mmc1_dat5",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
448         {"gpmc_ad4.mmc1_dat4",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
449         {"gpmc_ad3.mmc1_dat3",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
450         {"gpmc_ad2.mmc1_dat2",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
451         {"gpmc_ad1.mmc1_dat1",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
452         {"gpmc_ad0.mmc1_dat0",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
453         {"gpmc_csn1.mmc1_clk",  OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
454         {"gpmc_csn2.mmc1_cmd",  OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
455         {"gpmc_csn0.mmc1_sdwp", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
456         {"gpmc_advn_ale.mmc1_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
457         {NULL, 0},
458 };
460 /*
461 * @pin_mux - single module pin-mux structure which defines pin-mux
462 *                       details for all its pins.
463 */
464 static void setup_pin_mux(struct pinmux_config *pin_mux)
466         int i;
468         for (i = 0; pin_mux->string_name != NULL; pin_mux++)
469                 omap_mux_init_signal(pin_mux->string_name, pin_mux->val);
473 /*
474 * @evm_id - evm id which needs to be configured
475 * @dev_cfg - single evm structure which includes
476 *                               all module inits, pin-mux defines
477 * @profile - if present, else PROFILE_NONE
478 * @dghtr_brd_flg - Whether Daughter board is present or not
479 */
480 static void _configure_device(int evm_id, struct evm_dev_cfg *dev_cfg,
481         int profile)
483         int i;
485         /*
486         * Only General Purpose & Industrial Auto Motro Control
487         * EVM has profiles. So check if this evm has profile.
488         * If not, ignore the profile comparison
489         */
491         /*
492         * If the device is on baseboard, directly configure it. Else (device on
493         * Daughter board), check if the daughter card is detected.
494         */
495         if (profile == PROFILE_NONE) {
496                 for (i = 0; dev_cfg->device_init != NULL; dev_cfg++) {
497                         if (dev_cfg->device_on == DEV_ON_BASEBOARD)
498                                 dev_cfg->device_init(evm_id, profile);
499                         else if (daughter_brd_detected == true)
500                                 dev_cfg->device_init(evm_id, profile);
501                 }
502         } else {
503                 for (i = 0; dev_cfg->device_init != NULL; dev_cfg++) {
504                         if (dev_cfg->profile & profile) {
505                                 if (dev_cfg->device_on == DEV_ON_BASEBOARD)
506                                         dev_cfg->device_init(evm_id, profile);
507                                 else if (daughter_brd_detected == true)
508                                         dev_cfg->device_init(evm_id, profile);
509                         }
510                 }
511         }
514 #define AM335X_LCD_BL_PIN       GPIO_TO_PIN(0, 7)
516 /* pinmux for usb0 drvvbus */
517 static struct pinmux_config usb0_pin_mux[] = {
518         {"usb0_drvvbus.usb0_drvvbus",    OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
519         {NULL, 0},
520 };
522 /* pinmux for usb1 drvvbus */
523 static struct pinmux_config usb1_pin_mux[] = {
524         {"usb1_drvvbus.usb1_drvvbus",    OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
525         {NULL, 0},
526 };
528 /* Module pin mux for eCAP0 */
529 static struct pinmux_config ecap0_pin_mux[] = {
530         {"ecap0_in_pwm0_out.gpio0_7", AM33XX_PIN_OUTPUT},
531         {NULL, 0},
532 };
534 static int backlight_enable;
536 static void enable_ecap0(int evm_id, int profile)
538         backlight_enable = true;
541 static int __init ecap0_init(void)
543         int status = 0;
545         if (backlight_enable) {
546                 setup_pin_mux(ecap0_pin_mux);
548                 status = gpio_request(AM335X_LCD_BL_PIN, "lcd bl\n");
549                 if (status < 0)
550                         pr_warn("Failed to request gpio for LCD backlight\n");
552                 gpio_direction_output(AM335X_LCD_BL_PIN, 1);
553         }
554         return status;
556 late_initcall(ecap0_init);
558 static int __init conf_disp_pll(int rate)
560         struct clk *disp_pll;
561         int ret = -EINVAL;
563         disp_pll = clk_get(NULL, "dpll_disp_ck");
564         if (IS_ERR(disp_pll)) {
565                 pr_err("Cannot clk_get disp_pll\n");
566                 goto out;
567         }
569         ret = clk_set_rate(disp_pll, rate);
570         clk_put(disp_pll);
571 out:
572         return ret;
575 static void lcdc_init(int evm_id, int profile)
578         setup_pin_mux(lcdc_pin_mux);
580         if (conf_disp_pll(300000000)) {
581                 pr_info("Failed configure display PLL, not attempting to"
582                                 "register LCDC\n");
583                 return;
584         }
586         if (am33xx_register_lcdc(&TFC_S9700RTWV35TR_01B_pdata))
587                 pr_info("Failed to register LCDC device\n");
588         return;
591 static void tsc_init(int evm_id, int profile)
593         int err;
595         if (gp_evm_revision == GP_EVM_REV_IS_1_1A) {
596                 am335x_touchscreen_data.analog_input = 1;
597                 pr_info("TSC connected to beta GP EVM\n");
598         } else {
599                 am335x_touchscreen_data.analog_input = 0;
600                 pr_info("TSC connected to alpha GP EVM\n");
601         }
602         setup_pin_mux(tsc_pin_mux);
603         err = platform_device_register(&tsc_device);
604         if (err)
605                 pr_err("failed to register touchscreen device\n");
608 static void rgmii1_init(int evm_id, int profile)
610         setup_pin_mux(rgmii1_pin_mux);
611         return;
614 static void rgmii2_init(int evm_id, int profile)
616         setup_pin_mux(rgmii2_pin_mux);
617         return;
620 static void mii1_init(int evm_id, int profile)
622         setup_pin_mux(mii1_pin_mux);
623         return;
626 static void usb0_init(int evm_id, int profile)
628         setup_pin_mux(usb0_pin_mux);
629         return;
632 static void usb1_init(int evm_id, int profile)
634         setup_pin_mux(usb1_pin_mux);
635         return;
638 /* NAND partition information */
639 static struct mtd_partition am335x_nand_partitions[] = {
640 /* All the partition sizes are listed in terms of NAND block size */
641         {
642                 .name           = "SPL",
643                 .offset         = 0,                    /* Offset = 0x0 */
644                 .size           = SZ_128K,
645         },
646         {
647                 .name           = "SPL.backup1",
648                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x20000 */
649                 .size           = SZ_128K,
650         },
651         {
652                 .name           = "SPL.backup2",
653                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x40000 */
654                 .size           = SZ_128K,
655         },
656         {
657                 .name           = "SPL.backup3",
658                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x60000 */
659                 .size           = SZ_128K,
660         },
661         {
662                 .name           = "U-Boot",
663                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
664                 .size           = 15 * SZ_128K,
665         },
666         {
667                 .name           = "U-Boot Env",
668                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
669                 .size           = 1 * SZ_128K,
670         },
671         {
672                 .name           = "Kernel",
673                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
674                 .size           = 40 * SZ_128K,
675         },
676         {
677                 .name           = "File System",
678                 .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x780000 */
679                 .size           = MTDPART_SIZ_FULL,
680         },
681 };
683 static void evm_nand_init(int evm_id, int profile)
685         setup_pin_mux(nand_pin_mux);
686         board_nand_init(am335x_nand_partitions,
687                 ARRAY_SIZE(am335x_nand_partitions), 0, 0);
690 static struct i2c_board_info am335x_i2c_boardinfo1[] = {
691         {
692                 I2C_BOARD_INFO("tlv320aic3x", 0x1b),
693         },
694 };
696 static void i2c1_init(int evm_id, int profile)
698         setup_pin_mux(i2c1_pin_mux);
699         omap_register_i2c_bus(2, 100, am335x_i2c_boardinfo1,
700                         ARRAY_SIZE(am335x_i2c_boardinfo1));
701         return;
704 /* Setup McASP 1 */
705 static void mcasp1_init(int evm_id, int profile)
707         /* Configure McASP */
708         setup_pin_mux(mcasp1_pin_mux);
709         am335x_register_mcasp1(&am335x_evm_snd_data1);
710         return;
713 static void mmc1_init(int evm_id, int profile)
715         setup_pin_mux(mmc1_pin_mux);
717         am335x_mmc[1].mmc = 2;
718         am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA;
719         am335x_mmc[1].gpio_cd = GPIO_TO_PIN(2, 2);
720         am335x_mmc[1].gpio_wp = GPIO_TO_PIN(1, 29);
721         am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 */
723         /* mmc will be initialized when mmc0_init is called */
724         return;
727 static void mmc0_init(int evm_id, int profile)
729         setup_pin_mux(mmc0_pin_mux);
731         omap2_hsmmc_init(am335x_mmc);
732         return;
735 static void mmc0_no_cd_init(int evm_id, int profile)
737         setup_pin_mux(mmc0_no_cd_pin_mux);
739         omap2_hsmmc_init(am335x_mmc);
740         return;
744 /* Low-Cost EVM */
745 static struct evm_dev_cfg low_cost_evm_dev_cfg[] = {
746         {rgmii1_init,   DEV_ON_BASEBOARD, PROFILE_NONE},
747         {usb0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
748         {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
749         {evm_nand_init, DEV_ON_BASEBOARD, PROFILE_NONE},
750         {NULL, 0, 0},
751 };
753 /* General Purpose EVM */
754 static struct evm_dev_cfg gen_purp_evm_dev_cfg[] = {
755         {enable_ecap0,  DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 |
756                                                 PROFILE_2 | PROFILE_7) },
757         {lcdc_init,     DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 |
758                                                 PROFILE_2 | PROFILE_7) },
759         {tsc_init,      DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 |
760                                                 PROFILE_2 | PROFILE_7) },
761         {rgmii1_init,   DEV_ON_BASEBOARD, PROFILE_ALL},
762         {rgmii2_init,   DEV_ON_DGHTR_BRD, (PROFILE_1 | PROFILE_2 |
763                                                 PROFILE_4 | PROFILE_6) },
764         {usb0_init,     DEV_ON_BASEBOARD, PROFILE_ALL},
765         {usb1_init,     DEV_ON_BASEBOARD, PROFILE_ALL},
766         {evm_nand_init, DEV_ON_DGHTR_BRD,
767                 (PROFILE_ALL & ~PROFILE_2 & ~PROFILE_3)},
768         {i2c1_init,     DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7)},
769         {mcasp1_init,   DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7)},
770         {mmc1_init,     DEV_ON_DGHTR_BRD, PROFILE_2},
771         {mmc0_init,     DEV_ON_BASEBOARD, (PROFILE_ALL & ~PROFILE_5)},
772         {mmc0_no_cd_init,       DEV_ON_BASEBOARD, PROFILE_5},
773         {NULL, 0, 0},
774 };
776 /* Industrial Auto Motor Control EVM */
777 static struct evm_dev_cfg ind_auto_mtrl_evm_dev_cfg[] = {
778         {mii1_init,     DEV_ON_DGHTR_BRD, PROFILE_ALL},
779         {usb0_init,     DEV_ON_BASEBOARD, PROFILE_ALL},
780         {usb1_init,     DEV_ON_BASEBOARD, PROFILE_ALL},
781         {evm_nand_init, DEV_ON_DGHTR_BRD, PROFILE_ALL},
782         {NULL, 0, 0},
783 };
785 /* IP-Phone EVM */
786 static struct evm_dev_cfg ip_phn_evm_dev_cfg[] = {
787         {enable_ecap0,  DEV_ON_DGHTR_BRD, PROFILE_NONE},
788         {lcdc_init,     DEV_ON_DGHTR_BRD, PROFILE_NONE},
789         {tsc_init,      DEV_ON_DGHTR_BRD, PROFILE_NONE},
790         {rgmii1_init,   DEV_ON_BASEBOARD, PROFILE_NONE},
791         {rgmii2_init,   DEV_ON_DGHTR_BRD, PROFILE_NONE},
792         {usb0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
793         {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
794         {evm_nand_init, DEV_ON_DGHTR_BRD, PROFILE_NONE},
795         {i2c1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
796         {mcasp1_init,   DEV_ON_DGHTR_BRD, PROFILE_NONE},
797         {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
798         {NULL, 0, 0},
799 };
801 static void setup_low_cost_evm(void)
803         pr_info("The board is a AM335x Low Cost EVM.\n");
805         _configure_device(LOW_COST_EVM, low_cost_evm_dev_cfg, PROFILE_NONE);
808 static void setup_general_purpose_evm(void)
810         u32 prof_sel = am335x_get_profile_selection();
811         pr_info("The board is general purpose EVM in profile %d\n", prof_sel);
813         if (!strncmp("1.1A", config.version, 4)) {
814                 gp_evm_revision = GP_EVM_REV_IS_1_1A;
815         } else if (!strncmp("1.0", config.version, 3)) {
816                 gp_evm_revision = GP_EVM_REV_IS_1_0;
817         } else {
818                 pr_err("Found invalid GP EVM revision, falling back to Rev1.1A");
819                 gp_evm_revision = GP_EVM_REV_IS_1_1A;
820         }
822         if (gp_evm_revision == GP_EVM_REV_IS_1_0)
823                 gigabit_enable = 0;
824         else if (gp_evm_revision == GP_EVM_REV_IS_1_1A)
825                 gigabit_enable = 1;
827         _configure_device(GEN_PURP_EVM, gen_purp_evm_dev_cfg, (1L << prof_sel));
830 static void setup_ind_auto_motor_ctrl_evm(void)
832         u32 prof_sel = am335x_get_profile_selection();
834         pr_info("The board is an industrial automation EVM in profile %d\n",
835                 prof_sel);
837         /* Only Profile 0 is supported */
838         if ((1L << prof_sel) != PROFILE_0) {
839                 pr_err("AM335X: Only Profile 0 is supported\n");
840                 pr_err("Assuming profile 0 & continuing\n");
841                 prof_sel = PROFILE_0;
842         }
844         _configure_device(IND_AUT_MTR_EVM, ind_auto_mtrl_evm_dev_cfg,
845                 PROFILE_0);
849 static void setup_ip_phone_evm(void)
851         pr_info("The board is an IP phone EVM\n");
853         _configure_device(IP_PHN_EVM, ip_phn_evm_dev_cfg, PROFILE_NONE);
856 static void am335x_setup_daughter_board(struct memory_accessor *m, void *c)
858         u8 tmp;
859         int ret;
861         /*
862          * try reading a byte from the EEPROM to see if it is
863          * present. We could read a lot more, but that would
864          * just slow the boot process and we have all the information
865          * we need from the EEPROM on the base board anyway.
866          */
867         ret = m->read(m, &tmp, 0, sizeof(u8));
868         if (ret == sizeof(u8)) {
869                 pr_info("Detected a daughter card on AM335x EVM..");
870                 daughter_brd_detected = true;
871         } else {
872                 pr_info("No daughter card found\n");
873                 daughter_brd_detected = false;
874         }
877 static void am335x_evm_setup(struct memory_accessor *mem_acc, void *context)
879         int ret;
880         char tmp[10];
882         /* get board specific data */
883         ret = mem_acc->read(mem_acc, (char *)&config, 0, sizeof(config));
884         if (ret != sizeof(config)) {
885                 pr_warning("AM335X EVM config read fail, read %d bytes\n", ret);
886                 return;
887         }
889         if (config.header != AM335X_EEPROM_HEADER) {
890                 pr_warning("AM335X: wrong header 0x%x, expected 0x%x\n",
891                         config.header, AM335X_EEPROM_HEADER);
892                 goto out;
893         }
895         if (strncmp("A335", config.name, 4)) {
896                 pr_err("Board %s doesn't look like an AM335x board\n",
897                         config.name);
898                 goto out;
899         }
901         snprintf(tmp, sizeof(config.name), "%s", config.name);
902         pr_info("Board name: %s\n", tmp);
903         /* only 6 characters of options string used for now */
904         snprintf(tmp, 7, "%s", config.opt);
905         pr_info("SKU: %s\n", tmp);
907         if (!strncmp("SKU#00", config.opt, 6))
908                 setup_low_cost_evm();
909         else if (!strncmp("SKU#01", config.opt, 6))
910                 setup_general_purpose_evm();
911         else if (!strncmp("SKU#02", config.opt, 6))
912                 setup_ind_auto_motor_ctrl_evm();
913         else if (!strncmp("SKU#03", config.opt, 6))
914                 setup_ip_phone_evm();
915         else
916                 goto out;
918         /* Initialize cpsw after board detection is completed as board
919          * information is required for configuring phy address and hence
920          * should be call only after board detection
921          */
922         am33xx_cpsw_init();
924         return;
925 out:
926         /*
927          * for bring-up assume a full configuration, this should
928          * eventually be changed to assume a minimal configuration
929          */
930         pr_err("Could not detect any board, falling back to: "
931                 "General purpose EVM in profile 0 with daughter card connected\n");
932         daughter_brd_detected = true;
933         setup_general_purpose_evm();
935         /* Initialize cpsw after board detection is completed as board
936          * information is required for configuring phy address and hence
937          * should be call only after board detection
938          */
939         am33xx_cpsw_init();
943 static struct at24_platform_data am335x_daughter_board_eeprom_info = {
944         .byte_len       = (256*1024) / 8,
945         .page_size      = 64,
946         .flags          = AT24_FLAG_ADDR16,
947         .setup          = am335x_setup_daughter_board,
948         .context        = (void *)NULL,
949 };
951 static struct at24_platform_data am335x_baseboard_eeprom_info = {
952         .byte_len       = (256*1024) / 8,
953         .page_size      = 64,
954         .flags          = AT24_FLAG_ADDR16,
955         .setup          = am335x_evm_setup,
956         .context        = (void *)NULL,
957 };
959 /*
960 * Daughter board Detection.
961 * Every board has a ID memory (EEPROM) on board. We probe these devices at
962 * machine init, starting from daughter board and ending with baseboard.
963 * Assumptions :
964 *       1. probe for i2c devices are called in the order they are included in
965 *          the below struct. Daughter boards eeprom are probed 1st. Baseboard
966 *          eeprom probe is called last.
967 */
968 static struct i2c_board_info __initdata am335x_i2c_boardinfo[] = {
969         {
970                 /* Daughter Board EEPROM */
971                 I2C_BOARD_INFO("24c256", DAUG_BOARD_I2C_ADDR),
972                 .platform_data  = &am335x_daughter_board_eeprom_info,
973         },
974         {
975                 /* Baseboard board EEPROM */
976                 I2C_BOARD_INFO("24c256", BASEBOARD_I2C_ADDR),
977                 .platform_data  = &am335x_baseboard_eeprom_info,
978         },
979         {
980                 I2C_BOARD_INFO("cpld_reg", 0x35),
981         },
982         {
983                 I2C_BOARD_INFO("tlc59108", 0x40),
984         },
986 };
988 static struct omap_musb_board_data musb_board_data = {
989         .interface_type = MUSB_INTERFACE_ULPI,
990         .mode           = MUSB_OTG,
991         .power          = 500,
992         .instances      = 1,
993 };
995 static int cpld_reg_probe(struct i2c_client *client,
996             const struct i2c_device_id *id)
998         cpld_client = client;
999         return 0;
1002 static int __devexit cpld_reg_remove(struct i2c_client *client)
1004         cpld_client = NULL;
1005         return 0;
1008 static const struct i2c_device_id cpld_reg_id[] = {
1009         { "cpld_reg", 0 },
1010         { }
1011 };
1013 static struct i2c_driver cpld_reg_driver = {
1014         .driver = {
1015                 .name   = "cpld_reg",
1016         },
1017         .probe          = cpld_reg_probe,
1018         .remove         = cpld_reg_remove,
1019         .id_table       = cpld_reg_id,
1020 };
1022 static void evm_init_cpld(void)
1024         i2c_add_driver(&cpld_reg_driver);
1027 static void __init am335x_evm_i2c_init(void)
1029         /* Initially assume Low Cost EVM Config */
1030         am335x_evm_id = LOW_COST_EVM;
1032         evm_init_cpld();
1034         omap_register_i2c_bus(1, 100, am335x_i2c_boardinfo,
1035                                 ARRAY_SIZE(am335x_i2c_boardinfo));
1038 static void __init am335x_evm_init(void)
1040         am33xx_mux_init(board_mux);
1041         omap_serial_init();
1042         am335x_evm_i2c_init();
1043         omap_sdrc_init(NULL, NULL);
1044         usb_musb_init(&musb_board_data);
1045         omap_board_config = am335x_evm_config;
1046         omap_board_config_size = ARRAY_SIZE(am335x_evm_config);
1049 static void __init am335x_evm_map_io(void)
1051         omap2_set_globals_am33xx();
1052         omapam33xx_map_common_io();
1055 MACHINE_START(AM335XEVM, "am335xevm")
1056         /* Maintainer: Texas Instruments */
1057         .atag_offset    = 0x100,
1058         .map_io         = am335x_evm_map_io,
1059         .init_early     = am33xx_init_early,
1060         .init_irq       = ti81xx_init_irq,
1061         .handle_irq     = omap3_intc_handle_irq,
1062         .timer          = &omap3_am33xx_timer,
1063         .init_machine   = am335x_evm_init,
1064 MACHINE_END