This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Wl12xx on imx6 with SDIO power issue

Other Parts Discussed in Thread: WL1271, BQ24190, BQ24193

Hi,

I ma facing the wl12xx configuration issue with imx6s...


Can you please support, how to interface wl12xx driver with imx6 (platform data and power on sequence.)

freescale login: root
login[2348]: root login on 'ttymxc2'
<ib/modules/3.0.35-2666-gbdde708/kernel/drivers/net/wireless/cfg80211.ko     
/drivers/net/wireless/wl12xx_sdio.ko
cfg80211: Calling CRDA to update world regulatory domain
<ib/modules/3.0.35-2666-gbdde708/kernel/drivers/net/wireless/mac80211.ko     
<ib/modules/3.0.35-2666-gbdde708/kernel/drivers/net/wireless/wl12xx.ko       
<ib/modules/3.0.35-2666-gbdde708/kernel/drivers/net/wireless/wl12xx_sdio.ko  
add wake up source irq 137
wl1271: loaded
root@freescale ~$
root@freescale ~$
root@freescale ~$
root@freescale ~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 1E:ED:19:27:1A:B3  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          LOOPBACK  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr DE:AD:BE:EF:00:00  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@freescale ~$ ifconfig wlan0 up
wl1271: firmware booted (Rev 6.3.3.0.79)
wl1271: Driver version: R4_SP2_03_00
root@freescale ~$ ifconfig wlan0 down
wl1271: ERROR ELP wakeup timeout!
wl1271: Reading FW panic log
------------[ cut here ]------------
WARNING: at /opt/wifi-bt-driver/ti-compat-wireless-wl12xx-0.20120206r412_02/drivers/net/wireless/wl12xx/cmd.c:65 wl1271_cmd_send+0x3a4/0x3d4 [wl12xx])
Modules linked in: wl12xx_sdio wl12xx mac80211 cfg80211
[<800447e8>] (unwind_backtrace+0x0/0xf8) from [<80070600>] (warn_slowpath_common+0x4c/0x64)
[<80070600>] (warn_slowpath_common+0x4c/0x64) from [<80070634>] (warn_slowpath_null+0x1c/0x24)
[<80070634>] (warn_slowpath_null+0x1c/0x24) from [<7f08cfe4>] (wl1271_cmd_send+0x3a4/0x3d4 [wl12xx])
[<7f08cfe4>] (wl1271_cmd_send+0x3a4/0x3d4 [wl12xx]) from [<7f08f8e4>] (wl12xx_cmd_stop_fwlog+0x48/0x88 [wl12xx])
[<7f08f8e4>] (wl12xx_cmd_stop_fwlog+0x48/0x88 [wl12xx]) from [<7f08b9ec>] (wl1271_recovery_work+0x1a0/0x2e0 [wl12xx])
[<7f08b9ec>] (wl1271_recovery_work+0x1a0/0x2e0 [wl12xx]) from [<800853bc>] (process_one_work+0x10c/0x38c)
[<800853bc>] (process_one_work+0x10c/0x38c) from [<80085bf4>] (worker_thread+0x170/0x37c)
[<80085bf4>] (worker_thread+0x170/0x37c) from [<80089aa4>] (kthread+0x80/0x88)
[<80089aa4>] (kthread+0x80/0x88) from [<8003eaa4>] (kernel_thread_exit+0x0/0x8)
---[ end trace cc388c08a9461816 ]---
First address of fwlogger = 0x2603
wl1271: Hardware recovery in progress. FW ver: Rev 6.3.3.0.79 pc: 0x0
wl1271: down
ieee80211 phy0: Hardware restart was requested
root@freescale ~$

  • Hi Vishwa,

    This suggests that the WLAN IRQ lines are not mapped correctly in your board file...
    Please follow: http://processors.wiki.ti.com/index.php/WL127x_Porting_Guide for the wl12xx porting guide.

    Regards,
    Gigi Joseph.

  • Hi Gigi Joseph,

    Thank for your kind replay.

    Now i am unable to bring up the wl1271 interface the second time on imx6

    We have ported the TI WL1271 driver to the i.MX6S platform and are using it with Linux3.0.35 reference sabersd. We can enable and disable the Wi-Fi interface for the first time. On trying to enable the wlan interface for the 2nd time it gives the following error log:



    wl1271: ERROR timeout waiting for the hardware to complete initialization
    wl1271: ERROR timeout waiting for the hardware to complete initialization
    wl1271: ERROR timeout waiting for the hardware to complete initialization
    wl1271: ERROR firmware boot failed despite 3 retries
    ifconfig: SIOCSIFFLAGS: Input/output error


    mmc1: Timeout waiting for hardware interrupt.
    wl1271: ERROR sdio read failed (-110)
    wl1271: ERROR sdio write failed (-84)
    mmc1: Timeout waiting for hardware interrupt.
    wl1271: ERROR sdio read failed (-110)
    wl1271: ERROR chip id doesn't match after firmware boot
    mmc1: Timeout waiting for hardware interrupt.
    wl1271: ERROR sdio read failed (-110)
    wl1271: WARNING unsupported chip id: 0x1
    wl1271: ERROR firmware boot failed despite 3 retries
    ifconfig: SIOCSIFFLAGS: No such device


    Below is my boardfile for imx6s.

     


     * Copyright (C) 2012-2013 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.

     * You should have received a copy of the GNU General Public License along
     * with this program; if not, write to the Free Software Foundation, Inc.,
     * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     */

    #include <linux/types.h>
    #include <linux/sched.h>
    #include <linux/delay.h>
    #include <linux/pm.h>
    #include <linux/interrupt.h>
    #include <linux/irq.h>
    #include <linux/init.h>
    #include <linux/input.h>
    #include <linux/nodemask.h>
    #include <linux/clk.h>
    #include <linux/platform_device.h>
    #include <linux/fsl_devices.h>
    #include <linux/spi/spi.h>
    #include <linux/spi/flash.h>
    #include <linux/i2c.h>
    #include <linux/i2c/pca953x.h>
    #include <linux/ata.h>
    #include <linux/mtd/mtd.h>
    #include <linux/mtd/map.h>
    #include <linux/mtd/partitions.h>
    #include <linux/regulator/consumer.h>
    #include <linux/pmic_external.h>
    #include <linux/pmic_status.h>
    #include <linux/ipu.h>
    #include <linux/mxcfb.h>
    #include <linux/pwm_backlight.h>
    #include <linux/fec.h>
    #include <linux/memblock.h>
    #include <linux/gpio.h>
    #include <linux/etherdevice.h>
    #include <linux/power/sabresd_battery.h>
    #include <linux/regulator/anatop-regulator.h>
    #include <linux/regulator/consumer.h>
    #include <linux/regulator/machine.h>
    #include <linux/regulator/fixed.h>
    #include <linux/mfd/max17135.h>
    #include <linux/mfd/wm8994/pdata.h>
    #include <linux/mfd/wm8994/gpio.h>
    //#include <sound/wm8962.h>  //vv_cmd_19_5_14
    #include <sound/wm8960.h>
    #include <linux/mfd/mxc-hdmi-core.h>
    #include <linux/lis3lv02d.h> //vishwa
    #include <linux/lsm303d.h> //vishwa
    #include <linux/stc3115_battery.h> //vishwa
    #include <linux/power/bq24190_charger.h> //vishwa

    #include <mach/common.h>
    #include <mach/hardware.h>
    #include <mach/mxc_dvfs.h>
    #include <mach/memory.h>
    #include <mach/iomux-mx6q.h>
    #include <mach/imx-uart.h>
    #include <mach/viv_gpu.h>
    #include <mach/ahci_sata.h>
    #include <mach/ipu-v3.h>
    #include <mach/mxc_hdmi.h>
    #include <mach/mxc_asrc.h>
    #include <mach/mipi_dsi.h>

    #include <asm/irq.h>
    #include <asm/setup.h>
    #include <asm/mach-types.h>
    #include <asm/mach/arch.h>
    #include <asm/mach/time.h>
    #include <linux/wl12xx.h>                               //vishwa

    #include "usb.h"
    #include "devices-imx6q.h"
    #include "crm_regs.h"
    #include "cpu_op-mx6.h"
    #include "board-mx6q_sabresd.h"
    //#include "board-mx6dl_sabresd.h"
    #include "board-imx6_fs_pet.h"

    //#define SABRESD_USR_DEF_GRN_LED    IMX_GPIO_NR(1, 1)
    //#define SABRESD_USR_DEF_RED_LED    IMX_GPIO_NR(1, 2)
    //#define SABRESD_VOLUME_UP    IMX_GPIO_NR(1, 4)
    //#define SABRESD_VOLUME_DN    IMX_GPIO_NR(1, 5)
    //#define SABRESD_MICROPHONE_DET    IMX_GPIO_NR(1, 9)
    //#define SABRESD_CSI0_PWN    IMX_GPIO_NR(1, 16)
    //#define SABRESD_CSI0_RST    IMX_GPIO_NR(1, 17)
    #define SABRESD_ACCL_INT    IMX_GPIO_NR(1, 18)
    #define SABRESD_MIPICSI_PWN    IMX_GPIO_NR(1, 19)
    #define SABRESD_MIPICSI_RST    IMX_GPIO_NR(1, 20)
    #define SABRESD_RGMII_RST    IMX_GPIO_NR(1, 25)
    #define SABRESD_RGMII_INT    IMX_GPIO_NR(1, 26)
    #define SABRESD_CHARGE_UOK_B    IMX_GPIO_NR(1, 27)
    #define SABRESD_USBH1_PWR_EN    IMX_GPIO_NR(1, 29)
    #define SABRESD_DISP0_PWR_EN    IMX_GPIO_NR(1, 30)

    //#define SABRESD_SD3_CD        IMX_GPIO_NR(2, 0)
    #define SABRESD_SD3_CD        IMX_GPIO_NR(1, 4)
    //#define SABRESD_SD3_WP        IMX_GPIO_NR(2, 1)
    #define SABRESD_SD2_CD        IMX_GPIO_NR(2, 2)
    #define SABRESD_SD2_WP        IMX_GPIO_NR(2, 3)
    #define SABRESD_CHARGE_DOK_B    IMX_GPIO_NR(2, 24)
    #define SABRESD_GPS_RESET    IMX_GPIO_NR(2, 28)
    #define SABRESD_SENSOR_EN    IMX_GPIO_NR(2, 31)

    #define SABRESD_GPS_EN    IMX_GPIO_NR(3, 0)
    #define SABRESD_DISP0_RST_B    IMX_GPIO_NR(3, 8)
    #define SABRESD_ALS_INT        IMX_GPIO_NR(3, 9)
    #define SABRESD_CHARGE_CHG_2_B    IMX_GPIO_NR(3, 13)
    #define SABRESD_CHARGE_FLT_2_B    IMX_GPIO_NR(3, 14)
    #define SABRESD_BAR0_INT    IMX_GPIO_NR(3, 15)
    #define SABRESD_eCOMPASS_INT    IMX_GPIO_NR(3, 16)
    #define SABRESD_GPS_PPS        IMX_GPIO_NR(3, 18)
    #define SABRESD_PCIE_PWR_EN    IMX_GPIO_NR(3, 19)
    //#define SABRESD_USB_OTG_PWR    IMX_GPIO_NR(3, 22)
    #define SABRESD_USB_H1_PWR    IMX_GPIO_NR(1, 29)
    #define SABRESD_CHARGE_CHG_1_B    IMX_GPIO_NR(3, 23)
    #define SABRESD_TS_INT        IMX_GPIO_NR(3, 26)
    #define SABRESD_DISP0_RD    IMX_GPIO_NR(3, 28)
    #define SABRESD_POWER_OFF    IMX_GPIO_NR(3, 29)

    #define SABRESD_CAN1_STBY    IMX_GPIO_NR(4, 5)
    #define SABRESD_ECSPI1_CS0  IMX_GPIO_NR(4, 9)
    #define SABRESD_CODEC_PWR_EN    IMX_GPIO_NR(4, 10)
    #define SABRESD_HDMI_CEC_IN    IMX_GPIO_NR(4, 11)
    #define SABRESD_PCIE_DIS_B    IMX_GPIO_NR(4, 14)

    #define SABRESD_DI0_D0_CS    IMX_GPIO_NR(5, 0)
    #define SABRESD_CHARGE_FLT_1_B    IMX_GPIO_NR(5, 2)
    #define SABRESD_PCIE_WAKE_B    IMX_GPIO_NR(5, 20)

    #define SABRESD_CAP_TCH_INT1    IMX_GPIO_NR(6, 7)
    #define SABRESD_CAP_TCH_INT0    IMX_GPIO_NR(6, 8)
    #define SABRESD_DISP_RST_B    IMX_GPIO_NR(6, 11)
    #define SABRESD_DISP_PWR_EN    IMX_GPIO_NR(6, 14)
    #define SABRESD_CABC_EN0    IMX_GPIO_NR(6, 15)
    #define SABRESD_CABC_EN1    IMX_GPIO_NR(6, 16)
    #define SABRESD_AUX_3V15_EN    IMX_GPIO_NR(6, 9)
    #define SABRESD_DISP0_WR_REVB    IMX_GPIO_NR(6, 9)
    #define SABRESD_AUX_5V_EN    IMX_GPIO_NR(6, 10)
    #define SABRESD_DI1_D0_CS    IMX_GPIO_NR(6, 31)

    #define SABRESD_HEADPHONE_DET    IMX_GPIO_NR(7, 8)
    #define SABRESD_PCIE_RST_B_REVB    IMX_GPIO_NR(7, 12)
    #define SABRESD_PMIC_INT_B    IMX_GPIO_NR(7, 13)
    #define SABRESD_PFUZE_INT    IMX_GPIO_NR(7, 13)

    #define SABRESD_EPDC_SDDO_0    IMX_GPIO_NR(2, 22)
    #define SABRESD_EPDC_SDDO_1    IMX_GPIO_NR(3, 10)
    #define SABRESD_EPDC_SDDO_2    IMX_GPIO_NR(3, 12)
    #define SABRESD_EPDC_SDDO_3    IMX_GPIO_NR(3, 11)
    #define SABRESD_EPDC_SDDO_4    IMX_GPIO_NR(2, 27)
    #define SABRESD_EPDC_SDDO_5    IMX_GPIO_NR(2, 30)
    #define SABRESD_EPDC_SDDO_6    IMX_GPIO_NR(2, 23)
    #define SABRESD_EPDC_SDDO_7    IMX_GPIO_NR(2, 26)
    #define SABRESD_EPDC_SDDO_8    IMX_GPIO_NR(2, 24)
    #define SABRESD_EPDC_SDDO_9    IMX_GPIO_NR(3, 15)
    #define SABRESD_EPDC_SDDO_10    IMX_GPIO_NR(3, 16)
    #define SABRESD_EPDC_SDDO_11    IMX_GPIO_NR(3, 23)
    #define SABRESD_EPDC_SDDO_12    IMX_GPIO_NR(3, 19)
    #define SABRESD_EPDC_SDDO_13    IMX_GPIO_NR(3, 13)
    #define SABRESD_EPDC_SDDO_14    IMX_GPIO_NR(3, 14)
    #define SABRESD_EPDC_SDDO_15    IMX_GPIO_NR(5, 2)
    #define SABRESD_EPDC_GDCLK    IMX_GPIO_NR(2, 17)
    #define SABRESD_EPDC_GDSP    IMX_GPIO_NR(2, 16)
    #define SABRESD_EPDC_GDOE    IMX_GPIO_NR(6, 6)
    #define SABRESD_EPDC_GDRL    IMX_GPIO_NR(5, 4)
    #define SABRESD_EPDC_SDCLK    IMX_GPIO_NR(3, 31)
    #define SABRESD_EPDC_SDOEZ    IMX_GPIO_NR(3, 30)
    #define SABRESD_EPDC_SDOED    IMX_GPIO_NR(3, 26)
    #define SABRESD_EPDC_SDOE    IMX_GPIO_NR(3, 27)
    #define SABRESD_EPDC_SDLE    IMX_GPIO_NR(3, 1)
    #define SABRESD_EPDC_SDCLKN    IMX_GPIO_NR(3, 0)
    #define SABRESD_EPDC_SDSHR    IMX_GPIO_NR(2, 29)
    #define SABRESD_EPDC_PWRCOM    IMX_GPIO_NR(2, 28)
    #define SABRESD_EPDC_PWRSTAT    IMX_GPIO_NR(2, 21)
    #define SABRESD_EPDC_PWRCTRL0    IMX_GPIO_NR(2, 20)
    #define SABRESD_EPDC_PWRCTRL1    IMX_GPIO_NR(2, 19)
    #define SABRESD_EPDC_PWRCTRL2    IMX_GPIO_NR(2, 18)
    #define SABRESD_EPDC_PWRCTRL3    IMX_GPIO_NR(3, 28)
    #define SABRESD_EPDC_BDR0    IMX_GPIO_NR(3, 2)
    #define SABRESD_EPDC_BDR1    IMX_GPIO_NR(3, 3)
    #define SABRESD_EPDC_SDCE0    IMX_GPIO_NR(3, 4)
    #define SABRESD_EPDC_SDCE1    IMX_GPIO_NR(3, 5)
    #define SABRESD_EPDC_SDCE2    IMX_GPIO_NR(3, 6)
    #define SABRESD_EPDC_SDCE3    IMX_GPIO_NR(3, 7)
    #define SABRESD_EPDC_SDCE4    IMX_GPIO_NR(3, 8)
    #define SABRESD_EPDC_PMIC_WAKE    IMX_GPIO_NR(3, 20)
    #define SABRESD_EPDC_PMIC_INT    IMX_GPIO_NR(2, 25)
    #define SABRESD_EPDC_VCOM    IMX_GPIO_NR(3, 17)
    //#define SABRESD_CHARGE_NOW    IMX_GPIO_NR(1, 2)
    //#define SABRESD_CHARGE_DONE    IMX_GPIO_NR(1, 1)
    #define SABRESD_ELAN_CE        IMX_GPIO_NR(2, 18)
    #define SABRESD_ELAN_RST    IMX_GPIO_NR(3, 8)
    #define SABRESD_ELAN_INT    IMX_GPIO_NR(3, 28)

    #define MX6_ENET_IRQ        IMX_GPIO_NR(1, 6)
    #define IOMUX_OBSRV_MUX1_OFFSET    0x3c
    #define OBSRV_MUX1_MASK            0x3f
    #define OBSRV_MUX1_ENET_IRQ        0x9

    /*Wi-Fi*/
    #define GPIO_WLAN_EN        IMX_GPIO_NR(1, 15)
    #define GPIO_WLAN_IRQ        IMX_GPIO_NR(1, 14)

    /*Battery Charger*/
    #define FS_BAT_INT        IMX_GPIO_NR(1, 9)
    //#define FS_BAT_OTG        IMX_GPIO_NR(7, 12)

    /*Fuel Guage*/
    #define FS_FUEL_INT        IMX_GPIO_NR(1, 7)
    #define FS_FUEL_RST        IMX_GPIO_NR(1, 8)

    /*Accelerometer*/
    #define FS_ACC_INT2        IMX_GPIO_NR(1, 2)
    #define FS_ACC_INT1        IMX_GPIO_NR(1, 3)
    #define FS_ACC_CS        IMX_GPIO_NR(1, 5)

    /*USB OTG*/
    #define FS_USB_OTG_PWR         IMX_GPIO_NR(3, 22)


    static struct clk *sata_clk;
    static struct clk *clko;
    //static int mma8451_position = 1;
    //static int mag3110_position = 2;
    static int max11801_mode = 1;
    static int caam_enabled;

    extern char *gp_reg_id;
    extern char *soc_reg_id;
    extern char *pu_reg_id;
    extern int epdc_enabled;
    extern bool enet_to_gpio_6;

    static int max17135_regulator_init(struct max17135 *max17135);
    #if 0
    static const struct esdhc_platform_data mx6q_sabresd_sd2_data __initconst = {
        .cd_gpio = SABRESD_SD2_CD,
        .wp_gpio = SABRESD_SD2_WP,
        .keep_power_at_suspend = 1,
        .support_8bit = 1,
        .delay_line = 0,
        .cd_type = ESDHC_CD_CONTROLLER,
    };
    #endif
    static const struct esdhc_platform_data mx6q_sabresd_sd3_data __initconst = {
        .cd_gpio = SABRESD_SD3_CD,
    //    .wp_gpio = SABRESD_SD3_WP,
        .keep_power_at_suspend = 1,
        .support_8bit = 1,
        .delay_line = 0,
        .cd_type = ESDHC_CD_CONTROLLER,
    };

    static const struct esdhc_platform_data mx6q_sabresd_sd4_data __initconst = {
        .always_present = 1,
        .keep_power_at_suspend = 1,
        .support_8bit = 1,
        .delay_line = 0,
        .cd_type = ESDHC_CD_PERMANENT,
    };

    static const struct anatop_thermal_platform_data
        mx6q_sabresd_anatop_thermal_data __initconst = {
            .name = "anatop_thermal",
    };

    static inline void mx6q_sabresd_init_uart(void)
    {
        imx6q_add_imx_uart(2, NULL);
        imx6q_add_imx_uart(0, NULL);
    }

    static int mx6q_sabresd_fec_phy_init(struct phy_device *phydev)
    {
        unsigned short val;

        /* Ar8031 phy SmartEEE feature cause link status generates glitch,
         * which cause ethernet link down/up issue, so disable SmartEEE
         */
        phy_write(phydev, 0xd, 0x3);
        phy_write(phydev, 0xe, 0x805d);
        phy_write(phydev, 0xd, 0x4003);
        val = phy_read(phydev, 0xe);
        val &= ~(0x1 << 8);
        phy_write(phydev, 0xe, val);

        /* To enable AR8031 ouput a 125MHz clk from CLK_25M */
        phy_write(phydev, 0xd, 0x7);
        phy_write(phydev, 0xe, 0x8016);
        phy_write(phydev, 0xd, 0x4007);
        val = phy_read(phydev, 0xe);

        val &= 0xffe3;
        val |= 0x18;
        phy_write(phydev, 0xe, val);

        /* Introduce tx clock delay */
        phy_write(phydev, 0x1d, 0x5);
        val = phy_read(phydev, 0x1e);
        val |= 0x0100;
        phy_write(phydev, 0x1e, val);

        /*check phy power*/
        val = phy_read(phydev, 0x0);

        if (val & BMCR_PDOWN)
            phy_write(phydev, 0x0, (val & ~BMCR_PDOWN));

        return 0;
    }

    static struct fec_platform_data fec_data __initdata = {
        .init = mx6q_sabresd_fec_phy_init,
        .phy = PHY_INTERFACE_MODE_RGMII,
        .gpio_irq = MX6_ENET_IRQ,
    };

    static int mx6q_sabresd_spi_cs[] = {
        SABRESD_ECSPI1_CS0,
    };

    static const struct spi_imx_master mx6q_sabresd_spi_data __initconst = {
        .chipselect     = mx6q_sabresd_spi_cs,
        .num_chipselect = ARRAY_SIZE(mx6q_sabresd_spi_cs),
    };

    #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
    static struct mtd_partition imx6_sabresd_spi_nor_partitions[] = {
        {
         .name = "bootloader",
         .offset = 0,
         .size = 0x00100000,
        },
        {
         .name = "kernel",
         .offset = MTDPART_OFS_APPEND,
         .size = MTDPART_SIZ_FULL,
        },
    };

    static struct flash_platform_data imx6_sabresd__spi_flash_data = {
        .name = "m25p80",
        .parts = imx6_sabresd_spi_nor_partitions,
        .nr_parts = ARRAY_SIZE(imx6_sabresd_spi_nor_partitions),
        .type = "sst25vf016b",
    };
    #endif

    static struct spi_board_info imx6_sabresd_spi_nor_device[] __initdata = {
    #if defined(CONFIG_MTD_M25P80)
        {
            .modalias = "m25p80",
            .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
            .bus_num = 0,
            .chip_select = 0,
            .platform_data = &imx6_sabresd__spi_flash_data,
        },
    #endif
    };

    static void spi_device_init(void)
    {
        spi_register_board_info(imx6_sabresd_spi_nor_device,
                    ARRAY_SIZE(imx6_sabresd_spi_nor_device));
    }

    /******************************************************************************/
    /***************************Accelerometer**************************************/
    /******************************************************************************/

    struct lsm303d_acc_platform_data lsm303d_pdata = {

    //      .poll_interval = 1,
    //      .min_interval = 1,

    //      .fs_range,
    //    .rot_matrix[3][3],

        //    .aa_filter_bandwidth,

      //      .init,
    //        .exit,
            .power_on = 1,
    //        .power_off,

    //    .gpio_int1 =    FS_ACC_INT1,
    //    .gpio_int2 =    FS_ACC_INT2,

    };

    static void lsm303d_init(void)
    {

        gpio_request(FS_ACC_CS, "acc-cs");
            gpio_direction_output(FS_ACC_CS, 1);
        printk("\nVishwa: Accele-lsm303d ..... CS\n");

    //        gpio_request(FS_ACC_INT1, "acc-int1");
      //         gpio_direction_input(FS_ACC_INT1);
    //    int irq = gpio_to_irq(FS_ACC_INT1);

    //    printk("Vishwa: Accele-lsm303d ..... int1 pin number %d\n",FS_ACC_INT1);
    //    printk("Vishwa: Accele-lsm303d ..... int1 irq number %d\n",irq);
            
    //    gpio_request(FS_ACC_INT1, "acc-int2");
      //    gpio_direction_input(FS_ACC_INT2);
    //    int ret = gpio_to_irq(FS_ACC_INT2);
    //    printk("Vishwa: Accele-lsm303d ..... int2 pin number %d\n",FS_ACC_INT2);
    //    printk("Vishwa: Accele-lsm303d ..... int2 irq: %d\n",ret);
        
    }


    /******************************************************************************/
    /******************************************************************************/
    /***************************Battary Charger************************************/
    /******************************************************************************/
    static struct bq24190_platform_data bq24190_pdata = {
        .gpio_int = FS_BAT_INT,
    //    gpio_direction_input(FS_BAT_INT),
    };


    /******************************************************************************/
    /***************************Fuel Guage*****************************************/
    /******************************************************************************/
    #if CONFIG_BATTERY_STC3115
    int null_fn(void)
    {
            return 0;                // for discharging status
    }

    int Temperature_fn(void)
    {
            return (25);
    }

    static struct stc311x_platform_data stc3115_data = {
                    .battery_online = NULL,
                    .charger_online = null_fn,              // used in stc311x_get_status()
                    .charger_enable = null_fn,              // used in stc311x_get_status()
                    .power_supply_register = NULL,
                    .power_supply_unregister = NULL,

                    .Vmode= 1,       /*REG_MODE, BIT_VMODE 1=Voltage mode, 0=mixed mode */
                    .Alm_SOC = 10,      /* SOC alm level %*/
                    .Alm_Vbat = 3600,   /* Vbat alm level mV*/
                    .CC_cnf = 525,      /* nominal CC_cnf, coming from battery characterisation*/
                    .VM_cnf = 558,      /* nominal VM cnf , coming from battery characterisation*/
                    .Cnom = 2600,       /* nominal capacity in mAh, coming from battery characterisation*/
                    .Rsense = 10,       /* sense resistor mOhms*/
                    .RelaxCurrent = 150, /* current for relaxation in mA (< C/20) */
                    .Adaptive = 1,     /* 1=Adaptive mode enabled, 0=Adaptive mode disabled */

                    /* Elentec Co Ltd Battery pack - 80 means 8% */
                    .CapDerating[6] = 71,   /* capacity derating in 0.1%, for temp = -20°C */
                    .CapDerating[5] = 42,   /* capacity derating in 0.1%, for temp = -10°C */
                    .CapDerating[4] = 13,    /* capacity derating in 0.1%, for temp = 0°C */
                    .CapDerating[3] = 5,  /* capacity derating in 0.1%, for temp = 10°C */
                    .CapDerating[2] = 0,  /* capacity derating in 0.1%, for temp = 25°C */
                    .CapDerating[1] = 0,  /* capacity derating in 0.1%, for temp = 40°C */
                    .CapDerating[0] = 0,  /* capacity derating in 0.1%, for temp = 60°C */

                    .OCVOffset[15] = 0,    /* OCV curve adjustment */
                    .OCVOffset[14] = 0,   /* OCV curve adjustment */
                    .OCVOffset[13] = 0,    /* OCV curve adjustment */
                    .OCVOffset[12] = 0,    /* OCV curve adjustment */
                    .OCVOffset[11] = 0,    /* OCV curve adjustment */
                    .OCVOffset[10] = 0,    /* OCV curve adjustment */
                    .OCVOffset[9] = 0,     /* OCV curve adjustment */
                    .OCVOffset[8] = 0,      /* OCV curve adjustment */
             .OCVOffset[7] = 0,      /* OCV curve adjustment */
                    .OCVOffset[6] = 0,    /* OCV curve adjustment */
                    .OCVOffset[5] = 0,    /* OCV curve adjustment */
                    .OCVOffset[4] = 0,     /* OCV curve adjustment */
                    .OCVOffset[3] = 0,    /* OCV curve adjustment */
                    .OCVOffset[2] = 0,     /* OCV curve adjustment */
                    .OCVOffset[1] = 0,    /* OCV curve adjustment */
                    .OCVOffset[0] = 0,     /* OCV curve adjustment */

                            /*if the application temperature data is preferred than the STC3115 temperature*/
                    .ExternalTemperature = Temperature_fn, /*External temperature fonction, return °C*/
                    .ForceExternalTemperature = 0, /* 1=External temperature, 0=STC3115 temperature */

    };
    #endif         

    static void stc3115_init(void)
    {
            gpio_direction_input(FS_FUEL_INT);
            gpio_direction_input(FS_FUEL_RST);
    }

    /*****************************************************/

    static struct imx_ssi_platform_data mx6_sabresd_ssi_pdata = {
        .flags = IMX_SSI_DMA | IMX_SSI_SYN,
    };

    static struct platform_device mx6_sabresd_audio_wm8960_device = {
        .name = "imx-wm8960",
    };

    static struct mxc_audio_platform_data wm8960_data;

    static int wm8960_clk_enable(int enable)
    {
        if (enable)
            clk_enable(clko);
        else
            clk_disable(clko);

        return 0;
    }


    static int mxc_wm8960_init(void)
    {
        int rate;

        clko = clk_get(NULL, "clko_clk");
        if (IS_ERR(clko)) {
            pr_err("can't get CLKO clock.\n");
            return PTR_ERR(clko);
        }
        /* both audio codec and comera use CLKO clk*/
        rate = clk_round_rate(clko, 24000000);
        clk_set_rate(clko, rate);

        wm8960_data.sysclk = rate;
    printk("\n &&&&&& Kernel Sysclk=0x%x",wm8960_data.sysclk);

        return 0;
    }

    static struct wm8960_pdata wm8960_config_data = {
    #if 0  //vv_19_5_14

       .gpio_init = {
                    [2] = WM8960_GPIO_FN_DMICCLK,
                    [4] = 0x8000 | WM8960_GPIO_FN_DMICDAT,
            },

    #endif //vv_19_5_14
    };

    static struct mxc_audio_platform_data wm8960_data = {
        .ssi_num = 1,
        .src_port = 2,
        .ext_port = 3,
    //    .hp_gpio = SABRESD_HEADPHONE_DET,
        .hp_active_low = 1,
    //    .mic_gpio = SABRESD_MICROPHONE_DET,
        .mic_active_low = 1,
        .init = mxc_wm8960_init,
        .clock_enable = wm8960_clk_enable,
    };

    static struct regulator_consumer_supply sabresd_vwm8960_consumers[] = {
        REGULATOR_SUPPLY("SPKVDD1", "0-001a"),
        REGULATOR_SUPPLY("SPKVDD2", "0-001a"),
    };

    static struct regulator_init_data sabresd_vwm8960_init = {
        .constraints = {
            .name = "SPKVDD",
            .valid_ops_mask =  REGULATOR_CHANGE_STATUS,
            .boot_on = 1,
        },
        .num_consumer_supplies = ARRAY_SIZE(sabresd_vwm8960_consumers),
        .consumer_supplies = sabresd_vwm8960_consumers,
    };

    static struct fixed_voltage_config sabresd_vwm8960_reg_config = {
        .supply_name    = "SPKVDD",
        .microvolts        = 4200000,
    //    .gpio            = FS_CODEC_PWR_EN,
        .enable_high    = 1,
        .enabled_at_boot = 1,
        .init_data        = &sabresd_vwm8960_init,
    };

    static struct platform_device sabresd_vwm8960_reg_devices = {
        .name    = "reg-fixed-voltage",
        .id        = 4,
        .dev    = {
            .platform_data = &sabresd_vwm8960_reg_config,
        },
    };
    #if 0                                //vishwa
    static struct platform_device mx6_sabresd_audio_wm8958_device = {
        .name = "imx-wm8958",
    };


    static struct mxc_audio_platform_data wm8958_data = {
        .ssi_num = 1,
        .src_port = 2,
        .ext_port = 3,
        .hp_gpio = SABRESD_HEADPHONE_DET,
        .hp_active_low = 1,
    };


    static struct wm8994_pdata wm8958_config_data = {
        .gpio_defaults = {
            [0] = WM8994_GP_FN_GPIO | WM8994_GPN_DB,
            [1] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
            [2] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
            [3] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
            [4] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
            [5] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
            [7] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
            [8] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
            [9] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
            [10] = WM8994_GP_FN_GPIO | WM8994_GPN_DB | WM8994_GPN_PD,
        },
    };


    static int mxc_wm8958_init(void)
    {
        struct clk *clko;
        int rate;

        clko = clk_get(NULL, "clko_clk");
        if (IS_ERR(clko)) {
            pr_err("can't get CLKO clock.\n");
            return PTR_ERR(clko);
        }
        /* both audio codec and comera use CLKO clk*/
        rate = clk_round_rate(clko, 24000000);

        wm8958_data.sysclk = rate;
        clk_set_rate(clko, rate);

        /* enable wm8958 4.2v power supply */
        gpio_request(SABRESD_CODEC_PWR_EN, "aud_4v2");
        gpio_direction_output(SABRESD_CODEC_PWR_EN, 1);
        msleep(1);
        gpio_set_value(SABRESD_CODEC_PWR_EN, 1);

        return 0;
    }

    static struct platform_device mx6_sabresd_audio_wm8962_device = {
        .name = "imx-wm8962",
    };

    static struct mxc_audio_platform_data wm8962_data;

    static int wm8962_clk_enable(int enable)
    {
        if (enable)
            clk_enable(clko);
        else
            clk_disable(clko);

        return 0;
    }

    static int mxc_wm8962_init(void)
    {
        int rate;

        clko = clk_get(NULL, "clko_clk");
        if (IS_ERR(clko)) {
            pr_err("can't get CLKO clock.\n");
            return PTR_ERR(clko);
        }
        /* both audio codec and comera use CLKO clk*/
        rate = clk_round_rate(clko, 24000000);
        clk_set_rate(clko, rate);

        wm8962_data.sysclk = rate;

        return 0;
    }

    static struct wm8962_pdata wm8962_config_data = {
        .gpio_init = {
            [2] = WM8962_GPIO_FN_DMICCLK,
            [4] = 0x8000 | WM8962_GPIO_FN_DMICDAT,
        },
    };

    static struct mxc_audio_platform_data wm8962_data = {
        .ssi_num = 1,
        .src_port = 2,
        .ext_port = 3,
        .hp_gpio = SABRESD_HEADPHONE_DET,
        .hp_active_low = 1,
        .mic_gpio = SABRESD_MICROPHONE_DET,
        .mic_active_low = 1,
        .init = mxc_wm8962_init,
        .clock_enable = wm8962_clk_enable,
    };

    static struct regulator_consumer_supply sabresd_vwm8962_consumers[] = {
        REGULATOR_SUPPLY("SPKVDD1", "0-001a"),
        REGULATOR_SUPPLY("SPKVDD2", "0-001a"),
    };

    static struct regulator_init_data sabresd_vwm8962_init = {
        .constraints = {
            .name = "SPKVDD",
            .valid_ops_mask =  REGULATOR_CHANGE_STATUS,
            .boot_on = 1,
        },
        .num_consumer_supplies = ARRAY_SIZE(sabresd_vwm8962_consumers),
        .consumer_supplies = sabresd_vwm8962_consumers,
    };

    static struct fixed_voltage_config sabresd_vwm8962_reg_config = {
        .supply_name    = "SPKVDD",
        .microvolts        = 4200000,
        .gpio            = SABRESD_CODEC_PWR_EN,
        .enable_high    = 1,
        .enabled_at_boot = 1,
        .init_data        = &sabresd_vwm8962_init,
    };

    static struct platform_device sabresd_vwm8962_reg_devices = {
        .name    = "reg-fixed-voltage",
        .id        = 4,
        .dev    = {
            .platform_data = &sabresd_vwm8962_reg_config,
        },
    };
    #endif

    #if 0
    static void mx6q_csi0_cam_powerdown(int powerdown)
    {
        if (powerdown)
            gpio_set_value(SABRESD_CSI0_PWN, 1);
        else
            gpio_set_value(SABRESD_CSI0_PWN, 0);

        msleep(2);
    }

    static void mx6q_csi0_io_init(void)
    {
        if (cpu_is_mx6q())
            mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_csi0_sensor_pads,
                ARRAY_SIZE(mx6q_sabresd_csi0_sensor_pads));
        else if (cpu_is_mx6dl())
            mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_csi0_sensor_pads,
                ARRAY_SIZE(mx6dl_sabresd_csi0_sensor_pads));

        /* Camera reset */
        gpio_request(SABRESD_CSI0_RST, "cam-reset");
        gpio_direction_output(SABRESD_CSI0_RST, 1);

        /* Camera power down */
        gpio_request(SABRESD_CSI0_PWN, "cam-pwdn");
        gpio_direction_output(SABRESD_CSI0_PWN, 1);
        msleep(5);
        gpio_set_value(SABRESD_CSI0_PWN, 0);
        msleep(5);
        gpio_set_value(SABRESD_CSI0_RST, 0);
        msleep(1);
        gpio_set_value(SABRESD_CSI0_RST, 1);
        msleep(5);
        gpio_set_value(SABRESD_CSI0_PWN, 1);

        /* For MX6Q:
         * GPR1 bit19 and bit20 meaning:
         * Bit19:       0 - Enable mipi to IPU1 CSI0
         *                      virtual channel is fixed to 0
         *              1 - Enable parallel interface to IPU1 CSI0
         * Bit20:       0 - Enable mipi to IPU2 CSI1
         *                      virtual channel is fixed to 3
         *              1 - Enable parallel interface to IPU2 CSI1
         * IPU1 CSI1 directly connect to mipi csi2,
         *      virtual channel is fixed to 1
         * IPU2 CSI0 directly connect to mipi csi2,
         *      virtual channel is fixed to 2
         *
         * For MX6DL:
         * GPR13 bit 0-2 IPU_CSI0_MUX
         *   000 MIPI_CSI0
         *   100 IPU CSI0
         */
        if (cpu_is_mx6q())
            mxc_iomux_set_gpr_register(1, 19, 1, 1);
        else if (cpu_is_mx6dl())
            mxc_iomux_set_gpr_register(13, 0, 3, 4);
    }

    static struct fsl_mxc_camera_platform_data camera_data = {
        .mclk = 24000000,
        .mclk_source = 0,
        .csi = 0,
        .io_init = mx6q_csi0_io_init,
        .pwdn = mx6q_csi0_cam_powerdown,
    };

    static void mx6q_mipi_powerdown(int powerdown)
    {
        if (powerdown)
            gpio_set_value(SABRESD_MIPICSI_PWN, 1);
        else
            gpio_set_value(SABRESD_MIPICSI_PWN, 0);

        msleep(2);
    }

    static void mx6q_mipi_sensor_io_init(void)
    {
        if (cpu_is_mx6q())
            mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_mipi_sensor_pads,
                ARRAY_SIZE(mx6q_sabresd_mipi_sensor_pads));
        else if (cpu_is_mx6dl())
            mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_mipi_sensor_pads,
                ARRAY_SIZE(mx6dl_sabresd_mipi_sensor_pads));

        /* Camera reset */
        gpio_request(SABRESD_MIPICSI_RST, "cam-reset");
        gpio_direction_output(SABRESD_MIPICSI_RST, 1);

        /* Camera power down */
        gpio_request(SABRESD_MIPICSI_PWN, "cam-pwdn");
        gpio_direction_output(SABRESD_MIPICSI_PWN, 1);
        msleep(5);
        gpio_set_value(SABRESD_MIPICSI_PWN, 0);
        msleep(5);
        gpio_set_value(SABRESD_MIPICSI_RST, 0);
        msleep(1);
        gpio_set_value(SABRESD_MIPICSI_RST, 1);
        msleep(5);
        gpio_set_value(SABRESD_MIPICSI_PWN, 1);

        /*for mx6dl, mipi virtual channel 1 connect to csi 1*/
        if (cpu_is_mx6dl())
            mxc_iomux_set_gpr_register(13, 3, 3, 1);
    }

    static struct fsl_mxc_camera_platform_data mipi_csi2_data = {
        .mclk = 24000000,
        .mclk_source = 0,
        .csi = 1,
        .io_init = mx6q_mipi_sensor_io_init,
        .pwdn = mx6q_mipi_powerdown,
    };
    #endif
    #define mV_to_uV(mV) (mV * 1000)
    #define uV_to_mV(uV) (uV / 1000)
    #define V_to_uV(V) (mV_to_uV(V * 1000))
    #define uV_to_V(uV) (uV_to_mV(uV) / 1000)

    static struct regulator_consumer_supply display_consumers[] = {
        {
            /* MAX17135 */
            .supply = "DISPLAY",
        },
    };

    static struct regulator_consumer_supply vcom_consumers[] = {
        {
            /* MAX17135 */
            .supply = "VCOM",
        },
    };

    static struct regulator_consumer_supply v3p3_consumers[] = {
        {
            /* MAX17135 */
            .supply = "V3P3",
        },
    };

    static struct regulator_init_data max17135_init_data[] = {
        {
            .constraints = {
                .name = "DISPLAY",
                .valid_ops_mask =  REGULATOR_CHANGE_STATUS,
            },
            .num_consumer_supplies = ARRAY_SIZE(display_consumers),
            .consumer_supplies = display_consumers,
        }, {
            .constraints = {
                .name = "GVDD",
                .min_uV = V_to_uV(20),
                .max_uV = V_to_uV(20),
            },
        }, {
            .constraints = {
                .name = "GVEE",
                .min_uV = V_to_uV(-22),
                .max_uV = V_to_uV(-22),
            },
        }, {
            .constraints = {
                .name = "HVINN",
                .min_uV = V_to_uV(-22),
                .max_uV = V_to_uV(-22),
            },
        }, {
            .constraints = {
                .name = "HVINP",
                .min_uV = V_to_uV(20),
                .max_uV = V_to_uV(20),
            },
        }, {
            .constraints = {
                .name = "VCOM",
                .min_uV = mV_to_uV(-4325),
                .max_uV = mV_to_uV(-500),
                .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
                REGULATOR_CHANGE_STATUS,
            },
            .num_consumer_supplies = ARRAY_SIZE(vcom_consumers),
            .consumer_supplies = vcom_consumers,
        }, {
            .constraints = {
                .name = "VNEG",
                .min_uV = V_to_uV(-15),
                .max_uV = V_to_uV(-15),
            },
        }, {
            .constraints = {
                .name = "VPOS",
                .min_uV = V_to_uV(15),
                .max_uV = V_to_uV(15),
            },
        }, {
            .constraints = {
                .name = "V3P3",
                .valid_ops_mask =  REGULATOR_CHANGE_STATUS,
            },
            .num_consumer_supplies = ARRAY_SIZE(v3p3_consumers),
            .consumer_supplies = v3p3_consumers,
        },
    };

    static struct platform_device max17135_sensor_device = {
        .name = "max17135_sensor",
        .id = 0,
    };

    static struct max17135_platform_data max17135_pdata __initdata = {
        .vneg_pwrup = 1,
        .gvee_pwrup = 1,
        .vpos_pwrup = 2,
        .gvdd_pwrup = 1,
        .gvdd_pwrdn = 1,
        .vpos_pwrdn = 2,
        .gvee_pwrdn = 1,
        .vneg_pwrdn = 1,
        .gpio_pmic_pwrgood = SABRESD_EPDC_PWRSTAT,
        .gpio_pmic_vcom_ctrl = SABRESD_EPDC_VCOM,
        .gpio_pmic_wakeup = SABRESD_EPDC_PMIC_WAKE,
        .gpio_pmic_v3p3 = SABRESD_EPDC_PWRCTRL0,
        .gpio_pmic_intr = SABRESD_EPDC_PMIC_INT,
        .regulator_init = max17135_init_data,
        .init = max17135_regulator_init,
    };

    static int __init max17135_regulator_init(struct max17135 *max17135)
    {
        struct max17135_platform_data *pdata = &max17135_pdata;
        int i, ret;

        if (!epdc_enabled) {
            printk(KERN_DEBUG
                "max17135_regulator_init abort: EPDC not enabled\n");
            return 0;
        }

        max17135->gvee_pwrup = pdata->gvee_pwrup;
        max17135->vneg_pwrup = pdata->vneg_pwrup;
        max17135->vpos_pwrup = pdata->vpos_pwrup;
        max17135->gvdd_pwrup = pdata->gvdd_pwrup;
        max17135->gvdd_pwrdn = pdata->gvdd_pwrdn;
        max17135->vpos_pwrdn = pdata->vpos_pwrdn;
        max17135->vneg_pwrdn = pdata->vneg_pwrdn;
        max17135->gvee_pwrdn = pdata->gvee_pwrdn;

        max17135->max_wait = pdata->vpos_pwrup + pdata->vneg_pwrup +
            pdata->gvdd_pwrup + pdata->gvee_pwrup;

        max17135->gpio_pmic_pwrgood = pdata->gpio_pmic_pwrgood;
        max17135->gpio_pmic_vcom_ctrl = pdata->gpio_pmic_vcom_ctrl;
        max17135->gpio_pmic_wakeup = pdata->gpio_pmic_wakeup;
        max17135->gpio_pmic_v3p3 = pdata->gpio_pmic_v3p3;
        max17135->gpio_pmic_intr = pdata->gpio_pmic_intr;

        gpio_request(max17135->gpio_pmic_wakeup, "epdc-pmic-wake");
        gpio_direction_output(max17135->gpio_pmic_wakeup, 0);

        gpio_request(max17135->gpio_pmic_vcom_ctrl, "epdc-vcom");
        gpio_direction_output(max17135->gpio_pmic_vcom_ctrl, 0);

        gpio_request(max17135->gpio_pmic_v3p3, "epdc-v3p3");
        gpio_direction_output(max17135->gpio_pmic_v3p3, 0);

        gpio_request(max17135->gpio_pmic_intr, "epdc-pmic-int");
        gpio_direction_input(max17135->gpio_pmic_intr);

        gpio_request(max17135->gpio_pmic_pwrgood, "epdc-pwrstat");
        gpio_direction_input(max17135->gpio_pmic_pwrgood);

        max17135->vcom_setup = false;
        max17135->init_done = false;

        for (i = 0; i < MAX17135_NUM_REGULATORS; i++) {
            ret = max17135_register_regulator(max17135, i,
                &pdata->regulator_init[i]);
            if (ret != 0) {
                printk(KERN_ERR"max17135 regulator init failed: %d\n",
                    ret);
                return ret;
            }
        }

        /*
         * TODO: We cannot enable full constraints for now, since
         * it results in the PFUZE regulators being disabled
         * at the end of boot, which disables critical regulators.
         */
        /*regulator_has_full_constraints();*/

        return 0;
    }

    static struct imxi2c_platform_data mx6q_sabresd_i2c_data = {
        .bitrate = 100000,
    };

    static struct fsl_mxc_lightsensor_platform_data ls_data = {
        .rext = 499,    /* calibration: 499K->700K */
    };

    static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {
    //    {
    //        I2C_BOARD_INFO("wm89**", 0x1a),
    //    },
        {                                                               
                I2C_BOARD_INFO("wm8960", 0x1a),
            },
    //    {
    //        I2C_BOARD_INFO("ov564x", 0x3c),
    //        .platform_data = (void *)&camera_data,
    //    },
    //    {
    //        I2C_BOARD_INFO("mma8451", 0x1c),
    //        .platform_data = (void *)&mma8451_position,
    //    },
    };

    static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {
    //    {
    //        I2C_BOARD_INFO("mxc_hdmi_i2c", 0x50),
    //    },
    //    {
    //        I2C_BOARD_INFO("ov5640_mipi", 0x3c),
    //        .platform_data = (void *)&mipi_csi2_data,
    //    },
    //    {
    //        I2C_BOARD_INFO("egalax_ts", 0x4),
    //        .irq = gpio_to_irq(SABRESD_CAP_TCH_INT0),
    //    },
    //    {
    //        I2C_BOARD_INFO("max11801", 0x48),
    //        .platform_data = (void *)&max11801_mode,
    //        .irq = gpio_to_irq(SABRESD_TS_INT),
    //    },
        {
                I2C_BOARD_INFO("lsm303d", 0x1E),
    //        .irq    = gpio_to_irq(FS_ACC_INT1),   /*TODO*/
                  .platform_data = &lsm303d_pdata,
        },
        {                            
                    I2C_BOARD_INFO("bq24193", 0x6B),
            .platform_data = &bq24190_pdata,
            },
        {                                                               
                    I2C_BOARD_INFO("stc3115", 0x70),
                    .platform_data = &stc3115_data,
            .irq = gpio_to_irq(FS_FUEL_INT),
            },
    };

    static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {
    //    {
    //        I2C_BOARD_INFO("max17135", 0x48),
    //        .platform_data = &max17135_pdata,
    //    },
    //    {
    //        I2C_BOARD_INFO("egalax_ts", 0x4),
    //        .irq = gpio_to_irq(SABRESD_CAP_TCH_INT1),
    //    },
    //    {
    //        I2C_BOARD_INFO("mag3110", 0x0e),
    //        .irq = gpio_to_irq(SABRESD_eCOMPASS_INT),
    //        .platform_data = (void *)&mag3110_position,
    //    },
    //    {
    //        I2C_BOARD_INFO("isl29023", 0x44),
    //        .irq  = gpio_to_irq(SABRESD_ALS_INT),
    //        .platform_data = &ls_data,
    //    }, {
    //        I2C_BOARD_INFO("elan-touch", 0x10),
    //        .irq = gpio_to_irq(SABRESD_ELAN_INT),
    //    },
    };

    static int epdc_get_pins(void)
    {
        int ret = 0;

        /* Claim GPIOs for EPDC pins - used during power up/down */
        ret |= gpio_request(SABRESD_EPDC_SDDO_0, "epdc_d0");
        ret |= gpio_request(SABRESD_EPDC_SDDO_1, "epdc_d1");
        ret |= gpio_request(SABRESD_EPDC_SDDO_2, "epdc_d2");
        ret |= gpio_request(SABRESD_EPDC_SDDO_3, "epdc_d3");
        ret |= gpio_request(SABRESD_EPDC_SDDO_4, "epdc_d4");
        ret |= gpio_request(SABRESD_EPDC_SDDO_5, "epdc_d5");
        ret |= gpio_request(SABRESD_EPDC_SDDO_6, "epdc_d6");
        ret |= gpio_request(SABRESD_EPDC_SDDO_7, "epdc_d7");
        ret |= gpio_request(SABRESD_EPDC_GDCLK, "epdc_gdclk");
        ret |= gpio_request(SABRESD_EPDC_GDSP, "epdc_gdsp");
        ret |= gpio_request(SABRESD_EPDC_GDOE, "epdc_gdoe");
        ret |= gpio_request(SABRESD_EPDC_GDRL, "epdc_gdrl");
        ret |= gpio_request(SABRESD_EPDC_SDCLK, "epdc_sdclk");
        ret |= gpio_request(SABRESD_EPDC_SDOE, "epdc_sdoe");
        ret |= gpio_request(SABRESD_EPDC_SDLE, "epdc_sdle");
        ret |= gpio_request(SABRESD_EPDC_SDSHR, "epdc_sdshr");
        ret |= gpio_request(SABRESD_EPDC_BDR0, "epdc_bdr0");
        ret |= gpio_request(SABRESD_EPDC_SDCE0, "epdc_sdce0");
        ret |= gpio_request(SABRESD_EPDC_SDCE1, "epdc_sdce1");
        ret |= gpio_request(SABRESD_EPDC_SDCE2, "epdc_sdce2");

        return ret;
    }

    static void epdc_put_pins(void)
    {
        gpio_free(SABRESD_EPDC_SDDO_0);
        gpio_free(SABRESD_EPDC_SDDO_1);
        gpio_free(SABRESD_EPDC_SDDO_2);
        gpio_free(SABRESD_EPDC_SDDO_3);
        gpio_free(SABRESD_EPDC_SDDO_4);
        gpio_free(SABRESD_EPDC_SDDO_5);
        gpio_free(SABRESD_EPDC_SDDO_6);
        gpio_free(SABRESD_EPDC_SDDO_7);
        gpio_free(SABRESD_EPDC_GDCLK);
        gpio_free(SABRESD_EPDC_GDSP);
        gpio_free(SABRESD_EPDC_GDOE);
        gpio_free(SABRESD_EPDC_GDRL);
        gpio_free(SABRESD_EPDC_SDCLK);
        gpio_free(SABRESD_EPDC_SDOE);
        gpio_free(SABRESD_EPDC_SDLE);
        gpio_free(SABRESD_EPDC_SDSHR);
        gpio_free(SABRESD_EPDC_BDR0);
        gpio_free(SABRESD_EPDC_SDCE0);
        gpio_free(SABRESD_EPDC_SDCE1);
        gpio_free(SABRESD_EPDC_SDCE2);
    }

    static void epdc_enable_pins(void)
    {
        /* Configure MUX settings to enable EPDC use */
        mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_epdc_enable_pads, \
                    ARRAY_SIZE(mx6dl_sabresd_epdc_enable_pads));

        gpio_direction_input(SABRESD_EPDC_SDDO_0);
        gpio_direction_input(SABRESD_EPDC_SDDO_1);
        gpio_direction_input(SABRESD_EPDC_SDDO_2);
        gpio_direction_input(SABRESD_EPDC_SDDO_3);
        gpio_direction_input(SABRESD_EPDC_SDDO_4);
        gpio_direction_input(SABRESD_EPDC_SDDO_5);
        gpio_direction_input(SABRESD_EPDC_SDDO_6);
        gpio_direction_input(SABRESD_EPDC_SDDO_7);
        gpio_direction_input(SABRESD_EPDC_GDCLK);
        gpio_direction_input(SABRESD_EPDC_GDSP);
        gpio_direction_input(SABRESD_EPDC_GDOE);
        gpio_direction_input(SABRESD_EPDC_GDRL);
        gpio_direction_input(SABRESD_EPDC_SDCLK);
        gpio_direction_input(SABRESD_EPDC_SDOE);
        gpio_direction_input(SABRESD_EPDC_SDLE);
        gpio_direction_input(SABRESD_EPDC_SDSHR);
        gpio_direction_input(SABRESD_EPDC_BDR0);
        gpio_direction_input(SABRESD_EPDC_SDCE0);
        gpio_direction_input(SABRESD_EPDC_SDCE1);
        gpio_direction_input(SABRESD_EPDC_SDCE2);
    }

    static void epdc_disable_pins(void)
    {
        /* Configure MUX settings for EPDC pins to
         * GPIO and drive to 0. */
        mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_epdc_disable_pads, \
                    ARRAY_SIZE(mx6dl_sabresd_epdc_disable_pads));

        gpio_direction_output(SABRESD_EPDC_SDDO_0, 0);
        gpio_direction_output(SABRESD_EPDC_SDDO_1, 0);
        gpio_direction_output(SABRESD_EPDC_SDDO_2, 0);
        gpio_direction_output(SABRESD_EPDC_SDDO_3, 0);
        gpio_direction_output(SABRESD_EPDC_SDDO_4, 0);
        gpio_direction_output(SABRESD_EPDC_SDDO_5, 0);
        gpio_direction_output(SABRESD_EPDC_SDDO_6, 0);
        gpio_direction_output(SABRESD_EPDC_SDDO_7, 0);
        gpio_direction_output(SABRESD_EPDC_GDCLK, 0);
        gpio_direction_output(SABRESD_EPDC_GDSP, 0);
        gpio_direction_output(SABRESD_EPDC_GDOE, 0);
        gpio_direction_output(SABRESD_EPDC_GDRL, 0);
        gpio_direction_output(SABRESD_EPDC_SDCLK, 0);
        gpio_direction_output(SABRESD_EPDC_SDOE, 0);
        gpio_direction_output(SABRESD_EPDC_SDLE, 0);
        gpio_direction_output(SABRESD_EPDC_SDSHR, 0);
        gpio_direction_output(SABRESD_EPDC_BDR0, 0);
        gpio_direction_output(SABRESD_EPDC_SDCE0, 0);
        gpio_direction_output(SABRESD_EPDC_SDCE1, 0);
        gpio_direction_output(SABRESD_EPDC_SDCE2, 0);
    }

    static struct fb_videomode e60_v110_mode = {
        .name = "E60_V110",
        .refresh = 50,
        .xres = 800,
        .yres = 600,
        .pixclock = 18604700,
        .left_margin = 8,
        .right_margin = 178,
        .upper_margin = 4,
        .lower_margin = 10,
        .hsync_len = 20,
        .vsync_len = 4,
        .sync = 0,
        .vmode = FB_VMODE_NONINTERLACED,
        .flag = 0,
    };
    static struct fb_videomode e60_v220_mode = {
        .name = "E60_V220",
        .refresh = 85,
        .xres = 800,
        .yres = 600,
        .pixclock = 30000000,
        .left_margin = 8,
        .right_margin = 164,
        .upper_margin = 4,
        .lower_margin = 8,
        .hsync_len = 4,
        .vsync_len = 1,
        .sync = 0,
        .vmode = FB_VMODE_NONINTERLACED,
        .flag = 0,
        .refresh = 85,
        .xres = 800,
        .yres = 600,
    };
    static struct fb_videomode e060scm_mode = {
        .name = "E060SCM",
        .refresh = 85,
        .xres = 800,
        .yres = 600,
        .pixclock = 26666667,
        .left_margin = 8,
        .right_margin = 100,
        .upper_margin = 4,
        .lower_margin = 8,
        .hsync_len = 4,
        .vsync_len = 1,
        .sync = 0,
        .vmode = FB_VMODE_NONINTERLACED,
        .flag = 0,
    };
    static struct fb_videomode e97_v110_mode = {
        .name = "E97_V110",
        .refresh = 50,
        .xres = 1200,
        .yres = 825,
        .pixclock = 32000000,
        .left_margin = 12,
        .right_margin = 128,
        .upper_margin = 4,
        .lower_margin = 10,
        .hsync_len = 20,
        .vsync_len = 4,
        .sync = 0,
        .vmode = FB_VMODE_NONINTERLACED,
        .flag = 0,
    };

    static struct imx_epdc_fb_mode panel_modes[] = {
        {
            &e60_v110_mode,
            4,      /* vscan_holdoff */
            10,     /* sdoed_width */
            20,     /* sdoed_delay */
            10,     /* sdoez_width */
            20,     /* sdoez_delay */
            428,    /* gdclk_hp_offs */
            20,     /* gdsp_offs */
            0,      /* gdoe_offs */
            1,      /* gdclk_offs */
            1,      /* num_ce */
        },
        {
            &e60_v220_mode,
            4,      /* vscan_holdoff */
            10,     /* sdoed_width */
            20,     /* sdoed_delay */
            10,     /* sdoez_width */
            20,     /* sdoez_delay */
            465,    /* gdclk_hp_offs */
            20,     /* gdsp_offs */
            0,      /* gdoe_offs */
            9,      /* gdclk_offs */
            1,      /* num_ce */
        },
        {
            &e060scm_mode,
            4,      /* vscan_holdoff */
            10,     /* sdoed_width */
            20,     /* sdoed_delay */
            10,     /* sdoez_width */
            20,     /* sdoez_delay */
            419,    /* gdclk_hp_offs */
            20,     /* gdsp_offs */
            0,      /* gdoe_offs */
            5,      /* gdclk_offs */
            1,      /* num_ce */
        },
        {
            &e97_v110_mode,
            8,      /* vscan_holdoff */
            10,     /* sdoed_width */
            20,     /* sdoed_delay */
            10,     /* sdoez_width */
            20,     /* sdoez_delay */
            632,    /* gdclk_hp_offs */
            20,     /* gdsp_offs */
            0,      /* gdoe_offs */
            1,      /* gdclk_offs */
            3,      /* num_ce */
        }
    };

    static struct imx_epdc_fb_platform_data epdc_data = {
        .epdc_mode = panel_modes,
        .num_modes = ARRAY_SIZE(panel_modes),
        .get_pins = epdc_get_pins,
        .put_pins = epdc_put_pins,
        .enable_pins = epdc_enable_pins,
        .disable_pins = epdc_disable_pins,
    };

    static void imx6q_sabresd_usbotg_vbus(bool on)
    {
        if (on)
            gpio_set_value(FS_USB_OTG_PWR, 1);
        else
            gpio_set_value(FS_USB_OTG_PWR, 0);
    }
    #if 0
    static void imx6q_sabresd_host1_vbus(bool on)
    {
        if (on)
            gpio_set_value(SABRESD_USB_H1_PWR, 1);
        else
            gpio_set_value(SABRESD_USB_H1_PWR, 0);
    }
    #endif
    static void __init imx6q_sabresd_init_usb(void)
    {
        int ret = 0;

        imx_otg_base = MX6_IO_ADDRESS(MX6Q_USB_OTG_BASE_ADDR);
        /* disable external charger detect,
         * or it will affect signal quality at dp .
         */
        ret = gpio_request(FS_USB_OTG_PWR, "usb-pwr");
        if (ret) {
            pr_err("failed to get GPIO FS_USB_OTG_PWR: %d\n",
                ret);
            return;
        }
        gpio_direction_output(FS_USB_OTG_PWR, 0);
        /* keep USB host1 VBUS always on */
        ret = gpio_request(SABRESD_USB_H1_PWR, "usb-h1-pwr");
        if (ret) {
            pr_err("failed to get GPIO SABRESD_USB_H1_PWR: %d\n",
                ret);
            return;
        }
        gpio_direction_output(SABRESD_USB_H1_PWR, 0);
        if (board_is_mx6_reva())
            mxc_iomux_set_gpr_register(1, 13, 1, 1);
        else
            mxc_iomux_set_gpr_register(1, 13, 1, 0);

        mx6_set_otghost_vbus_func(imx6q_sabresd_usbotg_vbus);
    //    mx6_set_host1_vbus_func(imx6q_sabresd_host1_vbus);

    }

    /* HW Initialization, if return 0, initialization is successful. */
    static int mx6q_sabresd_sata_init(struct device *dev, void __iomem *addr)
    {
        u32 tmpdata;
        int ret = 0;
        struct clk *clk;

        sata_clk = clk_get(dev, "imx_sata_clk");
        if (IS_ERR(sata_clk)) {
            dev_err(dev, "no sata clock.\n");
            return PTR_ERR(sata_clk);
        }
        ret = clk_enable(sata_clk);
        if (ret) {
            dev_err(dev, "can't enable sata clock.\n");
            goto put_sata_clk;
        }

        /* Set PHY Paremeters, two steps to configure the GPR13,
         * one write for rest of parameters, mask of first write is 0x07FFFFFD,
         * and the other one write for setting the mpll_clk_off_b
         *.rx_eq_val_0(iomuxc_gpr13[26:24]),
         *.los_lvl(iomuxc_gpr13[23:19]),
         *.rx_dpll_mode_0(iomuxc_gpr13[18:16]),
         *.sata_speed(iomuxc_gpr13[15]),
         *.mpll_ss_en(iomuxc_gpr13[14]),
         *.tx_atten_0(iomuxc_gpr13[13:11]),
         *.tx_boost_0(iomuxc_gpr13[10:7]),
         *.tx_lvl(iomuxc_gpr13[6:2]),
         *.mpll_ck_off(iomuxc_gpr13[1]),
         *.tx_edgerate_0(iomuxc_gpr13[0]),
         */
        tmpdata = readl(IOMUXC_GPR13);
        writel(((tmpdata & ~0x07FFFFFD) | 0x0593A044), IOMUXC_GPR13);

        /* enable SATA_PHY PLL */
        tmpdata = readl(IOMUXC_GPR13);
        writel(((tmpdata & ~0x2) | 0x2), IOMUXC_GPR13);

        /* Get the AHB clock rate, and configure the TIMER1MS reg later */
        clk = clk_get(NULL, "ahb");
        if (IS_ERR(clk)) {
            dev_err(dev, "no ahb clock.\n");
            ret = PTR_ERR(clk);
            goto release_sata_clk;
        }
        tmpdata = clk_get_rate(clk) / 1000;
        clk_put(clk);

    #ifdef CONFIG_SATA_AHCI_PLATFORM
        ret = sata_init(addr, tmpdata);
        if (ret == 0)
            return ret;
    #else
        usleep_range(1000, 2000);
        /* AHCI PHY enter into PDDQ mode if the AHCI module is not enabled */
        tmpdata = readl(addr + PORT_PHY_CTL);
        writel(tmpdata | PORT_PHY_CTL_PDDQ_LOC, addr + PORT_PHY_CTL);
        pr_info("No AHCI save PWR: PDDQ %s\n", ((readl(addr + PORT_PHY_CTL)
                        >> 20) & 1) ? "enabled" : "disabled");
    #endif

    release_sata_clk:
        /* disable SATA_PHY PLL */
        writel((readl(IOMUXC_GPR13) & ~0x2), IOMUXC_GPR13);
        clk_disable(sata_clk);
    put_sata_clk:
        clk_put(sata_clk);

        return ret;
    }

    #ifdef CONFIG_SATA_AHCI_PLATFORM
    static void mx6q_sabresd_sata_exit(struct device *dev)
    {
        clk_disable(sata_clk);
        clk_put(sata_clk);
    }

    static struct ahci_platform_data mx6q_sabresd_sata_data = {
        .init = mx6q_sabresd_sata_init,
        .exit = mx6q_sabresd_sata_exit,
    };
    #endif

    static void mx6q_sabresd_flexcan0_switch(int enable)
    {
        if (enable) {
            gpio_set_value(SABRESD_CAN1_STBY, 1);
        } else {
            gpio_set_value(SABRESD_CAN1_STBY, 0);
        }
    }

    static const struct flexcan_platform_data
        mx6q_sabresd_flexcan0_pdata __initconst = {
        .transceiver_switch = mx6q_sabresd_flexcan0_switch,
    };

    static struct viv_gpu_platform_data imx6q_gpu_pdata __initdata = {
        .reserved_mem_size = SZ_128M,
    };

    static struct imx_asrc_platform_data imx_asrc_data = {
        .channel_bits = 4,
        .clk_map_ver = 2,
    };

    static void mx6_reset_mipi_dsi(void)
    {
        gpio_set_value(SABRESD_DISP_PWR_EN, 1);
        gpio_set_value(SABRESD_DISP_RST_B, 1);
        udelay(10);
        gpio_set_value(SABRESD_DISP_RST_B, 0);
        udelay(50);
        gpio_set_value(SABRESD_DISP_RST_B, 1);

        /*
         * it needs to delay 120ms minimum for reset complete
         */
        msleep(120);
    }

    static struct mipi_dsi_platform_data mipi_dsi_pdata = {
        .ipu_id        = 0,
        .disp_id    = 1,
        .lcd_panel    = "TRULY-WVGA",
        .reset        = mx6_reset_mipi_dsi,
    };

    static struct ipuv3_fb_platform_data sabresd_fb_data[] = {
        { /*fb0*/
        .disp_dev = "ldb",
        .interface_pix_fmt = IPU_PIX_FMT_RGB666,
        .mode_str = "LDB-XGA",
        .default_bpp = 16,
        .int_clk = false,
        .late_init = false,
        }, {
        .disp_dev = "ldb",
        .interface_pix_fmt = IPU_PIX_FMT_RGB666,
        .mode_str = "LDB-XGA",
        .default_bpp = 16,
        .int_clk = false,
        }, {
        .disp_dev = "lcd",
        .interface_pix_fmt = IPU_PIX_FMT_RGB565,
        .mode_str = "CLAA-WVGA",
        .default_bpp = 16,
        .int_clk = false,
        .late_init = false,
        }, {
        .disp_dev = "ldb",
        .interface_pix_fmt = IPU_PIX_FMT_RGB666,
        .mode_str = "LDB-VGA",
        .default_bpp = 16,
        .int_clk = false,
        .late_init = false,
        },
    };
    #if 0
    static void hdmi_init(int ipu_id, int disp_id)
    {
        int hdmi_mux_setting;

        if ((ipu_id > 1) || (ipu_id < 0)) {
            pr_err("Invalid IPU select for HDMI: %d. Set to 0\n", ipu_id);
            ipu_id = 0;
        }

        if ((disp_id > 1) || (disp_id < 0)) {
            pr_err("Invalid DI select for HDMI: %d. Set to 0\n", disp_id);
            disp_id = 0;
        }

        /* Configure the connection between IPU1/2 and HDMI */
        hdmi_mux_setting = 2*ipu_id + disp_id;

        /* GPR3, bits 2-3 = HDMI_MUX_CTL */
        mxc_iomux_set_gpr_register(3, 2, 2, hdmi_mux_setting);

        /* Set HDMI event as SDMA event2 while Chip version later than TO1.2 */
        if (hdmi_SDMA_check())
            mxc_iomux_set_gpr_register(0, 0, 1, 1);
    }

    /* On mx6x sabresd board i2c2 iomux with hdmi ddc,
     * the pins default work at i2c2 function,
     when hdcp enable, the pins should work at ddc function */

    static void hdmi_enable_ddc_pin(void)
    {
        if (cpu_is_mx6dl())
            mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_hdmi_ddc_pads,
                ARRAY_SIZE(mx6dl_sabresd_hdmi_ddc_pads));
        else
            mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_hdmi_ddc_pads,
                ARRAY_SIZE(mx6q_sabresd_hdmi_ddc_pads));
    }

    static void hdmi_disable_ddc_pin(void)
    {
        if (cpu_is_mx6dl())
            mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_i2c2_pads,
                ARRAY_SIZE(mx6dl_sabresd_i2c2_pads));
        else
            mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_i2c2_pads,
                ARRAY_SIZE(mx6q_sabresd_i2c2_pads));
    }

    static struct fsl_mxc_hdmi_platform_data hdmi_data = {
        .init = hdmi_init,
        .enable_pins = hdmi_enable_ddc_pin,
        .disable_pins = hdmi_disable_ddc_pin,
        .phy_reg_vlev = 0x0294,
        .phy_reg_cksymtx = 0x800d,
    };

    static struct fsl_mxc_hdmi_core_platform_data hdmi_core_data = {
        .ipu_id = 0,
        .disp_id = 0,
    };

    static struct fsl_mxc_lcd_platform_data lcdif_data = {
        .ipu_id = 0,
        .disp_id = 0,
        .default_ifmt = IPU_PIX_FMT_RGB565,
    };
    #endif
    static struct fsl_mxc_ldb_platform_data ldb_data = {
        .ipu_id = 1,
        .disp_id = 1,
        .ext_ref = 1,
        .mode = LDB_SEP1,
        .sec_ipu_id = 1,
        .sec_disp_id = 0,
    };

    static struct max8903_pdata charger1_data = {
        .dok = SABRESD_CHARGE_DOK_B,
        .uok = SABRESD_CHARGE_UOK_B,
        .chg = SABRESD_CHARGE_CHG_1_B,
        .flt = SABRESD_CHARGE_FLT_1_B,
        .dcm_always_high = true,
        .dc_valid = true,
        .usb_valid = true,
    };

    static struct platform_device sabresd_max8903_charger_1 = {
        .name    = "max8903-charger",
        .id    = 1,
        .dev    = {
            .platform_data = &charger1_data,
        },
    };

    static struct imx_ipuv3_platform_data ipu_data[] = {
        {
        .rev = 4,
        .csi_clk[0] = "clko_clk",
        .bypass_reset = false,
        }, {
        .rev = 4,
        .csi_clk[0] = "clko_clk",
        .bypass_reset = false,
        },
    };

    static struct fsl_mxc_capture_platform_data capture_data[] = {
        {
            .csi = 0,
            .ipu = 0,
            .mclk_source = 0,
            .is_mipi = 0,
        }, {
            .csi = 1,
            .ipu = 0,
            .mclk_source = 0,
            .is_mipi = 1,
        },
    };


    struct imx_vout_mem {
        resource_size_t res_mbase;
        resource_size_t res_msize;
    };

    static struct imx_vout_mem vout_mem __initdata = {
        .res_msize = SZ_128M,
    };

    static void sabresd_suspend_enter(void)
    {
        /* suspend preparation */
        /* Disable AUX 5V */
        gpio_set_value(SABRESD_AUX_5V_EN, 0);
    }

    static void sabresd_suspend_exit(void)
    {
        /* resume restore */
        /* Enable AUX 5V */
        gpio_set_value(SABRESD_AUX_5V_EN, 1);
    }
    static const struct pm_platform_data mx6q_sabresd_pm_data __initconst = {
        .name = "imx_pm",
        .suspend_enter = sabresd_suspend_enter,
        .suspend_exit = sabresd_suspend_exit,
    };

    static struct regulator_consumer_supply sabresd_vmmc_consumers[] = {
        REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.0"),
    //    REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.1"),
        REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.2"),
    //    REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.3"),
    };

    static struct regulator_init_data sabresd_vmmc_init = {
        .num_consumer_supplies = ARRAY_SIZE(sabresd_vmmc_consumers),
        .consumer_supplies = sabresd_vmmc_consumers,
    };

    static struct fixed_voltage_config sabresd_vmmc_reg_config = {
        .supply_name        = "vmmc",
        .microvolts        = 3300000,
        .gpio            = -1,
        .init_data        = &sabresd_vmmc_init,
    };

    static struct platform_device sabresd_vmmc_reg_devices = {
        .name    = "reg-fixed-voltage",
        .id    = 3,
        .dev    = {
            .platform_data = &sabresd_vmmc_reg_config,
        },
    };

    static int __init imx6q_init_audio(void)
    {
            platform_device_register(&sabresd_vwm8960_reg_devices);
            mxc_register_device(&mx6_sabresd_audio_wm8960_device,
                        &wm8960_data);
            imx6q_add_imx_ssi(1, &mx6_sabresd_ssi_pdata);

            mxc_wm8960_init();
        return 0;
    }

    #if 0                            //vishwa
    static int __init imx6q_init_audio(void)
    {
        if (board_is_mx6_reva()) {
            mxc_register_device(&mx6_sabresd_audio_wm8958_device,
                        &wm8958_data);
            imx6q_add_imx_ssi(1, &mx6_sabresd_ssi_pdata);

            mxc_wm8958_init();
        } else {
            platform_device_register(&sabresd_vwm8962_reg_devices);
            mxc_register_device(&mx6_sabresd_audio_wm8962_device,
                        &wm8962_data);
            imx6q_add_imx_ssi(1, &mx6_sabresd_ssi_pdata);

            mxc_wm8962_init();
        }

        return 0;
    }
    #endif
    #ifndef CONFIG_IMX_PCIE
    static void pcie_3v3_power(void)
    {
        /* disable PCIE_3V3 first */
        gpio_request(SABRESD_PCIE_PWR_EN, "pcie_3v3_en");
        gpio_direction_output(SABRESD_PCIE_PWR_EN, 0);
        mdelay(10);
        /* enable PCIE_3V3 again */
        gpio_set_value(SABRESD_PCIE_PWR_EN, 1);
        gpio_free(SABRESD_PCIE_PWR_EN);
    }

    static void pcie_3v3_reset(void)
    {
        /* reset miniPCIe */
        gpio_request(SABRESD_PCIE_RST_B_REVB, "pcie_reset_rebB");
        gpio_direction_output(SABRESD_PCIE_RST_B_REVB, 0);
        /* The PCI Express Mini CEM specification states that PREST# is
        deasserted minimum 1ms after 3.3vVaux has been applied and stable*/
        mdelay(1);
        gpio_set_value(SABRESD_PCIE_RST_B_REVB, 1);
        gpio_free(SABRESD_PCIE_RST_B_REVB);
    }
    #endif

    static void gps_power_on(bool on)
    {
        /* Enable/disable aux_3v15 */
        gpio_request(SABRESD_AUX_3V15_EN, "aux_3v15_en");
        gpio_direction_output(SABRESD_AUX_3V15_EN, 1);
        gpio_set_value(SABRESD_AUX_3V15_EN, on);
        gpio_free(SABRESD_AUX_3V15_EN);
        /*Enable/disable gps_en*/
        gpio_request(SABRESD_GPS_EN, "gps_en");
        gpio_direction_output(SABRESD_GPS_EN, 1);
        gpio_set_value(SABRESD_GPS_EN, on);
        gpio_free(SABRESD_GPS_EN);

    }

    #if defined(CONFIG_LEDS_TRIGGER) || defined(CONFIG_LEDS_GPIO)

    #define GPIO_LED(gpio_led, name_led, act_low, state_suspend, trigger)    \
    {                                    \
        .gpio            = gpio_led,                \
        .name            = name_led,                \
        .active_low        = act_low,                \
        .retain_state_suspended = state_suspend,            \
        .default_state        = 0,                    \
        .default_trigger    = "max8903-"trigger,        \
    }

    /* use to show a external power source is connected
     * GPIO_LED(SABRESD_CHARGE_DONE, "chg_detect", 0, 1, "ac-online"),
     */
    static struct gpio_led imx6q_gpio_leds[] = {
    //    GPIO_LED(SABRESD_CHARGE_NOW, "chg_now_led", 0, 1,
    //        "charger-charging"),
    /* For the latest B4 board, this GPIO_1 is connected to POR_B,
    which will reset the whole board if this pin's level is changed,
    so, for the latest board, we have to avoid using this pin as
    GPIO.
        GPIO_LED(SABRESD_CHARGE_DONE, "chg_done_led", 0, 1,
                "charger-full"),
    */
    };

    static struct gpio_led_platform_data imx6q_gpio_leds_data = {
        .leds        = imx6q_gpio_leds,
        .num_leds    = ARRAY_SIZE(imx6q_gpio_leds),
    };

    static struct platform_device imx6q_gpio_led_device = {
        .name        = "leds-gpio",
        .id        = -1,
        .num_resources  = 0,
        .dev        = {
            .platform_data = &imx6q_gpio_leds_data,
        }
    };

    static void __init imx6q_add_device_gpio_leds(void)
    {
        platform_device_register(&imx6q_gpio_led_device);
    }
    #else
    static void __init imx6q_add_device_gpio_leds(void) {}
    #endif

    #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
    #define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake, debounce)    \
    {                                \
        .gpio        = gpio_num,                \
        .type        = EV_KEY,                \
        .code        = ev_code,                \
        .active_low    = act_low,                \
        .desc        = "btn " descr,                \
        .wakeup        = wake,                    \
        .debounce_interval = debounce,                \
    }

    static struct gpio_keys_button imx6q_buttons[] = {
    //    GPIO_BUTTON(SABRESD_VOLUME_UP, KEY_VOLUMEUP, 1, "volume-up", 0, 1),
    //    GPIO_BUTTON(SABRESD_VOLUME_DN, KEY_VOLUMEDOWN, 1, "volume-down", 0, 1),
    //    GPIO_BUTTON(SABRESD_POWER_OFF, KEY_POWER, 1, "power", 1, 1),
    };

    static struct gpio_keys_platform_data imx6q_button_data = {
        .buttons    = imx6q_buttons,
        .nbuttons    = ARRAY_SIZE(imx6q_buttons),
    };

    static struct platform_device imx6q_button_device = {
        .name        = "gpio-keys",
        .id        = -1,
        .num_resources  = 0,
        .dev        = {
            .platform_data = &imx6q_button_data,
        }
    };

    static void __init imx6q_add_device_buttons(void)
    {
        platform_device_register(&imx6q_button_device);
    }
    #else
    static void __init imx6q_add_device_buttons(void) {}
    #endif

    static struct platform_pwm_backlight_data mx6_sabresd_pwm_backlight_data = {
        .pwm_id = 0,
        .max_brightness = 248,
        .dft_brightness = 128,
        .pwm_period_ns = 50000,
    };

    static struct mxc_dvfs_platform_data sabresd_dvfscore_data = {
        .reg_id = "VDDCORE",
        .soc_id    = "VDDSOC",
        .clk1_id = "cpu_clk",
        .clk2_id = "gpc_dvfs_clk",
        .gpc_cntr_offset = MXC_GPC_CNTR_OFFSET,
        .ccm_cdcr_offset = MXC_CCM_CDCR_OFFSET,
        .ccm_cacrr_offset = MXC_CCM_CACRR_OFFSET,
        .ccm_cdhipr_offset = MXC_CCM_CDHIPR_OFFSET,
        .prediv_mask = 0x1F800,
        .prediv_offset = 11,
        .prediv_val = 3,
        .div3ck_mask = 0xE0000000,
        .div3ck_offset = 29,
        .div3ck_val = 2,
        .emac_val = 0x08,
        .upthr_val = 25,
        .dnthr_val = 9,
        .pncthr_val = 33,
        .upcnt_val = 10,
        .dncnt_val = 10,
        .delay_time = 80,
    };

    static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags,
                       char **cmdline, struct meminfo *mi)
    {
    }

    static struct mipi_csi2_platform_data mipi_csi2_pdata = {
        .ipu_id     = 0,
        .csi_id = 1,
        .v_channel = 0,
        .lanes = 2,
        .dphy_clk = "mipi_pllref_clk",
        .pixel_clk = "emi_clk",
    };

    static int __init caam_setup(char *__unused)
    {
        caam_enabled = 1;
        return 1;
    }
    early_param("caam", caam_setup);

    #define SNVS_LPCR 0x38
    static void mx6_snvs_poweroff(void)
    {

        void __iomem *mx6_snvs_base =  MX6_IO_ADDRESS(MX6Q_SNVS_BASE_ADDR);
        u32 value;
        value = readl(mx6_snvs_base + SNVS_LPCR);
        /*set TOP and DP_EN bit*/
        writel(value | 0x60, mx6_snvs_base + SNVS_LPCR);
    }

    static const struct imx_pcie_platform_data mx6_sabresd_pcie_data __initconst = {
        .pcie_pwr_en    = SABRESD_PCIE_PWR_EN,
        .pcie_rst    = SABRESD_PCIE_RST_B_REVB,
        .pcie_wake_up    = SABRESD_PCIE_WAKE_B,
        .pcie_dis    = SABRESD_PCIE_DIS_B,
    #ifdef CONFIG_IMX_PCIE_EP_MODE_IN_EP_RC_SYS
        .type_ep    = 1,
    #else
        .type_ep    = 0,
    #endif
    };

    /*********************************************************************************************/
    struct gpio fs_wl1271_gpios[] __initdata = {
        {.label = "wl1271_int",    .gpio = GPIO_WLAN_IRQ,    .flags = GPIOF_DIR_IN},
        {.label = "wl1271_wl_en", .gpio = GPIO_WLAN_EN,    .flags = 0},
    };

    static void wl12xx_set_power(int on)
    {       
            pr_debug("%s:%s: set power(%d)\n", __FILE__, __func__, on);
            
            if(on)
            {
                    gpio_set_value(GPIO_WLAN_EN, 1);
                    mdelay(70);
            }
            else
                    gpio_set_value(GPIO_WLAN_EN, 0);
    }


    static struct esdhc_platform_data mx6q_sabresd_sd1_data = {
        .always_present = 1,
        .cd_gpio = -1,
        .wp_gpio = -1,
        .keep_power_at_suspend = 0,
        .caps = MMC_CAP_POWER_OFF_CARD,
    //    .platform_pad_change = -1,
            .cd_type = ESDHC_CD_PERMANENT,
        .set_power = wl12xx_set_power,
    };

    struct wl12xx_platform_data wlan_data __initdata = {
        .irq = gpio_to_irq(GPIO_WLAN_IRQ),
        .board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */
    };


    static void __init fs_wl12xx_init(void)
    {

        gpio_request(GPIO_WLAN_EN, "wifi-en");
            gpio_direction_output(GPIO_WLAN_EN, 1);
        gpio_request(GPIO_WLAN_IRQ, "wifi-int");
            gpio_direction_input(GPIO_WLAN_IRQ);
          
    //    wlan_data.irq = gpio_to_irq(GPIO_WLAN_IRQ);
     
            imx6q_add_sdhci_usdhc_imx(0, &mx6q_sabresd_sd1_data);
        
        int ret = wl12xx_set_platform_data(&wlan_data);
                    if(ret)
                            pr_err("error setting wl12xx data ret %d \n",ret );


            msleep(20);
            gpio_set_value(GPIO_WLAN_EN, 0);
        mdelay(20);
            gpio_set_value(GPIO_WLAN_EN, 1);

            gpio_free(GPIO_WLAN_EN);
            mdelay(1);
        
    //    mx6q_sabresd_sd1_data.set_power = wl12xx_set_power;
    }

    /*********************************************************************************************/

    /*!
     * Board specific initialization.
     */
    static void __init mx6_sabresd_board_init(void)
    {
        int i;
        int ret;
        struct clk *clko, *clko2;
        struct clk *new_parent;
        int rate;
        struct platform_device *voutdev;

        if (cpu_is_mx6q()) {
            mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_pads,
                ARRAY_SIZE(mx6q_sabresd_pads));
            if (enet_to_gpio_6) {
                iomux_v3_cfg_t enet_gpio_pad =
                    MX6Q_PAD_GPIO_6__ENET_IRQ_TO_GPIO_6;
                mxc_iomux_v3_setup_pad(enet_gpio_pad);
            } else {
                iomux_v3_cfg_t i2c3_pad =
                    MX6Q_PAD_GPIO_6__I2C3_SDA;
                mxc_iomux_v3_setup_pad(i2c3_pad);
            }
        } else if (cpu_is_mx6dl()) {
            mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_pads,
                ARRAY_SIZE(mx6dl_sabresd_pads));

            if (enet_to_gpio_6) {
                iomux_v3_cfg_t enet_gpio_pad =
                    MX6DL_PAD_GPIO_6__ENET_IRQ_TO_GPIO_6;
                mxc_iomux_v3_setup_pad(enet_gpio_pad);
            } else {
                iomux_v3_cfg_t i2c3_pad =
                    MX6DL_PAD_GPIO_6__I2C3_SDA;
                mxc_iomux_v3_setup_pad(i2c3_pad);
            }
        }


    #ifdef CONFIG_FEC_1588
        /* Set GPIO_16 input for IEEE-1588 ts_clk and RMII reference clock
         * For MX6 GPR1 bit21 meaning:
         * Bit21:       0 - GPIO_16 pad output
         *              1 - GPIO_16 pad input
         */
         mxc_iomux_set_gpr_register(1, 21, 1, 1);
    #endif

        gp_reg_id = sabresd_dvfscore_data.reg_id;
        soc_reg_id = sabresd_dvfscore_data.soc_id;
        mx6q_sabresd_init_uart();

        /*
         * MX6DL/Solo only supports single IPU
         * The following codes are used to change ipu id
         * and display id information for MX6DL/Solo. Then
         * register 1 IPU device and up to 2 displays for
         * MX6DL/Solo
         */
        if (cpu_is_mx6dl()) {
            ldb_data.ipu_id = 0;
            ldb_data.sec_ipu_id = 0;
        }
    //    imx6q_add_mxc_hdmi_core(&hdmi_core_data);

        imx6q_add_ipuv3(0, &ipu_data[0]);
        if (cpu_is_mx6q()) {
            imx6q_add_ipuv3(1, &ipu_data[1]);
            for (i = 0; i < 4 && i < ARRAY_SIZE(sabresd_fb_data); i++)
                imx6q_add_ipuv3fb(i, &sabresd_fb_data[i]);
        } else
            for (i = 0; i < 2 && i < ARRAY_SIZE(sabresd_fb_data); i++)
                imx6q_add_ipuv3fb(i, &sabresd_fb_data[i]);

        imx6q_add_vdoa();
    //    imx6q_add_mipi_dsi(&mipi_dsi_pdata);
    //    imx6q_add_lcdif(&lcdif_data);
        imx6q_add_ldb(&ldb_data);
        voutdev = imx6q_add_v4l2_output(0);
        if (vout_mem.res_msize && voutdev) {
            dma_declare_coherent_memory(&voutdev->dev,
                            vout_mem.res_mbase,
                            vout_mem.res_mbase,
                            vout_mem.res_msize,
                            (DMA_MEMORY_MAP |
                             DMA_MEMORY_EXCLUSIVE));
        }

        imx6q_add_v4l2_capture(0, &capture_data[0]);
        imx6q_add_v4l2_capture(1, &capture_data[1]);
        imx6q_add_mipi_csi2(&mipi_csi2_pdata);
        imx6q_add_imx_snvs_rtc();

        if (1 == caam_enabled)
            imx6q_add_imx_caam();

        strcpy(mxc_i2c0_board_info[0].type, "wm8960");
        mxc_i2c0_board_info[0].platform_data = &wm8960_config_data;
    #if 0                    //vishwa
        if (board_is_mx6_reva()) {
            strcpy(mxc_i2c0_board_info[0].type, "wm8958");
            mxc_i2c0_board_info[0].platform_data = &wm8958_config_data;
        } else {
            strcpy(mxc_i2c0_board_info[0].type, "wm8962");
            mxc_i2c0_board_info[0].platform_data = &wm8962_config_data;
        }
    #endif

        imx6q_add_device_gpio_leds();

        imx6q_add_imx_i2c(0, &mx6q_sabresd_i2c_data);
        imx6q_add_imx_i2c(1, &mx6q_sabresd_i2c_data);
        imx6q_add_imx_i2c(2, &mx6q_sabresd_i2c_data);
        if (cpu_is_mx6dl())
            imx6q_add_imx_i2c(3, &mx6q_sabresd_i2c_data);
        i2c_register_board_info(0, mxc_i2c0_board_info,
                ARRAY_SIZE(mxc_i2c0_board_info));
        i2c_register_board_info(1, mxc_i2c1_board_info,
                ARRAY_SIZE(mxc_i2c1_board_info));
        i2c_register_board_info(2, mxc_i2c2_board_info,
                ARRAY_SIZE(mxc_i2c2_board_info));
        ret = gpio_request(SABRESD_PFUZE_INT, "pFUZE-int");
        if (ret) {
            printk(KERN_ERR"request pFUZE-int error!!\n");
            return;
        } else {
            gpio_direction_input(SABRESD_PFUZE_INT);
            mx6q_sabresd_init_pfuze100(SABRESD_PFUZE_INT);
        }
        /* SPI */
        imx6q_add_ecspi(0, &mx6q_sabresd_spi_data);
        spi_device_init();

    //    imx6q_add_mxc_hdmi(&hdmi_data);

        imx6q_add_anatop_thermal_imx(1, &mx6q_sabresd_anatop_thermal_data);

        if (enet_to_gpio_6)
            /* Make sure the IOMUX_OBSRV_MUX1 is set to ENET_IRQ. */
            mxc_iomux_set_specialbits_register(
                IOMUX_OBSRV_MUX1_OFFSET,
                OBSRV_MUX1_ENET_IRQ,
                OBSRV_MUX1_MASK);
        else
            fec_data.gpio_irq = -1;
        imx6_init_fec(fec_data);

        imx6q_add_pm_imx(0, &mx6q_sabresd_pm_data);

        /* Move sd4 to first because sd4 connect to emmc.
           Mfgtools want emmc is mmcblk0 and other sd card is mmcblk1.
        */
    //    imx6q_add_sdhci_usdhc_imx(3, &mx6q_sabresd_sd4_data);
    //    imx6q_add_sdhci_usdhc_imx(1, &mx6q_sabresd_sd2_data);
        imx6q_add_sdhci_usdhc_imx(2, &mx6q_sabresd_sd3_data);
    //    imx6q_add_sdhci_usdhc_imx(0, &mx6q_sabresd_sd1_data);
        imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata);
        imx6q_sabresd_init_usb();
        /* SATA is not supported by MX6DL/Solo */
        if (cpu_is_mx6q()) {
    #ifdef CONFIG_SATA_AHCI_PLATFORM
            imx6q_add_ahci(0, &mx6q_sabresd_sata_data);
    #else
            mx6q_sabresd_sata_init(NULL,
                (void __iomem *)ioremap(MX6Q_SATA_BASE_ADDR, SZ_4K));
    #endif
        }
        imx6q_add_vpu();
        imx6q_init_audio();
        platform_device_register(&sabresd_vmmc_reg_devices);
        imx_asrc_data.asrc_core_clk = clk_get(NULL, "asrc_clk");
        imx_asrc_data.asrc_audio_clk = clk_get(NULL, "asrc_serial_clk");
        imx6q_add_asrc(&imx_asrc_data);

        /*
         * Disable HannStar touch panel CABC function,
         * this function turns the panel's backlight automatically
         * according to the content shown on the panel which
         * may cause annoying unstable backlight issue.
         */
        gpio_request(SABRESD_CABC_EN0, "cabc-en0");
        gpio_direction_output(SABRESD_CABC_EN0, 0);
        gpio_request(SABRESD_CABC_EN1, "cabc-en1");
        gpio_direction_output(SABRESD_CABC_EN1, 0);

        imx6q_add_mxc_pwm(0);
        imx6q_add_mxc_pwm(1);
        imx6q_add_mxc_pwm(2);
        imx6q_add_mxc_pwm(3);
        imx6q_add_mxc_pwm_backlight(0, &mx6_sabresd_pwm_backlight_data);

        imx6q_add_otp();
        imx6q_add_viim();
        imx6q_add_imx2_wdt(0, NULL);
        imx6q_add_dma();

        imx6q_add_dvfs_core(&sabresd_dvfscore_data);
        imx6q_add_device_buttons();

        /* enable sensor 3v3 and 1v8 */
        gpio_request(SABRESD_SENSOR_EN, "sensor-en");
        gpio_direction_output(SABRESD_SENSOR_EN, 1);

        /* enable ecompass intr */
        gpio_request(SABRESD_eCOMPASS_INT, "ecompass-int");
        gpio_direction_input(SABRESD_eCOMPASS_INT);
        /* enable light sensor intr */
        gpio_request(SABRESD_ALS_INT, "als-int");
        gpio_direction_input(SABRESD_ALS_INT);

        imx6q_add_hdmi_soc();
        imx6q_add_hdmi_soc_dai();

        if (cpu_is_mx6dl()) {
            imx6dl_add_imx_pxp();
            imx6dl_add_imx_pxp_client();
            if (epdc_enabled) {
                mxc_register_device(&max17135_sensor_device, NULL);
                imx6dl_add_imx_epdc(&epdc_data);
            }
        }
        /*
        ret = gpio_request_array(mx6q_sabresd_flexcan_gpios,
                ARRAY_SIZE(mx6q_sabresd_flexcan_gpios));
        if (ret)
            pr_err("failed to request flexcan1-gpios: %d\n", ret);
        else
            imx6q_add_flexcan0(&mx6q_sabresd_flexcan0_pdata);
        */

        clko2 = clk_get(NULL, "clko2_clk");
        if (IS_ERR(clko2))
            pr_err("can't get CLKO2 clock.\n");

        new_parent = clk_get(NULL, "osc_clk");
        if (!IS_ERR(new_parent)) {
            clk_set_parent(clko2, new_parent);
            clk_put(new_parent);
        }
        rate = clk_round_rate(clko2, 24000000);
        clk_set_rate(clko2, rate);
        clk_enable(clko2);

        /* Camera and audio use osc clock */
        clko = clk_get(NULL, "clko_clk");
        if (!IS_ERR(clko))
            clk_set_parent(clko, clko2);

        /* Enable Aux_5V */
        gpio_request(SABRESD_AUX_5V_EN, "aux_5v_en");
        gpio_direction_output(SABRESD_AUX_5V_EN, 1);
        gpio_set_value(SABRESD_AUX_5V_EN, 1);

    #ifndef CONFIG_IMX_PCIE
        /* enable pcie 3v3 power without pcie driver */
        pcie_3v3_power();
        mdelay(10);
        pcie_3v3_reset();
    #endif

        gps_power_on(true);
        /* Register charger chips */
        platform_device_register(&sabresd_max8903_charger_1);
        pm_power_off = mx6_snvs_poweroff;
        imx6q_add_busfreq();

        /* Add PCIe RC interface support */
        imx6q_add_pcie(&mx6_sabresd_pcie_data);
        if (cpu_is_mx6dl()) {
            mxc_iomux_v3_setup_multiple_pads(mx6dl_arm2_elan_pads,
                            ARRAY_SIZE(mx6dl_arm2_elan_pads));

            /* ELAN Touchscreen */
            gpio_request(SABRESD_ELAN_INT, "elan-interrupt");
            gpio_direction_input(SABRESD_ELAN_INT);

            gpio_request(SABRESD_ELAN_CE, "elan-cs");
            gpio_direction_output(SABRESD_ELAN_CE, 1);
            gpio_direction_output(SABRESD_ELAN_CE, 0);

            gpio_request(SABRESD_ELAN_RST, "elan-rst");
            gpio_direction_output(SABRESD_ELAN_RST, 1);
            gpio_direction_output(SABRESD_ELAN_RST, 0);
            mdelay(1);
            gpio_direction_output(SABRESD_ELAN_RST, 1);
            gpio_direction_output(SABRESD_ELAN_CE, 1);
        }

        imx6_add_armpmu();
        imx6q_add_perfmon(0);
        imx6q_add_perfmon(1);
        imx6q_add_perfmon(2);
        
        lsm303d_init();
        fs_wl12xx_init();
        gpio_export(GPIO_WLAN_EN,1);

    }

    extern void __iomem *twd_base;
    static void __init mx6_sabresd_timer_init(void)
    {
        struct clk *uart_clk;
    #ifdef CONFIG_LOCAL_TIMERS
        twd_base = ioremap(LOCAL_TWD_ADDR, SZ_256);
        BUG_ON(!twd_base);
    #endif
        mx6_clocks_init(32768, 24000000, 0, 0);

        uart_clk = clk_get_sys("imx-uart.0", NULL);
        early_console_setup(UART3_BASE_ADDR, uart_clk);
    }

    static struct sys_timer mx6_sabresd_timer = {
        .init   = mx6_sabresd_timer_init,
    };

    static void __init mx6q_sabresd_reserve(void)
    {
        phys_addr_t phys;
    #if defined(CONFIG_MXC_GPU_VIV) || defined(CONFIG_MXC_GPU_VIV_MODULE)

        if (imx6q_gpu_pdata.reserved_mem_size) {
            phys = memblock_alloc_base(imx6q_gpu_pdata.reserved_mem_size,
                           SZ_4K, SZ_1G);
            memblock_remove(phys, imx6q_gpu_pdata.reserved_mem_size);
            imx6q_gpu_pdata.reserved_mem_base = phys;
        }
    #endif

        if (vout_mem.res_msize) {
            phys = memblock_alloc_base(vout_mem.res_msize,
                           SZ_4K, SZ_1G);
            memblock_remove(phys, vout_mem.res_msize);
            vout_mem.res_mbase = phys;
        }
    }

    /*
     * initialize __mach_desc_MX6Q_SABRESD data structure.
     */
    MACHINE_START(MX6Q_SABRESD, "Freescale i.MX 6Quad/DualLite/Solo Sabre-SD Board")
        /* Maintainer: Freescale Semiconductor, Inc. */
        .boot_params = MX6_PHYS_OFFSET + 0x100,
        .fixup = fixup_mxc_board,
        .map_io = mx6_map_io,
        .init_irq = mx6_init_irq,
        .init_machine = mx6_sabresd_board_init,
        .timer = &mx6_sabresd_timer,
        .reserve = mx6q_sabresd_reserve,
    MACHINE_ENDoot failed despite 3 retries
    ifconfig: SIOCSIFFLAGS: No such device


    My board file is attached.

     

  • Hi Vishwa,

    Please check: http://e2e.ti.com/support/wireless_connectivity/f/307/t/181835.aspx
    It deals with a similar issue as yours.

    Regards,
    Gigi Joseph.

  • Hello Vishwanath Raju,

     

    We're facing a similar issue while we try to bring up the TiWi-BLE module for WiFi on i.MX6 custom board. (kernel version -3.0.35).

    Did you get the solution for this problem? It would help us if you could share the information.

     

    Thanks,

    Silvy.

  • Hi Silvy,

    Built in driver for wi-fi is not working for me.. I used external driver source and complied for IMX6 as a module and loaded then its worked for me.

  • Hi Vishwa,


    Our BSP is based on Sabresd downloaded from freescale and the kernel version is 3.0.35.
    We  also compiled the wi-fi drivers(wl12xx.ko,wl12xx_sdio.ko) as modules, still issue is there..
    may i know which kernel version and BSP you are using?

    Thanks,
    Silvy

  • Hi Silvy,

    I am using the same linux kernel 3.0.35.

    Could you brief the issue with log exactly.

  • Hi Vishwa,


    While booting it shows the following message, seems that the device is detected.
    [ 3.393043] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
    [ 3.401764] mmc1: new SDIO card at address 0001

    Also while loading the drivers some transactions are happening on the mmc1, but not sure it is correct or not..
    But if we use the command ifconfig wlan0 up some error messages are shown and we noticed that the mmc1 clock value is set to zero.

    Logs are attached.

    6471.ifconfig_wlan0_up_msg.txt
    root@imx6qsabresd:~# ifconfig -a
    can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              NOARP  MTU:16  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:10
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:142
    
    can1      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              NOARP  MTU:16  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:10
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
              Interrupt:143
    
    eth0      Link encap:Ethernet  HWaddr 1E:ED:19:27:1A:B3
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:32 errors:0 dropped:0 overruns:0 frame:0
              TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:2568 (2.5 KiB)  TX bytes:2568 (2.5 KiB)
    
    wlan0     Link encap:Ethernet  HWaddr DE:AD:BE:EF:00:00
              BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    root@imx6qsabresd:~# ifconfig wlan0 up
    [  188.800370] SDIO: Disabling device mmc1:0001:2...
    [  188.800394] ------------[ cut here ]------------
    [  188.805067] WARNING: at drivers/mmc/core/core.c:348 mmc_wait_for_cmd+0x9c/0xa0()
    [  188.812511] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  188.820476] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  188.830000] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  188.839721] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c672c>] (mmc_wait_for_cmd+0x9c/0xa0)
    [  188.849103] [<803c672c>] (mmc_wait_for_cmd+0x9c/0xa0) from [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150)
    [  188.858822] [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150) from [<803cfcd0>] (sdio_disable_func+0x58/0xfc)
    [  188.868642] [<803cfcd0>] (sdio_disable_func+0x58/0xfc) from [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio])
    [  188.879655] [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  188.892053] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  188.903045] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  188.911947] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  188.920842] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  188.930247] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  188.939321] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  188.948062] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  188.956698] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  188.965078] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  188.973530] ---[ end trace 1800fb87e278dc1f ]---
    [  188.978154] mmc1: starting CMD52 arg 00000400 flags 00000195
    [  188.978161] ------------[ cut here ]------------
    [  188.982801] WARNING: at drivers/mmc/core/core.c:168 __mmc_start_req+0x21c/0x248()
    [  188.990285] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  188.998136] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  189.007637] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  189.017318] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c6524>] (__mmc_start_req+0x21c/0x248)
    [  189.026735] [<803c6524>] (__mmc_start_req+0x21c/0x248) from [<803c6704>] (mmc_wait_for_cmd+0x74/0xa0)
    [  189.035978] [<803c6704>] (mmc_wait_for_cmd+0x74/0xa0) from [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150)
    [  189.045651] [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150) from [<803cfcd0>] (sdio_disable_func+0x58/0xfc)
    [  189.055417] [<803cfcd0>] (sdio_disable_func+0x58/0xfc) from [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio])
    [  189.066331] [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  189.078710] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  189.089691] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  189.098588] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  189.107481] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  189.116899] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  189.125966] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  189.134688] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  189.143322] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  189.151697] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  189.160139] ---[ end trace 1800fb87e278dc20 ]---
    [  189.164800] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
    [  189.164820] mmc1: req done (CMD52): 0: 00001000 00000000 00000000 00000000
    [  189.164846] ------------[ cut here ]------------
    [  189.169476] WARNING: at drivers/mmc/core/core.c:348 mmc_wait_for_cmd+0x9c/0xa0()
    [  189.176884] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  189.184738] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  189.194241] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  189.203917] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c672c>] (mmc_wait_for_cmd+0x9c/0xa0)
    [  189.213255] [<803c672c>] (mmc_wait_for_cmd+0x9c/0xa0) from [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150)
    [  189.222945] [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150) from [<803cfd08>] (sdio_disable_func+0x90/0xfc)
    [  189.232720] [<803cfd08>] (sdio_disable_func+0x90/0xfc) from [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio])
    [  189.243637] [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  189.256022] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  189.267012] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  189.275912] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  189.284807] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  189.294222] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  189.303290] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  189.312015] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  189.320657] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  189.329018] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  189.337471] ---[ end trace 1800fb87e278dc21 ]---
    [  189.342105] mmc1: starting CMD52 arg 80000400 flags 00000195
    [  189.342111] ------------[ cut here ]------------
    [  189.346736] WARNING: at drivers/mmc/core/core.c:168 __mmc_start_req+0x21c/0x248()
    [  189.354230] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  189.362078] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  189.371582] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  189.381259] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c6524>] (__mmc_start_req+0x21c/0x248)
    [  189.390674] [<803c6524>] (__mmc_start_req+0x21c/0x248) from [<803c6704>] (mmc_wait_for_cmd+0x74/0xa0)
    [  189.399906] [<803c6704>] (mmc_wait_for_cmd+0x74/0xa0) from [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150)
    [  189.409586] [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150) from [<803cfd08>] (sdio_disable_func+0x90/0xfc)
    [  189.419351] [<803cfd08>] (sdio_disable_func+0x90/0xfc) from [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio])
    [  189.430256] [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  189.442636] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  189.453618] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  189.462514] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  189.471413] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  189.480831] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  189.489885] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  189.498607] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  189.507241] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  189.515611] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  189.524066] ---[ end trace 1800fb87e278dc22 ]---
    [  189.528710] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
    [  189.528727] mmc1: req done (CMD52): 0: 00001000 00000000 00000000 00000000
    [  189.528751] SDIO: Disabled device mmc1:0001:2
    [  189.528760] ------------[ cut here ]------------
    [  189.533551] WARNING: at drivers/mmc/core/core.c:711 mmc_release_host+0x38/0x3c()
    [  189.541018] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  189.548860] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  189.558461] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  189.568199] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c6f7c>] (mmc_release_host+0x38/0x3c)
    [  189.577653] [<803c6f7c>] (mmc_release_host+0x38/0x3c) from [<7f0402a0>] (wl1271_sdio_set_power+0x20/0x84 [wl12xx_sdio])
    [  189.588571] [<7f0402a0>] (wl1271_sdio_set_power+0x20/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  189.601061] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  189.612043] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  189.621096] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  189.629990] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  189.639569] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  189.648744] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  189.657571] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  189.666306] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  189.674783] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  189.683321] ---[ end trace 1800fb87e278dc23 ]---
    [  189.687957] mmc1: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
    [  189.687985] sdhci_platform_set_power----------------- 0: bfe26ac0:80064670
    [  189.687995] in wl12xx_set_power  on=0
    [  189.691662] shabeer in dri/host/mmc/sdhci--imx.c
    [  189.720324] SDIO: Disabling device mmc1:0001:2...
    [  189.720333] ------------[ cut here ]------------
    [  189.724963] WARNING: at drivers/mmc/core/core.c:348 mmc_wait_for_cmd+0x9c/0xa0()
    [  189.732552] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  189.740763] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  189.750332] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  189.760066] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c672c>] (mmc_wait_for_cmd+0x9c/0xa0)
    [  189.770175] [<803c672c>] (mmc_wait_for_cmd+0x9c/0xa0) from [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150)
    [  189.780161] [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150) from [<803cfcd0>] (sdio_disable_func+0x58/0xfc)
    [  189.790231] [<803cfcd0>] (sdio_disable_func+0x58/0xfc) from [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio])
    [  189.801482] [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  189.814099] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  189.825598] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  189.834553] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  189.844048] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  189.853530] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  189.863248] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  189.872029] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  189.880712] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  189.889842] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  189.898576] ---[ end trace 1800fb87e278dc24 ]---
    [  189.903255] mmc1: starting CMD52 arg 00000400 flags 00000195
    [  189.903828] ------------[ cut here ]------------
    [  189.908515] WARNING: at drivers/mmc/core/core.c:168 __mmc_start_req+0x21c/0x248()
    [  189.916046] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  189.924598] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  189.934150] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  189.944548] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c6524>] (__mmc_start_req+0x21c/0x248)
    [  189.954272] [<803c6524>] (__mmc_start_req+0x21c/0x248) from [<803c6704>] (mmc_wait_for_cmd+0x74/0xa0)
    [  189.963847] [<803c6704>] (mmc_wait_for_cmd+0x74/0xa0) from [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150)
    [  189.973834] [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150) from [<803cfcd0>] (sdio_disable_func+0x58/0xfc)
    [  189.984003] [<803cfcd0>] (sdio_disable_func+0x58/0xfc) from [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio])
    [  189.995244] [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  190.008064] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  190.019458] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  190.028656] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  190.037851] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  190.047587] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  190.057043] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  190.066063] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  190.074989] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  190.083755] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  190.092511] ---[ end trace 1800fb87e278dc25 ]---
    [  190.097216] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
    [  190.097264] mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
    [  190.097323] SDIO: Failed to disable device mmc1:0001:2
    [  190.097341] ------------[ cut here ]------------
    [  190.102775] WARNING: at drivers/mmc/core/core.c:711 mmc_release_host+0x38/0x3c()
    [  190.110223] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  190.118569] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  190.128519] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  190.138504] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c6f7c>] (mmc_release_host+0x38/0x3c)
    [  190.148222] [<803c6f7c>] (mmc_release_host+0x38/0x3c) from [<7f0402a0>] (wl1271_sdio_set_power+0x20/0x84 [wl12xx_sdio])
    [  190.159369] [<7f0402a0>] (wl1271_sdio_set_power+0x20/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  190.172094] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  190.183478] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  190.192471] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  190.201471] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  190.210984] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  190.220043] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  190.228918] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  190.237646] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  190.246112] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  190.254652] ---[ end trace 1800fb87e278dc26 ]---
    [  190.259276] mmc1: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
    [  190.259297] sdhci_platform_set_power----------------- 0: bfe26ac0:80064670
    [  190.259307] in wl12xx_set_power  on=0
    [  190.262972] shabeer in dri/host/mmc/sdhci--imx.c
    [  190.290317] SDIO: Disabling device mmc1:0001:2...
    [  190.290324] ------------[ cut here ]------------
    [  190.294953] WARNING: at drivers/mmc/core/core.c:348 mmc_wait_for_cmd+0x9c/0xa0()
    [  190.302541] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  190.310717] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  190.320234] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  190.330124] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c672c>] (mmc_wait_for_cmd+0x9c/0xa0)
    [  190.339594] [<803c672c>] (mmc_wait_for_cmd+0x9c/0xa0) from [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150)
    [  190.349493] [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150) from [<803cfcd0>] (sdio_disable_func+0x58/0xfc)
    [  190.359405] [<803cfcd0>] (sdio_disable_func+0x58/0xfc) from [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio])
    [  190.370469] [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  190.382863] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  190.394153] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  190.403191] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  190.412101] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  190.421729] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  190.430901] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  190.439831] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  190.448613] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  190.457215] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  190.465798] ---[ end trace 1800fb87e278dc27 ]---
    [  190.470443] mmc1: starting CMD52 arg 00000400 flags 00000195
    [  190.470451] ------------[ cut here ]------------
    [  190.475318] WARNING: at drivers/mmc/core/core.c:168 __mmc_start_req+0x21c/0x248()
    [  190.483025] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  190.490926] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  190.500726] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  190.510418] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c6524>] (__mmc_start_req+0x21c/0x248)
    [  190.520042] [<803c6524>] (__mmc_start_req+0x21c/0x248) from [<803c6704>] (mmc_wait_for_cmd+0x74/0xa0)
    [  190.529424] [<803c6704>] (mmc_wait_for_cmd+0x74/0xa0) from [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150)
    [  190.539321] [<803ceb98>] (mmc_io_rw_direct_host+0xa0/0x150) from [<803cfcd0>] (sdio_disable_func+0x58/0xfc)
    [  190.549223] [<803cfcd0>] (sdio_disable_func+0x58/0xfc) from [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio])
    [  190.560271] [<7f040298>] (wl1271_sdio_set_power+0x18/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  190.572924] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  190.584050] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  190.593084] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  190.602125] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  190.611752] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  190.620960] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  190.629698] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  190.638535] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  190.647113] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  190.655696] ---[ end trace 1800fb87e278dc28 ]---
    [  190.660522] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
    [  190.660555] mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
    [  190.660583] SDIO: Failed to disable device mmc1:0001:2
    [  190.660591] ------------[ cut here ]------------
    [  190.665316] WARNING: at drivers/mmc/core/core.c:711 mmc_release_host+0x38/0x3c()
    [  190.673137] Modules linked in: wl12xx_sdio_test wl12xx_sdio wl12xx power_mgr flexcan
    [  190.681234] [<8004bff4>] (unwind_backtrace+0x0/0x134) from [<800804bc>] (warn_slowpath_common+0x54/0x64)
    [  190.690925] [<800804bc>] (warn_slowpath_common+0x54/0x64) from [<80080568>] (warn_slowpath_null+0x1c/0x24)
    [  190.700821] [<80080568>] (warn_slowpath_null+0x1c/0x24) from [<803c6f7c>] (mmc_release_host+0x38/0x3c)
    [  190.710166] [<803c6f7c>] (mmc_release_host+0x38/0x3c) from [<7f0402a0>] (wl1271_sdio_set_power+0x20/0x84 [wl12xx_sdio])
    [  190.721209] [<7f0402a0>] (wl1271_sdio_set_power+0x20/0x84 [wl12xx_sdio]) from [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx])
    [  190.733739] [<7f0136a0>] (wl1271_op_add_interface+0x174/0x354 [wl12xx]) from [<80573560>] (ieee80211_do_open+0x4c4/0x62c)
    [  190.744934] [<80573560>] (ieee80211_do_open+0x4c4/0x62c) from [<8047c150>] (__dev_open+0x98/0xec)
    [  190.753966] [<8047c150>] (__dev_open+0x98/0xec) from [<8047c37c>] (__dev_change_flags+0x84/0x134)
    [  190.763006] [<8047c37c>] (__dev_change_flags+0x84/0x134) from [<8047c498>] (dev_change_flags+0x10/0x48)
    [  190.772566] [<8047c498>] (dev_change_flags+0x10/0x48) from [<804d1e14>] (devinet_ioctl+0x688/0x7a4)
    [  190.781838] [<804d1e14>] (devinet_ioctl+0x688/0x7a4) from [<80468920>] (sock_ioctl+0x118/0x260)
    [  190.790694] [<80468920>] (sock_ioctl+0x118/0x260) from [<80134a00>] (do_vfs_ioctl+0x3b4/0x530)
    [  190.799342] [<80134a00>] (do_vfs_ioctl+0x3b4/0x530) from [<80134bb0>] (sys_ioctl+0x34/0x60)
    [  190.808083] [<80134bb0>] (sys_ioctl+0x34/0x60) from [<800452a0>] (ret_fast_syscall+0x0/0x30)
    [  190.816625] ---[ end trace 1800fb87e278dc29 ]---
    [  190.821341] mmc1: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
    [  190.821362] sdhci_platform_set_power----------------- 0: bfe26ac0:80064670
    [  190.821370] in wl12xx_set_power  on=0
    [  190.825034] shabeer in dri/host/mmc/sdhci--imx.c
    [  190.829667] wl1271: ERROR firmware boot failed despite 3 retries
    root@imx6qsabresd:~#
    3823.kernel_boot_msg.txt
    U-Boot 2013.10 (Apr 16 2014 - 10:46:22)
    
    CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
    Reset cause: POR
    Board: MX6-SabreSD
    DRAM:  1 GiB
    MMC:   FSL_SDHC: 0
    No panel detected: default to HDMI
    Display: HDMI (1024x768)
    In:    serial
    Out:   serial
    Err:   serial
    i2c: I2C1 SDA is low, start i2c recovery...
    I2C1 Recovery success
    force_idle_bus: sda=0 scl=0 sda.gp=0x0 scl.gp=0x0
    force_idle_bus: failed to clear bus, sda=0 scl=0
    POT value := 64Net:   Phy not found
    PHY reset timed out
    FEC [PRIME]
    Warning: failed to set MAC address
    
    Hit any key to stop autoboot:  0
    mmc0(part 0) is current device
    
    MMC read: dev # 0, block # 2048, count 8192 ... 8192 blocks read: OK
    ## Booting kernel from Legacy Image at 12000000 ...
       Image Name:   Linux-3.0.35-4.1.0+yocto+gbdde70
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    4124948 Bytes = 3.9 MiB
       Load Address: 10008000
       Entry Point:  10008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Linux version 3.0.35-4.1.0+yocto+gbdde708 (flex@ubuntu) (gcc version 4.8.1 (GCC) ) #102 SMP PREEMPT Tue Jul 22 21:19:15 PDT 2014
    [    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: Freescale i.MX 6Quad/DualLite/Solo Sabre-SD Board
    [    0.000000] Memory policy: ECC disabled, Data cache writealloc
    [    0.000000] CPU identified as i.MX6Q, silicon rev 1.2
    [    0.000000] PERCPU: Embedded 7 pages/cpu @8c008000 s5792 r8192 d14688 u32768
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 194560
    [    0.000000] Kernel command line: console=ttymxc0,115200 ip= root=/dev/mmcblk0p1 rootwait
    [    0.000000] New Kernel compiled by Shabeer
    [    0.000000] New changes added by TE Drivecam
    [    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Memory: 512MB 256MB = 768MB total
    [    0.000000] Memory: 768288k/768288k available, 280288k reserved, 0K highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     DMA     : 0xf4600000 - 0xffe00000   ( 184 MB)
    [    0.000000]     vmalloc : 0xc0800000 - 0xf2000000   ( 792 MB)
    [    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
    [    0.000000]     pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    [    0.000000]     modules : 0x7f000000 - 0x7fe00000   (  14 MB)
    [    0.000000]       .init : 0x80008000 - 0x8003f000   ( 220 kB)
    [    0.000000]       .text : 0x8003f000 - 0x807c173c   (7690 kB)
    [    0.000000]       .data : 0x807c2000 - 0x80839f50   ( 480 kB)
    [    0.000000]        .bss : 0x80839f74 - 0x808ca2f4   ( 577 kB)
    [    0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [    0.000000] Preemptible hierarchical RCU implementation.
    [    0.000000] NR_IRQS:624
    [    0.000000] MXC GPIO hardware
    [    0.000000] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 1431655ms
    [    0.000000] arm_max_freq=1GHz
    [    0.000000] MXC_Early serial console at MMIO 0x2020000 (options '115200')
    [    0.000000] bootconsole [ttymxc0] enabled
    [    0.000000] Console: colour dummy device 80x30
    [    0.219298] Calibrating delay loop... 1581.05 BogoMIPS (lpj=7905280)
    [    0.307619] pid_max: default: 32768 minimum: 301
    [    0.312602] Mount-cache hash table entries: 512
    [    0.318136] CPU: Testing write buffer coherency: ok
    [    0.323326] hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
    [    0.423880] CPU1: Booted secondary processor
    [    0.553878] CPU2: Booted secondary processor
    [    0.683891] CPU3: Booted secondary processor
    [    0.773363] Brought up 4 CPUs
    [    0.789192] SMP: Total of 4 processors activated (6324.22 BogoMIPS).
    [    0.796159] devtmpfs: initialized
    [    0.818308] print_constraints: dummy:
    [    0.822341] NET: Registered protocol family 16
    [    0.828080] print_constraints: vddpu: 725 <--> 1300 mV at 1150 mV fast normal
    [    0.835522] print_constraints: vddcore: 725 <--> 1300 mV at 1150 mV fast normal
    [    0.843094] print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal
    [    0.850646] print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal
    [    0.858275] print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal
    [    0.865792] print_constraints: vdd3p0: 2625 <--> 3400 mV at 3000 mV fast normal
    [    0.880120] shabeer dc2_pwr_enable delay over
    [    0.907979] Going to call fs_wl12xx_init()
    [    0.912091] in fs_wl12xx_init start
    [    1.164060] in fs_wl12xx_init end
    [    1.167396] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
    [    1.174223] hw-breakpoint: 1 breakpoint(s) reserved for watchpoint single-step.
    [    1.181569] hw-breakpoint: maximum watchpoint size is 4 bytes.
    [    1.187469] L310 cache controller enabled
    [    1.191497] l2x0: 16 ways, CACHE_ID 0x410000c7, AUX_CTRL 0x02070000, Cache size: 1048576 B
    [    1.208316] bio: create slab <bio-0> at 0
    [    1.214195] mxs-dma mxs-dma-apbh: initialized
    [    1.218730] print_constraints: vmmc: 3300 mV
    [    1.223731] SCSI subsystem initialized
    [    1.227987] spi_imx imx6q-ecspi.1: probed
    [    1.232298] spi_imx imx6q-ecspi.2: probed
    [    1.236579] usbcore: registered new interface driver usbfs
    [    1.242137] usbcore: registered new interface driver hub
    [    1.247559] usbcore: registered new device driver usb
    [    1.252629] Freescale USB OTG Driver loaded, $Revision: 1.55 $
    [    1.260373] mc_pfuze 2-0008: ID: 0,Full lay: 1 ,Metal lay: 2
    [    1.266573] mc_pfuze 2-0008: FAB: 0 ,FIN: 0
    [    1.280848] SHABEER PFUZE VALUE CHANGED
    [    1.287986] print_constraints: PFUZE100_SW1A: 300 <--> 1875 mV at 1300 mV
    [    1.295581] print_constraints: PFUZE100_SW1B: 300 <--> 1875 mV at 300 mV
    [    1.303927] print_constraints: PFUZE100_SW1C: 300 <--> 1875 mV at 1300 mV
    [    1.311475] print_constraints: PFUZE100_SW2: 800 <--> 3950 mV at 3000 mV
    [    1.318954] print_constraints: PFUZE100_SW3A: 400 <--> 1975 mV at 1500 mV
    [    1.326530] print_constraints: PFUZE100_SW3B: 400 <--> 1975 mV at 1500 mV
    [    1.334087] print_constraints: PFUZE100_SW4: 800 <--> 3950 mV at 3300 mV
    [    1.341562] print_constraints: PFUZE100_SWBST: 5000 <--> 5150 mV at 5000 mV
    [    1.349309] print_constraints: PFUZE100_VSNVS: 1200 <--> 3000 mV at 1800 mV
    [    1.357429] print_constraints: PFUZE100_VREFDDR: at 750 mV
    [    1.363655] print_constraints: PFUZE100_VGEN1: 800 <--> 1550 mV at 800 mV
    [    1.371194] print_constraints: PFUZE100_VGEN2: 800 <--> 1550 mV at 1500 mV
    [    1.379720] print_constraints: PFUZE100_VGEN3: 1800 <--> 3300 mV at 1800 mV
    [    1.388341] print_constraints: PFUZE100_VGEN4: 1800 <--> 3300 mV at 1800 mV
    [    1.396967] print_constraints: PFUZE100_VGEN5: 1800 <--> 3300 mV at 2500 mV
    [    1.404700] print_constraints: PFUZE100_VGEN6: 1800 <--> 3300 mV at 3000 mV
    [    1.423356] imx-ipuv3 imx-ipuv3.0: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
    [    1.443347] imx-ipuv3 imx-ipuv3.1: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
    [    1.451104] mxc_mipi_csi2 mxc_mipi_csi2: i.MX MIPI CSI2 driver probed
    [    1.457579] mxc_mipi_csi2 mxc_mipi_csi2: i.MX MIPI CSI2 dphy version is 0x3130302a
    [    1.465229] MIPI CSI2 driver module loaded
    [    1.469405] Advanced Linux Sound Architecture Driver Version 1.0.24.
    [    1.476266] Bluetooth: Core ver 2.16
    [    1.479898] NET: Registered protocol family 31
    [    1.484369] Bluetooth: HCI device and connection manager initialized
    [    1.490745] Bluetooth: HCI socket layer initialized
    [    1.495645] Bluetooth: L2CAP socket layer initialized
    [    1.500778] Bluetooth: SCO socket layer initialized
    [    1.505984] cfg80211: Calling CRDA to update world regulatory domain
    [    1.513195] i2c-core: driver [max17135] using legacy suspend method
    [    1.519494] i2c-core: driver [max17135] using legacy resume method
    [    1.525721] Switching to clocksource mxc_timer1
    [    1.549262] NET: Registered protocol family 2
    [    1.553815] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    1.561477] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
    [    1.570917] TCP bind hash table entries: 65536 (order: 7, 786432 bytes)
    [    1.578661] TCP: Hash tables configured (established 131072 bind 65536)
    [    1.585312] TCP reno registered
    [    1.588475] UDP hash table entries: 512 (order: 2, 16384 bytes)
    [    1.594470] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
    [    1.601297] NET: Registered protocol family 1
    [    1.605974] RPC: Registered named UNIX socket transport module.
    [    1.611932] RPC: Registered udp transport module.
    [    1.616652] RPC: Registered tcp transport module.
    [    1.621383] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    1.628542] PMU: registered new PMU device of type 0
    [    1.633579] Static Power Management for Freescale i.MX6
    [    1.638821] wait mode is enabled for i.MX6
    [    1.643043] cpaddr = c0880000 suspend_iram_base=c0914000
    [    1.648455] PM driver module loaded
    [    1.652142] IMX usb wakeup probe
    [    1.655773] add wake up source irq 75
    [    1.665809] IMX usb wakeup probe
    [    1.669230] cpu regulator mode:ldo_bypass
    [    1.675346] _regulator_get: get() with no identifier
    [    1.680343] mx6_cpu_regulator_init: failed to get pu regulator
    [    1.688356] i.MXC CPU frequency driver
    [    1.787485] JFFS2 version 2.2. (NAND) � 2001-2006 Red Hat, Inc.
    [    1.794021] msgmni has been set to 1500
    [    1.799428] alg: No test for stdrng (krng)
    [    1.803719] io scheduler noop registered
    [    1.807655] io scheduler deadline registered
    [    1.812039] io scheduler cfq registered (default)
    [    1.817507] imx-sdma imx-sdma: loaded firmware 1.1
    [    1.824619] imx-sdma imx-sdma: initialized
    [    1.923087] Serial: IMX driver
    [    1.926274] imx-uart.0: ttymxc0 at MMIO 0x2020000 (irq = 58) is a IMX
    [    1.932778] console [ttymxc0] enabled, bootconsole disabled
    [    1.932778] console [ttymxc0] enabled, bootconsole disabled
    [    1.944273] imx-uart.1: ttymxc1 at MMIO 0x21e8000 (irq = 59) is a IMX
    [    1.951042] imx-uart.2: ttymxc2 at MMIO 0x21ec000 (irq = 60) is a IMX
    [    1.962033] loop: module loaded
    [    1.990270] Can't recover from RESET HBA!
    [    2.036788] No sata disk.
    [    2.040241] m25p80 spi1.0: unrecognized JEDEC id 20ba20
    [    2.045599] GPMI NAND driver registered. (IMX)
    [    2.050528] CAN device driver interface
    [    2.054378] FEC Ethernet Driver
    [    2.060056] fec_enet_mii_bus: probed
    [    2.064089] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    2.070789] fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
    [    2.077436] fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
    [    2.110342] fsl-ehci fsl-ehci.0: irq 75, io base 0x02184000
    [    2.130327] fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
    [    2.136469] hub 1-0:1.0: USB hub found
    [    2.140236] hub 1-0:1.0: 1 port detected
    [    2.144387] add wake up source irq 72
    [    2.148091] fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
    [    2.154739] fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
    [    2.200330] fsl-ehci fsl-ehci.1: irq 72, io base 0x02184200
    [    2.230315] fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
    [    2.236366] hub 2-0:1.0: USB hub found
    [    2.240131] hub 2-0:1.0: 1 port detected
    [    2.244229] Initializing USB Mass Storage driver...
    [    2.249220] usbcore: registered new interface driver usb-storage
    [    2.255277] USB Mass Storage support registered.
    [    2.259940] ARC USBOTG Device Controller driver (1 August 2005)
    [    2.266456] mousedev: PS/2 mouse device common for all mice
    [    2.272487] i2c-core: driver [isl29023] using legacy suspend method
    [    2.278762] i2c-core: driver [isl29023] using legacy resume method
    [    2.285493] snvs_rtc snvs_rtc.0: rtc core: registered snvs_rtc as rtc0
    [    2.292125] i2c /dev entries driver
    [    2.296127] Linux video capture interface: v2.00
    [    2.301012] i2c-core: driver [mag3110] using legacy suspend method
    [    2.307195] i2c-core: driver [mag3110] using legacy resume method
    [    2.313600] imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=1)
    [    2.321657] Bluetooth: Virtual HCI driver ver 1.3
    [    2.326514] Bluetooth: HCI UART driver ver 2.2
    [    2.330977] Bluetooth: HCIATH3K protocol initialized
    [    2.335945] Bluetooth: Generic Bluetooth USB driver ver 0.6
    [    2.341598] usbcore: registered new interface driver btusb
    [    2.347171] sdhci: Secure Digital Host Controller Interface driver
    [    2.353401] sdhci: Copyright(c) Pierre Ossman
    [    2.358176] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.362843] mmc0: SDHCI controller on platform [sdhci-esdhc-imx.2] using DMA
    [    2.362855] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
    [    2.362888] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.381989] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.383854] in wl12xx_set_power  on=0
    [    2.383860] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.383884] mmc1: SDHCI controller on platform [sdhci-esdhc-imx.1] using DMA
    [    2.384007] mxc_vdoa mxc_vdoa: i.MX Video Data Order Adapter(VDOA) driver probed
    [    2.384446] VPU initialized
    [    2.385260] mxc_asrc registered
    [    2.385352] Galcore version 4.6.9.6622
    [    2.407799] Thermal calibration data is 0x5574ad7d
    [    2.407807] Thermal sensor with ratio = 175
    [    2.420322] Anatop Thermal registered as thermal_zone0
    [    2.420424] anatop_thermal_probe: default cooling device is cpufreq!
    [    2.420872] usbcore: registered new interface driver usbhid
    [    2.420878] usbhid: USB HID core driver
    [    2.421203] usbcore: registered new interface driver snd-usb-audio
    [    2.421565] Cirrus Logic CS42888 ALSA SoC Codec Driver
    [    2.421620] i2c-core: driver [cs42888] using legacy suspend method
    [    2.421626] i2c-core: driver [cs42888] using legacy resume method
    [    2.422879] imx_3stack asoc driver
    [    2.423245] ALSA device list:
    [    2.423251]   No soundcards found.
    [    2.423445] NET: Registered protocol family 26
    [    2.423501] TCP cubic registered
    [    2.423507] NET: Registered protocol family 17
    [    2.423523] can: controller area network core (rev 20090105 abi 8)
    [    2.423596] NET: Registered protocol family 29
    [    2.423611] can: raw protocol (rev 20090105)
    [    2.423617] can: broadcast manager protocol (rev 20090105 t)
    [    2.423627] can: SAE J1939
    [    2.423734] Bluetooth: RFCOMM TTY layer initialized
    [    2.423747] Bluetooth: RFCOMM socket layer initialized
    [    2.423752] Bluetooth: RFCOMM ver 1.11
    [    2.423758] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [    2.423763] Bluetooth: BNEP filters: protocol multicast
    [    2.423769] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
    [    2.423824] lib80211: common routines for IEEE802.11 drivers
    [    2.555788] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
    [    2.563749] Bus freq driver module loaded
    [    2.567765] Bus freq driver Enabled
    [    2.575297] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.577503] mxc_dvfs_core_probe
    [    2.577598] DVFS driver module loaded
    [    2.579086] regulator_init_complete: PFUZE100_VGEN6: incomplete constraints, leaving on
    [    2.579614] regulator_init_complete: PFUZE100_VGEN2: incomplete constraints, leaving on
    [    2.605152] snvs_rtc snvs_rtc.0: setting system clock to 2014-07-15 11:25:59 UTC (1405423559)
    [    2.614491] Waiting for root device /dev/mmcblk0p1...
    [    2.614554] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.648353] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.655445] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.664366] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.691694] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.712903] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.720780] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.728820] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.737135] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.744215] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.751271] mmc0: new high speed DDR MMC card at address 0001
    [    2.757437] mmcblk0: mmc0:0001 MMC04G 3.52 GiB
    [    2.762207] mmcblk0boot0: mmc0:0001 MMC04G partition 1 16.0 MiB
    [    2.768346] mmcblk0boot1: mmc0:0001 MMC04G partition 2 16.0 MiB
    [    2.776419]  mmcblk0: p1
    [    2.781060]  mmcblk0boot1: unknown partition table
    [    2.787773]  mmcblk0boot0: unknown partition table
    [    2.792749] mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
    [    2.799401] in wl12xx_set_power  on=1
    [    2.858633] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.868585] EXT3-fs: barriers not enabled
    [    2.881156] in wl12xx_set_power  on=1
    [    2.940387] shabeer in dri/host/mmc/sdhci--imx.c
    [    2.964307] in wl12xx_set_power  on=1
    [    3.023538] shabeer in dri/host/mmc/sdhci--imx.c
    [    3.032930] in wl12xx_set_power  on=1
    [    3.092159] shabeer in dri/host/mmc/sdhci--imx.c
    [    3.102743] mmc1: card claims to support voltages below the defined range. These will be ignored.
    [    3.111657] in wl12xx_set_power  on=1
    [    3.170887] shabeer in dri/host/mmc/sdhci--imx.c
    [    3.179004] in wl12xx_set_power  on=1
    [    3.238233] shabeer in dri/host/mmc/sdhci--imx.c
    [    3.256228] in wl12xx_set_power  on=1
    [    3.315457] shabeer in dri/host/mmc/sdhci--imx.c
    [    3.323002] in wl12xx_set_power  on=1
    [    3.382231] shabeer in dri/host/mmc/sdhci--imx.c
    [    3.393043] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
    [    3.401764] mmc1: new SDIO card at address 0001
    [    3.694968] kjournald starting.  Commit interval 5 seconds
    [    3.697705] EXT3-fs (mmcblk0p1): using internal journal
    [    3.697713] EXT3-fs (mmcblk0p1): recovery complete
    [    3.699014] EXT3-fs (mmcblk0p1): mounted filesystem with writeback data mode
    [    3.699052] VFS: Mounted root (ext3 filesystem) on device 179:1.
    [    3.701518] devtmpfs: mounted
    [    3.701594] Freeing init memory: 220K
    [    3.925348] init: upstart-dbus-bridge main process (71) terminated with status 1
    [    3.932911] init: upstart-dbus-bridge main process ended, respawning
    running mountall.conf
    [    4.037170] init: Unable to connect to the system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    starting dbus
    in rc-sysinit.conf
    Starting udev
    [    4.226519] init: upstart-event-bridge main process (110) terminated with status 1
    [    4.234466] init: upstart-event-bridge main process ended, respawning
    Starting udev[    4.257594] init: upstart-event-bridge main process (117) terminated with status 1
    [    4.266080] init: upstart-event-bridge main process ended, respawning
    
    [    4.285742] init: upstart-event-bridge main process (119) terminated with status 1
    [    4.294687] init: upstart-event-bridge main process ended, respawning
    [    4.325638] init: upstart-event-bridge main process (124) terminated with status 1
    [    4.333414] init: upstart-event-bridge main process ended, respawning
    [    4.350064] init: upstart-event-bridge main process (126) terminated with status 1
    [    4.359167] init: upstart-event-bridge main process ended, respawning
    [    4.376215] init: upstart-event-bridge main process (129) terminated with status 1
    [    4.383907] init: upstart-event-bridge main process ended, respawning
    [    4.408884] init: upstart-event-bridge main process (132) terminated with status 1
    [    4.416683] init: upstart-event-bridge main process ended, respawning
    [    4.418600] udevd[133]: starting version 182
    [    4.441251] init: upstart-event-bridge main process (136) terminated with status 1
    [    4.449461] init: upstart-event-bridge main process ended, respawning
    [    4.470931] init: upstart-event-bridge main process (137) terminated with status 1
    [    4.478692] init: upstart-event-bridge main process ended, respawning
    [    4.498568] init: upstart-event-bridge main process (140) terminated with status 1
    [    4.506483] init: upstart-event-bridge main process ended, respawning
    [    4.507843] udevd[142]: starting version 182
    [    4.527971] init: upstart-event-bridge main process (145) terminated with status 1
    [    4.535689] init: upstart-event-bridge respawning too fast, stopped
    Starting Bootlog daemon: bootlogd.
    ALSA: Restoring mixer settings...
    Configuring network interfaces... /usr/sbin/alsactl: load_state:1729: No soundcards found...
    [    5.631480] eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, irq=-1)
    udhcpc (v1.21.1) started
    Sending discover...
    Sending discover...
    Sending discover...
    No lease, failing
    Starting rpcbind daemon...rpcbind: cannot create socket for udp6
    rpcbind: cannot create socket for tcp6
    done.
    system message bus already started; not starting.
    Starting system message bus: dbus.
    Starting OpenBSD Secure Shell server: sshd
    done.
    Starting advanced power management daemon: apmd.
    apmd[500]: apmd 3.2.1 interfacing with apm driver 1.13 and APM BIOS 1.2
    Starting ntpd: done
    starting rsyslogd ... rsyslogd: error: option -c is no longer supported - ignored
    rsyslogd: run failed with error -2207 (see rsyslog.h or try http://www.rsyslog.com/e/2207 to learn what that number means)
    failed
    Starting syslogd/klogd: done
     * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
       ...done.
    Running local boot scripts (/etc/rc.local)running rc.local
    [   16.240036] flexcan netdevice driver
    [   16.245176] flexcan imx6q-flexcan.0: device registered (reg_base=c0af8000, irq=142)
    [   16.254873] flexcan imx6q-flexcan.1: device registered (reg_base=c0b00000, irq=143)
    [   16.297711] adc_spi: disagrees about version of symbol wake_up_process
    [   16.304275] adc_spi: Unknown symbol wake_up_process (err -22)
    insmod: ERROR: could not insert module /lib/modules/3.0.35-4.1.0+yocto+gbdde708/extra/adc/adc_spi.ko: Invalid parameters
    error
    Stopping Bootlog daemon: bootlogd.
    
    Poky (Yocto Project Reference Distro) 1.5.1 imx6qsabresd /dev/ttymxc0
    
    imx6qsabresd login: root
    root@imx6qsabresd:~#
    5287.wifi_driver_load_msg.txt
    root@imx6qsabresd:~# insmod wl12xx.ko
    root@imx6qsabresd:~# insmod wl12xx_sdio.ko
    [  103.975062] add wake up source irq 103
    [  103.998955] wl1271: loaded
    [  104.002694] wl1271: initialized
    root@imx6qsabresd:~# insmod wl12xx_sdio_test.ko
    root@imx6qsabresd:~# dmesg
    [   93.888878] mmc0: starting CMD18 arg 000b9000 flags 000000b5
    [   93.888909] mmc0:     blksz 512 blocks 104 flags 00000200 tsac 400 ms nsac 1000
    [   93.888932] mmc0:     CMD12 arg 00000000 flags 0000049d
    [   93.888991] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   93.889041] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   93.891363] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [   93.891394] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [   93.891442] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [   93.891464] mmc0:     53248 bytes transferred: 0
    [   93.891483] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [   93.892624] mmc0: starting CMD18 arg 000b9068 flags 000000b5
    [   93.892650] mmc0:     blksz 512 blocks 160 flags 00000200 tsac 400 ms nsac 1000
    [   93.892671] mmc0:     CMD12 arg 00000000 flags 0000049d
    [   93.892721] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   93.892766] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   93.894929] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [   93.894955] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [   93.895001] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [   93.895022] mmc0:     81920 bytes transferred: 0
    [   93.895041] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [   93.896587] mmc0: starting CMD18 arg 000b9108 flags 000000b5
    [   93.896614] mmc0:     blksz 512 blocks 184 flags 00000200 tsac 400 ms nsac 1000
    [   93.896634] mmc0:     CMD12 arg 00000000 flags 0000049d
    [   93.896682] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   93.896731] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   93.899127] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [   93.899154] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [   93.899197] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [   93.899219] mmc0:     94208 bytes transferred: 0
    [   93.899237] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [   94.280733] mmc0: starting CMD25 arg 00346030 flags 000000b5
    [   94.280763] mmc0:     blksz 512 blocks 16 flags 00000100 tsac 1600 ms nsac 4000
    [   94.280787] mmc0:     CMD12 arg 00000000 flags 0000049d
    [   94.280844] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   94.280891] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   94.281156] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000008
    [   94.281185] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4fb80000, transferred 0x080000 bytes, next 0x4fc00000
    [   94.285434] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000002
    [   94.285477] mmc0: req done (CMD25): 0: 00000900 00000000 00000000 00000000
    [   94.285499] mmc0:     8192 bytes transferred: 0
    [   94.285518] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [   94.285564] mmc0: starting CMD13 arg 00010000 flags 00000195
    [   94.285624] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   94.285664] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
    [   94.285917] mmc0: starting CMD25 arg 00346040 flags 000000b5
    [   94.285944] mmc0:     blksz 512 blocks 8 flags 00000100 tsac 1600 ms nsac 4000
    [   94.285964] mmc0:     CMD12 arg 00000000 flags 0000049d
    [   94.286010] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   94.286054] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   94.286208] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000008
    [   94.286233] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4fb80000, transferred 0x080000 bytes, next 0x4fc00000
    [   94.287030] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000002
    [   94.287069] mmc0: req done (CMD25): 0: 00000900 00000000 00000000 00000000
    [   94.287088] mmc0:     4096 bytes transferred: 0
    [   94.287107] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [   94.287149] mmc0: starting CMD13 arg 00010000 flags 00000195
    [   94.287202] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [   94.287239] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
    [  103.968665] mmc0: starting CMD18 arg 000bd000 flags 000000b5
    [  103.968694] mmc0:     blksz 512 blocks 32 flags 00000200 tsac 400 ms nsac 1000
    [  103.968716] mmc0:     CMD12 arg 00000000 flags 0000049d
    [  103.968775] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.968824] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.972082] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [  103.972114] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [  103.972163] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [  103.972183] mmc0:     16384 bytes transferred: 0
    [  103.972205] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [  103.973848] mmc1: starting CMD52 arg 80022000 flags 00000195
    [  103.973918] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
    [  103.973959] mmc1: req done (CMD52): 0: 00001000 00000000 00000000 00000000
    [  103.974013] mmc1: starting CMD52 arg 80022202 flags 00000195
    [  103.974076] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
    [  103.974112] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
    [  103.974210] mmc1: starting CMD52 arg 80042000 flags 00000195
    [  103.974271] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
    [  103.974306] mmc1: req done (CMD52): 0: 00001000 00000000 00000000 00000000
    [  103.974346] mmc1: starting CMD52 arg 80042202 flags 00000195
    [  103.974400] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
    [  103.974433] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
    [  103.975062] add wake up source irq 103
    [  103.981479] mmc0: starting CMD18 arg 003ab860 flags 000000b5
    [  103.981519] mmc0:     blksz 512 blocks 8 flags 00000200 tsac 400 ms nsac 1000
    [  103.981553] mmc0:     CMD12 arg 00000000 flags 0000049d
    [  103.981616] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.981677] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.982410] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [  103.982443] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [  103.982500] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [  103.982523] mmc0:     4096 bytes transferred: 0
    [  103.982544] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [  103.983485] mmc0: starting CMD18 arg 003c11f0 flags 000000b5
    [  103.983511] mmc0:     blksz 512 blocks 8 flags 00000200 tsac 400 ms nsac 1000
    [  103.983535] mmc0:     CMD12 arg 00000000 flags 0000049d
    [  103.983604] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.983654] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.984332] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [  103.984360] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [  103.984403] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [  103.984423] mmc0:     4096 bytes transferred: 0
    [  103.984442] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [  103.984976] mmc0: starting CMD18 arg 003bb1f8 flags 000000b5
    [  103.985015] mmc0:     blksz 512 blocks 8 flags 00000200 tsac 400 ms nsac 1000
    [  103.985044] mmc0:     CMD12 arg 00000000 flags 0000049d
    [  103.985104] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.985164] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.985829] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [  103.985856] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [  103.985897] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [  103.985916] mmc0:     4096 bytes transferred: 0
    [  103.985936] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [  103.987020] mmc0: starting CMD18 arg 003be480 flags 000000b5
    [  103.987048] mmc0:     blksz 512 blocks 8 flags 00000200 tsac 400 ms nsac 1000
    [  103.987074] mmc0:     CMD12 arg 00000000 flags 0000049d
    [  103.987128] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.987177] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  103.987845] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [  103.987874] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [  103.987917] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [  103.987938] mmc0:     4096 bytes transferred: 0
    [  103.987956] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [  103.998955] wl1271: loaded
    [  104.002694] wl1271: initialized
    [  109.568692] mmc0: starting CMD18 arg 000c1000 flags 000000b5
    [  109.568722] mmc0:     blksz 512 blocks 40 flags 00000200 tsac 400 ms nsac 1000
    [  109.568745] mmc0:     CMD12 arg 00000000 flags 0000049d
    [  109.568806] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  109.568854] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00000001
    [  109.570223] sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0000000a
    [  109.570252] sdhci [sdhci_data_irq()]: mmc0: DMA base 0x4a000000, transferred 0x080000 bytes, next 0x4a080000
    [  109.570353] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
    [  109.570374] mmc0:     20480 bytes transferred: 0
    [  109.570394] mmc0:     (CMD12): 0: 00000000 00000000 00000000 00000000
    [  109.572154] mmc1: starting CMD52 arg 80022000 flags 00000195
    [  109.572225] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
    [  109.572270] mmc1: req done (CMD52): 0: 00001000 00000000 00000000 00000000
    [  109.572327] mmc1: starting CMD52 arg 80022202 flags 00000195
    [  109.572378] sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
    [  109.572417] mmc1: req done (CMD52): 0: 00001002 00000000 00000000 00000000
    root@imx6qsabresd:~#

    Thanks,

    Silvy.

  • Hi Vishwa,

    Additionally, the set_power functions  were updated as specified in the below link.

    https://github.com/boundarydevices/linux-imx6/commit/cdee0ec7fd5cdd21c205e76fea6398eea343eec0

    Thanks,

    Silvy.