blob: 410fe006c0f6c7ed5bab7c76384623905415b920 [file] [log] [blame]
Vikram Pandita577145f2009-05-28 14:04:04 -07001/*
2 * Copyright (C) 2009 Texas Instruments Inc.
3 * Mikkel Christensen <mlc@ti.com>
4 *
5 * Modified from mach-omap2/board-ldp.c
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
Vikram Pandita70ac51a2009-08-28 11:24:13 -070015#include <linux/input.h>
Vikram Pandita577145f2009-05-28 14:04:04 -070016#include <linux/gpio.h>
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000017#include <linux/i2c/twl.h>
Vikram Pandita577145f2009-05-28 14:04:04 -070018
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21
Tony Lindgrence491cf2009-10-20 09:40:47 -070022#include <plat/common.h>
vikram pandita479f12c2009-11-22 10:11:30 -080023#include <plat/board.h>
Vikram Pandita577145f2009-05-28 14:04:04 -070024
vikram pandita62d0b3362009-11-22 10:11:31 -080025#include <mach/board-zoom.h>
26
Tony Lindgrenca5742b2009-12-11 16:16:32 -080027#include "mux.h"
Teerth Reddy02563a52009-10-14 09:56:35 -070028#include "sdram-micron-mt46h32m32lf-6.h"
Vikram Pandita577145f2009-05-28 14:04:04 -070029
Paul Walmsleyb3c6df32009-09-03 20:14:02 +030030static void __init omap_zoom2_init_irq(void)
31{
Teerth Reddy02563a52009-10-14 09:56:35 -070032 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
33 mt46h32m32lf6_sdrc_params);
Paul Walmsleyb3c6df32009-09-03 20:14:02 +030034 omap_init_irq();
35 omap_gpio_init();
36}
37
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000038/* EXTMUTE callback function */
39void zoom2_set_hs_extmute(int mute)
40{
41 gpio_set_value(ZOOM2_HEADSET_EXTMUTE_GPIO, mute);
42}
Vikram Pandita70ac51a2009-08-28 11:24:13 -070043
44static struct twl4030_madc_platform_data zoom2_madc_data = {
45 .irq_line = 1,
Vikram Pandita577145f2009-05-28 14:04:04 -070046};
47
Peter Ujfalusif8d9aad2009-10-22 13:26:46 +030048static struct twl4030_codec_audio_data zoom2_audio_data = {
49 .audio_mclk = 26000000,
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000050 .ramp_delay_value = 3, /* 161 ms */
51 .hs_extmute = 1,
52 .set_hs_extmute = zoom2_set_hs_extmute,
Peter Ujfalusif8d9aad2009-10-22 13:26:46 +030053};
54
55static struct twl4030_codec_data zoom2_codec_data = {
Peter Ujfalusi953e2f32009-11-04 09:58:18 +020056 .audio_mclk = 26000000,
Peter Ujfalusif8d9aad2009-10-22 13:26:46 +030057 .audio = &zoom2_audio_data,
58};
59
Vikram Pandita577145f2009-05-28 14:04:04 -070060static struct twl4030_platform_data zoom2_twldata = {
61 .irq_base = TWL4030_IRQ_BASE,
62 .irq_end = TWL4030_IRQ_END,
63
64 /* platform_data for children goes here */
Vikram Pandita70ac51a2009-08-28 11:24:13 -070065 .bci = &zoom2_bci_data,
66 .madc = &zoom2_madc_data,
67 .usb = &zoom2_usb_data,
Vikram Pandita577145f2009-05-28 14:04:04 -070068 .gpio = &zoom2_gpio_data,
Vikram Pandita70ac51a2009-08-28 11:24:13 -070069 .keypad = &zoom2_kp_twl4030_data,
Peter Ujfalusif8d9aad2009-10-22 13:26:46 +030070 .codec = &zoom2_codec_data,
Vikram Pandita70ac51a2009-08-28 11:24:13 -070071 .vmmc1 = &zoom2_vmmc1,
72 .vmmc2 = &zoom2_vmmc2,
73 .vsim = &zoom2_vsim,
Vikram Pandita577145f2009-05-28 14:04:04 -070074};
75
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +000076static struct i2c_board_info __initdata zoom2_i2c_boardinfo[] = {
77 {
78 I2C_BOARD_INFO("twl4030", 0x48),
79 .flags = I2C_CLIENT_WAKE,
80 .irq = INT_34XX_SYS_NIRQ,
81 .platform_data = &zoom2_twldata,
82 },
83};
84
85static int __init omap3_zoom2_i2c_init(void)
86{
87 omap_register_i2c_bus(1, 2600, zoom2_i2c_boardinfo,
88 ARRAY_SIZE(zoom2_i2c_boardinfo));
89 return 0;
90}
91
Vikram Pandita577145f2009-05-28 14:04:04 -070092
Tony Lindgrenca5742b2009-12-11 16:16:32 -080093#ifdef CONFIG_OMAP_MUX
94static struct omap_board_mux board_mux[] __initdata = {
95 { .reg_offset = OMAP_MUX_TERMINATOR },
96};
97#else
98#define board_mux NULL
99#endif
100
Vikram Pandita577145f2009-05-28 14:04:04 -0700101static void __init omap_zoom2_init(void)
102{
Tony Lindgrenca5742b2009-12-11 16:16:32 -0800103 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
vikram pandita479f12c2009-11-22 10:11:30 -0800104 zoom_peripherals_init();
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000105 omap3_zoom2_i2c_init();
vikram pandita62d0b3362009-11-22 10:11:31 -0800106 zoom_debugboard_init();
Vikram Pandita577145f2009-05-28 14:04:04 -0700107}
108
109static void __init omap_zoom2_map_io(void)
110{
111 omap2_set_globals_343x();
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800112 omap34xx_map_common_io();
Vikram Pandita577145f2009-05-28 14:04:04 -0700113}
114
115MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
Tony Lindgrena4f57b82010-04-30 12:57:14 -0700116 .phys_io = ZOOM_UART_BASE,
117 .io_pg_offst = (ZOOM_UART_VIRT >> 18) & 0xfffc,
Vikram Pandita577145f2009-05-28 14:04:04 -0700118 .boot_params = 0x80000100,
119 .map_io = omap_zoom2_map_io,
120 .init_irq = omap_zoom2_init_irq,
121 .init_machine = omap_zoom2_init,
122 .timer = &omap_timer,
123MACHINE_END