[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.2-280-g69d9a4e
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2013-06-11 05:02:35
|
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 69d9a4e0096a27b85d24321e024348676b0a014f (commit)
from c6ead1e594061691245b2be8312849251dbae31c (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 69d9a4e0096a27b85d24321e024348676b0a014f
Author: Julien Boibessot <jul...@ar...>
Date: Tue Jun 11 07:01:13 2013 +0200
[LINUX] 3.4: re-introduce 3.4 Linux support (for APF28 only), to have a xenomai working version on APF28.
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf28/apf28-linux-3.4.48.config | 1 +
.../device/armadeus/apf28/apf28-linux-3.4.config | 192 ++++
patches/linux/3.4.48 | 1 +
...50-fix-signed-12bits-to-32bits-conversion.patch | 33 +
...o-mxs-add_support_for_both_edge_interrupt.patch | 77 ++
...50-armadeus-add_custom_drivers_to_kconfig.patch | 24 +
..._star_completion_for_source_in_menuconfig.patch | 77 ++
.../450-armadeus-add_apf28_module_support.patch | 184 ++++
...1-armadeus-add_apf28dev_baseboard_support.patch | 294 ++++++
.../linux/3.4/454-armadeus-add-spi-support.patch | 19 +
...a-raw-and-processed-elements-to-info-mask.patch | 72 ++
...ix-lib-add-support-for-stmp-style-devices.patch | 184 ++++
...nction-for-initializing-triggered-buffers.patch | 186 ++++
.../800-armadeus-staging-iio-add_mxs_lradc.patch | 737 ++++++++++++++
...-armadeus-spi-add-spi-mxs-mainline-driver.patch | 1015 ++++++++++++++++++++
...device-tree-mapping-table-parsing-support.patch | 537 +++++++++++
...kumar-pinctrl-replace-list-with-get_count.patch | 634 ++++++++++++
...05-brown-clkdev-implement-managed-clk-get.patch | 137 +++
...ree-move-devicetree-support-code-into-spi.patch | 353 +++++++
...inctrl-implement-pinctrl-deferred-probing.patch | 82 ++
...n-pinctrl-implement-devm_pintctrl_get-put.patch | 296 ++++++
...epare-unprepare-transfer-if-not-populated.patch | 44 +
...-out-the-ssp-clock-configuration-function.patch | 100 ++
...2-armadeus-adding_rtc_stmp3xx_declaration.patch | 20 +
24 files changed, 5299 insertions(+), 0 deletions(-)
create mode 120000 buildroot/target/device/armadeus/apf28/apf28-linux-3.4.48.config
create mode 100644 buildroot/target/device/armadeus/apf28/apf28-linux-3.4.config
create mode 120000 patches/linux/3.4.48
create mode 100644 patches/linux/3.4/0001-Input-mma8450-fix-signed-12bits-to-32bits-conversion.patch
create mode 100644 patches/linux/3.4/0206-armadeus-mxs-gpio-mxs-add_support_for_both_edge_interrupt.patch
create mode 100644 patches/linux/3.4/050-armadeus-add_custom_drivers_to_kconfig.patch
create mode 100644 patches/linux/3.4/441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
create mode 100644 patches/linux/3.4/450-armadeus-add_apf28_module_support.patch
create mode 100644 patches/linux/3.4/451-armadeus-add_apf28dev_baseboard_support.patch
create mode 100644 patches/linux/3.4/454-armadeus-add-spi-support.patch
create mode 100644 patches/linux/3.4/799-2012-04-18-kernel-staging-iio-add-a-raw-and-processed-elements-to-info-mask.patch
create mode 100644 patches/linux/3.4/799-2012-04-20-pengutronix-lib-add-support-for-stmp-style-devices.patch
create mode 100644 patches/linux/3.4/799-2012-06-19-metafoo-iio-add-helper-function-for-initializing-triggered-buffers.patch
create mode 100644 patches/linux/3.4/800-armadeus-staging-iio-add_mxs_lradc.patch
create mode 100644 patches/linux/3.4/801-armadeus-spi-add-spi-mxs-mainline-driver.patch
create mode 100644 patches/linux/3.4/801a-2012-03-23-warren-pinctrl-core-device-tree-mapping-table-parsing-support.patch
create mode 100644 patches/linux/3.4/801a-2012-03-30-kumar-pinctrl-replace-list-with-get_count.patch
create mode 100644 patches/linux/3.4/801a-2012-04-05-brown-clkdev-implement-managed-clk-get.patch
create mode 100644 patches/linux/3.4/801a-2012-04-07-secretlab-spi-devicetree-move-devicetree-support-code-into-spi.patch
create mode 100644 patches/linux/3.4/801a-2012-04-10-walleij-pinctrl-implement-pinctrl-deferred-probing.patch
create mode 100644 patches/linux/3.4/801a-2012-04-16-warren-pinctrl-implement-devm_pintctrl_get-put.patch
create mode 100644 patches/linux/3.4/801a-2012-05-10-ti-spi-dont-call-prepare-unprepare-transfer-if-not-populated.patch
create mode 100644 patches/linux/3.4/801a-2012-08-03-denx-mmc-spi-pull-out-the-ssp-clock-configuration-function.patch
create mode 100644 patches/linux/3.4/802-armadeus-adding_rtc_stmp3xx_declaration.patch
diff --git a/buildroot/target/device/armadeus/apf28/apf28-linux-3.4.48.config b/buildroot/target/device/armadeus/apf28/apf28-linux-3.4.48.config
new file mode 120000
index 0000000..ba0c3a3
--- /dev/null
+++ b/buildroot/target/device/armadeus/apf28/apf28-linux-3.4.48.config
@@ -0,0 +1 @@
+apf28-linux-3.4.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf28/apf28-linux-3.4.config b/buildroot/target/device/armadeus/apf28/apf28-linux-3.4.config
new file mode 100644
index 0000000..c50a91d
--- /dev/null
+++ b/buildroot/target/device/armadeus/apf28/apf28-linux-3.4.config
@@ -0,0 +1,192 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_EMBEDDED=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_BSD_DISKLABEL=y
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_MXS=y
+CONFIG_MACH_MX28EVK=y
+CONFIG_MACH_APF28=y
+CONFIG_MACH_APF28_DEV=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CPU_IDLE=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_PNP=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+CONFIG_IPV6=y
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+CONFIG_CAN_VCAN=m
+CONFIG_CAN_FLEXCAN=m
+CONFIG_BT=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_CFG80211=m
+CONFIG_NL80211_TESTMODE=y
+CONFIG_LIB80211=m
+CONFIG_MAC80211=m
+CONFIG_MAC80211_RC_PID=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_FW_LOADER=m
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_GPMI_NAND=y
+CONFIG_MTD_UBI=y
+CONFIG_EEPROM_AT24=y
+CONFIG_EEPROM_AT25=y
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=y
+CONFIG_BLK_DEV_SR=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SCH=y
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_NETDEVICES=y
+CONFIG_RTL8187=m
+CONFIG_RT2X00=m
+CONFIG_RT73USB=m
+CONFIG_WL12XX_MENU=m
+CONFIG_WL12XX=m
+CONFIG_WL12XX_SDIO=m
+CONFIG_ZD1211RW=m
+CONFIG_INPUT_JOYDEV=y
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_MXS_AUART=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MXS=y
+CONFIG_SPI=y
+CONFIG_SPI_BITBANG=m
+CONFIG_SPI_SPIDEV=m
+CONFIG_GPIO_SYSFS=y
+CONFIG_HWMON=m
+CONFIG_WATCHDOG=y
+CONFIG_MEDIA_SUPPORT=m
+CONFIG_VIDEO_DEV=m
+# CONFIG_RC_CORE is not set
+# CONFIG_MEDIA_TUNER_SIMPLE is not set
+# CONFIG_MEDIA_TUNER_TDA8290 is not set
+# CONFIG_MEDIA_TUNER_TDA827X is not set
+# CONFIG_MEDIA_TUNER_TDA18271 is not set
+# CONFIG_MEDIA_TUNER_TDA9887 is not set
+# CONFIG_MEDIA_TUNER_TEA5761 is not set
+# CONFIG_MEDIA_TUNER_TEA5767 is not set
+# CONFIG_MEDIA_TUNER_MT20XX is not set
+# CONFIG_MEDIA_TUNER_MT2060 is not set
+# CONFIG_MEDIA_TUNER_MT2266 is not set
+# CONFIG_MEDIA_TUNER_MT2131 is not set
+# CONFIG_MEDIA_TUNER_QT1010 is not set
+# CONFIG_MEDIA_TUNER_XC2028 is not set
+# CONFIG_MEDIA_TUNER_XC5000 is not set
+# CONFIG_MEDIA_TUNER_XC4000 is not set
+# CONFIG_MEDIA_TUNER_MXL5005S is not set
+# CONFIG_MEDIA_TUNER_MXL5007T is not set
+# CONFIG_MEDIA_TUNER_MC44S803 is not set
+# CONFIG_MEDIA_TUNER_MAX2165 is not set
+# CONFIG_MEDIA_TUNER_TDA18218 is not set
+# CONFIG_MEDIA_TUNER_TDA18212 is not set
+CONFIG_VIDEO_VIVI=m
+# CONFIG_RADIO_ADAPTERS is not set
+CONFIG_FB=y
+CONFIG_FB_MXS=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_USB=y
+CONFIG_USB_DEBUG=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+CONFIG_USB_MON=y
+CONFIG_USB_ACM=y
+CONFIG_USB_PRINTER=y
+CONFIG_USB_WDM=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_ETH=m
+CONFIG_USB_ULPI=y
+CONFIG_MMC=y
+CONFIG_MMC_MXS=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_STMP=y
+CONFIG_DMADEVICES=y
+CONFIG_MXS_DMA=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+CONFIG_EXT2_FS_XIP=y
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_AUTOFS4_FS=y
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_UBIFS_FS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_850=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_DEBUG_FS=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
diff --git a/patches/linux/3.4.48 b/patches/linux/3.4.48
new file mode 120000
index 0000000..af1817b
--- /dev/null
+++ b/patches/linux/3.4.48
@@ -0,0 +1 @@
+3.4
\ No newline at end of file
diff --git a/patches/linux/3.4/0001-Input-mma8450-fix-signed-12bits-to-32bits-conversion.patch b/patches/linux/3.4/0001-Input-mma8450-fix-signed-12bits-to-32bits-conversion.patch
new file mode 100644
index 0000000..a0ffc77
--- /dev/null
+++ b/patches/linux/3.4/0001-Input-mma8450-fix-signed-12bits-to-32bits-conversion.patch
@@ -0,0 +1,33 @@
+From da435877e057ed18d8a053685bbee1c85abea7fc Mon Sep 17 00:00:00 2001
+From: seb <seb...@ar...>
+Date: Thu, 28 Mar 2013 09:58:54 +0100
+Subject: [PATCH 1/1] Input: mma8450 - fix signed 12bits to 32bits conversion
+
+Event value is wrong. Should be in range -2048 to 2047, but is in range 0 to 4095.
+Use s8 to int conversion and remove 0xfff mask.
+
+Signed-off-by: Sebastien Royen <seb...@ar...>
+---
+ drivers/input/misc/mma8450.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c
+index 480557f..f330969 100644
+--- a/drivers/input/misc/mma8450.c
++++ b/drivers/input/misc/mma8450.c
+@@ -123,9 +123,9 @@ static void mma8450_poll(struct input_polled_dev *dev)
+ if (ret < 0)
+ return;
+
+- x = ((buf[1] << 4) & 0xff0) | (buf[0] & 0xf);
+- y = ((buf[3] << 4) & 0xff0) | (buf[2] & 0xf);
+- z = ((buf[5] << 4) & 0xff0) | (buf[4] & 0xf);
++ x = ((int)(s8)buf[1] << 4) | (buf[0] & 0xf);
++ y = ((int)(s8)buf[3] << 4) | (buf[2] & 0xf);
++ z = ((int)(s8)buf[5] << 4) | (buf[4] & 0xf);
+
+ input_report_abs(dev->input, ABS_X, x);
+ input_report_abs(dev->input, ABS_Y, y);
+--
+1.7.9.5
+
diff --git a/patches/linux/3.4/0206-armadeus-mxs-gpio-mxs-add_support_for_both_edge_interrupt.patch b/patches/linux/3.4/0206-armadeus-mxs-gpio-mxs-add_support_for_both_edge_interrupt.patch
new file mode 100644
index 0000000..d9d7a0b
--- /dev/null
+++ b/patches/linux/3.4/0206-armadeus-mxs-gpio-mxs-add_support_for_both_edge_interrupt.patch
@@ -0,0 +1,77 @@
+This patch adds support for IRQ_TYPE_EDGE_BOTH needed for some driver
+(gpio-keys).
+Inspired from gpio-mxc.c
+
+Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou at armadeus.com>
+---
+Index: linux-3.4.28/drivers/gpio/gpio-mxs.c
+===================================================================
+--- linux-3.4.28.orig/drivers/gpio/gpio-mxs.c 2013-02-08 17:00:23.000000000 +0100
++++ linux-3.4.28/drivers/gpio/gpio-mxs.c 2013-02-08 18:18:01.000000000 +0100
+@@ -58,20 +58,32 @@
+ int irq;
+ int virtual_irq_start;
+ struct bgpio_chip bgc;
++ u32 both_edges;
+ };
+
+ /* Note: This driver assumes 32 GPIOs are handled in one register */
+
+ static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type)
+ {
++ u32 val;
+ u32 gpio = irq_to_gpio(d->irq);
++ u32 gpio_idx = d->hwirq;
+ u32 pin_mask = 1 << (gpio & 31);
+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+ struct mxs_gpio_port *port = gc->private;
+ void __iomem *pin_addr;
+ int edge;
+
++ port->both_edges &= ~(1 << gpio_idx);
+ switch (type) {
++ case IRQ_TYPE_EDGE_BOTH:
++ val = gpio_get_value(port->bgc.gc.base + gpio_idx);
++ if (val)
++ edge = GPIO_INT_FALL_EDGE;
++ else
++ edge = GPIO_INT_RISE_EDGE;
++ port->both_edges |= pin_mask;
++ break;
+ case IRQ_TYPE_EDGE_RISING:
+ edge = GPIO_INT_RISE_EDGE;
+ break;
+@@ -108,6 +120,23 @@
+ return 0;
+ }
+
++static void mxs_flip_edge(struct mxs_gpio_port *port, u32 gpio)
++{
++ u32 bit, val, edge;
++ void __iomem *pin_addr;
++
++ bit = 1 << gpio;
++
++ pin_addr = port->base + PINCTRL_IRQPOL(port->id);
++ val = readl(pin_addr);
++ edge = val & bit;
++
++ if (edge)
++ writel(bit, pin_addr + MXS_CLR);
++ else
++ writel(bit, pin_addr + MXS_SET);
++}
++
+ /* MXS has one interrupt *per* gpio port */
+ static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+ {
+@@ -122,6 +151,9 @@
+
+ while (irq_stat != 0) {
+ int irqoffset = fls(irq_stat) - 1;
++ if (port->both_edges & (1 << irqoffset))
++ mxs_flip_edge(port, irqoffset);
++
+ generic_handle_irq(gpio_irq_no_base + irqoffset);
+ irq_stat &= ~(1 << irqoffset);
+ }
diff --git a/patches/linux/3.4/050-armadeus-add_custom_drivers_to_kconfig.patch b/patches/linux/3.4/050-armadeus-add_custom_drivers_to_kconfig.patch
new file mode 100644
index 0000000..9839872
--- /dev/null
+++ b/patches/linux/3.4/050-armadeus-add_custom_drivers_to_kconfig.patch
@@ -0,0 +1,24 @@
+This patch adds the possibility to have custom Armadeus drivers built in kernel or compiled as modules
+
+Index: linux-3.4.28/drivers/usb/Kconfig
+===================================================================
+--- linux-3.4.28.orig/drivers/usb/Kconfig 2013-01-28 05:51:45.000000000 +0100
++++ linux-3.4.28/drivers/usb/Kconfig 2013-03-25 10:45:08.000000000 +0100
+@@ -184,3 +184,5 @@
+ source "drivers/usb/otg/Kconfig"
+
+ endif # USB_SUPPORT
++
++source "drivers/armadeus/Kconfig"
+Index: linux-3.4.28/drivers/Makefile
+===================================================================
+--- linux-3.4.28.orig/drivers/Makefile 2013-03-25 10:34:50.000000000 +0100
++++ linux-3.4.28/drivers/Makefile 2013-03-25 10:45:08.000000000 +0100
+@@ -113,6 +113,7 @@
+ obj-$(CONFIG_HID) += hid/
+ obj-$(CONFIG_PPC_PS3) += ps3/
+ obj-$(CONFIG_OF) += of/
++obj-$(CONFIG_ARMADEUS_DRIVERS) += armadeus/
+ obj-$(CONFIG_SSB) += ssb/
+ obj-$(CONFIG_BCMA) += bcma/
+ obj-$(CONFIG_VHOST_NET) += vhost/
diff --git a/patches/linux/3.4/441-armadeus-adding_star_completion_for_source_in_menuconfig.patch b/patches/linux/3.4/441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
new file mode 100644
index 0000000..77841d2
--- /dev/null
+++ b/patches/linux/3.4/441-armadeus-adding_star_completion_for_source_in_menuconfig.patch
@@ -0,0 +1,77 @@
+Index: linux-3.4.28/scripts/kconfig/zconf.tab.c_shipped
+===================================================================
+--- linux-3.4.28.orig/scripts/kconfig/zconf.tab.c_shipped 2013-03-25 11:05:01.000000000 +0100
++++ linux-3.4.28/scripts/kconfig/zconf.tab.c_shipped 2013-03-25 11:05:07.000000000 +0100
+@@ -86,6 +86,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdbool.h>
++#include <dirent.h>
++#include <sys/stat.h>
+
+ #include "lkc.h"
+
+@@ -93,6 +95,7 @@
+
+ #define PRINTD 0x0001
+ #define DEBUG_PARSE 0x0002
++#define BUFF_SIZE 300
+
+ int cdebug = PRINTD;
+
+@@ -106,8 +109,23 @@
+
+ static struct menu *current_menu, *current_entry;
+
++int isDir(const char *fullpath, const char *dname) {
++ struct stat sbuf;
+
++ if (*dname == '.')
++ return 0;
+
++ if (lstat(fullpath, &sbuf) == -1) {
++ fprintf(stderr, "lstat() Failed.\n");
++ return 0;
++ }
++
++ if(S_ISDIR(sbuf.st_mode)) {
++ return 1;
++ }
++
++return 0;
++}
+
+ /* Enabling traces. */
+ #ifndef YYDEBUG
+@@ -1900,8 +1918,30 @@
+ case 83:
+
+ {
++ char *name;
++ char *ptr;
++ char dirname[BUFF_SIZE];
++ char filename[BUFF_SIZE];
++ struct dirent *lecture;
++ DIR *rep;
++
+ printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
+- zconf_nextfile((yyvsp[(2) - (3)].string));
++ name = (yyvsp[(2) -(3)].string);
++ ptr = strchr(name, '*');
++ if(ptr != NULL) {
++ *ptr = '\0';
++ snprintf(dirname, BUFF_SIZE, "%s/%s", getenv(SRCTREE), name);
++ rep = opendir(dirname);
++ while ((lecture = readdir(rep))) {
++ snprintf(filename, BUFF_SIZE, "%s/%s/%s", getenv(SRCTREE), name, lecture->d_name);
++ if(isDir(filename, lecture->d_name)){
++ snprintf(filename, BUFF_SIZE, "%s/%s/%s/%s", getenv(SRCTREE), name, lecture->d_name, ptr+1);
++ zconf_nextfile(filename);
++ }
++ }
++ } else {
++ zconf_nextfile((yyvsp[(2) - (3)].string));
++ }
+ ;}
+ break;
+
diff --git a/patches/linux/3.4/450-armadeus-add_apf28_module_support.patch b/patches/linux/3.4/450-armadeus-add_apf28_module_support.patch
new file mode 100644
index 0000000..57fe584
--- /dev/null
+++ b/patches/linux/3.4/450-armadeus-add_apf28_module_support.patch
@@ -0,0 +1,184 @@
+Add Armadeus systems APF28 SOM support.
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-3.4.37/arch/arm/mach-mxs/Kconfig
+===================================================================
+--- linux-3.4.37.orig/arch/arm/mach-mxs/Kconfig 2013-03-20 21:05:12.000000000 +0100
++++ linux-3.4.37/arch/arm/mach-mxs/Kconfig 2013-04-08 14:27:12.000000000 +0200
+@@ -107,4 +107,15 @@
+ bool "Support Bluegiga APX4 Development Kit"
+ select MODULE_APX4
+
++config MACH_APF28
++ bool "Armadeus APF28 module"
++ select SOC_IMX28
++ select MXS_HAVE_AMBA_DUART
++ select MXS_HAVE_PLATFORM_FEC
++ select MXS_HAVE_PLATFORM_MXS_SPI
++ select MXS_HAVE_PLATFORM_GPMI_NAND
++ help
++ Include support for the Armadeus systems APF28 SOM. This includes
++ specific configurations for the module and its peripherals.
++
+ endif
+Index: linux-3.4.37/arch/arm/mach-mxs/Makefile
+===================================================================
+--- linux-3.4.37.orig/arch/arm/mach-mxs/Makefile 2013-03-20 21:05:12.000000000 +0100
++++ linux-3.4.37/arch/arm/mach-mxs/Makefile 2013-04-08 14:26:43.000000000 +0200
+@@ -14,5 +14,6 @@
+ obj-$(CONFIG_MACH_APX4DEVKIT) += mach-apx4devkit.o
+ obj-$(CONFIG_MODULE_TX28) += module-tx28.o
+ obj-$(CONFIG_MACH_TX28) += mach-tx28.o
++obj-$(CONFIG_MACH_APF28) += mach-apf28.o
+
+ obj-y += devices/
+Index: linux-3.4.37/arch/arm/mach-mxs/mach-apf28.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-3.4.37/arch/arm/mach-mxs/mach-apf28.c 2013-04-08 14:26:43.000000000 +0200
+@@ -0,0 +1,144 @@
++/*
++ * Copyright 2011 Armadeus systems.
++ *
++ * Based on code which is:
++ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/delay.h>
++#include <linux/platform_device.h>
++#include <linux/gpio.h>
++#include <linux/clk.h>
++
++#include <asm/mach-types.h>
++#include <asm/mach/arch.h>
++#include <asm/mach/time.h>
++
++#include <mach/common.h>
++#include <mach/iomux-mx28.h>
++
++#include "devices-mx28.h"
++
++#define APF28_FEC_PHY_RESET MXS_GPIO_NR(4, 13)
++
++static const iomux_cfg_t apf28_pads[] __initconst = {
++ /* duart */
++ MX28_PAD_PWM0__DUART_RX | MXS_PAD_CTRL,
++ MX28_PAD_PWM1__DUART_TX | MXS_PAD_CTRL,
++
++#define MXS_PAD_FEC (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP)
++ /* FEC0 */
++ MX28_PAD_ENET0_MDC__ENET0_MDC | MXS_PAD_FEC,
++ MX28_PAD_ENET0_MDIO__ENET0_MDIO | MXS_PAD_FEC,
++ MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | MXS_PAD_FEC,
++ MX28_PAD_ENET0_RXD0__ENET0_RXD0 | MXS_PAD_FEC,
++ MX28_PAD_ENET0_RXD1__ENET0_RXD1 | MXS_PAD_FEC,
++ MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | MXS_PAD_FEC,
++ MX28_PAD_ENET0_TXD0__ENET0_TXD0 | MXS_PAD_FEC,
++ MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MXS_PAD_FEC,
++ MX28_PAD_ENET_CLK__CLKCTRL_ENET | MXS_PAD_FEC,
++ /* phy reset line */
++ MX28_PAD_ENET0_RX_CLK__GPIO_4_13 | MXS_PAD_CTRL,
++
++#define MXS_NAND_PAD_VOLTAGE MXS_PAD_3V3
++ /* NAND */
++ MX28_PAD_GPMI_D00__GPMI_D0 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_D01__GPMI_D1 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_D02__GPMI_D2 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_D03__GPMI_D3 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_D04__GPMI_D4 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_D05__GPMI_D5 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_D06__GPMI_D6 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_D07__GPMI_D7 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_CE0N__GPMI_CE0N |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_RDY0__GPMI_READY0 |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_NOPULL),
++ MX28_PAD_GPMI_RDN__GPMI_RDN |
++ (MXS_PAD_8MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_PULLUP),
++ MX28_PAD_GPMI_WRN__GPMI_WRN |
++ (MXS_PAD_8MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_PULLUP),
++ MX28_PAD_GPMI_ALE__GPMI_ALE |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_PULLUP),
++ MX28_PAD_GPMI_CLE__GPMI_CLE |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_PULLUP),
++ MX28_PAD_GPMI_RESETN__GPMI_RESETN |
++ (MXS_PAD_4MA | MXS_NAND_PAD_VOLTAGE | MXS_PAD_PULLUP),
++};
++
++/* FEC */
++static void __init apf28_fec_reset(void)
++{
++ int ret;
++ struct clk *clk;
++
++ /* Enable fec phy clock */
++ clk = clk_get_sys("pll2", NULL);
++ if (!IS_ERR(clk))
++ clk_enable(clk);
++
++ /* Reset fec phy */
++ ret = gpio_request(APF28_FEC_PHY_RESET, "fec-phy-reset");
++ if (ret) {
++ pr_err("Failed to request gpio fec-phy-reset: %d\n", ret);
++ return;
++ }
++
++ gpio_direction_output(APF28_FEC_PHY_RESET, 0);
++ mdelay(1);
++ gpio_set_value(APF28_FEC_PHY_RESET, 1);
++}
++
++static struct fec_platform_data mx28_fec0_pdata __initdata = {
++ .phy = PHY_INTERFACE_MODE_RMII,
++};
++
++static struct gpmi_nand_platform_data apf28_nand_pdata __initdata = {
++ .max_chip_count = 1,
++};
++
++static void __init apf28_init(void)
++{
++ mxs_iomux_setup_multiple_pads(apf28_pads, ARRAY_SIZE(apf28_pads));
++
++ mx28_add_duart();
++ mx28_add_gpmi_nand(&apf28_nand_pdata);
++
++ apf28_fec_reset();
++ mx28_add_fec(0, &mx28_fec0_pdata);
++}
++
++static void __init apf28_timer_init(void)
++{
++ mx28_clocks_init();
++}
++
++static struct sys_timer apf28_timer = {
++ .init = apf28_timer_init,
++};
++
++MACHINE_START(APF28, "Armadeus APF28")
++ /* Maintainer: Julien Boibessot <jul...@ar...> */
++ .map_io = mx28_map_io,
++ .init_irq = mx28_init_irq,
++ .init_machine = apf28_init,
++ .timer = &apf28_timer,
++MACHINE_END
diff --git a/patches/linux/3.4/451-armadeus-add_apf28dev_baseboard_support.patch b/patches/linux/3.4/451-armadeus-add_apf28dev_baseboard_support.patch
new file mode 100644
index 0000000..cf141f1
--- /dev/null
+++ b/patches/linux/3.4/451-armadeus-add_apf28dev_baseboard_support.patch
@@ -0,0 +1,294 @@
+Add Armadeus systems APF28Dev development board support.
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+
+Index: linux-3.4.48/arch/arm/mach-mxs/Kconfig
+===================================================================
+--- linux-3.4.48.orig/arch/arm/mach-mxs/Kconfig 2013-06-11 06:31:03.183290567 +0200
++++ linux-3.4.48/arch/arm/mach-mxs/Kconfig 2013-06-11 06:39:35.465830838 +0200
+@@ -118,4 +118,23 @@
+ Include support for the Armadeus systems APF28 SOM. This includes
+ specific configurations for the module and its peripherals.
+
++comment "APF28 baseboard support"
++ depends on MACH_APF28
++
++config MACH_APF28_DEV
++ bool "Armadeus APF28Dev development board"
++ depends on MACH_APF28
++ select MXS_HAVE_PLATFORM_AUART
++ select MXS_HAVE_PLATFORM_FLEXCAN
++ select MXS_HAVE_PLATFORM_MXS_MMC
++ select MXS_HAVE_PLATFORM_MXSFB
++ select MXS_HAVE_PLATFORM_MXS_I2C
++ select MXS_HAVE_PLATFORM_MXS_PWM
++ select MXS_HAVE_PLATFORM_MXS_SAIF
++ select MXS_HAVE_PLATFORM_MXS_LRADC
++ help
++ This selects the Armadeus systems APF28Dev as baseboard and adds board's
++ specific devices. "baseboard=apf28dev" bootargs will this board effective
++ at runtime.
++
+ endif
+Index: linux-3.4.48/arch/arm/mach-mxs/Makefile
+===================================================================
+--- linux-3.4.48.orig/arch/arm/mach-mxs/Makefile 2013-06-11 06:31:03.183290567 +0200
++++ linux-3.4.48/arch/arm/mach-mxs/Makefile 2013-06-11 06:31:03.195290632 +0200
+@@ -15,5 +15,6 @@
+ obj-$(CONFIG_MODULE_TX28) += module-tx28.o
+ obj-$(CONFIG_MACH_TX28) += mach-tx28.o
+ obj-$(CONFIG_MACH_APF28) += mach-apf28.o
++obj-$(CONFIG_MACH_APF28_DEV) += apf28dev-baseboard.o
+
+ obj-y += devices/
+Index: linux-3.4.48/arch/arm/mach-mxs/apf28dev-baseboard.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-3.4.48/arch/arm/mach-mxs/apf28dev-baseboard.c 2013-06-11 06:54:21.086222359 +0200
+@@ -0,0 +1,209 @@
++/*
++ * Copyright 2011-2013 Armadeus systems.
++ *
++ * Based on code which is:
++ * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/delay.h>
++#include <linux/platform_device.h>
++#include <linux/gpio.h>
++#include <linux/leds.h>
++#include <linux/irq.h>
++#include <linux/clk.h>
++
++#include <asm/mach-types.h>
++#include <asm/mach/arch.h>
++#include <asm/mach/time.h>
++
++#include <mach/common.h>
++#include <mach/iomux-mx28.h>
++
++#include "devices-mx28.h"
++
++#define APF28DEV_CAN
++#define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
++#define APF28DEV_FEC_PHY_RESET MXS_GPIO_NR(0, 23)
++
++static const iomux_cfg_t apf28dev_pads[] __initconst = {
++ /* AUART0 */
++ MX28_PAD_AUART0_RX__AUART0_RX | MXS_PAD_CTRL,
++ MX28_PAD_AUART0_TX__AUART0_TX | MXS_PAD_CTRL,
++ MX28_PAD_AUART0_CTS__AUART0_CTS | MXS_PAD_CTRL,
++ MX28_PAD_AUART0_RTS__AUART0_RTS | MXS_PAD_CTRL,
++ /* AUART1 */
++ MX28_PAD_AUART1_RX__AUART1_RX | MXS_PAD_CTRL,
++ MX28_PAD_AUART1_TX__AUART1_TX | MXS_PAD_CTRL,
++ MX28_PAD_AUART1_CTS__AUART1_CTS | MXS_PAD_CTRL,
++ MX28_PAD_AUART1_RTS__AUART1_RTS | MXS_PAD_CTRL,
++ /* AUART2 */
++ MX28_PAD_AUART2_RX__AUART2_RX | MXS_PAD_CTRL,
++ MX28_PAD_AUART2_TX__AUART2_TX | MXS_PAD_CTRL,
++ MX28_PAD_AUART2_CTS__AUART2_CTS | MXS_PAD_CTRL,
++ MX28_PAD_AUART2_RTS__AUART2_RTS | MXS_PAD_CTRL,
++#ifndef APF28DEV_CAN
++ /* AUART3 */
++ MX28_PAD_AUART3_RX__AUART3_RX | MXS_PAD_CTRL,
++ MX28_PAD_AUART3_TX__AUART3_TX | MXS_PAD_CTRL,
++ MX28_PAD_AUART3_CTS__AUART3_CTS | MXS_PAD_CTRL,
++ MX28_PAD_AUART3_RTS__AUART3_RTS | MXS_PAD_CTRL,
++#else
++ /* CAN0 */
++ MX28_PAD_AUART3_RX__CAN0_TX,
++ MX28_PAD_AUART3_TX__CAN0_RX,
++#endif
++
++#define MXS_PAD_FEC (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP)
++ /* FEC1 */
++ MX28_PAD_ENET0_CRS__ENET1_RX_EN | MXS_PAD_FEC,
++ MX28_PAD_ENET0_RXD2__ENET1_RXD0 | MXS_PAD_FEC,
++ MX28_PAD_ENET0_RXD3__ENET1_RXD1 | MXS_PAD_FEC,
++ MX28_PAD_ENET0_COL__ENET1_TX_EN | MXS_PAD_FEC,
++ MX28_PAD_ENET0_TXD2__ENET1_TXD0 | MXS_PAD_FEC,
++ MX28_PAD_ENET0_TXD3__ENET1_TXD1 | MXS_PAD_FEC,
++ /* phy reset line */
++ MX28_PAD_GPMI_RDY3__GPIO_0_23 | MXS_PAD_CTRL,
++
++ /* LCD */
++ MX28_PAD_LCD_D00__LCD_D0 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D01__LCD_D1 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D02__LCD_D2 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D03__LCD_D3 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D04__LCD_D4 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D05__LCD_D5 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D06__LCD_D6 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D07__LCD_D7 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D08__LCD_D8 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D09__LCD_D9 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D10__LCD_D10 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D11__LCD_D11 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D12__LCD_D12 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D13__LCD_D13 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D14__LCD_D14 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D15__LCD_D15 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D16__LCD_D16 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D17__LCD_D17 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D18__LCD_D18 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D19__LCD_D19 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D20__LCD_D20 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D21__LCD_D21 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D22__LCD_D22 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_D23__LCD_D23 | MXS_PAD_CTRL,
++ MX28_PAD_LCD_RD_E__LCD_VSYNC | MXS_PAD_CTRL,
++ MX28_PAD_LCD_WR_RWN__LCD_HSYNC | MXS_PAD_CTRL,
++ MX28_PAD_LCD_RS__LCD_DOTCLK | MXS_PAD_CTRL,
++ MX28_PAD_LCD_CS__LCD_ENABLE | MXS_PAD_CTRL,
++
++ /* MMC0 */
++ MX28_PAD_SSP0_DATA0__SSP0_D0 |
++ (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
++ MX28_PAD_SSP0_DATA1__SSP0_D1 |
++ (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
++ MX28_PAD_SSP0_DATA2__SSP0_D2 |
++ (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
++ MX28_PAD_SSP0_DATA3__SSP0_D3 |
++ (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
++ MX28_PAD_SSP0_SCK__SSP0_SCK |
++ (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
++ MX28_PAD_SSP0_CMD__SSP0_CMD |
++ (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
++ MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
++ (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
++
++ /* User LED */
++ MX28_PAD_GPMI_RDY1__GPIO_0_21 | MXS_PAD_CTRL,
++ /* User button */
++ MX28_PAD_GPMI_RDY2__GPIO_0_22 | MXS_PAD_CTRL,
++
++ /* I2C0 */
++ MX28_PAD_I2C0_SCL__I2C0_SCL |
++ (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP),
++ MX28_PAD_I2C0_SDA__I2C0_SDA |
++ (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP),
++};
++
++/* fec */
++static void __init apf28dev_fec1_reset(void)
++{
++ int ret;
++
++ /* Reset fec phy */
++ ret = gpio_request(APF28DEV_FEC_PHY_RESET, "fec-phy-reset");
++ if (ret) {
++ pr_err("Failed to request gpio fec-phy-%s: %d\n", "reset", ret);
++ return;
++ }
++
++ gpio_direction_output(APF28DEV_FEC_PHY_RESET, 0);
++ mdelay(1);
++ gpio_set_value(APF28DEV_FEC_PHY_RESET, 1);
++}
++
++static struct fec_platform_data mx28_fec1_pdata __initdata = {
++ .phy = PHY_INTERFACE_MODE_RMII,
++};
++
++/* mxsfb (lcdif) */
++static struct fb_videomode apf28dev_video_modes[] = {
++ {
++ .name = "Chimei-LW700AT9003",
++ .refresh = 60,
++ .xres = 800,
++ .yres = 480,
++ .pixclock = 30303, /* picosecond */
++ .left_margin = 96,
++ .right_margin = 96,
++ .upper_margin = 20,
++ .lower_margin = 21,
++ .hsync_len = 64,
++ .vsync_len = 4,
++ /* .sync = FB_SYNC_CLK_IDLE_EN, ?? */
++ .vmode = FB_VMODE_NONINTERLACED,
++ },
++};
++
++static const struct mxsfb_platform_data apf28dev_mxsfb_pdata __initconst = {
++ .mode_list = apf28dev_video_modes,
++ .mode_count = ARRAY_SIZE(apf28dev_video_modes),
++ .default_bpp = 16,
++ .ld_intf_width = STMLCDIF_18BIT,
++};
++
++static struct mxs_mmc_platform_data apf28dev_mmc0_pdata __initdata = {
++ .flags = SLOTF_4_BIT_CAPABLE,
++};
++
++void __init apf28dev_init(void)
++{
++ printk("--- %s\n", __func__);
++
++ mxs_iomux_setup_multiple_pads(apf28dev_pads, ARRAY_SIZE(apf28dev_pads));
++
++ mx28_add_auart0();
++ mx28_add_auart1();
++ mx28_add_auart2();
++
++ apf28dev_fec1_reset();
++ mx28_add_fec(1, &mx28_fec1_pdata);
++#ifdef APF28DEV_CAN
++ mx28_add_flexcan(0, NULL);
++#else
++ mx28_add_auart3();
++#endif
++ mx28_add_mxsfb(&apf28dev_mxsfb_pdata);
++
++ mx28_add_mxs_mmc(0, &apf28dev_mmc0_pdata);
++
++ mx28_add_mxs_i2c(0);
++}
++EXPORT_SYMBOL_GPL(apf28dev_init);
+Index: linux-3.4.48/arch/arm/mach-mxs/mach-apf28.c
+===================================================================
+--- linux-3.4.48.orig/arch/arm/mach-mxs/mach-apf28.c 2013-06-11 06:31:03.183290567 +0200
++++ linux-3.4.48/arch/arm/mach-mxs/mach-apf28.c 2013-06-11 06:31:03.195290632 +0200
+@@ -115,6 +115,19 @@
+ .max_chip_count = 1,
+ };
+
++/* Get baseboard */
++static char apf28_baseboard[16] = "apf28dev";
++
++static int __init apf28_get_baseboard(char *options)
++{
++ strncpy(apf28_baseboard, options, sizeof(apf28_baseboard));
++
++ return 0;
++}
++__setup("baseboard=", apf28_get_baseboard);
++
++extern void __init apf28dev_init(void);
++
+ static void __init apf28_init(void)
+ {
+ mxs_iomux_setup_multiple_pads(apf28_pads, ARRAY_SIZE(apf28_pads));
+@@ -124,6 +137,12 @@
+
+ apf28_fec_reset();
+ mx28_add_fec(0, &mx28_fec0_pdata);
++
++ printk("--- APF28 baseboard: (%s)\n", apf28_baseboard);
++#ifdef CONFIG_MACH_APF28_DEV
++ if (!strcmp(apf28_baseboard, "apf28dev"))
++ apf28dev_init();
++#endif
+ }
+
+ static void __init apf28_timer_init(void)
diff --git a/patches/linux/3.4/454-armadeus-add-spi-support.patch b/patches/linux/3.4/454-armadeus-add-spi-support.patch
new file mode 100644
index 0000000..4e5daed
--- /dev/null
+++ b/patches/linux/3.4/454-armadeus-add-spi-support.patch
@@ -0,0 +1,19 @@
+Activate clock for SPI
+
+Signed-off-by: Fabien Marteau <fab...@ar...>
+---
+Index: linux-3.4.28/arch/arm/mach-mxs/clock-mx28.c
+===================================================================
+--- linux-3.4.28.orig/arch/arm/mach-mxs/clock-mx28.c 2013-03-01 14:39:38.000000000 +0100
++++ linux-3.4.28/arch/arm/mach-mxs/clock-mx28.c 2013-03-05 09:38:51.000000000 +0100
+@@ -629,8 +629,8 @@
+ _REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
+ _REGISTER_CLOCK("mxs-mmc.0", NULL, ssp0_clk)
+ _REGISTER_CLOCK("mxs-mmc.1", NULL, ssp1_clk)
+- _REGISTER_CLOCK("mxs-mmc.2", NULL, ssp2_clk)
+- _REGISTER_CLOCK("mxs-mmc.3", NULL, ssp3_clk)
++ _REGISTER_CLOCK("mxs-spi.2", NULL, ssp2_clk)
++ _REGISTER_CLOCK("mxs-spi.3", NULL, ssp3_clk)
+ _REGISTER_CLOCK("flexcan.0", NULL, can0_clk)
+ _REGISTER_CLOCK("flexcan.1", NULL, can1_clk)
+ _REGISTER_CLOCK(NULL, "usb0", usb0_clk)
diff --git a/patches/linux/3.4/799-2012-04-18-kernel-staging-iio-add-a-raw-and-processed-elements-to-info-mask.patch b/patches/linux/3.4/799-2012-04-18-kernel-staging-iio-add-a-raw-and-processed-elements-to-info-mask.patch
new file mode 100644
index 0000000..396a97a
--- /dev/null
+++ b/patches/linux/3.4/799-2012-04-18-kernel-staging-iio-add-a-raw-and-processed-elements-to-info-mask.patch
@@ -0,0 +1,72 @@
+From 5ccb3adbd7593b69d1355454b0c6d2dffdad51d9 Mon Sep 17 00:00:00 2001
+From: Jonathan Cameron <ji...@ke...>
+Date: Sun, 15 Apr 2012 17:41:16 +0100
+Subject: [PATCH] staging:iio: add a raw and processed elements to info_mask
+
+This will allow us to have drivers where the channel value
+may not be read or written but other information is available.
+Also adds the ability to have both processed and raw access
+to a given channel, though in most cases this doesn't make
+sense.
+
+Ultimately will lead to simpler code by allowing us to drop
+the special case handling for the value reading cases.
+
+Signed-off-by: Jonathan Cameron <ji...@ke...>
+Acked-by: Lars-Peter Clausen <la...@me...>
+Signed-off-by: Greg Kroah-Hartman <gr...@li...>
+---
+ drivers/staging/iio/iio.h | 9 +++++++--
+ drivers/staging/iio/industrialio-core.c | 5 +++--
+ 2 files changed, 10 insertions(+), 4 deletions(-)
+
+Index: linux-3.4.28/drivers/staging/iio/iio.h
+===================================================================
+--- linux-3.4.28.orig/drivers/staging/iio/iio.h 2013-01-28 05:51:45.000000000 +0100
++++ linux-3.4.28/drivers/staging/iio/iio.h 2013-02-11 20:00:03.000000000 +0100
+@@ -26,8 +26,9 @@
+
+ /* Could add the raw attributes as well - allowing buffer only devices */
+ enum iio_chan_info_enum {
+- /* 0 is reserved for raw attributes */
+- IIO_CHAN_INFO_SCALE = 1,
++ IIO_CHAN_INFO_RAW = 0,
++ IIO_CHAN_INFO_PROCESSED,
++ IIO_CHAN_INFO_SCALE,
+ IIO_CHAN_INFO_OFFSET,
+ IIO_CHAN_INFO_CALIBSCALE,
+ IIO_CHAN_INFO_CALIBBIAS,
+@@ -41,6 +42,10 @@
+ #define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2)
+ #define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1)
+
++#define IIO_CHAN_INFO_RAW_SEPARATE_BIT \
++ IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW)
++#define IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT \
++ IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PROCESSED)
+ #define IIO_CHAN_INFO_SCALE_SEPARATE_BIT \
+ IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SCALE)
+ #define IIO_CHAN_INFO_SCALE_SHARED_BIT \
+Index: linux-3.4.28/drivers/staging/iio/industrialio-core.c
+===================================================================
+--- linux-3.4.28.orig/drivers/staging/iio/industrialio-core.c 2013-01-28 05:51:45.000000000 +0100
++++ linux-3.4.28/drivers/staging/iio/industrialio-core.c 2013-02-11 20:00:03.000000000 +0100
+@@ -575,7 +575,8 @@
+ static int iio_device_add_channel_sysfs(struct iio_dev *indio_dev,
+ struct iio_chan_spec const *chan)
+ {
+- int ret, i, attrcount = 0;
++ int ret, attrcount = 0;
++ int i = 4;
+ const struct iio_chan_spec_ext_info *ext_info;
+
+ if (chan->channel < 0)
+@@ -594,7 +595,7 @@
+ goto error_ret;
+ attrcount++;
+
+- for_each_set_bit(i, &chan->info_mask, sizeof(long)*8) {
++ for_each_set_bit_from(i, &chan->info_mask, sizeof(long)*8) {
+ ret = __iio_add_chan_devattr(iio_chan_info_postfix[i/2],
+ chan,
+ &iio_read_channel_info,
diff --git a/patches/linux/3.4/799-2012-04-20-pengutronix-lib-add-support-for-stmp-style-devices.patch b/patches/linux/3.4/799-2012-04-20-pengutronix-lib-add-support-for-stmp-style-devices.patch
new file mode 100644
index 0000000..227b897
--- /dev/null
+++ b/patches/linux/3.4/799-2012-04-20-pengutronix-lib-add-support-for-stmp-style-devices.patch
@@ -0,0 +1,184 @@
+From 4ccf4beab8c447f8cd33d46afb6e10e1aa3befc6 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <w....@pe...>
+Date: Wed, 31 Aug 2011 20:35:40 +0200
+Subject: [PATCH] lib: add support for stmp-style devices
+
+MX23/28 use IP cores which follow a register layout I have first seen on
+STMP3xxx SoCs. In this layout, every register actually has four u32:
+
+ 1.) to store a value directly
+ 2.) a SET register where every 1-bit sets the corresponding bit,
+ others are unaffected
+ 3.) same with a CLR register
+ 4.) same with a TOG (toggle) register
+
+Also, the 2 MSBs in register 0 are always the same and can be used to reset
+the IP core.
+
+All this is strictly speaking not mach-specific (but IP core specific) and,
+thus, doesn't need to be in mach-mxs/include. At least mx6 also uses IP cores
+following this stmp-style. So:
+
+Introduce a stmp-style device, put the code and defines for that in a public
+place (lib/), and let drivers for stmp-style devices select that code.
+To avoid regressions and ease reviewing, the actual code is simply copied from
+mach-mxs. It definately wants updates, but those need a seperate patch series.
+
+Voila, mach dependency gone, reusable code introduced. Note that I didn't
+remove the duplicated code from mach-mxs yet, first the drivers have to be
+converted.
+
+Signed-off-by: Wolfram Sang <w....@pe...>
+Acked-by: Shawn Guo <sha...@li...>
+Acked-by: Dong Aisheng <don...@li...>
+---
+ include/linux/stmp_device.h | 20 +++++++++++
+ lib/Kconfig | 3 ++
+ lib/Makefile | 2 +
+ lib/stmp_device.c | 80 +++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 105 insertions(+), 0 deletions(-)
+ create mode 100644 include/linux/stmp_device.h
+ create mode 100644 lib/stmp_device.c
+
+diff --git a/include/linux/stmp_device.h b/include/linux/stmp_device.h
+new file mode 100644
+index 0000000..6cf7ec9
+--- /dev/null
++++ b/include/linux/stmp_device.h
+@@ -0,0 +1,20 @@
++/*
++ * basic functions for devices following the "stmp" style register layout
++ *
++ * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ */
++
++#ifndef __STMP_DEVICE_H__
++#define __STMP_DEVICE_H__
++
++#define STMP_OFFSET_REG_SET 0x4
++#define STMP_OFFSET_REG_CLR 0x8
++#define STMP_OFFSET_REG_TOG 0xc
++
++extern int stmp_reset_block(void __iomem *);
++#endif /* __STMP_DEVICE_H__ */
+diff --git a/lib/Kconfig b/lib/Kconfig
+index 4a8aba2..c5da154 100644
+--- a/lib/Kconfig
++++ b/lib/Kconfig
+@@ -33,6 +33,9 @@ config GENERIC_IO
+ boolean
+ default n
+
++config STMP_DEVICE
++ bool
++
+ config CRC_CCITT
+ tristate "CRC-CCITT functions"
+ help
+diff --git a/lib/Makefile b/lib/Makefile
+index 18515f0..f78dbcd 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -123,6 +123,8 @@ obj-$(CONFIG_SIGNATURE) += digsig.o
+
+ obj-$(CONFIG_CLZ_TAB) += clz_tab.o
+
++obj-$(CONFIG_STMP_DEVICE) += stmp_device.o
++
+ hostprogs-y := gen_crc32table
+ clean-files := crc32table.h
+
+diff --git a/lib/stmp_device.c b/lib/stmp_device.c
+new file mode 100644
+index 0000000..8ac9bcc
+--- /dev/null
++++ b/lib/stmp_device.c
+@@ -0,0 +1,80 @@
++/*
++ * Copyright (C) 1999 ARM Limited
++ * Copyright (C) 2000 Deep Blue Solutions Ltd
++ * Copyright 2006-2007,2010 Freescale Semiconductor, Inc. All Rights Reserved.
++ * Copyright 2008 Juergen Beisert, ke...@pe...
++ * Copyright 2009 Ilya Yanok, Emcraft Systems Ltd, ya...@em...
++ * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ */
++
++#include <linux/io.h>
++#include <linux/errno.h>
++#include <linux/delay.h>
++#include <linux/module.h>
++#include <linux/stmp_device.h>
++
++#define STMP_MODULE_CLKGATE (1 << 30)
++#define STMP_MODULE_SFTRST (1 << 31)
++
++/*
++ * Clear the bit and poll it cleared. This is usually called with
++ * a reset address and mask being either SFTRST(bit 31) or CLKGATE
++ * (bit 30).
++ */
++static int stmp_clear_poll_bit(void __iomem *addr, u32 mask)
++{
++ int timeout = 0x400;
++
++ writel(mask, addr + STMP_OFFSET_REG_CLR);
++ udelay(1);
++ while ((readl(addr) & mask) && --timeout)
++ /* nothing */;
++
++ return !timeout;
++}
++
++int stmp_reset_block(void __iomem *reset_addr)
++{
++ int ret;
++ int timeout = 0x400;
++
++ /* clear and poll SFTRST */
++ ret = stmp_clear_poll_bit(reset_addr, STMP_MODULE_SFTRST);
++ if (unlikely(ret))
++ goto error;
++
++ /* clear CLKGATE */
++ writel(STMP_MODULE_CLKGATE, reset_addr + STMP_OFFSET_REG_CLR);
++
++ /* set SFTRST to reset the block */
++ writel(STMP_MODULE_SFTRST, reset_addr + STMP_OFFSET_REG_SET);
++ udelay(1);
++
++ /* poll CLKGATE becoming set */
++ while ((!(readl(reset_addr) & STMP_MODULE_CLKGATE)) && --timeout)
++ /* nothing */;
++ if (unlikely(!timeout))
++ goto error;
++
++ /* clear and poll SFTRST */
++ ret = stmp_clear_poll_bit(reset_addr, STMP_MODULE_SFTRST);
++ if (unlikely(ret))
++ goto error;
++
++ /* clear and poll CLKGATE */
++ ret = stmp_clear_poll_bit(reset_addr, STMP_MODULE_CLKGATE);
++ if (unlikely(ret))
++ goto error;
++
++ return 0;
++
++error:
++ pr_err("%s(%p): module reset timeout\n", __func__, reset_addr);
++ return -ETIMEDOUT;
++}
++EXPORT_SYMBOL(stmp_reset_block);
+--
+1.7.6.5
+
diff --git a/patches/linux/3.4/799-2012-06-19-metafoo-iio-add-helper-function-for-initializing-triggered-buffers.patch b/patches/linux/3.4/799-2012-06-19-metafoo-iio-add-helper-function-for-initializing-triggered-buffers.patch
new file mode 100644
index 0000000..ca6e844
--- /dev/null
+++ b/patches/linux/3.4/799-2012-06-19-metafoo-iio-add-helper-function-for-initializing-triggered-buffers.patch
@@ -0,0 +1,186 @@
+From 23f2d735a932c7833d2d00da5e3ecdf4a6836210 Mon Sep 17 00:00:00 2001
+From: Lars-Peter Clausen <la...@me...>
+Date: Mon, 18 Jun 2012 18:33:48 +0200
+Subject: [PATCH] iio: Add helper function for initializing triggered buffers
+
+Add a helper function for executing the common tasks which are usually involved
+in setting up a simple software ringbuffer. It will allocate the buffer,
+allocate the pollfunc and register the buffer.
+
+Signed-off-by: Lars-Peter Clausen <la...@me...>
+Acked-by: Jonathan Cameron <ji...@ke...>
+Signed-off-by: Greg Kroah-Hartman <gr...@li...>
+---
+ drivers/staging/iio/Kconfig | 7 ++
+ drivers/staging/iio/Makefile | 1 +
+ drivers/staging/iio/industrialio-triggered-buffer.c | 110 +++++++++++++++++++++++++++
+ drivers/staging/iio/triggered_buffer.h | 15 ++++
+ 4 files changed, 133 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/staging/iio/industrialio-triggered-buffer.c
+ create mode 100644 drivers/staging/iio/triggered_buffer.h
+
+Index: linux-3.4.28/drivers/staging/iio/Kconfig
+===================================================================
+--- linux-3.4.28.orig/drivers/staging/iio/Kconfig 2013-01-28 05:51:45.000000000 +0100
++++ linux-3.4.28/drivers/staging/iio/Kconfig 2013-02-11 22:17:59.000000000 +0100
+@@ -45,6 +45,13 @@
+ no buffer events so it is up to userspace to work out how
+ often to read from the buffer.
+
++config IIO_TRIGGERED_BUFFER
++ tristate
++ select IIO_TRIGGER
++ select IIO_KFIFO_BUF
++ help
++ Provides helper functions for setting up triggered buffers.
++
+ endif # IIO_BUFFER
+
+ config IIO_TRIGGER
+Index: linux-3.4.28/drivers/staging/iio/Makefile
+===================================================================
+--- linux-3.4.28.orig/drivers/staging/iio/Makefile 2013-01-28 05:51:45.000000000 +0100
++++ linux-3.4.28/drivers/staging/iio/Makefile 2013-02-11 22:17:59.000000000 +0100
+@@ -7,6 +7,7 @@
+ industrialio-$(CONFIG_IIO_BUFFER) += industrialio-buffer.o
+ industrialio-$(CONFIG_IIO_TRIGGER) += industrialio-trigger.o
+
++obj-$(CONFIG_IIO_TRIGGERED_BUFFER) += industrialio-triggered-buffer.o
+ obj-$(CONFIG_IIO_SW_RING) += ring_sw.o
+ obj-$(CONFIG_IIO_KFIFO_BUF) += kfifo_buf.o
+
+Index: linux-3.4.28/drivers/staging/iio/industrialio-triggered-buffer.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-3.4.28/drivers/staging/iio/industrialio-triggered-buffer.c 2013-02-11 22:25:18.000000000 +0100
+@@ -0,0 +1,110 @@
++ /*
++ * Copyright (c) 2012 Analog Devices, Inc.
++ * Author: Lars-Peter Clausen <la...@me...>
++ *
++ * 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 <linux/kernel.h>
++#include <linux/export.h>
++#include <linux/module.h>
++#include "iio.h"
++#include "buffer.h"
++#include "kfifo_buf.h"
++#include "triggered_buffer.h"
++#include "trigger_consumer.h"
++
++static const struct iio_buffer_setup_ops iio_triggered_buffer_setup_ops = {
++ .preenable = &iio_sw_buffer_preenable,
++ .postenable = &iio_triggered_buffer_postenable,
++ .predisable = &iio_triggered_buffer_predisable,
++};
++
++/**
++ * iio_triggered_buffer_setup() - Setup triggered buffer and pollfunc
++ * @indio_dev: IIO device structure
++ * @pollfunc_bh: Function which will be used as pollfunc bottom half
++ * @pollfunc_th: Function which will be used as pollfunc top half
++ * @setup_ops: Buffer setup functions to use for this device.
++ * If NULL the default setup functions for triggered
++ * buffers will be used.
++ *
++ * This function combines some common tasks which will normally be performed
++ * when setting up a triggered buffer. It will allocate the buffer and the
++ * pollfunc, as well as register the buffer with the IIO core.
++ *
++ * Before calling this function the indio_dev structure should already be
++ * completely initialized, but not yet registered. In practice this means that
++ * this function should be called right before iio_device_register().
++ *
++ * To free the resources allocated by this function call
++ * iio_triggered_buffer_cleanup().
++ */
++int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
++ irqreturn_t (*pollfunc_bh)(int irq, void *p),
++ irqreturn_t (*pollfunc_th)(int irq, void *p),
++ const struct iio_buffer_setup_ops *setup_ops)
++{
++ int ret;
++
++ indio_dev->buffer = iio_kfifo_allocate(indio_dev);
++ if (!indio_dev->buffer) {
++ ret = -ENOMEM;
++ goto error_ret;
++ }
++
++ indio_dev->pollfunc = iio_alloc_pollfunc(pollfunc_bh,
++ pollfunc_th,
++ IRQF_ONESHOT,
++ indio_dev,
++ "%s_consumer%d",
++ indio_dev->name,
++ indio_dev->id);
++ if (indio_dev->pollfunc == NULL) {
++ ret = -ENOMEM;
++ goto error_kfifo_free;
++ }
++
++ /* Ring buffer functions - here trigger setup related */
++ if (setup_ops)
++ indio_dev->setup_ops = setup_ops;
++ else
++ indio_dev->setup_ops = &iio_triggered_buffer_setup_ops;
++
++ /* Flag that polled ring buffering is possible */
++ indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
++
++ ret = iio_buffer_register(indio_dev,
++ indio_dev->channels,
++ indio_dev->num_channels);
++ if (ret)
++ goto error_dealloc_pollfunc;
++
++ return 0;
++
++error_dealloc_pollfunc:
++ iio_dealloc_pollfunc(indio_dev->pollfunc);
++error_kfifo_free:
++ iio_kfifo_free(indio_dev->buffer);
++error_ret:
++ return ret;
++}
++EXPORT_SYMBOL(iio_triggered_buffer_setup);
++
++/**
++ * iio_triggered_buffer_cleanup() - Free resources allocated by iio_triggered_buffer_setup()
++ * @indio_dev: IIO device structure
++ */
++void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev)
++{
++ iio_buffer_unregister(indio_dev);
++ iio_dealloc_pollfunc(indio_dev->pollfunc);
++ iio_kfifo_free(indio_dev->buffer);
++}
++EXPORT_SYMBOL(iio_triggered_buffer_cleanup);
++
++MODULE_AUTHOR("Lars-Peter Clausen <la...@me...>");
++MODULE_DESCRIPTION("IIO helper functions for setting up triggered buffers");
++MODULE_LICENSE("GPL");
+Index: linux-3.4.28/drivers/staging/iio/triggered_buffer.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-3.4.28/drivers/staging/iio/triggered_buffer.h 2013-02-11 22:17:59.000000000 +0100
+@@ -0,0 +1,15 @@
++#ifndef _LINUX_IIO_TRIGGERED_BUFFER_H_
++#define _LINUX_IIO_TRIGGERED_BUFFER_H_
++
++#include <linux/interrupt.h>
++
++struct iio_dev;
++struct iio_buffer_setup_ops;
++
++int iio_triggered_buffer_setup(struct iio_dev *indio_dev,
++ irqreturn_t (*pollfunc_bh)(int irq, void *p),
++ irqreturn_t (*pollfunc_th)(int irq, void *p),
++ const struct iio_buffer_setup_ops *setup_ops);
++void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev);
++
++#endif
diff --git a/patches/linux/3.4/800-armadeus-staging-iio-add_mxs_lradc.patch b/patches/linux/3.4/800-armadeus-staging-iio-add_mxs_lradc.patch
new file mode 100644
index 0000000..df577d4
--- /dev/null
+++ b/patches/linux/3.4/800-armadeus-staging-iio-add_mxs_lradc.patch
@@ -0,0 +1,737 @@
+Adaptation of Marek Vasut / Denx mainline patch.
+
+Index: linux-3.4.28/drivers/staging/iio/adc/Kconfig
+===================================================================
+--- linux-3.4.28.orig/drivers/staging/iio/adc/Kconfig 2013-02-12 09:11:18.000000000 +0100
++++ linux-3.4.28/drivers/staging/iio/adc/Kconfig 2013-02-12 09:24:30.000000000 +0100
+@@ -202,4 +202,17 @@
+ touchscreen driver, so you can only select one of the two drivers
+ (lpc32xx_adc or lpc32xx_ts). Provides direct access via sysfs.
+
++config MXS_LRADC
++ tristate "Freescale i.MX28 LRADC"
++ depends on ARCH_MXS
++ select IIO_BUFFER
++ select IIO_TRIGGERED_BUFFER
++ select STMP_DEVICE
++ help
++ Say yes here to build support for i.MX28 LRADC convertor
++ built into these chips.
++
++ To compile this driver as a module, choose M here: the
++ module will be called mxs-lradc.
++
+ endmenu
+Index: linux-3.4.28/drivers/staging/iio/adc/Makefile
+===================================================================
+--- linux-3.4.28.orig/drivers/staging/iio/adc/Makefile 2013-02-12 09:11:18.000000000 +0100
++++ linux-3.4.28/drivers/staging/iio/adc/Makefile 2013-02-12 09:24:30.000000000 +0100
+@@ -38,3 +38,4 @@
+ obj-$(CONFIG_ADT7410) += adt7410.o
+ obj-$(CONFIG_AD7280) += ad7280a.o
+ obj-$(CONFIG_LPC32XX_ADC) += lpc32xx_adc.o
++obj-$(CONFIG_MXS_LRADC) += mxs-lradc.o
+Index: linux-3.4.28/drivers/staging/iio/adc/mxs-lradc.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-3.4.28/drivers/staging/iio/adc/mxs-lradc.c 2013-02-12 11:30:00.000000000 +0100
+@@ -0,0 +1,587 @@
++/*
++ * Freescale i.MX28 LRADC driver
++ *
++ * Copyright (c) 2012 DENX Software Engineering, GmbH.
++ * Marek Vasut <ma...@de...>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include <linux/interrupt.h>
++#include <linux/device.h>
++#include <linux/kernel.h>
++#include <linux/slab.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/sysfs.h>
++#include <linux/list.h>
++#include <linux/io.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/spinlock.h>
++#include <linux/wait.h>
++#include <linux/sched.h>
++#include <linux/stmp_device.h>
++#include <linux/bitops.h>
++#include <linux/completion.h>
++
++#include <mach/mxs.h>
++#include <mach/common.h>
++
++#include "../iio.h"
++#include "../buffer.h"
++#include "../trigger.h"
++#include "../trigger_consumer.h"
++#include "../triggered_buffer.h"
++
++#define DRIVER_NAME "mxs-lradc"
++
++#define LRADC_MAX_DELAY_CHANS 4
++#define LRADC_MAX_MAPPED_CHANS 8
++#define LRADC_MAX_TOTAL_CHANS 16
++
++#define LRADC_DELAY_TIMER_HZ 2000
++
++/*
++ * Make this runtime configurable if necessary. Currently, if the buffered mode
++ * is enabled, the LRADC takes LRADC_DELAY_TIMER_LOOP samples of data before
++ * triggering IRQ. The sampling happens every (LRADC_DELAY_TIMER_PER / 2000)
++ * seconds. The result is that the samples arrive every 500mS.
++ */
++#define LRADC_DELAY_TIMER_PER 200
++#define LRADC_DELAY_TIMER_LOOP 5
++
++static const char * const mxs_lradc_irq_name[] = {
++ "mxs-lradc-touchscreen",
++ "mxs-lradc-thresh0",
++ "mxs-lradc-thresh1",
++ "mxs-lradc-channel0",
++ "mxs-lradc-channel1",
++ "mxs-lradc-channel2",
++ "mxs-lradc-channel3",
++ "mxs-lradc-channel4",
++ "mxs-lradc-channel5",
++ "mxs-lradc-channel6",
++ "mxs-lradc-channel7",
++ "mxs-lradc-button0",
++ "mxs-lradc-button1",
++};
++
++struct mxs_lradc_chan {
++ uint8_t slot;
++ uint8_t flags;
++};
++
++struct mxs_lradc {
++ struct device *dev;
++ void __iomem *base;
++ int irq[13];
++
++ uint32_t *buffer;
++ struct iio_trigger *trig;
++
++ struct mutex lock;
++
++ uint8_t enable;
++
++ struct completion completion;
++};
++
++#define LRADC_CTRL0 0x00
++#define LRADC_CTRL0_TOUCH_DETECT_ENABLE (1 << 23)
++#define LRADC_CTRL0_TOUCH_SCREEN_TYPE (1 << 22)
++
++#define LRADC_CTRL1 0x10
++#define LRADC_CTRL1_LRADC_IRQ(n) (1 << (n))
++#define LRADC_CTRL1_LRADC_IRQ_MASK 0x1fff
++#define LRADC_CTRL1_LRADC_IRQ_EN(n) (1 << ((n) + 16))
++#define LRADC_CTRL1_LRADC_IRQ_EN_MASK (0x1fff << 16)
++
++#define LRADC_CTRL2 0x20
++#define LRADC_CTRL2_TEMPSENSE_PWD (1 << 15)
++
++#define LRADC_CH(n) (0x50 + (0x10 * (n)))
++#define LRADC_CH_ACCUMULATE (1 << 29)
++#define LRADC_CH_NUM_SAMPLES_MASK (0x1f << 24)
++#define LRADC_CH_NUM_SAMPLES_OFFSET 24
++#define LRADC_CH_VALUE_MASK 0x3ffff
++#define LRADC_CH_VALUE_OFFSET 0
++
++#define LRADC_DELAY(n) (0xd0 + (0x10 * (n)))
++#define LRADC_DELAY_TRIGGER_LRADCS_MASK (0xff << 24)
++#define LRADC_DELAY_TRIGGER_LRADCS_OFFSET 24
++#define LRADC_DELAY_KICK (1 << 20)
++#define LRADC_DELAY_TRIGGER_DELAYS_MASK (0xf << 16)
++#define LRADC_DELAY_TRIGGER_DELAYS_OFFSET 16
++#define LRADC_DELAY_LOOP_COUNT_MASK (0x1f << 11)
++#define LRADC_DELAY_LOOP_COUNT_OFFSET 11
++#define LRADC_DELAY_DELAY_MASK 0x7ff
++#define LRADC_DELAY_DELAY_OFFSET 0
++
++#define LRADC_CTRL4 0x140
++#define LRADC_CTRL4_LRADCSELECT_MASK(n) (0xf << ((n) * 4))
++#define LRADC_CTRL4_LRADCSELECT_OFFSET(n) ((n) * 4)
++
++/*
++ * Raw I/O operations
++ */
++static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
++ const struct iio_chan_spec *chan,
++ int *val, int *val2, long m)
++{
++ struct mxs_lradc *lradc = iio_priv(iio_dev);
++ int ret;
++
++ if (m != IIO_CHAN_INFO_RAW)
++ return -EINVAL;
++
++ /* Check for invalid channel */
++ if (chan->channel > LRADC_MAX_TOTAL_CHANS)
++ return -EINVAL;
++
++ /*
++ * See if there is no buffered operation in progess. If there is, simply
++ * bail out. This can be improved to support both buffered and raw IO at
++ * the same time, yet the code becomes horribly complicated. Therefore I
++ * applied KISS principle here.
++ */
++ ret = mutex_trylock(&lradc->lock);
++ if (!ret)
++ return -EBUSY;
++
++ INIT_COMPLETION(lradc->completion);
++
++ /*
++ * No buffered operation in progress, map the channel and trigger it.
++ * Virtual channel 0 is always used here as the others are always not
++ * used if doing raw sampling.
++ */
++ writel(LRADC_CTRL1_LRADC_IRQ_EN_MASK,
++ lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
++ writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);
++
++ writel(chan->channel, lradc->base + LRADC_CTRL4);
++ writel(0, lradc->base + LRADC_CH(0));
++
++ /* Enable the IRQ and start sampling the channel. */
++ writel(LRADC_CTRL1_LRADC_IRQ_EN(0),
++ lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_SET);
++ writel(1 << 0, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_SET);
++
++ /* Wait for completion on the channel, 1 second max. */
++ ret = wait_for_completion_killable_timeout(&lradc->completion, HZ);
++ if (!ret)
++ ret = -ETIMEDOUT;
++ if (ret < 0)
++ goto err;
++
++ /* Read the data. */
++ *val = readl(lradc->base + LRADC_CH(0)) & LRADC_CH_VALUE_MASK;
++ ret = IIO_VAL_INT;
++
++err:
++ writel(LRADC_CTRL1_LRADC_IRQ_EN(0),
++ lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
++
++ mutex_unlock(&lradc->lock);
++
++ return ret;
++}
++
++static const struct iio_info mxs_lradc_iio_info = {
++ .driver_module = THIS_MODULE,
++ .read_raw = mxs_lradc_read_raw,
++};
++
++/*
++ * IRQ Handling...
[truncated message content] |