ARM: tegra: enable unaligned_dma_buf_support
Rohith Seelaboyina [Wed, 10 Apr 2013 08:54:27 +0000 (13:54 +0530)]
enable unalgined_dma_buf_support for boards in which
h/w fix is enabled.

Bug 1235943

Change-Id: Idaead18f21b554a9888f30ec9796125aabd4ab72
Reviewed-on: http://git-master/r/200471
(cherry picked from commit 35628248962a01ff63f327cb11397c5bd0608403)
Signed-off-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Reviewed-on: http://git-master/r/206617
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>

arch/arm/mach-tegra/board-dalmore.c
arch/arm/mach-tegra/board-macallan.c
arch/arm/mach-tegra/board-pluto.c
arch/arm/mach-tegra/board-roth.c

index dc1fe77..c7e7061 100644 (file)
@@ -438,6 +438,7 @@ static struct tegra_usb_platform_data tegra_udc_pdata = {
        .port_otg = true,
        .has_hostpc = true,
        .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .unaligned_dma_buf_supported = false,
        .op_mode = TEGRA_USB_OPMODE_DEVICE,
        .u_data.dev = {
                .vbus_pmu_irq = 0,
@@ -523,6 +524,12 @@ static void dalmore_usb_init(void)
        tegra_set_usb_wake_source();
 
        if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
+               if (tegra_get_chipid() == TEGRA_CHIPID_TEGRA11 &&
+                       tegra_revision == TEGRA_REVISION_A02) {
+                       tegra_ehci1_utmi_pdata \
+                       .unaligned_dma_buf_supported = true;
+                       tegra_udc_pdata.unaligned_dma_buf_supported = true;
+               }
                tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
                platform_device_register(&tegra_otg_device);
                /* Setup the udc platform data */
@@ -530,6 +537,11 @@ static void dalmore_usb_init(void)
        }
 
        if (!(usb_port_owner_info & UTMI2_PORT_OWNER_XUSB)) {
+               if (tegra_get_chipid() == TEGRA_CHIPID_TEGRA11 &&
+                       tegra_revision == TEGRA_REVISION_A02) {
+                       tegra_ehci3_utmi_pdata \
+                       .unaligned_dma_buf_supported = true;
+               }
                tegra_ehci3_device.dev.platform_data = &tegra_ehci3_utmi_pdata;
                platform_device_register(&tegra_ehci3_device);
        }
@@ -653,8 +665,13 @@ static void dalmore_modem_init(void)
        int usb_port_owner_info = tegra_get_usb_port_owner_info();
        switch (modem_id) {
        case TEGRA_BB_NEMO: /* on board i500 HSIC */
-               if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB))
+               if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) {
+                       if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) &&
+                               (tegra_revision == TEGRA_REVISION_A02))
+                               tegra_ehci2_hsic_baseband_pdata \
+                               .unaligned_dma_buf_supported = true;
                        platform_device_register(&icera_nemo_device);
+               }
                break;
        }
 }
index 7d61f24..d25840d 100644 (file)
@@ -439,6 +439,13 @@ static void macallan_usb_init(void)
        tegra_set_usb_wake_source();
 
        if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
+               if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) &&
+                   (tegra_revision == TEGRA_REVISION_A02)) {
+                       tegra_ehci1_utmi_pdata \
+                       .unaligned_dma_buf_supported = true;
+                       tegra_udc_pdata \
+                       .unaligned_dma_buf_supported = true;
+               }
                tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
                platform_device_register(&tegra_otg_device);
                /* Setup the udc platform data */
@@ -514,6 +521,11 @@ static void macallan_modem_init(void)
        int usb_port_owner_info = tegra_get_usb_port_owner_info();
        switch (modem_id) {
        case TEGRA_BB_NEMO: /* on board i500 HSIC */
+               if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) &&
+                   (tegra_revision == TEGRA_REVISION_A02)) {
+                       tegra_ehci2_hsic_baseband_pdata \
+                       .unaligned_dma_buf_supported = true;
+               }
                if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB))
                        platform_device_register(&icera_nemo_device);
                break;
index 47d0897..1b87e00 100644 (file)
@@ -686,6 +686,7 @@ static struct tegra_usb_platform_data tegra_udc_pdata = {
        .port_otg = true,
        .has_hostpc = true,
        .id_det_type = TEGRA_USB_PMU_ID,
+       .unaligned_dma_buf_supported = false,
        .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
        .op_mode = TEGRA_USB_OPMODE_DEVICE,
        .u_data.dev = {
@@ -1032,6 +1033,13 @@ static void pluto_usb_init(void)
        int usb_port_owner_info = tegra_get_usb_port_owner_info();
 
        if (!(usb_port_owner_info & UTMI1_PORT_OWNER_XUSB)) {
+               if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) &&
+                       (tegra_revision == TEGRA_REVISION_A02)) {
+                       tegra_ehci1_utmi_pdata \
+                       .unaligned_dma_buf_supported = true;
+                       tegra_udc_pdata \
+                       .unaligned_dma_buf_supported = true;
+               }
                tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
                platform_device_register(&tegra_otg_device);
 
@@ -1051,12 +1059,22 @@ static void pluto_modem_init(void)
 
        switch (modem_id) {
        case TEGRA_BB_I500: /* on board i500 HSIC */
-               if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB))
+               if (!(usb_port_owner_info & HSIC1_PORT_OWNER_XUSB)) {
+                       if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) &&
+                               (tegra_revision == TEGRA_REVISION_A02))
+                               tegra_ehci2_hsic_baseband_pdata \
+                               .unaligned_dma_buf_supported = true;
                        platform_device_register(&icera_baseband_device);
+               }
                break;
        case TEGRA_BB_I500SWD: /* i500 SWD HSIC */
-               if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB))
+               if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) {
+                       if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) &&
+                               (tegra_revision == TEGRA_REVISION_A02))
+                               tegra_ehci3_hsic_baseband2_pdata \
+                               .unaligned_dma_buf_supported = true;
                        platform_device_register(&icera_baseband2_device);
+               }
                break;
        case TEGRA_BB_OEM1:     /* OEM1 HSIC */
                if ((board_info.board_id == BOARD_E1575) ||
@@ -1070,6 +1088,10 @@ static void pluto_modem_init(void)
                        tegra_hsic_pdata.ops = &oem1_hsic_pops;
                        tegra_ehci3_device.dev.platform_data
                                = &tegra_hsic_pdata;
+                       if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) &&
+                               (tegra_revision == TEGRA_REVISION_A02))
+                               tegra_hsic_pdata \
+                               .unaligned_dma_buf_supported = true;
                        platform_device_register(&tegra_bb_oem1);
                }
                break;
@@ -1124,6 +1146,10 @@ static void pluto_modem_init(void)
                break;
        case TEGRA_BB_HSIC_HUB: /* HSIC hub */
                if (!(usb_port_owner_info & HSIC2_PORT_OWNER_XUSB)) {
+                       if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11) &&
+                               (tegra_revision == TEGRA_REVISION_A02))
+                               tegra_ehci3_hsic_smsc_hub_pdata \
+                               .unaligned_dma_buf_supported = true;
                        tegra_ehci3_device.dev.platform_data =
                                &tegra_ehci3_hsic_smsc_hub_pdata;
                        platform_device_register(&tegra_ehci3_device);
index c2dafde..a5c36f2 100644 (file)
@@ -61,6 +61,7 @@
 #include <mach/gpio-tegra.h>
 #include <mach/tegra_fiq_debugger.h>
 #include <mach/edp.h>
+#include <mach/hardware.h>
 
 #include "board.h"
 #include "board-common.h"
@@ -537,6 +538,14 @@ static struct tegra_usb_otg_data tegra_otg_pdata = {
 
 static void roth_usb_init(void)
 {
+       if ((tegra_get_chipid() == TEGRA_CHIPID_TEGRA11)
+               && (tegra_revision == TEGRA_REVISION_A02)) {
+               tegra_ehci1_utmi_pdata \
+               .unaligned_dma_buf_supported = true;
+               tegra_udc_pdata.unaligned_dma_buf_supported = true;
+               tegra_ehci3_utmi_pdata \
+               .unaligned_dma_buf_supported = true;
+       }
        tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
        platform_device_register(&tegra_otg_device);