[Armadeus-commitlog] armadeus branch, master, updated. release-3.3-188-gd0a58ce
Brought to you by:
sszy
|
From: Gwenhael <gwe...@us...> - 2010-12-23 11:39:11
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via d0a58cec1516ad347ee9200292cb0bd40e9dd83d (commit)
via bc14a99508e76fb1116fc2c0e6551debfbebb138 (commit)
from 48b5a8bb52b7eef44cf8d5b12cf7310686da85a6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d0a58cec1516ad347ee9200292cb0bd40e9dd83d
Merge: bc14a99508e76fb1116fc2c0e6551debfbebb138 48b5a8bb52b7eef44cf8d5b12cf7310686da85a6
Author: gwenhael <gw...@tr...>
Date: Thu Dec 23 12:45:01 2010 +0100
Merge branch 'master' of ssh://armadeus.git.sourceforge.net/gitroot/armadeus/armadeus
commit bc14a99508e76fb1116fc2c0e6551debfbebb138
Author: gwenhael <gw...@tr...>
Date: Thu Dec 23 12:44:31 2010 +0100
first commit for apf9328 support, CSI,SSI and FPGA not available. RTC not being tested
-----------------------------------------------------------------------
Summary of changes:
.../{2.6.29 => 2.6.36}/021-armadeus-apf9328.patch | 851 ++++++++++----------
1 files changed, 423 insertions(+), 428 deletions(-)
copy buildroot/target/device/armadeus/linux/kernel-patches/{2.6.29 => 2.6.36}/021-armadeus-apf9328.patch (65%)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.36/021-armadeus-apf9328.patch
similarity index 65%
copy from buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch
copy to buildroot/target/device/armadeus/linux/kernel-patches/2.6.36/021-armadeus-apf9328.patch
index d558383..fc89aa5 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/021-armadeus-apf9328.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.36/021-armadeus-apf9328.patch
@@ -1,11 +1,6 @@
-PATCH AUTOMATICALLY GENERATED
-DON'T EDIT IT OR YOUR MODIFICATIONS WILL BE LOST
-(Take a look at armadeus/target/linux/ directory to know how to generate it)
-Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
-===================================================================
---- /dev/null
-+++ linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
-@@ -0,0 +1,627 @@
+--- /dev/null 2010-11-28 19:42:11.148000001 +0100
++++ b/arch/arm/mach-imx/apf9328.c 2010-12-19 11:31:56.000000000 +0100
+@@ -0,0 +1,588 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328.c
+ *
@@ -27,12 +22,16 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ *
+ */
+
++#include <asm/mach/arch.h>
++#include <asm/mach/time.h>
++#include <mach/common.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/physmap.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/serial_8250.h>
++#include <linux/serial.h>
+#include <linux/spi/spi.h>
+
+#include <asm/system.h>
@@ -43,23 +42,29 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+
+#include <asm/mach/map.h>
+#include <asm/mach-types.h>
-+#include <asm/mach/arch.h>
++#include <mach/gpio.h>
+#include <mach/imx-uart.h>
+#include <mach/mmc.h>
+#include <mach/usb.h>
-+#include <mach/spi_imx.h>
-+#include <mach/imx-regs.h> /* imx_gpio_mode() */
++#include <mach/spi.h>
++#include <mach/mx1.h> /* mxc_gpio_mode() */
+#include <linux/spi/max1027.h>
-+#include <mach/imx_ssi.h>
-+#include <mach/dma.h>
++#include <mach/ssi.h>
++#include <mach/dma-mx1-mx2.h>
+#include "../../../drivers/armadeus/pwm/pwm.h"
+#include <linux/dm9000.h>
++#include <mach/iomux-v1.h>
++#include <mach/iomux-mx1.h>
++#include <mach/board-apf9328.h>
+#ifdef CONFIG_MACH_APF9328_FPGA
+#include "../plat-mxc/include/mach/fpga.h" /* To be removed when MX1 arch is fully integrated */
+#endif
+#include <mach/imxfb.h>
-+#include "generic.h"
++#include "devices-imx1.h"
++#include "devices.h"
+
++#define IMX_FB_VIRT 0xF1000000
++#define IMX_FB_SIZE (256*1024)
+#ifdef CONFIG_ARMADEUS_MAX1027_MODULE
+#define CONFIG_ARMADEUS_MAX1027 1
+#endif
@@ -75,7 +80,18 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+#ifdef CONFIG_ARMADEUS_PWM_DRIVER_MODULE
+#define CONFIG_PWM
+#endif
++#ifdef CONFIG_ARMADEUS_PWM_DRIVER
++#define CONFIG_PWM
++#endif
++
+
++static int apf9328_pins[] = {
++/* SPI0 */
++ PC14_PF_SPI1_SCLK,
++ PC16_PF_SPI1_MISO,
++ PC17_PF_SPI1_MOSI,
++};
++
+
+/*
+ * APF9328 has a DM9000 Ethernet controller
@@ -94,7 +110,7 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ [2] = {
+ .start = (APF9328_ETH_IRQ),
+ .end = (APF9328_ETH_IRQ),
-+ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
++ .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
+ },
+};
+
@@ -110,8 +126,7 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ .dev = { .platform_data = &dm9000_setup, },
+};
+
-+
-+#ifdef CONFIG_PWM
++#ifdef CONFIG_MXC_PWM
+static struct resource pwm_resources[] = {
+ [0] = {
+ .start = 0x00208000,
@@ -119,8 +134,8 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
-+ .start = (PWM_INT),
-+ .end = (PWM_INT),
++ .start = (MX1_PWM_INT),
++ .end = (MX1_PWM_INT),
+ .flags = IORESOURCE_IRQ,
+ },
+};
@@ -128,9 +143,7 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+static int apf9328_pwm_0_init(void)
+{
+ /* Init Port PA[2] : PWMO*/
-+ DDIR(0) |= 0x00000002;
-+ GIUS(0) &= ~0x00000002;
-+ GPR(0) &= ~0x00000002;
++ mxc_gpio_mode(PA2_PF_PWM0);
+ return 0;
+}
+
@@ -153,28 +166,26 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ .platform_data = &apf9328_pwm_0_data,
+ }
+};
-+#endif /* CONFIG_PWM */
-+
++#endif /* CONFIG_MXC_PWM */
+
+#ifdef CONFIG_USB_GADGET_IMX
+static int apf9328_udc_0_init(struct device * dev)
+{
-+ imx_gpio_mode(PC3_PF_SSI_RXFS);
-+ imx_gpio_mode(PB20_PF_USBD_AFE);
-+ imx_gpio_mode(PB21_PF_USBD_OE);
-+ imx_gpio_mode(PB22_PF_USBD_RCV);
-+ imx_gpio_mode(PB23_PF_USBD_SUSPND);
-+ imx_gpio_mode(PB24_PF_USBD_VP);
-+ imx_gpio_mode(PB25_PF_USBD_VM);
-+ imx_gpio_mode(PB26_PF_USBD_VPO);
-+ imx_gpio_mode(PB27_PF_USBD_VMO);
++ mxc_gpio_mode(PC3_PF_SSI_RXFS);
++ mxc_gpio_mode(PB20_PF_USBD_AFE);
++ mxc_gpio_mode(PB21_PF_USBD_OE);
++ mxc_gpio_mode(PB22_PF_USBD_RCV);
++ mxc_gpio_mode(PB23_PF_USBD_SUSPND);
++ mxc_gpio_mode(PB24_PF_USBD_VP);
++ mxc_gpio_mode(PB25_PF_USBD_VM);
++ mxc_gpio_mode(PB26_PF_USBD_VPO);
++ mxc_gpio_mode(PB27_PF_USBD_VMO);
+
+ return 0;
+}
+
-+static int apf9328_udc_0_exit(struct device * dev)
++static void apf9328_udc_0_exit(struct device * dev)
+{
-+ return 0;
+}
+
+static struct imxusb_platform_data apf9328_udc_0_data = {
@@ -183,21 +194,22 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+};
+#endif /* CONFIG_USB_GADGET_IMX */
+
-+
++// TBD GGM
++#if 0
+#if defined(CONFIG_SND_IMX_PCM) || defined(CONFIG_SND_IMX_PCM_MODULE)
+int apf9328_ssi_gpio_init(struct platform_device *pdev)
+{
+ /* Activate SSI on PortC */
-+ imx_gpio_mode(PC3_PF_SSI_RXFS);
++ mxc_gpio_mode(PC3_PF_SSI_RXFS);
+ FMCR &= ~(SSI_RXFS_SEL);
-+ imx_gpio_mode(PC4_PF_SSI_RXCLK);
++ mxc_gpio_mode(PC4_PF_SSI_RXCLK);
+ FMCR &= ~(SSI_RXCLK_SEL);
-+ imx_gpio_mode(PC5_PF_SSI_RXDAT);
++ mxc_gpio_mode(PC5_PF_SSI_RXDAT);
+ FMCR &= ~(SSI_RXDAT_SEL);
-+ imx_gpio_mode(PC6_PF_SSI_TXDAT);
-+ imx_gpio_mode(PC7_PF_SSI_TXFS);
++ mxc_gpio_mode(PC6_PF_SSI_TXDAT);
++ mxc_gpio_mode(PC7_PF_SSI_TXFS);
+ FMCR &= ~(SSI_TXFS_SEL);
-+ imx_gpio_mode(PC8_PF_SSI_TXCLK);
++ mxc_gpio_mode(PC8_PF_SSI_TXCLK);
+ FMCR &= ~(SSI_TXCLK_SEL);
+
+ printk("SSI pins configured\n");
@@ -259,133 +271,80 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+};
+
+#endif /* defined(CONFIG_SND_IMX_PCM) || defined(CONFIG_SND_IMX_PCM_MODULE) */
-+
++#endif
+
+/* --- SERIAL RESSOURCE --- */
-+static struct imxuart_platform_data uart1_pdata = {
-+ .flags = 0,
++static int mxc_uart0_pins[] = {
++ PC9_PF_UART1_CTS,
++ PC10_PF_UART1_RTS,
++ PC11_PF_UART1_TXD,
++ PC12_PF_UART1_RXD
+};
+
-+static struct resource imx_uart1_resources[] = {
-+ [0] = {
-+ .start = 0x00206000,
-+ .end = 0x002060FF,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = (UART1_MINT_RX),
-+ .end = (UART1_MINT_RX),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [2] = {
-+ .start = (UART1_MINT_TX),
-+ .end = (UART1_MINT_TX),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+};
++static int uart_mxc_port0_init(struct platform_device *pdev)
++{
++ return mxc_gpio_setup_multiple_pins(mxc_uart0_pins, ARRAY_SIZE(mxc_uart0_pins), "UART1");
++}
+
-+static struct platform_device imx_uart1_device = {
-+ .name = "imx-uart",
-+ .id = 0,
-+ .num_resources = ARRAY_SIZE(imx_uart1_resources),
-+ .resource = imx_uart1_resources,
-+ .dev = {
-+ .platform_data = &uart1_pdata,
-+ }
-+};
++static void uart_mxc_port0_exit(struct platform_device *pdev)
++{
++ mxc_gpio_release_multiple_pins(mxc_uart0_pins, ARRAY_SIZE(mxc_uart0_pins));
++}
+
-+static struct imxuart_platform_data uart2_pdata = {
-+ .flags = IMXUART_HAVE_RTSCTS,
++static struct imxuart_platform_data uart0_pdata = {
++ .init = uart_mxc_port0_init,
++ .exit = uart_mxc_port0_exit,
++ .flags = 0,
+};
+
-+static struct resource imx_uart2_resources[] = {
-+ [0] = {
-+ .start = 0x00207000,
-+ .end = 0x002070FF,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = (UART2_MINT_RX),
-+ .end = (UART2_MINT_RX),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [2] = {
-+ .start = (UART2_MINT_TX),
-+ .end = (UART2_MINT_TX),
-+ .flags = IORESOURCE_IRQ,
-+ },
-+ [3] = {
-+ .start = UART2_MINT_RTS,
-+ .end = UART2_MINT_RTS,
-+ .flags = IORESOURCE_IRQ,
-+ },
++static int mxc_uart1_pins[] = {
++ PB28_PF_UART2_CTS,
++ PB29_PF_UART2_RTS,
++ PB30_PF_UART2_TXD,
++ PB31_PF_UART2_RXD
+};
+
-+static struct platform_device imx_uart2_device = {
-+ .name = "imx-uart",
-+ .id = 1,
-+ .num_resources = ARRAY_SIZE(imx_uart2_resources),
-+ .resource = imx_uart2_resources,
-+ .dev = {
-+ .platform_data = &uart2_pdata,
-+ }
++static int uart_mxc_port1_init(struct platform_device *pdev)
++{
++ return mxc_gpio_setup_multiple_pins(mxc_uart1_pins, ARRAY_SIZE(mxc_uart1_pins), "UART2");
++}
++
++static void uart_mxc_port1_exit(struct platform_device *pdev)
++{
++ mxc_gpio_release_multiple_pins(mxc_uart1_pins, ARRAY_SIZE(mxc_uart1_pins));
++}
++
++static struct imxuart_platform_data uart1_pdata = {
++ .init = uart_mxc_port1_init,
++ .exit = uart_mxc_port1_exit,
++ .flags = IMXUART_HAVE_RTSCTS,
+};
+
+#ifdef CONFIG_SPI_IMX
-+static struct resource imx_spi1_resource[] = {
-+ [0] = {
-+ .start = 0x00213000,
-+ .end = 0x00213fff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = CSPI_INT,
-+ .end = CSPI_INT,
-+ .flags = IORESOURCE_IRQ,
-+ }
-+};
++#define SPIDEV_CS (GPIO_PORTB + 18)
++#define MAX1027_CS (GPIO_PORTC + 15)
+
-+static struct spi_imx_master imx_spi1_master_info = {
-+ .num_chipselect = 2,
-+ .enable_dma = 0,
++static int apf9328_spi1_cs[] = {
++ MAX1027_CS,
++ SPIDEV_CS,
+};
+
-+static struct platform_device imx_spi1 = {
-+ .name = "spi_imx",
-+ .id = 1,
-+ .resource = imx_spi1_resource,
-+ .num_resources = ARRAY_SIZE(imx_spi1_resource),
-+ .dev = {
-+ .platform_data = &imx_spi1_master_info,
-+ },
++static const struct spi_imx_master imx_spi1_master_info = {
++ .chipselect = apf9328_spi1_cs,
++ .num_chipselect = ARRAY_SIZE(apf9328_spi1_cs),
+};
+
-+static struct resource imx_spi2_resource[] = {
-+ [0] = {
-+ .start = 0x00219000,
-+ .end = 0x00219fff,
-+ .flags = IORESOURCE_MEM,
-+ },
-+ [1] = {
-+ .start = SPI2_INT,
-+ .end = SPI2_INT,
-+ .flags = IORESOURCE_IRQ,
-+ }
-+};
++#define MCP251X_CS (GPIO_PORTB + 19)
++#define TSC2102_CS (GPIO_PORTB + 17)
+
-+static struct spi_imx_master imx_spi2_master_info = {
-+ .num_chipselect = 2,
-+ .enable_dma = 0,
++static int apf9328_spi2_cs[] = {
++ TSC2102_CS,
++ MCP251X_CS,
+};
+
-+static struct platform_device imx_spi2 = {
-+ .name = "spi_imx",
-+ .id = 2,
-+ .resource = imx_spi2_resource,
-+ .num_resources = ARRAY_SIZE(imx_spi2_resource),
-+ .dev = {
-+ .platform_data = &imx_spi2_master_info,
-+ },
++static const struct spi_imx_master imx_spi2_master_info = {
++ .chipselect = apf9328_spi2_cs,
++ .num_chipselect = ARRAY_SIZE(apf9328_spi2_cs),
+};
+#endif /* CONFIG_SPI_IMX */
+
@@ -394,28 +353,13 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ */
+#ifdef CONFIG_ARMADEUS_MAX1027
+#define IMX_SPI1_SS_PIN 15
-+#define IMX_SPI1_SS (1<<15)
-+#define MAX1027_EOC_INT 13
-+#define MAX1027_CNVST 14
++#define MAX1027_EOC_INT (GPIO_PORTA | 13)
++#define MAX1027_CNVST (GPIO_PORTA | 14)
+
+static int max1027_init(struct spi_device *spi)
+{
-+ /* SPI1 GPIOs */
-+ imx_gpio_mode(PC14_PF_SPI1_SCLK);
-+ imx_gpio_mode(PC16_PF_SPI1_MISO);
-+ imx_gpio_mode(PC17_PF_SPI1_MOSI);
-+
-+ /* configure CNVST */
-+ DR(0) |= 1 << MAX1027_CNVST; /* Initializes it High */
-+ imx_gpio_mode(GPIO_PORTA | MAX1027_CNVST | GPIO_OUT | GPIO_GIUS | GPIO_DR);
-+
-+ /* configure EOC */
-+ imx_gpio_mode(GPIO_PORTA | MAX1027_EOC_INT | GPIO_IN | GPIO_GIUS);
-+
-+ /* SPI CSn is used as chip select but in GPIO mode */
-+ DR(2) |= IMX_SPI1_SS;
-+ imx_gpio_mode(GPIO_PORTC | IMX_SPI1_SS_PIN | GPIO_OUT | GPIO_GIUS | GPIO_DR);
-+
++ mxc_gpio_mode(MAX1027_EOC_INT | GPIO_IN | GPIO_GPIO);
++ mxc_gpio_mode(MAX1027_CNVST | GPIO_OUT | GPIO_GPIO);
+ return 0;
+}
+
@@ -424,18 +368,6 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ return 0;
+}
+
-+static void max1027_cs(u32 command)
-+{
-+ if (command == SPI_CS_DEASSERT)
-+ DR(2) |= IMX_SPI1_SS;
-+ else
-+ DR(2) &= ~IMX_SPI1_SS;
-+}
-+
-+static struct spi_imx_chip max1027_hw = {
-+ .cs_control = max1027_cs,
-+};
-+
+static struct max1027_config apf9328_max1027_config = {
+ .conv = MAX1027_CONV_DEFAULT,
+ .setup = MAX1027_SETUP_DEFAULT,
@@ -451,9 +383,8 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+static struct spi_board_info spi_board_info[] __initdata = {
+{
+ .modalias = "max1027",
-+ .controller_data= &max1027_hw,
+ .max_speed_hz = 8000000,
-+ .bus_num = 1, /* SPI1 */
++ .bus_num = 0, /* SPI1 */
+ .chip_select = 0,
+ .mode = 0,
+ .irq = IRQ_GPIOA(MAX1027_EOC_INT),
@@ -484,8 +415,8 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ * The APF9328 can have up to 32MB NOR Flash
+ */
+static struct resource flash_resource = {
-+ .start = IMX_CS0_PHYS,
-+ .end = IMX_CS0_PHYS + (32 * 1024 * 1024) - 1,
++ .start = MX1_CS0_PHYS,
++ .end = MX1_CS0_PHYS + (32 * 1024 * 1024) - 1,
+ .flags = IORESOURCE_MEM,
+};
+
@@ -535,15 +466,33 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+};
+#endif /* CONFIG_MACH_APF9328_FPGA */
+
++#ifdef CONFIG_I2C_IMX
++static int mxc_i2c_pins[] = {
++ PA15_PF_I2C_SDA,
++ PA16_PF_I2C_SCL,
++};
++
++static int apf9328_i2c_init(struct platform_device *pdev)
++{
++ return mxc_gpio_setup_multiple_pins(mxc_i2c_pins,
++ ARRAY_SIZE(mxc_i2c_pins), "I2C");
++}
++
++static int apf9328_i2c_exit(struct platform_device *pdev)
++{
++ mxc_gpio_release_multiple_pins(mxc_i2c_pins, ARRAY_SIZE(mxc_i2c_pins));
++ return 0;
++}
++
++static const struct imxi2c_platform_data apf9328_i2c_data __initconst = {
++ .bitrate = 100000,
++ .init = apf9328_i2c_init,
++ .exit = apf9328_i2c_exit,
++};
++#endif /* CONFIG_I2C_IMX */
+
+static struct platform_device *devices[] __initdata = {
-+ &imx_uart1_device,
-+ &imx_uart2_device,
+ &dm9000x_device,
-+#ifdef CONFIG_SPI_IMX
-+ &imx_spi1,
-+ &imx_spi2,
-+#endif
+#ifdef CONFIG_PWM
+ &imx_pwm_device,
+#endif
@@ -563,22 +512,31 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+{
+ printk("--- Registering APF9328 ressources\n");
+
-+ /* Initializes serial port 1/console GPIOs */
-+ imx_gpio_mode(PC9_PF_UART1_CTS);
-+ imx_gpio_mode(PC10_PF_UART1_RTS);
-+ imx_gpio_mode(PC11_PF_UART1_TXD);
-+ imx_gpio_mode(PC12_PF_UART1_RXD);
++ mxc_gpio_setup_multiple_pins(apf9328_pins,
++ ARRAY_SIZE(apf9328_pins), "apf9328");
+
-+#ifdef CONFIG_USB_GADGET_IMX
-+ set_imx_usb_info(&apf9328_udc_0_data);
-+#endif
+
-+ platform_add_devices(devices, ARRAY_SIZE(devices));
++ imx1_add_imx_uart0(&uart0_pdata); /* console */
++ imx1_add_imx_uart1(&uart1_pdata);
+
++#ifdef CONFIG_SPI_IMX
++#if defined (CONFIG_ARMADEUS_MAX1027) || defined (CONFIG_SPIDEV)
++ mxc_gpio_mode(GPIO_PORTC | IMX_SPI1_SS_PIN | GPIO_OUT | GPIO_GPIO);
++ mxc_gpio_mode(GPIO_PORTA | 4 | GPIO_GPIO | GPIO_OUT);
++#endif
++ imx1_add_spi_imx0(&imx_spi1_master_info);
++ imx1_add_spi_imx1(&imx_spi2_master_info);
+#if defined (CONFIG_ARMADEUS_MAX1027)
+ spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
+#endif
-+
++#endif
++#ifdef CONFIG_I2C_IMX
++ imx1_add_i2c_imx(&apf9328_i2c_data);
++#endif
++#ifdef CONFIG_USB_GADGET_IMX
++ mxc_register_device(&imx_usb_device, &apf9328_udc_0_data);
++#endif
++ platform_add_devices(devices, ARRAY_SIZE(devices));
+ apf9328_baseboard_init();
+
+ printk("--- APF9328 ressources registered\n");
@@ -588,56 +546,52 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328.c
+ * Register here the memory addresses we want to access from our drivers and
+ * which are not already registered in generic.c
+ */
-+#ifdef CONFIG_FB_IMX
-+#define IMX_FB_PHYS (0x0C000000 - 0x40000)
-+#endif
+
+static struct map_desc apf9328_io_desc[] __initdata = {
-+#ifdef CONFIG_FB_IMX
-+ {
-+ .virtual = IMX_FB_VIRT,
-+ .pfn = __phys_to_pfn(IMX_FB_PHYS),
-+ .length = IMX_FB_SIZE,
-+ .type = MT_DEVICE
-+ },
-+#endif
+#ifdef CONFIG_MACH_APF9328_FPGA
+ /* FPGA Memory mapping */
-+ {.virtual = IMX_CS1_VIRT, .pfn = __phys_to_pfn(IMX_CS1_PHYS), .length = IMX_CS1_SIZE, .type = MT_DEVICE},
++ {.virtual = MX1_CS1_VIRT, .pfn = __phys_to_pfn(MX1_CS1_PHYS), .length = MX1_CS1_SIZE, .type = MT_DEVICE},
+#endif
+};
+
+void __init apf9328_map_io(void)
+{
-+ imx_map_io();
++ mx1_map_io();
+ iotable_init(apf9328_io_desc, ARRAY_SIZE(apf9328_io_desc));
++
+}
+
+static void __init apf9328_init_irq(void)
+{
+ /* Init generic IRQs */
-+ imx_init_irq();
++ mx1_init_irq();
+
+ /* Init our custom IRQs (DM9000) */
++
++ mxc_gpio_mode(GPIO_PORTB | 14 | GPIO_IN | GPIO_GPIO);
+ set_irq_type(APF9328_ETH_IRQ, IRQF_TRIGGER_FALLING);
+}
-+
++static void __init apf9328_timer_init(void)
++{
++ mx1_clocks_init(32768);
++}
++static struct sys_timer apf9328_timer = {
++ .init = apf9328_timer_init,
++};
+
+MACHINE_START(APF9328, "Armadeus APF9328")
+ /* Maintainer: Julien Boibessot, Armadeus */
-+ .phys_io = 0x00200000,
-+ .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
-+ .boot_params = 0x08000100,
++ .phys_io = MX1_IO_BASE_ADDR,
++ .io_pg_offst = (MX1_IO_BASE_ADDR_VIRT >> 18) & 0xfffc,
++ .boot_params = MX1_PHYS_OFFSET + 0x100,
+ .map_io = apf9328_map_io,
+ .init_irq = apf9328_init_irq,
-+ .timer = &imx_timer,
++ .timer = &apf9328_timer,
+ .init_machine = apf9328_init,
+MACHINE_END
-Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
-===================================================================
---- /dev/null
-+++ linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
-@@ -0,0 +1,301 @@
+--- /dev/null 2010-11-28 19:42:11.148000001 +0100
++++ b/arch/arm/mach-imx/apf9328_lcd_config.h 2010-12-19 11:20:34.000000000 +0100
+@@ -0,0 +1,355 @@
+/*
+ *
+ * Armadeus LCD configuration file
@@ -654,12 +608,14 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
+
+#ifdef CONFIG_FB_IMX
+
-+#include <mach/imxfb.h>
+#include <linux/delay.h>
+#include <mach/gpio.h>
++#include <linux/fb.h>
+
-+#ifdef CONFIG_ARCH_IMX
-+#define LCDC_BASE_ADDR IMX_LCDC_BASE
++#ifdef CONFIG_ARCH_MX1
++#include <mach/mx1.h>
++#define LCDC_BASE_ADDR MX1_LCDC_BASE_ADDR
++#define IO_ADDRESS MX1_IO_ADDRESS
+#endif
+#define LCDISR_EOF (1 << 1)
+
@@ -679,7 +635,7 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
+
+#ifdef CONFIG_MACH_APF9328
+static int apf9328_fb_init(struct platform_device *pdev);
-+static int apf9328_fb_exit(struct platform_device *pdev);
++static void apf9328_fb_exit(struct platform_device *pdev);
+#endif
+
+/*
@@ -688,7 +644,7 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
+static void apf_lcd_power(int on)
+{
+ u32 isr;
-+
++ printk("apf_lcd_power\n");
+ pr_debug("%s: %s\n", __func__, on ? "on":"off");
+ isr = 0;
+#ifdef CONFIG_FB_IMX_OPTREX_F51900_CSTN
@@ -704,8 +660,10 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
+ enabling the display */
+ /* Waits end of current frame */
+ isr = readl(IO_ADDRESS(LCDC_BASE_ADDR) + 0x40);
++ printk("isr %08x\n", isr);
+ do {
+ isr = readl(IO_ADDRESS(LCDC_BASE_ADDR) + 0x40);
++ printk("isr %08x\n", isr);
+ udelay(1000);
+ pr_debug("%08x\n", isr);
+ } while ((isr & LCDISR_EOF) == 0);
@@ -736,9 +694,11 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
+ pr_debug("%s: %s\n", __func__, on ? "on":"off");
+
+ pwmr = readl(IO_ADDRESS(LCDC_BASE_ADDR) + 0x2c);
++ printk("pwmr %08x\n", pwmr);
++
+#ifdef CONFIG_MACH_APF9328
+ if (pwmr)
-+ imx_gpio_mode(PD11_PF_CONTRAST);
++ mxc_gpio_mode(PD11_PF_CONTRAST);
+#endif
+ if (on) {
+ pwmr |= PWMR_CC_EN;
@@ -747,101 +707,121 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
+ }
+ writel(pwmr, IO_ADDRESS(LCDC_BASE_ADDR) + 0x2c);
+}
++static struct imx_fb_videomode mde[] = {
++ [0]={
++#ifdef CONFIG_FB_IMX_SHARP_LQ043_TFT
++ .mode = {
++ .name = "Sharp-LQ043",
++ .refresh = 60,
++ .xres = 480,
++ .yres = 272,
++ .pixclock = 125000, /* picoS -> ~8MHz */
++ .left_margin = 3, /* should be 2 but i.MX doesn't support it */
++ .right_margin = 2,
++ .upper_margin = 3,
++ .lower_margin = 2,
++ .hsync_len = 41,
++ .vsync_len = 10,
++ },
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
++ PCR_CLKPOL | PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(5),
++ .bpp = 16,
++#elif CONFIG_FB_IMX_MICROTIPS_MTF_T035_TFT
++ .mode = {
++ .name = "Microtips-T035",
++ .refresh = 60,
++ .xres = 320,
++ .yres = 240,
++ .pixclock = 156250, /* picoS -> ~6.4MHz */
++ .left_margin = 4,
++ .upper_margin = 20,
++ .right_margin = 69,
++ .lower_margin = 20,
++ .hsync_len = 31,
++ .vsync_len = 3,
++ },
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
++ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(7),
++ .bpp = 16,
++#elif CONFIG_FB_IMX_SHARP_LQ057_TFT
++ .mode = {
++ .name = "Sharp-LQ057",
++ .refresh = 60,
++ .xres = 320,
++ .yres = 240,
++ .pixclock = 158730, /* picoS -> ~6.3MHz */
++ .left_margin = 9,
++ .upper_margin = 0,
++ .right_margin = 27,
++ .lower_margin = 7,
++ .hsync_len = 9,
++ .vsync_len = 2,
++ },
++ .bpp = 16,
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | /*PCR_CLKPOL |*/
++ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(9),
++#elif CONFIG_FB_IMX_OPTREX_F51900_CSTN
++ .mode = {
++ .name = "Optrex-F51900",
++ .refresh = 60,
++ .xres = 320,
++ .yres = 240,
++ .pixclock = 62500,
++ .left_margin = 2,
++ .upper_margin = 2,
++ .right_margin = 2,
++ .lower_margin = 2,
++ .hsync_len = 2,
++ .vsync_len = 2,
++ },
++ .bpp = 8,
++ .pcr = PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_8 | PCR_ACD(5) |
++ PCR_END_BYTE_SWAP | PCR_PCD(3),
++#elif CONFIG_FB_IMX_MOTOROLA_A910_TFT
++ .mode = {
++ .name = "Motorola-A910",
++ .refresh = 60,
++ .xres = 240,
++ .yres = 320,
++ .pixclock = 158730, /* picoS -> ~6.3MHz */
++ .left_margin = 9,
++ .upper_margin = 2,
++ .right_margin = 27,
++ .lower_margin = 4,
++ .hsync_len = 9,
++ .vsync_len = 2,
++ },
++ .bpp = 16,
++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_CLKPOL |
++ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(9),
++#endif
++ },
++};
+
+#ifdef CONFIG_MACH_APF9328
+static struct imx_fb_platform_data apf9328_fb_info /*__initdata*/ = {
-+#elif CONFIG_MACH_APF27
-+static struct imx_fb_platform_data apf27_fb_data = {
+#endif
++ .mode = mde,
++ .num_modes = ARRAY_SIZE(mde),
+#ifdef CONFIG_FB_IMX_SHARP_LQ043_TFT
-+ .pixclock = 125000, /* picoS -> ~8MHz */
-+ .bpp = 16,
-+ .xres = 480,
-+ .yres = 272,
-+
-+ .hsync_len = 41,
-+ .vsync_len = 10,
-+ .left_margin = 3, /* should be 2 but i.MX doesn't support it */
-+ .upper_margin = 3,
-+ .right_margin = 2,
-+ .lower_margin = 2,
-+
-+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
-+ PCR_CLKPOL | PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(5),
+ .pwmr = 0x000003ff, /* Contrast with PWM @ Pixel clock / 256, max width by default */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .backlight_power= apf_lcd_backlight_power,
+ .lcd_power = apf_lcd_power,
+#elif CONFIG_FB_IMX_MICROTIPS_MTF_T035_TFT
-+ .pixclock = 156250, /* picoS -> ~6.4MHz */
-+ .bpp = 16,
-+ .xres = 320,
-+ .yres = 240,
-+
-+ .hsync_len = 31,
-+ .vsync_len = 3,
-+ .left_margin = 4,
-+ .upper_margin = 20,
-+ .right_margin = 69,
-+ .lower_margin = 20,
-+
-+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL |
-+ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(7),
+ .pwmr = 0x00000150, /* Contrast with PWM @ Line Pulse / 256, medium width by default */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .backlight_power= apf_lcd_backlight_power,
+ .lcd_power = apf_lcd_power,
+#elif CONFIG_FB_IMX_SHARP_LQ057_TFT
-+ .pixclock = 158730, /* picoS -> ~6.3MHz */
-+ .bpp = 16,
-+ .xres = 320,
-+ .yres = 240,
-+
-+ .hsync_len = 9,
-+ .vsync_len = 2,
-+ .left_margin = 9,
-+ .upper_margin = 0,
-+ .right_margin = 27,
-+ .lower_margin = 7,
-+
-+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | /*PCR_CLKPOL |*/
-+ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(9),
+ .pwmr = 0, /* No contrast management */
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .lcd_power = apf_lcd_power,
+#elif CONFIG_FB_IMX_OPTREX_F51900_CSTN
-+ .pixclock = 62500,
-+ .bpp = 8,
-+ .xres = 320,
-+ .yres = 240,
-+
-+ .hsync_len = 2,
-+ .vsync_len = 2,
-+ .left_margin = 2,
-+ .upper_margin = 2,
-+ .right_margin = 2,
-+ .lower_margin = 2,
-+
-+ .pcr = PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_8 | PCR_ACD(5) |
-+ PCR_END_BYTE_SWAP | PCR_PCD(3),
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .pwmr = 0, /* No contrast management */
+ .lcd_power = apf_lcd_power,
+#elif CONFIG_FB_IMX_MOTOROLA_A910_TFT
-+ .pixclock = 158730, /* picoS -> ~6.3MHz */
-+ .bpp = 16,
-+ .xres = 240,
-+ .yres = 320,
-+
-+ .hsync_len = 9,
-+ .vsync_len = 2,
-+ .left_margin = 9,
-+ .upper_margin = 2,
-+ .right_margin = 27,
-+ .lower_margin = 4,
-+
-+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | PCR_BPIX_16 | PCR_CLKPOL |
-+ PCR_SCLKIDLE | PCR_SCLK_SEL | PCR_PCD(9),
+ .dmacr = DEFAULT_DMA_SETTINGS,
+ .pwmr = 0, /* No contrast management */
+ .lcd_power = apf_lcd_power,
@@ -856,7 +836,32 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
+ .exit = apf27_fb_exit,
+#endif
+};
++static struct resource imxfb_resources[] = {
++ [0] = {
++ .start = MX1_LCDC_BASE_ADDR,
++ .end = MX1_LCDC_BASE_ADDR +0xFF,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = MX1_LCDC_INT,
++ .end = MX1_LCDC_INT,
++ .flags = IORESOURCE_IRQ,
++ },
++};
+
++static u64 fb_dma_mask = ~(u64)0;
++
++static struct platform_device imxfb_device = {
++ .name = "imx-fb",
++ .id = 0,
++ .dev = {
++ //.platform_data = &apf9328_fb_info,
++ .dma_mask = &fb_dma_mask,
++ .coherent_dma_mask = 0xffffffff,
++ },
++ .num_resources = ARRAY_SIZE(imxfb_resources),
++ .resource = imxfb_resources,
++};
+/*
+ * Configure all GPIOs needed by LCDs
+ */
@@ -865,85 +870,86 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328_lcd_config.h
+{
+ struct imx_fb_platform_data *fb_inf = &apf9328_fb_info;
+ int width;
-+
++ printk("apf9328_fb_init\n");
+ pr_debug("%s\n", __func__);
+
+#ifdef CONFIG_FB_IMX_OPTREX_F51900_CSTN
+ gpio_set_value(OPTREX_F51900_POWER_DOWN, 1); /* Initializes it High */
-+ imx_gpio_mode(OPTREX_F51900_POWER_DOWN | GPIO_OUT | GPIO_DR);
++ mxc_gpio_mode(OPTREX_F51900_POWER_DOWN | GPIO_OUT | GPIO_DR);
+#endif
+#ifdef CONFIG_FB_IMX_SHARP_LQ043_TFT
+ /* ACD_OE (SHARP_LQ043_POWER_DOWN) used as power down signal */
+ gpio_set_value(SHARP_LQ043_POWER_DOWN, 0); /* Initializes it Low */
-+ imx_gpio_mode(SHARP_LQ043_POWER_DOWN | GPIO_OUT | GPIO_GIUS | GPIO_DR);
++ mxc_gpio_mode(SHARP_LQ043_POWER_DOWN | GPIO_OUT | GPIO_GPIO);//1<<16 | 3<<10);
+#else
+ /* otherwise use ACD_OE as standard LCD controller signal */
-+ imx_gpio_mode(PD12_PF_ACD_OE);
++ mxc_gpio_mode(PD12_PF_ACD_OE);
+#endif
+
-+ if (fb_inf->pcr & PCR_TFT)
++ if (fb_inf->mode->pcr & PCR_TFT)
+ width = 16;
+ else
-+ width = 1 << ((fb_inf->pcr >> 28) & 0x3);
++ width = 1 << ((fb_inf->mode->pcr >> 28) & 0x3);
+
+ switch (width) {
+ case 16:
-+ imx_gpio_mode(PD30_PF_LD15);
-+ imx_gpio_mode(PD29_PF_LD14);
-+ imx_gpio_mode(PD28_PF_LD13);
-+ imx_gpio_mode(PD27_PF_LD12);
-+ imx_gpio_mode(PD26_PF_LD11);
-+ imx_gpio_mode(PD25_PF_LD10);
-+ imx_gpio_mode(PD24_PF_LD9);
-+ imx_gpio_mode(PD23_PF_LD8);
++ mxc_gpio_mode(PD30_PF_LD15);
++ mxc_gpio_mode(PD29_PF_LD14);
++ mxc_gpio_mode(PD28_PF_LD13);
++ mxc_gpio_mode(PD27_PF_LD12);
++ mxc_gpio_mode(PD26_PF_LD11);
++ mxc_gpio_mode(PD25_PF_LD10);
++ mxc_gpio_mode(PD24_PF_LD9);
++ mxc_gpio_mode(PD23_PF_LD8);
+ case 8:
-+ imx_gpio_mode(PD22_PF_LD7);
-+ imx_gpio_mode(PD21_PF_LD6);
-+ imx_gpio_mode(PD20_PF_LD5);
-+ imx_gpio_mode(PD19_PF_LD4);
++ mxc_gpio_mode(PD22_PF_LD7);
++ mxc_gpio_mode(PD21_PF_LD6);
++ mxc_gpio_mode(PD20_PF_LD5);
++ mxc_gpio_mode(PD19_PF_LD4);
+ case 4:
-+ imx_gpio_mode(PD18_PF_LD3);
-+ imx_gpio_mode(PD17_PF_LD2);
++ mxc_gpio_mode(PD18_PF_LD3);
++ mxc_gpio_mode(PD17_PF_LD2);
+ case 2:
-+ imx_gpio_mode(PD16_PF_LD1);
++ mxc_gpio_mode(PD16_PF_LD1);
+ case 1:
-+ imx_gpio_mode(PD15_PF_LD0);
++ mxc_gpio_mode(PD15_PF_LD0);
+ }
+
-+ imx_gpio_mode(PD6_PF_LSCLK);
-+ imx_gpio_mode(PD14_PF_FLM_VSYNC);
-+ imx_gpio_mode(PD13_PF_LP_HSYNC);
++ mxc_gpio_mode(PD6_PF_LSCLK);
++ mxc_gpio_mode(PD14_PF_FLM_VSYNC);
++ mxc_gpio_mode(PD13_PF_LP_HSYNC);
+
+ /* Sharp's HR TFT displays specific */
-+ if (fb_inf->pcr & PCR_SHARP) {
-+ imx_gpio_mode(PD7_PF_REV);
-+ imx_gpio_mode(PD8_PF_CLS);
-+ imx_gpio_mode(PD9_PF_PS);
-+ imx_gpio_mode(PD10_PF_SPL_SPR);
++ if (fb_inf->mode->pcr & PCR_SHARP) {
++ mxc_gpio_mode(PD7_PF_REV);
++ mxc_gpio_mode(PD8_PF_CLS);
++ mxc_gpio_mode(PD9_PF_PS);
++ mxc_gpio_mode(PD10_PF_SPL_SPR);
+ }
+
-+ gpio_set_value(CONTRAST_LINE, 0); /* Initializes it Low */
+ /* GPIO Function for CONTRAST pin */
-+ imx_gpio_mode(CONTRAST_LINE | GPIO_OUT | GPIO_GIUS | GPIO_DR);
++ gpio_set_value(CONTRAST_LINE, 0); /* Initializes it Low */
++ mxc_gpio_mode(CONTRAST_LINE | GPIO_OUT /*| GPIO_GPIO*/ | 1<<16 | 3<<10);
+
+ return 0;
+}
+
-+static int apf9328_fb_exit(struct platform_device *pdev)
++static void apf9328_fb_exit(struct platform_device *pdev)
+{
+ /* TO BE DONE */
-+ return 0;
++}
++static void apf9328_init_lcd(void)
++{
++ mxc_register_device(&imxfb_device, &apf9328_fb_info);
+}
+#endif /* CONFIG_MACH_APF9328 */
+
+#endif /* CONFIG_FB_IMX */
+
+#endif /* APF_LCD_CONFIG_H */
-Index: linux-2.6.29.6/arch/arm/mach-imx/include/mach/apf9328.h
-===================================================================
---- /dev/null
-+++ linux-2.6.29.6/arch/arm/mach-imx/include/mach/apf9328.h
-@@ -0,0 +1,68 @@
+--- /dev/null 2010-11-28 19:42:11.148000001 +0100
++++ b/arch/arm/plat-mxc/include/mach/board-apf9328.h 2010-12-19 11:20:34.000000000 +0100
+@@ -0,0 +1,71 @@
+/*
+ * linux/include/asm-arm/arch-imx/apf9328.h
+ *
@@ -973,12 +979,15 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/include/mach/apf9328.h
+/* ------------------------------------------------------------------------ */
+
+/* Ethernet */
++#define IMX_CS4_VIRT 0xed000000
++#define IMX_CS0_VIRT 0xe8000000
++#define IMX_CS1_VIRT 0xea000000
+#define APF9328_ETH_VIRT ( IMX_CS4_VIRT + 0x00C00000 )
-+#define APF9328_ETH_PHYS ( IMX_CS4_PHYS + 0x00C00000 )
++#define APF9328_ETH_PHYS ( MX1_CS4_PHYS + 0x00C00000 )
+#define APF9328_ETH_IRQ ( IRQ_GPIOB(14) )
+
+/* FLASH */
-+#define APF9328_FLASH_PHYS IMX_CS0_PHYS
++#define APF9328_FLASH_PHYS MX1_CS0_PHYS
+#ifdef CONFIG_IMX_APF9328_FLASH_8MB
+# define APF9328_FLASH_SIZE 0x00800000
+#endif
@@ -993,7 +1002,7 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/include/mach/apf9328.h
+#define ARMADEUS_FPGA_IRQ ( APF9328_FPGA_IRQ )
+
+#define APF9328_FPGA_VIRT ( IMX_CS1_VIRT )
-+#define APF9328_FPGA_PHYS ( IMX_CS1_PHYS )
++#define APF9328_FPGA_PHYS ( MX1_CS1_PHYS )
+#define APF9328_FPGA_IRQ ( IRQ_GPIOA(1) )
+
+#define CLK32 32768
@@ -1012,11 +1021,9 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/include/mach/apf9328.h
+#endif
+
+#endif /* __ASM_ARCH_APF9328_H */
-Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
-===================================================================
---- /dev/null
-+++ linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
-@@ -0,0 +1,338 @@
+--- /dev/null 2010-11-28 19:42:11.148000001 +0100
++++ b/arch/arm/mach-imx/apf9328-dev.c 2010-12-19 11:34:40.000000000 +0100
+@@ -0,0 +1,326 @@
+/*
+ * linux/arch/arm/mach-imx/apf9328-dev.c
+ * Declares hardware present on APF9328_DevLight or DevFull boards
@@ -1045,8 +1052,10 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#include <linux/interrupt.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spidev.h>
++#include <mach/common.h>
++#include <mach/gpio.h>
+#include <linux/spi/tsc2102.h>
-+#include "../../../drivers/net/can/mcp251x.h"
++#include <linux/can/platform/mcp251x.h>
+
+#include <asm/system.h>
+#include <mach/hardware.h>
@@ -1060,14 +1069,18 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#include <mach/imx-uart.h>
+#include <mach/mmc.h>
+#include <mach/usb.h>
-+#include <mach/spi_imx.h>
-+#include <mach/imx-regs.h> /* imx_gpio_mode() */
++#include <mach/spi.h>
++#include <mach/mx1.h> /* mxc_gpio_mode() */
+#include <mach/gpio.h>
-+#include <mach/imx-alsa.h>
-+#include <linux/usb/isp116x.h>
-+#include <mach/imx_ssi.h>
-+
-+#include "generic.h"
++//#include <mach/imx-alsa.h>
++//#include <linux/usb/isp116x.h>
++#include <linux/usb/isp1760.h>
++#include <mach/ssi.h>
++#include <mach/iomux-mx1.h>
++#include <mach/iomux-v1.h>
++#include "devices.h"
++#include <mach/imxfb.h>
++//#include "generic.h"
+
+
+#ifdef CONFIG_SPI_TSC2102_MODULE
@@ -1082,14 +1095,16 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#ifdef CONFIG_SPI_SPIDEV_MODULE
+#define CONFIG_SPI_SPIDEV 1
+#endif
-+
++#ifdef CONFIG_MMC_IMX_MODULE
++#define CONFIG_MMC_IMX 1
++#endif
+
+
+/*
+ * APF9328_DevFull board has an ISP1761 USB Host controller
+ */
+#ifdef CONFIG_ARMADEUS_ISP1761
-+#define ISP1761_BASE IMX_CS3_PHYS
++#define ISP1761_BASE MX1_CS3_PHYS
+#define ISP1761_GPIO_IRQ (GPIO_PORTC | 10)
+#define ISP1761_IRQ (IRQ_GPIOC(10))
+
@@ -1123,41 +1138,25 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#ifdef CONFIG_SPI_TSC2102
+#define TSC2102_CS_GPIOB 17
+#define TSC2102_INT_GPIOD 8
-+
++#define SPI2_RXD_SEL (1<<8)
++#define FMCR MX1_IO_ADDRESS(MX1_SCM_BASE_ADDR)+4
+static int tsc2102_init_gpio(void)
+{
+ /* Activate SPI2 port ---- */
-+ /* PortB 17 is used as chip select (in GPIO mode) */
-+ DR(1) |= 1 << TSC2102_CS_GPIOB; /* Initializes it High */
-+ imx_gpio_mode(GPIO_PORTB | TSC2102_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR);
+ /* Configure SPI2 outputs */
-+ imx_gpio_mode(PD7_AIN_SPI2_SCLK);
-+ imx_gpio_mode(PD10_AIN_SPI2_TXD);
-+ imx_gpio_mode(PD9_AOUT_SPI2_RXD);
-+ FMCR |= SPI2_RXD_SEL; /* RX is AOUT on PORTD */
++ mxc_gpio_mode(PD7_AIN_SPI2_SCLK);
++ mxc_gpio_mode(PD10_AIN_SPI2_TXD);
++ mxc_gpio_mode(PD9_AOUT_SPI2_RXD);
++ __raw_writel(__raw_readl(FMCR)|SPI2_RXD_SEL,FMCR);
+
+ /* PortD 8 is used as PINTDAV interrupt */
++ mxc_gpio_mode(GPIO_PORTD | TSC2102_INT_GPIOD | GPIO_IN | GPIO_GPIO);
+ set_irq_type(IRQ_GPIOD(TSC2102_INT_GPIOD), IRQF_TRIGGER_FALLING);
-+ imx_gpio_mode(GPIO_PORTD | TSC2102_INT_GPIOD | GPIO_IN | GPIO_GIUS);
+
+ printk("TSC2102 GPIOs initialized\n");
+ return 0;
+}
+
-+/* Chip select command for TSC2102 */
-+static void tsc2102_cs(u32 command)
-+{
-+ /* PortB 19 is used as chip select */
-+ if (command == SPI_CS_DEASSERT)
-+ DR(1) |= 1<< TSC2102_CS_GPIOB;
-+ else
-+ DR(1) &= ~(1<< TSC2102_CS_GPIOB);
-+}
-+
-+static struct spi_imx_chip tsc2102_hw = {
-+ .cs_control = tsc2102_cs,
-+};
-+
+static struct tsc210x_config apf9328_tsc2102_config = {
+ .use_internal = 1, /* -> use internal voltage reference */
+ .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP,
@@ -1190,6 +1189,7 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#define CAN_MPC251X_INT_GPIOC 13
+
+/* Chip select command for MCP251X */
++#if 0
+static void mcp251X_cs(u32 command)
+{
+ /* PortB 19 is used as chip select */
@@ -1202,28 +1202,30 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+static struct spi_imx_chip mcp251X_hw = {
+ .cs_control = mcp251X_cs,
+};
-+
++#endif
+static void mcp251X_init_gpio(void)
+{
++#if 0
+ /* PortB 19 is used as chip select (in GPIO mode) */
+ DR(1) |= 1 << CAN_MPC251X_CS_GPIOB; /* Initializes it High */
-+ imx_gpio_mode(GPIO_PORTB | CAN_MPC251X_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR);
++ mxc_gpio_mode(GPIO_PORTB | CAN_MPC251X_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR);
+
+ /* PortC 13 is used as CAN interrupt */
+ set_irq_type(IRQ_GPIOC(CAN_MPC251X_INT_GPIOC), IRQF_TRIGGER_FALLING);
-+ imx_gpio_mode(GPIO_PORTC | CAN_MPC251X_INT_GPIOC | GPIO_IN | GPIO_GIUS);
++ mxc_gpio_mode(GPIO_PORTC | CAN_MPC251X_INT_GPIOC | GPIO_IN | GPIO_GIUS);
+
+ /* Configure SPI2 outputs */
-+ imx_gpio_mode(PD7_AIN_SPI2_SCLK);
-+ imx_gpio_mode(PD10_AIN_SPI2_TXD);
-+ imx_gpio_mode(PD9_AOUT_SPI2_RXD);
++ mxc_gpio_mode(PD7_AIN_SPI2_SCLK);
++ mxc_gpio_mode(PD10_AIN_SPI2_TXD);
++ mxc_gpio_mode(PD9_AOUT_SPI2_RXD);
+ FMCR |= SPI2_RXD_SEL; /* RX is AOUT on PORTD */
++#endif
+}
-+
+static struct mcp251x_platform_data apf9328_mcp251x_config = {
+ .oscillator_frequency = 16000000,
++ .model = CAN_MCP251X_MCP2515,
+ .board_specific_setup = NULL,
-+ .device_reset = NULL,
++ //.device_reset = NULL,
+ .transceiver_enable = NULL,
+};
+
@@ -1233,36 +1235,11 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+ * APF9328 CONFIG SPIDEV
+ */
+#ifdef CONFIG_SPI_SPIDEV
-+#define SPIDEV_CS_GPIOB 18
-+
+static int spidev_init_gpio(void)
+{
-+ /* SPI1 GPIOs */
-+ imx_gpio_mode(PC14_PF_SPI1_SCLK);
-+ imx_gpio_mode(PC16_PF_SPI1_MISO);
-+ imx_gpio_mode(PC17_PF_SPI1_MOSI);
-+
-+ /* PortB 18 is used as chip select (in GPIO mode) */
-+ DR(1) |= 1 << SPIDEV_CS_GPIOB; /* Initializes it High */
-+ imx_gpio_mode(GPIO_PORTB | SPIDEV_CS_GPIOB | GPIO_OUT | GPIO_GIUS | GPIO_DR);
-+
+ return 0;
+}
+
-+/* Chip select command for spidev */
-+static void spidev_cs(u32 command)
-+{
-+ /* PortB 18 is used as chip select */
-+ if (command == SPI_CS_DEASSERT)
-+ DR(1) |= 1<< SPIDEV_CS_GPIOB;
-+ else
-+ DR(1) &= ~(1<< SPIDEV_CS_GPIOB);
-+}
-+
-+static struct spi_imx_chip spidev_hw = {
-+ .cs_control = spidev_cs,
-+};
-+
+static struct spidev_platform_data apf9328_spidev_config = {
+ .init = spidev_init_gpio,
+};
@@ -1274,9 +1251,9 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#ifdef CONFIG_SPI_TSC2102
+{
+ .modalias = "tsc210x",
-+ .controller_data= &tsc2102_hw,
++// .controller_data= &tsc2102_hw,
+ .max_speed_hz = 8000000,
-+ .bus_num = 2, /* SPI2 */
++ .bus_num = 1, /* SPI2 */
+ .irq = IRQ_GPIOD(TSC2102_INT_GPIOD),
+ .chip_select = 0,
+ .mode = 0,
@@ -1287,8 +1264,8 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+{
+ .modalias = "mcp251x",
+ .max_speed_hz = 8000000, /* 8MHz */
-+ .controller_data= &mcp251X_hw,
-+ .bus_num = 2,
++ //.controller_data= &mcp251X_hw,
++ .bus_num = 1,
+ .mode = SPI_MODE_0,
+ .chip_select = 1,
+ .irq = IRQ_GPIOC( CAN_MPC251X_INT_GPIOC ),
@@ -1298,9 +1275,8 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#ifdef CONFIG_SPI_SPIDEV
+{
+ .modalias = "spidev",
-+ .controller_data = &spidev_hw,
+ .max_speed_hz = 8000000, /* 8MHz */
-+ .bus_num = 1, /* SPI1 */
++ .bus_num = 0, /* SPI1 */
+ .mode = SPI_MODE_0,
+ .chip_select = 1,
+ .platform_data = &apf9328_spidev_config,
@@ -1308,6 +1284,18 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#endif /* CONFIG_SPI_SPIDEV */
+};
+
++#ifdef CONFIG_I2C
++static struct i2c_board_info apf9328_i2c_devices_bus0[] = {
++ [0] = {
++ .type = "ds1374",
++ .flags = 0, /* FIXME */
++ .addr = 0x68,
++ .platform_data = NULL,
++ .irq = 0,
++ },
++};
++#endif
++
+/*
+ * You may connect several types of LCD on these boards
+ */
@@ -1316,7 +1304,6 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#include "apf9328_lcd_config.h"
+#endif
+
-+
+static struct platform_device *devices[] __initdata = {
+#if defined(CONFIG_SND_IMX_TSC2102) || defined(CONFIG_SND_IMX_TSC2102_MODULE)
+ &tsc2102_alsa_device,
@@ -1324,31 +1311,39 @@ Index: linux-2.6.29.6/arch/arm/mach-imx/apf9328-dev.c
+#ifdef CONFIG_ARMADEUS_ISP1761
+ &devfull_isp1761_device,
+#endif
++#ifdef CONFIG_MMC_IMX
++ &imx_mmc_device,
++#endif
+};
+
+void __init apf9328_baseboard_init(void)
+{
+ printk(" Registering APF9328_Dev ressources:");
-+
+ /* Initializes serial port 2 GPIOs */
-+ imx_gpio_mode(PB30_PF_UART2_TXD);
-+ imx_gpio_mode(PB31_PF_UART2_RXD);
-+ imx_gpio_mode(PB28_PF_UART2_CTS);
-+ imx_gpio_mode(PB29_PF_UART2_RTS);
++ mxc_gpio_mode(PB30_PF_UART2_TXD);
++ mxc_gpio_mode(PB31_PF_UART2_RXD);
++ mxc_gpio_mode(PB28_PF_UART2_CTS);
++ mxc_gpio_mode(PB29_PF_UART2_RTS);
+
+#ifdef CONFIG_FB_IMX
-+ set_imx_fb_info(&apf9328_fb_info);
++ apf9328_init_lcd();
+#endif
+#ifdef CONFIG_CAN_MCP251X
+ mcp251X_init_gpio();
+#endif
++#ifdef CONFIG_I2C
++ i2c_register_board_info(0,apf9328_i2c_devices_bus0,
++ ARRAY_SIZE(apf9328_i2c_devices_bus0));
++#endif
+#ifdef CONFIG_ARMADEUS_ISP1761
++ mxc_gpio_mode(ISP1761_GPIO_IRQ | GPIO_IN | GPIO_GPIO);
+ set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
-+ imx_gpio_mode(ISP1761_GPIO_IRQ | GPIO_IN | GPIO_GIUS);
+#endif
+ platform_add_devices(devices, ARRAY_SIZE(devices));
+
+#if defined (CONFIG_SPI_TSC2102) || defined (CONFIG_CAN_MCP251X) || defined(CONFIG_SPI_SPIDEV)
++ mxc_gpio_mode(GPIO_PORTB | 19 | GPIO_GPIO | GPIO_OUT);
++ mxc_gpio_mode(GPIO_PORTB | 17 | GPIO_GPIO | GPIO_OUT);
+ spi_register_board_info(spi_dev_board_info, ARRAY_SIZE(spi_dev_board_info));
+#endif
+
hooks/post-receive
--
armadeus
|