diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap3h1.c')
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3h1.c | 274 | 
1 files changed, 191 insertions, 83 deletions
| diff --git a/arch/arm/mach-omap2/board-omap3h1.c b/arch/arm/mach-omap2/board-omap3h1.c index 4e01a52f9b5..fa9164322c3 100644 --- a/arch/arm/mach-omap2/board-omap3h1.c +++ b/arch/arm/mach-omap2/board-omap3h1.c @@ -51,6 +51,8 @@  #include <video/omapdss.h>  #include <video/omap-panel-data.h>  #include <linux/platform_data/mtd-nand-omap2.h> +#include <linux/platform_data/serial-omap.h> +#include <linux/interrupt.h>  #include <linux/of_irq.h>  #include <linux/of_platform.h> @@ -66,6 +68,8 @@  #include "common-board-devices.h"  #include "board-omap3h1.h" +#include "sdram-micron-mt29c4g48.h" +  #define NAND_CS 0  #define MPUIRQ_GPIO 31 @@ -74,6 +78,10 @@  #define USB_IRQ 124  #define USB_ON_ETK_D7 21 +#define DEFAULT_RXDMA_POLLRATE		1	/* RX DMA polling rate (us) */ +#define DEFAULT_RXDMA_BUFSIZE		4096	/* RX DMA buffer size */ +#define DEFAULT_RXDMA_TIMEOUT		(3 * HZ)/* RX DMA timeout (jiffies) */ +  #if defined(CONFIG_MACH_OMAP3_H1_DVT1) || defined(CONFIG_MACH_OMAP3_H1_DVT2)  #define LCD_RESET_GPIO 94  #else  @@ -207,21 +215,24 @@ static struct mxt_platform_data mxt_data = {      .irqflags	= IRQF_TRIGGER_FALLING,  };  +/*  static struct platform_device bcm20702_bluetooth_device = {  	.name = "bcm20702_bluetooth",  	.id   = -1,   }; +*/  static struct platform_device omap3h1_dmic_codec = {  		.name = "dmic-codec",  		.id = -1,  }; -  /* --------------------------------------------------------------------------- */  /* USB settings    */ + +  static struct omap_musb_board_data musb_board_data = {  	.interface_type		= MUSB_INTERFACE_ULPI,  	.mode   			= MUSB_OTG, @@ -255,7 +266,7 @@ static struct platform_device nop_phy_device = {  static struct regulator_init_data omap3h1_vbat_data = {      .constraints.always_on = true, -    .constraints.valid_modes_mask = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, +    .constraints.valid_modes_mask = REGULATOR_MODE_NORMAL,      .constraints.valid_ops_mask = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,  }; @@ -279,13 +290,12 @@ static struct platform_device omap3h1_vbat = {  static struct regulator_init_data tps65910_dummy = {  	.supply_regulator = "VBAT", -    .constraints.always_on  = true, +    .constraints.always_on  = false,      .constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS,  };  /* --------------------------------------------------------------------------- */ -/* This one is required for the display to work ... makes no sense, but there - * you are.  +/* This one is required for the display to work.   */  static struct regulator_consumer_supply tps65910_touch3_supply[] = { @@ -343,8 +353,18 @@ static struct regulator_init_data tps65910_vibrator = {          .max_uV            = 3300000,          .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,          .valid_ops_mask    = REGULATOR_CHANGE_MODE, -        .always_on         = true, +        .always_on         = false,          .apply_uV		   = true, + +        .state_mem         = { +            .disabled = 1, +        }, +        .state_disk        = { +            .disabled = 1, +        }, +        .state_standby     = { +            .disabled = 1, +        },      },      .num_consumer_supplies = ARRAY_SIZE(tps65910_vibrator_supply),      .consumer_supplies     = tps65910_vibrator_supply, @@ -371,7 +391,7 @@ static struct regulator_init_data tps65910_3v3 = {          .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,          .valid_ops_mask    = REGULATOR_CHANGE_MODE    |                                REGULATOR_CHANGE_STATUS, -        .always_on         = true, +        .always_on         = false,          .apply_uV		   = true,          .state_mem         = { @@ -393,7 +413,7 @@ static struct regulator_init_data tps65910_3v3 = {   * USB also depends on this, so if you want to transfer files it has to be    * always on.   * NAND flash and UART3 (which we don't use) requires it  - * as well.  + * as well. And the i2c bus, and lots of other stuff.   *    * Setting always_on to "false" resulted in almost no power savings, at   * least in the current setting.  @@ -410,34 +430,16 @@ static struct regulator_init_data tps65910_1v8 = {          .max_uV            = 1800000,          .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,          .valid_ops_mask    = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,  -        .always_on         = true, +        .always_on         = false,          .apply_uV		   = true, -         -        .state_mem         = { -            .uV = 0, -            .mode = REGULATOR_MODE_STANDBY, -            .enabled = 1, -        }, -        .state_disk        = { -            .uV = 0, -            .mode = REGULATOR_MODE_STANDBY, -            .enabled = 1, -        }, -        .state_standby     = { -            .uV = 0, -            .mode = REGULATOR_MODE_STANDBY, -            .enabled = 1, -        }, -      },      .num_consumer_supplies = ARRAY_SIZE(tps65910_1v8_supply),      .consumer_supplies     = tps65910_1v8_supply,  };  /* --------------------------------------------------------------------------- */ -/* This isn't actually used, but the wires are required by the processor / - * PMIC. I should be able to set it to constant standby mode (and maybe  - * also some sort of off setting?). +/* There's no driver explicitly using this one, but it goes to VDDA_DPLL_PER  + * on the OMAP chip. So it's used internally by the DPLL devices in PER, I think.   */  static struct regulator_consumer_supply tps65910_vpll_supply[] = { @@ -460,12 +462,7 @@ static struct regulator_init_data tps65910_vpll = {  /* --------------------------------------------------------------------------- */ -/* If this one isn't "always on", the display doesn't come up right.  - * Maybe the power code should be in the panel part of the driver, rather than  - * the SPI? But then again, the SPI part is what needs a power cycle ... tricky! - *  - * OK this is weird. The other touch rail (3.3) seems to be gating the display.  - * What's going on? Maybe the spi is on the wrong rail? +/* Touch power supply part 2.   */  static struct regulator_consumer_supply tps65910_touch_supply[] = { @@ -483,15 +480,17 @@ static struct regulator_init_data tps65910_touch = {          .apply_uV		   = true,          .state_mem         = { -            .uV = 0, +            .uV = 1,              .mode = REGULATOR_MODE_STANDBY,              .disabled = 1,          },          .state_disk        = { +            .uV = 1,              .mode = REGULATOR_MODE_STANDBY,              .disabled = 1,          },          .state_standby     = { +            .uV = 1,              .mode = REGULATOR_MODE_STANDBY,              .disabled = 1,          }, @@ -507,6 +506,9 @@ static struct regulator_init_data tps65910_touch = {  /* This one only works if 'always_on' is set to true. Do I need to do something   * special otherwise to turn it on? Maybe the driver doesn't enable it. + *  + * The accelerometer driver isn't using regulators properly, hence this needs to + * be always on.   */  static struct regulator_consumer_supply tps65910_accel_supply[] = { @@ -524,12 +526,18 @@ static struct regulator_init_data tps65910_accel = {          .apply_uV		   = true,          .state_mem         = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY,              .disabled = 1,          },          .state_disk        = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY,              .disabled = 1,          },          .state_standby     = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY,              .disabled = 1,          },      }, @@ -538,8 +546,7 @@ static struct regulator_init_data tps65910_accel = {  };  /* --------------------------------------------------------------------------- */ -/* This one isn't pulled on by the CPU ... wrong supply name ? - * Also, the TWL code does NOT have always on set.  +/* Supplies the MPU PD and friends.    */  static struct regulator_consumer_supply tps65910_vdd1_supply[] = { @@ -552,9 +559,25 @@ static struct regulator_init_data tps65910_vdd1 = {          .name              = "vdd_mpu_iva",          .min_uV            = 900000,          .max_uV            = 1350000, -        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE, -        .always_on         = true, +        .valid_modes_mask  = REGULATOR_MODE_NORMAL, +        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE, +        .always_on         = false, + +        .state_mem         = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_disk        = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_standby     = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        },      },      .num_consumer_supplies = ARRAY_SIZE(tps65910_vdd1_supply), @@ -566,7 +589,7 @@ static struct regulator_init_data tps65910_vdd1 = {   */  static struct regulator_consumer_supply tps65910_vdd2_supply[] = { -    REGULATOR_SUPPLY("vcc", "l3_main.0"), +    REGULATOR_SUPPLY("vdd_core", "l3_main.0"),  };  static struct regulator_init_data tps65910_vdd2 = { @@ -575,11 +598,27 @@ static struct regulator_init_data tps65910_vdd2 = {          .name              = "vdd_core",          .min_uV            = 900000,          .max_uV            = 1200000, -        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE, -        .always_on         = true, -    }, +        .valid_modes_mask  = REGULATOR_MODE_NORMAL, +        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE, +        .always_on         = false, +        .state_mem         = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_disk        = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_standby     = { +            .uV = 1, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +    }, +          .num_consumer_supplies = ARRAY_SIZE(tps65910_vdd2_supply),      .consumer_supplies     = tps65910_vdd2_supply,  }; @@ -594,13 +633,13 @@ static struct regulator_init_data tps65910_vdd2 = {   * boot, touch not working when up).    */ -/*  +/*  static struct tps65910_sleep_keepon_data olio_slp_keepon = { -    .therm_keepon = 1, -    .clkout32k_keepon = 1,   +    .therm_keepon = 0, +    .clkout32k_keepon = 0,        .i2chs_keepon = 1, -}; - */ + };*/ +  static struct tps65910_board omap3h1_tps65910_pdata = { @@ -721,31 +760,31 @@ static struct i2c_board_info __initdata omap3h1_i2c1_board_info[] = {  };  static struct i2c_board_info __initdata omap3h1_i2c2_board_info[] = {  #endif -         { -            I2C_BOARD_INFO("mpu6515", 0x68), -            // This is needed for the interrupt wake. IH_GPIO_BASE changed in 3.10  -            // .irq = (IH_GPIO_BASE + MPUIRQ_GPIO), -            .platform_data = &mpu_data, -         }, -         {  -            /* Backlight */ -            I2C_BOARD_INFO("lm3530-led", 0x38), -            .platform_data = &omap3h1_backlight_platform_data, -    	 }, -         { -            I2C_BOARD_INFO("mXT224", 0x4a), -            .platform_data = &mxt_data, -         }, -         { -            I2C_BOARD_INFO("cm3391", 0x10), -         }, +    { +        I2C_BOARD_INFO("mpu6515", 0x68), +        // This is needed for the interrupt wake. IH_GPIO_BASE changed in 3.10  +        // .irq = (IH_GPIO_BASE + MPUIRQ_GPIO), +        .platform_data = &mpu_data, +    }, +    {  +        /* Backlight */ +        I2C_BOARD_INFO("lm3530-led", 0x38), +        .platform_data = &omap3h1_backlight_platform_data, +    }, +    { +        I2C_BOARD_INFO("mXT224", 0x4a), +        .platform_data = &mxt_data, +    }, +    { +        I2C_BOARD_INFO("cm3391", 0x10), +    },  #ifdef CONFIG_MACH_OMAP3_H1_EVT1  };  static struct i2c_board_info __initdata omap3h1_i2c3_board_info[] = {  #endif -         { -            I2C_BOARD_INFO("bq274xx", 0x55), -         }, +    { +        I2C_BOARD_INFO("bq274xx", 0x55), +    },  };  #ifdef ONLY_KEEPING_THIS_STUFF_FOR_NOSTALGIC_REASONS @@ -757,7 +796,6 @@ static struct i2c_board_info __initdata omap3h1_i2c3_board_info[] = {   * That PID will then be used when waking the system up.   */ -  struct dentry * pidfile;  #define SIG_OLIO_WAKE 44	// we choose 44 as our signal number (real-time signals are in the range of 33 to 64) @@ -884,7 +922,7 @@ static irqreturn_t acc_irq_handler_thr(int irq, void * omap3h1_d) {       */      send_wake_signal();     -    wake_lock_timeout (&acc_wake.lock, msecs_to_jiffies (2 * OLIO_ONE_SECOND)); +    wake_lock_timeout (&acc_wake.lock, msecs_to_jiffies (20 * OLIO_ONE_SECOND));      previous_double = now;      previous = 0; @@ -910,7 +948,9 @@ static int __init omap3_acc_irq_init (int irq, void * dev_id) {      irq_set_irq_wake(irq, 1);      if (request_threaded_irq (irq, acc_irq_handler,  -                              acc_irq_handler_thr, 0x81, "acc_wake",  +                              acc_irq_handler_thr,  +                              IRQF_SHARED | IRQF_TRIGGER_RISING,  +                              "acc_wake",                                 dev_id)) {        printk (KERN_DEBUG "Couldn't register handler for accelerometer IRQ\n");      } @@ -934,6 +974,69 @@ static int __init omap3_wake_init (void) {  #endif /* ONLY_KEEPING_THIS_STUFF_FOR_NOSTALGIC_REASONS */ + +/*************************************************************************** + * omap_uart data  + */ + +/* Some notes: +		.dma_enabled	= false, +		.dma_rx_buf_size = DEFAULT_RXDMA_BUFSIZE, +		.dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE, +		.dma_rx_timeout = DEFAULT_RXDMA_TIMEOUT, +		.autosuspend_timeout = DEFAULT_AUTOSUSPEND_DELAY, ( -1 or X ms. ) +         +        .wakelock_timeout - for minnow, this is 150 (BT) or 50 (M4 debug). +              Can be left out. + +        .DTR_* -> can be left out. I can't find anyone using it. + +        int			    DTR_gpio; +        int			    DTR_inverted; +        int			    DTR_present; +        bool			wakeup_capable; +         +        bool			open_close_pm; - Minnow uses this for c55 only +        unsigned int	rx_trig;  Minnow, BT & debug only +*/ + +static struct omap_uart_port_info omap_uart_ports[] = { +    { +        .dma_enabled = false,	/* To specify DMA Mode */ +        .dma_rx_buf_size  = DEFAULT_RXDMA_BUFSIZE, +        .dma_rx_timeout   = DEFAULT_RXDMA_TIMEOUT, +        .dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE, +        .autosuspend_timeout = 5000, +        .wakeup_capable = false, +    }, +    { +        .dma_enabled = false,	/* To specify DMA Mode */ +        .dma_rx_buf_size  = DEFAULT_RXDMA_BUFSIZE, +        .dma_rx_timeout   = DEFAULT_RXDMA_TIMEOUT, +        .dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE, +        .autosuspend_timeout = 5000, +        .wakeup_capable = false, +    }, +    { +        .dma_enabled = false,	/* To specify DMA Mode */ +        .dma_rx_buf_size  = DEFAULT_RXDMA_BUFSIZE, +        .dma_rx_timeout   = DEFAULT_RXDMA_TIMEOUT, +        .dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE, +        .autosuspend_timeout = -1, +        .wakelock_timeout = 10000, +        .wakeup_capable = true, +    }, +    { +        .dma_enabled = false,	/* To specify DMA Mode */ +        .dma_rx_buf_size  = DEFAULT_RXDMA_BUFSIZE, +        .dma_rx_timeout   = DEFAULT_RXDMA_TIMEOUT, +        .dma_rx_poll_rate = DEFAULT_RXDMA_POLLRATE, +        .autosuspend_timeout = 5000, +        .wakeup_capable = false, +    }, +}; + +  /***************************************************************************   * DEVICE TREE STUFF   *  @@ -1000,7 +1103,7 @@ static int __init omap3_h1_i2c_init(void)  static struct platform_device *omap3h1_devices[] __initdata = {  		&omap3h1_vbat, -        &bcm20702_bluetooth_device, +        // &bcm20702_bluetooth_device,          &nop_phy_device,  		&omap3h1_dmic_codec,  }; @@ -1065,7 +1168,7 @@ static struct omap_board_mux board_mux[] __initdata = {      OMAP3_MUX(JTAG_EMU1, (OMAP_MUX_MODE4 | OMAP_PIN_INPUT                             | OMAP_PIN_OFF_WAKEUPENABLE)), - +          /* USB on */      OMAP3_MUX(ETK_D7, (OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT)), @@ -1076,8 +1179,6 @@ static struct omap_board_mux board_mux[] __initdata = {  };  #endif - -  static void __init omap3_h1_init(void)  {      /* Read what we can from the device tree */ @@ -1088,7 +1189,7 @@ static void __init omap3_h1_init(void)                      ARRAY_SIZE(omap3h1_nand_partitions), NAND_CS,                      NAND_BUSWIDTH_16, NULL); -	omap_sdrc_init(NULL, NULL); +	omap_sdrc_init(mt29c4g48_sdrc_params, mt29c4g48_sdrc_params);      omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); @@ -1101,7 +1202,7 @@ static void __init omap3_h1_init(void)  	omap3h1_spi_init(); -	omap_serial_init(); +	omap_serial_board_init(omap_uart_ports);      omap_display_init(&omap3h1_dss_data); @@ -1109,15 +1210,22 @@ static void __init omap3_h1_init(void)  	usb_musb_init(&musb_board_data); +    /* #ifdef ONLY_KEEPING_THIS_STUFF_FOR_NOSTALGIC_REASONS */ +      /* For handling interrupts from the accelerometer */      /* previous = jiffies; */      /* Init the code that handles wake ups */ -    /* omap3_wake_init(); */ +    /* +    omap3_wake_init(); + +    omap3_acc_irq_init(omap3h1_i2c2_board_info[0].irq, (void *) &omap3h1_devices); +     */ + +    /* #endif  ONLY_KEEPING_THIS_STUFF_FOR_NOSTALGIC_REASONS*/ -    /* omap3_acc_irq_init(omap3h1_i2c2_board_info[0].irq, (void *) &omap3h1_devices); */  }  static const char *omap3_h1_boards_compat[] __initdata = { |