diff options
Diffstat (limited to 'recipes/linux/linux-2.6.31/pcm043/Update-PCM043-board-support.patch')
-rw-r--r-- | recipes/linux/linux-2.6.31/pcm043/Update-PCM043-board-support.patch | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.31/pcm043/Update-PCM043-board-support.patch b/recipes/linux/linux-2.6.31/pcm043/Update-PCM043-board-support.patch new file mode 100644 index 0000000000..117611e920 --- /dev/null +++ b/recipes/linux/linux-2.6.31/pcm043/Update-PCM043-board-support.patch @@ -0,0 +1,134 @@ +Based on +From 0d4941a59648e16d99624cf16812d5ae83986187 Mon Sep 17 00:00:00 2001 +From: Sascha Hauer <s.hauer@pengutronix.de> +Date: Fri, 6 Feb 2009 15:42:26 +0100 +Subject: [PATCH 026/101] [ARM] MX35: Add PCM043 board support + +add USB support + +Signed-off-by: Jan Weitzel <J.Weitzel@phytec.de> +--- +Index: linux-2.6.31.6/arch/arm/mach-mx3/pcm043.c +=================================================================== +--- linux-2.6.31.6.orig/arch/arm/mach-mx3/pcm043.c 2009-12-10 11:59:35.364772725 +0100 ++++ linux-2.6.31.6/arch/arm/mach-mx3/pcm043.c 2009-12-10 13:45:21.484650731 +0100 +@@ -28,6 +28,7 @@ + #include <linux/interrupt.h> + #include <linux/i2c.h> + #include <linux/i2c/at24.h> ++#include <linux/fsl_devices.h> + #include <linux/delay.h> + + #include <asm/mach-types.h> +@@ -44,6 +45,7 @@ + #include <mach/iomux-mx35.h> + #include <mach/ipu.h> + #include <mach/mx3fb.h> ++#include <mach/mxc_ehci.h> + #include <mach/audmux.h> + #include <mach/ssi.h> + +@@ -207,6 +209,9 @@ + MX35_PAD_D3_REV__IPU_DISPB_D3_REV, + MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS, + MX35_PAD_D3_SPL__IPU_DISPB_D3_SPL, ++ /* USB host */ ++ MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR, ++ MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC, + /* SSI */ + MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS, + MX35_PAD_STXD4__AUDMUX_AUD4_TXD, +@@ -214,6 +219,66 @@ + MX35_PAD_SCK4__AUDMUX_AUD4_TXC, + }; + ++static int pcm043_usbh1_init(struct platform_device *pdev) ++{ ++ unsigned int tmp; ++ ++ tmp = readl(IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x600); ++ tmp &= ~((3 << 21) | (1 << 2) | (1 << 16)); ++ tmp |= (1 << 4) | (2 << 21) | (1 << 19) | (1 << 12) | (1 << 6) | (1 << 5); ++ writel(tmp, IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x600); ++ ++ tmp = readl(IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x584); ++ tmp |= (3 << 30); ++ writel(tmp, IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x584); ++ ++ return 0; ++} ++ ++static struct mxc_usbh_platform_data usbh1_pdata = { ++ .init = pcm043_usbh1_init, ++}; ++ ++static int pcm043_otg_init(struct platform_device *pdev) ++{ ++ unsigned int tmp; ++ ++ tmp = readl(IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x600); ++ tmp &= ~(3 << 29); ++ tmp |= (2 << 29); ++ writel(tmp, IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x600); ++ ++ tmp = readl(IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x184); ++ tmp &= ~(3 << 30); ++ writel(tmp, IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x184); ++ ++ return 0; ++} ++ ++static struct mxc_usbh_platform_data otg_pdata = { ++ .init = pcm043_otg_init, ++}; ++ ++static struct fsl_usb2_platform_data usb_data = { ++ .operating_mode = FSL_USB2_DR_DEVICE, ++ .phy_mode = FSL_USB2_PHY_UTMI, ++}; ++ ++static int otg_mode_host; ++ ++static int __init pcm043_otg_mode(char *options) ++{ ++ if (!strcmp(options, "host")) ++ otg_mode_host = 1; ++ else if (!strcmp(options, "device")) ++ otg_mode_host = 0; ++ else ++ pr_info("pcm043_otg_mode neither \"host\" nor \"device\". " ++ "Defaulting to device\n"); ++ return 0; ++} ++__setup("pcm043_otg_mode=", pcm043_otg_mode); ++ + #define AC97_GPIO_TXFS (1 * 32 + 31) + #define AC97_GPIO_TXD (1 * 32 + 28) + #define AC97_GPIO_RESET (1 * 32 + 0) +@@ -299,6 +364,8 @@ + */ + static void __init mxc_board_init(void) + { ++ unsigned int tmp; ++ + mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads)); + + mxc_audmux_v2_configure_port(3, +@@ -329,6 +396,17 @@ + + mxc_register_device(&mx3_ipu, &mx3_ipu_data); + mxc_register_device(&mx3_fb, &mx3fb_pdata); ++ ++ tmp = readl(IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x600); ++ tmp &= ~(3 << 29); ++ tmp |= (2 << 29); ++ writel(tmp, IO_ADDRESS(MX35_OTG_BASE_ADDR) + 0x600); ++ ++ mxc_register_device(&mxc_usbh1, &usbh1_pdata); ++ if (otg_mode_host) ++ mxc_register_device(&mxc_otg, &otg_pdata); ++ else ++ mxc_register_device(&mxc_otg_udc_device, &usb_data); + } + + static void __init pcm043_timer_init(void) |