Re: [PATCH 1/3] Initial support for Technexion Thunderboard : boardsupport

2010-02-04 Thread Tony Lindgren
Hi,


* Daniel Toussaint  [091213 05:32]:
> Dear All,
> 
> Patches reformatted for mainline.

Look OK, can you please repost the series with proper patch description
and Signed-off-by? See Documentation/submit* files for more info.

Need it pretty fast too for this merge window please :)

Tony

 
> Daniel Toussaint
> 

> Signed-off-by: Daniel Toussaint 
> diff -Nur linux-2.6.32-pristine/arch/arm/mach-omap2/board-omap3thunder.c 
> linux-2.6.32-patched/arch/arm/mach-omap2/board-omap3thunder.c
> --- linux-2.6.32-pristine/arch/arm/mach-omap2/board-omap3thunder.c
> 1970-01-01 01:00:00.0 +0100
> +++ linux-2.6.32-patched/arch/arm/mach-omap2/board-omap3thunder.c 
> 2009-12-11 13:09:42.0 +0100
> @@ -0,0 +1,455 @@
> +/*
> + * Copyright (C) 2009 Technexion
> + * Modified from mach-omap2/board-omap3beagleboard.c
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "mmc-twl4030.h"
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define OMAP3_THUNDER_TS_GPIO136
> +#define GPMC_CS0_BASE  0x60
> +#define GPMC_CS_SIZE   0x30
> +#define NAND_BLOCK_SIZE  SZ_128K
> +
> +#define THUNDER_DVI_PANEL_EN_GPIO 199
> +#define THUNDER_LCD_PANEL_ENVDD 138
> +#define THUNDER_LCD_PON 139
> +
> +static struct mtd_partition omap3thunder_nand_partitions[] = {
> + /* All the partition sizes are listed in terms of NAND block size */
> + {
> + .name   = "X-Loader",
> + .offset = 0,
> + .size   = 4 * NAND_BLOCK_SIZE,
> + .mask_flags = MTD_WRITEABLE,/* force read-only */
> + },
> + {
> + .name   = "U-Boot",
> + .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
> + .size   = 15 * NAND_BLOCK_SIZE,
> + .mask_flags = MTD_WRITEABLE,/* force read-only */
> + },
> + {
> + .name   = "U-Boot Env",
> + .offset = MTDPART_OFS_APPEND,   /* Offset = 0x26 */
> + .size   = 1 * NAND_BLOCK_SIZE,
> + },
> + {
> + .name   = "Kernel",
> + .offset = MTDPART_OFS_APPEND,   /* Offset = 0x28 */
> + .size   = 32 * NAND_BLOCK_SIZE,
> + },
> + {
> + .name   = "File System",
> + .offset = MTDPART_OFS_APPEND,   /* Offset = 0x68 */
> + .size   = MTDPART_SIZ_FULL,
> + },
> +};
> +
> +static struct omap_nand_platform_data omap3thunder_nand_data = {
> + .options= NAND_BUSWIDTH_16,
> + .parts  = omap3thunder_nand_partitions,
> + .nr_parts   = ARRAY_SIZE(omap3thunder_nand_partitions),
> + .dma_channel= -1,   /* disable DMA in OMAP NAND driver */
> + .nand_setup = NULL,
> + .dev_ready  = NULL,
> +};
> +
> +static struct resource omap3thunder_nand_resource = {
> + .flags  = IORESOURCE_MEM,
> +};
> +
> +static struct platform_device omap3thunder_nand_device = {
> + .name   = "omap2-nand",
> + .id = -1,
> + .dev= {
> + .platform_data  = &omap3thunder_nand_data,
> + },
> + .num_resources  = 1,
> + .resource   = &omap3thunder_nand_resource,
> +};
> +
> +#include "sdram-micron-mt46h32m32lf-6.h"
> +
> +static struct omap_uart_config omap3_thunder_uart_config __initdata = {
> + .enabled_uarts  = ((1 << 0) | (1 << 1) | (1 << 2)),
> +};
> +
> +static struct twl4030_usb_data thunder_usb_data = {
> + .usb_mode   = T2_USB_MODE_ULPI,
> +};
> +
> +static struct twl4030_hsmmc_info mmc[] = {
> + {
> + .mmc= 1,
> + .wires  = 8,
> + .gpio_cd= -EINVAL,
> + .gpio_wp= 29,
> + },
> + {
> + .mmc= 2,
> + .wires  = 4,
> + .gpio_cd= -EINVAL,
> + .gpio_wp= -EINVAL,
> + },
> + {}  /* Terminator */
> +};
> +
> +static struct regulator_consumer_supply thunder_vmmc1_supply = {
> + .supply = "vmmc",
> +};
> +
> +static struct regulator_consumer_supply thunder_vmmc2_supply = {
> + .supply = "vmmc",
> +};
> +
> +static struct regulator_consumer_supply thunder_vsim_supply = {
> + .supply = "vmmc_aux",
> +};
> +
> +static struct gpio_led gpio_leds

[PATCH 1/3] Initial support for Technexion Thunderboard : boardsupport

2009-12-13 Thread Daniel Toussaint

Dear All,

Patches reformatted for mainline.

Daniel Toussaint

Signed-off-by: Daniel Toussaint 
diff -Nur linux-2.6.32-pristine/arch/arm/mach-omap2/board-omap3thunder.c linux-2.6.32-patched/arch/arm/mach-omap2/board-omap3thunder.c
--- linux-2.6.32-pristine/arch/arm/mach-omap2/board-omap3thunder.c	1970-01-01 01:00:00.0 +0100
+++ linux-2.6.32-patched/arch/arm/mach-omap2/board-omap3thunder.c	2009-12-11 13:09:42.0 +0100
@@ -0,0 +1,455 @@
+/*
+ * Copyright (C) 2009 Technexion
+ * Modified from mach-omap2/board-omap3beagleboard.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "mmc-twl4030.h"
+
+#include 
+#include 
+#include 
+#include 
+
+#define OMAP3_THUNDER_TS_GPIO	136
+#define GPMC_CS0_BASE  0x60
+#define GPMC_CS_SIZE   0x30
+#define NAND_BLOCK_SIZE	SZ_128K
+
+#define THUNDER_DVI_PANEL_EN_GPIO 199
+#define THUNDER_LCD_PANEL_ENVDD 138
+#define THUNDER_LCD_PON 139
+
+static struct mtd_partition omap3thunder_nand_partitions[] = {
+	/* All the partition sizes are listed in terms of NAND block size */
+	{
+		.name		= "X-Loader",
+		.offset		= 0,
+		.size		= 4 * NAND_BLOCK_SIZE,
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "U-Boot",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x8 */
+		.size		= 15 * NAND_BLOCK_SIZE,
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "U-Boot Env",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x26 */
+		.size		= 1 * NAND_BLOCK_SIZE,
+	},
+	{
+		.name		= "Kernel",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x28 */
+		.size		= 32 * NAND_BLOCK_SIZE,
+	},
+	{
+		.name		= "File System",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x68 */
+		.size		= MTDPART_SIZ_FULL,
+	},
+};
+
+static struct omap_nand_platform_data omap3thunder_nand_data = {
+	.options	= NAND_BUSWIDTH_16,
+	.parts		= omap3thunder_nand_partitions,
+	.nr_parts	= ARRAY_SIZE(omap3thunder_nand_partitions),
+	.dma_channel	= -1,		/* disable DMA in OMAP NAND driver */
+	.nand_setup	= NULL,
+	.dev_ready	= NULL,
+};
+
+static struct resource omap3thunder_nand_resource = {
+	.flags		= IORESOURCE_MEM,
+};
+
+static struct platform_device omap3thunder_nand_device = {
+	.name		= "omap2-nand",
+	.id		= -1,
+	.dev		= {
+		.platform_data	= &omap3thunder_nand_data,
+	},
+	.num_resources	= 1,
+	.resource	= &omap3thunder_nand_resource,
+};
+
+#include "sdram-micron-mt46h32m32lf-6.h"
+
+static struct omap_uart_config omap3_thunder_uart_config __initdata = {
+	.enabled_uarts	= ((1 << 0) | (1 << 1) | (1 << 2)),
+};
+
+static struct twl4030_usb_data thunder_usb_data = {
+	.usb_mode	= T2_USB_MODE_ULPI,
+};
+
+static struct twl4030_hsmmc_info mmc[] = {
+	{
+		.mmc		= 1,
+		.wires		= 8,
+		.gpio_cd	= -EINVAL,
+		.gpio_wp	= 29,
+	},
+	{
+		.mmc		= 2,
+		.wires		= 4,
+		.gpio_cd	= -EINVAL,
+		.gpio_wp	= -EINVAL,
+	},
+	{}	/* Terminator */
+};
+
+static struct regulator_consumer_supply thunder_vmmc1_supply = {
+	.supply		= "vmmc",
+};
+
+static struct regulator_consumer_supply thunder_vmmc2_supply = {
+	.supply		= "vmmc",
+};
+
+static struct regulator_consumer_supply thunder_vsim_supply = {
+	.supply			= "vmmc_aux",
+};
+
+static struct gpio_led gpio_leds[] = {
+	{
+		.name			= "thunderboard::usr0",
+		.default_trigger= "heartbeat",
+		.gpio			= -EINVAL,	/* gets replaced */
+		.active_low		= true,
+	},
+};
+
+static int thunder_twl_gpio_setup(struct device *dev,
+		unsigned gpio, unsigned ngpio)
+{
+	mmc[0].gpio_cd = gpio + 0;
+	twl4030_mmc_init(mmc);
+
+	/* link regulators to MMC adapters */
+	thunder_vmmc1_supply.dev = mmc[0].dev;
+	thunder_vmmc2_supply.dev = mmc[1].dev;
+	thunder_vsim_supply.dev = mmc[0].dev;
+
+	/* the LED marked LED 2 (LEDA) */
+	gpio_leds[0].gpio = gpio + TWL4030_GPIO_MAX + 1;
+
+	/* gpio + 7 == DVI Enable */
+	gpio_request(gpio + 7, "EN_DVI");
+	gpio_direction_output(gpio + 7,	0);
+	return 0;
+}
+
+static struct twl4030_gpio_platform_data thunder_gpio_data = {
+	.gpio_base	= OMAP_MAX_GPIO_LINES,
+	.irq_base	= TWL4030_GPIO_IRQ_BASE,
+	.irq_end	= TWL4030_GPIO_IRQ_END,
+	.use_leds	= false,
+	.pullups	= BIT(1),
+	.pulldowns	= BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
+| BIT(15) | BIT(16) | BIT(17),
+	.setup		= thunder_twl_gpio_setup,
+};
+
+
+/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
+static struct regulator_init_data thunder_vmmc1 = {
+	.constraints = {
+		.min_uV			= 185,
+		.max_uV			= 315,
+		.valid_modes_mask	= REGULATOR_MODE_NORMAL
+	| REGULATOR_MODE_STANDBY,
+		.valid_ops_mask		= REGULATOR_CHANGE_VOLTA