diff options
| author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2009-07-08 00:16:22 +0400 |
|---|---|---|
| committer | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2009-07-08 00:16:22 +0400 |
| commit | 1fc42f78167d44d0e26d09a431e26bb1313dde9a (patch) | |
| tree | 13c927e18d4c5134f81b104e04e43d776c90fdb2 /recipes | |
| parent | eaee46b83cf415bb60bbc59b71a4632478b5e48a (diff) | |
| parent | f3d6071476b37720b561fed60b540c4f3a10a865 (diff) | |
Merge branch 'org.openembedded.dev' of git://git.openembedded.org/openembedded into org.openembedded.dev
Diffstat (limited to 'recipes')
27 files changed, 7712 insertions, 15 deletions
diff --git a/recipes/antlr/antlr-native_2.7.7.bb b/recipes/antlr/antlr-native_2.7.7.bb index 871e620b93..3a2bd122eb 100644 --- a/recipes/antlr/antlr-native_2.7.7.bb +++ b/recipes/antlr/antlr-native_2.7.7.bb @@ -5,7 +5,7 @@ SRC_URI += "file://runantlr" inherit java-native do_configure() { - sed -i -e"s|@JAR_FILE@|${STAGING_DATADIR_NATIVE}/java/antlr.jar|" ${WORKDIR}/runantlr + sed -i -e"s|@JAR_FILE@|${STAGING_DATADIR_JAVA_NATIVE}/antlr.jar|" ${WORKDIR}/runantlr } do_stage() { diff --git a/recipes/classpath/classpath.inc b/recipes/classpath/classpath.inc index bf630bf569..06e236ca60 100644 --- a/recipes/classpath/classpath.inc +++ b/recipes/classpath/classpath.inc @@ -5,7 +5,7 @@ PRIORITY = "optional" LICENSE = "Classpath" PBN = "classpath" -DEPENDS = "virtual/javac-native fastjar-native zip-native gmp" +DEPENDS = "virtual/javac-native fastjar-native zip-native gmp antlr-native" RPROVIDES = "" RDEPENDS_${PN} = "${PBN}-common (>= ${PV})" @@ -30,6 +30,7 @@ EXTRA_OECONF = "\ --includedir=${includedir}/classpath \ --with-vm=java \ --disable-Werror \ + --with-antlr-jar=${STAGING_DATADIR_JAVA_NATIVE}/antlr.jar \ " inherit autotools diff --git a/recipes/classpath/classpath_0.95.bb b/recipes/classpath/classpath_0.95.bb index 6952cda72f..ccc1ecee7e 100644 --- a/recipes/classpath/classpath_0.95.bb +++ b/recipes/classpath/classpath_0.95.bb @@ -6,7 +6,7 @@ SRC_URI += "\ file://javanet-local.patch;patch=1;pnum=0 \ " -PR = "r6" +PR = "r7" DEPENDS += "gtk+ gconf libxtst" diff --git a/recipes/classpath/classpath_0.96.1.bb b/recipes/classpath/classpath_0.96.1.bb index cc3505a293..4e1288ff0b 100644 --- a/recipes/classpath/classpath_0.96.1.bb +++ b/recipes/classpath/classpath_0.96.1.bb @@ -6,7 +6,7 @@ SRC_URI += "\ file://javanet-local.patch;patch=1;pnum=0 \ " -PR = "r8" +PR = "r9" DEPENDS += "gtk+ gconf libxtst" diff --git a/recipes/classpath/classpath_0.97.2.bb b/recipes/classpath/classpath_0.97.2.bb index 1daaa1aa2c..e3b22fb6c5 100644 --- a/recipes/classpath/classpath_0.97.2.bb +++ b/recipes/classpath/classpath_0.97.2.bb @@ -12,7 +12,7 @@ SRC_URI += "\ file://gtk-fix.patch;patch=1;pnum=0 \ " -PR = "r8" +PR = "r9" DEPENDS += "gtk+ gconf libxtst" diff --git a/recipes/classpath/classpath_0.98.bb b/recipes/classpath/classpath_0.98.bb index 13f7a72b44..6dc1e9e28b 100644 --- a/recipes/classpath/classpath_0.98.bb +++ b/recipes/classpath/classpath_0.98.bb @@ -7,7 +7,7 @@ SRC_URI += "\ file://fix-gmp.patch;patch=1 \ " -PR = "r1" +PR = "r2" DEPENDS += "gtk+ gconf libxtst" diff --git a/recipes/gmp/files/use-includedir.patch b/recipes/gmp/files/use-includedir.patch new file mode 100644 index 0000000000..ee3891f807 --- /dev/null +++ b/recipes/gmp/files/use-includedir.patch @@ -0,0 +1,13 @@ +Index: gmp-4.2.4/Makefile.am +=================================================================== +--- gmp-4.2.4.orig/Makefile.am 2008-09-10 19:31:27.000000000 +0000 ++++ gmp-4.2.4/Makefile.am 2009-07-06 20:19:19.000000000 +0000 +@@ -106,7 +106,7 @@ + # but anyone knowledgable enough to be playing with exec_prefix will be able + # to address that. + # +-includeexecdir = $(exec_prefix)/include ++includeexecdir = $(includedir) + include_HEADERS = $(GMPXX_HEADERS_OPTION) + nodist_includeexec_HEADERS = gmp.h $(MPBSD_HEADERS_OPTION) + lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION) $(MPBSD_LTLIBRARIES_OPTION) diff --git a/recipes/gmp/gmp-canadian_4.2.4.bb b/recipes/gmp/gmp-canadian_4.2.4.bb index 27d179a569..63f62ace5e 100644 --- a/recipes/gmp/gmp-canadian_4.2.4.bb +++ b/recipes/gmp/gmp-canadian_4.2.4.bb @@ -1,5 +1,6 @@ PV = "4.2.4" require gmp_${PV}.bb +PR = "${INC_PR}.1" FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gmp-${PV}" S = "${WORKDIR}/gmp-${PV}" diff --git a/recipes/gmp/gmp-native_4.2.4.bb b/recipes/gmp/gmp-native_4.2.4.bb index 1e0ffb4bed..aa927b6854 100644 --- a/recipes/gmp/gmp-native_4.2.4.bb +++ b/recipes/gmp/gmp-native_4.2.4.bb @@ -1,2 +1,3 @@ PV = "4.2.4" require gmp-native.inc +PR = "${INC_PR}.1" diff --git a/recipes/gmp/gmp_4.2.4.bb b/recipes/gmp/gmp_4.2.4.bb index a7aa712ddc..a9c14e6a3f 100644 --- a/recipes/gmp/gmp_4.2.4.bb +++ b/recipes/gmp/gmp_4.2.4.bb @@ -1,6 +1,8 @@ -PR = "r0" +INC_PR = "r0" +PR = "${INC_PR}.1" SRC_URI_append += "file://sh4-asmfix.patch;patch=1 \ + file://use-includedir.patch;patch=1 \ " require gmp.inc LICENSE = "GPLv3 LGPLv3" diff --git a/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/tx25-can.patch b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/tx25-can.patch new file mode 100644 index 0000000000..dd857d5846 --- /dev/null +++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/tx25-can.patch @@ -0,0 +1,5914 @@ +diff -purN -X linux-2.6.30-rc4-karo/Documentation/dontdiff linux-2.6.30-rc4-karo/arch/arm/mach-mx2/Kconfig linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/Kconfig +--- linux-2.6.30-rc4-karo/arch/arm/mach-mx2/Kconfig 2009-06-08 11:15:16.000000000 +0200 ++++ linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/Kconfig 2009-07-01 11:09:09.000000000 +0200 +@@ -15,6 +15,9 @@ config MACH_MX27 + bool "i.MX27 support" + select ARCH_MXC_IOMUX_V2 + select ARCH_MXC_HAS_NFC_V1 ++ select USB_ARCH_HAS_EHCI ++ select ARCH_MXC_HAS_USBH2 ++ select ARCH_MXC_HAS_USBOTG + help + This enables support for Freescale's MX2 based i.MX27 processor. + +@@ -22,6 +25,9 @@ config MACH_MX25 + bool "i.MX25 support" + select ARCH_MXC_IOMUX_V3 + select ARCH_MXC_HAS_NFC_V1_1 ++ select USB_ARCH_HAS_EHCI ++ select ARCH_MXC_HAS_USBH2 ++ select ARCH_MXC_HAS_USBOTG + select PHYLIB if FEC + help + This enables support for Freescale's MX2 based i.MX25 processor. +diff -purN -X linux-2.6.30-rc4-karo/Documentation/dontdiff linux-2.6.30-rc4-karo/arch/arm/mach-mx2/clock_imx25.c linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/clock_imx25.c +--- linux-2.6.30-rc4-karo/arch/arm/mach-mx2/clock_imx25.c 2009-07-06 17:32:59.000000000 +0200 ++++ linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/clock_imx25.c 2009-07-06 15:40:57.000000000 +0200 +@@ -274,37 +274,42 @@ static void _perclk_disable(struct clk * + static int _clk_pll_set_rate(struct clk *clk, unsigned long rate) + { + unsigned long reg; +- signed long pd = 1; /* Pre-divider */ +- signed long mfi; /* Multiplication Factor (Integer part) */ ++ unsigned int pd = 1; /* Pre-divider */ ++ unsigned long mfi; /* Multiplication Factor (Integer part) */ + signed long mfn; /* Multiplication Factor (Integer part) */ +- signed long mfd; /* Multiplication Factor (Denominator Part) */ ++ unsigned long mfd; /* Multiplication Factor (Denominator Part) */ + signed long tmp; + unsigned long ref_freq = clk_get_rate(clk->parent); ++ unsigned long err = ~0; ++ int best_mfn = -1; ++ int best_mfd = -1; + + while (((ref_freq / pd) * 10) > rate) + pd++; + +- /* the ref_freq/2 in the following is to round up */ +- mfi = (((rate / 2) * pd) + (ref_freq / 2)) / ref_freq; ++ mfi = ((rate / 2) * pd) / ref_freq; + if (mfi < 5 || mfi > 15) + return -EINVAL; + +- /* pick a mfd value that will work +- * then solve for mfn */ +- mfd = ref_freq / 50000; +- +- /* +- * pll_freq * pd * mfd +- * mfn = -------------------- - (mfi * mfd) +- * 2 * ref_freq +- */ +- /* the tmp/2 is for rounding */ + tmp = ref_freq / 10000; +- mfn = ((((((rate / 2) + (tmp / 2)) / tmp) * pd) * mfd) / 10000) - +- (mfi * mfd); ++ for (mfd = 1; mfd <= 1024; mfd++) { ++ unsigned long act_freq; + +- printk(KERN_DEBUG "pll freq: %lu PD=%ld MFI=%ld MFD=%ld MFN=%ld (0x%03lx)\n", +- rate, pd, mfi, mfd, mfn, (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff); ++ mfn = ((((((rate / 2) + (tmp - 1)) / tmp) * pd) * mfd) / 10000) - ++ (mfi * mfd); ++ ++ act_freq = (2 * ref_freq * mfi + (2 * ref_freq * mfn / mfd)) / pd; ++ act_freq -= rate; ++ if (abs(act_freq) < err) { ++ best_mfn = mfn; ++ best_mfd = mfd; ++ err = abs(act_freq); ++ if (err == 0) ++ break; ++ } ++ } ++ mfn = best_mfn; ++ mfd = best_mfd; + + mfn = (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff; + pd--; +@@ -333,7 +338,8 @@ static int _clk_pll_set_rate(struct clk + static unsigned long _clk_pll_getrate(struct clk *clk) + { + unsigned long rate; +- signed long mfi, mfn, mfd, pdf; ++ unsigned int mfi, mfd, pdf; ++ int mfn; + unsigned long ref_clk; + unsigned long reg; + +@@ -355,6 +361,9 @@ static unsigned long _clk_pll_getrate(st + BUG(); /* oops */ + } + ++ if (mfn >= 512) ++ mfn = 1024 - mfn; ++ + mfi = (mfi < 5) ? 5 : mfi; + rate = 2LL * ref_clk * mfn; + do_div(rate, mfd + 1); +@@ -436,8 +445,8 @@ static unsigned long _clk_perclkx_getrat + + pcdr = __raw_readl(pcdr_a[clk->id >> 2]); + +- perclk_pdf = +- (pcdr >> ((clk->id & 3) << 3)) & MXC_CCM_PCDR1_PERDIV1_MASK; ++ perclk_pdf = (pcdr >> ((clk->id & 3) << 3)) & ++ MXC_CCM_PCDR1_PERDIV1_MASK; + + return clk_get_rate(clk->parent) / (perclk_pdf + 1); + } +@@ -466,8 +475,6 @@ static int _clk_perclkx_set_rate(struct + return -EINVAL; + + div = clk_get_rate(clk->parent) / rate; +- printk(KERN_DEBUG "%s: perclk[%d] parent_rate=%lu rate=%lu div=%lu\n", +- __FUNCTION__, clk->id, clk_get_rate(clk->parent), rate, div); + if (div > 64 || div < 1 || ((clk_get_rate(clk->parent) / div) != rate)) + return -EINVAL; + div--; +@@ -542,7 +549,8 @@ static int _clk_perclkx_set_parent3(stru + + static unsigned long _clk_ipg_getrate(struct clk *clk) + { +- return clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */ ++ unsigned long rate = clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */ ++ return rate; + } + + /* Top-level clocks */ +@@ -714,7 +722,7 @@ static struct clk per_clk[] = { + }, + { + .id = 5, +- .parent = &upll_clk, /* can be AHB or UPLL */ ++ .parent = &ahb_clk, /* can be AHB or UPLL */ + .round_rate = _clk_perclkx_round_rate, + .set_rate = _clk_perclkx_set_rate, + .set_parent = _clk_perclkx_set_parent, +@@ -1121,7 +1129,7 @@ static struct clk gpt2_clk[] = { + { + .id = 1, + .parent = &per_clk[5], +- .secondary = &gpt1_clk[1], ++ .secondary = &gpt2_clk[1], + }, + { + .id = 1, +@@ -1137,7 +1145,7 @@ static struct clk gpt3_clk[] = { + { + .id = 2, + .parent = &per_clk[5], +- .secondary = &gpt1_clk[1], ++ .secondary = &gpt3_clk[1], + }, + { + .id = 2, +@@ -1153,7 +1161,7 @@ static struct clk gpt4_clk[] = { + { + .id = 3, + .parent = &per_clk[5], +- .secondary = &gpt1_clk[1], ++ .secondary = &gpt4_clk[1], + }, + { + .id = 3, +@@ -1576,9 +1584,9 @@ static int _clk_usb_set_rate(struct clk + + static unsigned long _clk_usb_getrate(struct clk *clk) + { +- unsigned long div = +- __raw_readl(MXC_CCM_MCR) & MXC_CCM_CCTL_USB_DIV_MASK; ++ unsigned long div; + ++ div = __raw_readl(MXC_CCM_MCR) & MXC_CCM_CCTL_USB_DIV_MASK; + div >>= MXC_CCM_CCTL_USB_DIV_OFFSET; + + return clk_get_rate(clk->parent) / (div + 1); +@@ -1726,8 +1734,8 @@ static struct clk_lookup lookups[] = { + _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) + _REGISTER_CLOCK(NULL, "audmux", audmux_clk) + _REGISTER_CLOCK(NULL, "ata", ata_clk[0]) +- _REGISTER_CLOCK("mxc-can.0", NULL, can_clk[0]) +- _REGISTER_CLOCK("mxc-can.1", NULL, can_clk[1]) ++ _REGISTER_CLOCK("mxc-flexcan.0", NULL, can_clk[0]) ++ _REGISTER_CLOCK("mxc-flexcan.1", NULL, can_clk[1]) + _REGISTER_CLOCK(NULL, "csi", csi_clk[0]) + _REGISTER_CLOCK(NULL, "cspi.0", cspi_clk[0]) + _REGISTER_CLOCK(NULL, "cspi.1", cspi_clk[1]) +@@ -1784,12 +1792,8 @@ int __init mx25_clocks_init(unsigned lon + { + int i; + +- for (i = 0; i < ARRAY_SIZE(lookups); i++) { +- printk(KERN_DEBUG "Registering clock '%s' '%s'\n", +- lookups[i].dev_id ? lookups[i].dev_id : "", +- lookups[i].con_id ? lookups[i].con_id : ""); ++ for (i = 0; i < ARRAY_SIZE(lookups); i++) + clkdev_add(&lookups[i]); +- } + + ckih_rate = fref; + #ifndef CONFIG_DEBUG_LL +@@ -1825,23 +1829,19 @@ int __init mx25_clocks_init(unsigned lon + } + } + } +-#endif ++ + /* the NFC clock must be derived from AHB clock */ + clk_set_parent(&per_clk[8], &ahb_clk); ++#endif + clk_set_rate(&per_clk[8], clk_get_rate(&ahb_clk) / 6); ++ clk_set_rate(&per_clk[7], clk_get_rate(per_clk[7].parent)); + + /* This will propagate to all children and init all the clock rates */ + #ifdef CONFIG_DEBUG_LL + clk_enable(&uart1_clk[0]); + #endif + clk_enable(&emi_clk); +- clk_enable(&gpio_clk[0]); +- clk_enable(&gpio_clk[1]); +- clk_enable(&gpio_clk[2]); + clk_enable(&iim_clk); +- clk_enable(&gpt1_clk[0]); +- clk_enable(&iomuxc_clk); +- clk_enable(&scc_clk); + + pr_info("Clock input source is %ld\n", clk_get_rate(&osc24m_clk)); + +@@ -1856,6 +1856,6 @@ int __init mx25_clocks_init(unsigned lon + clk_set_rate(&mpll_clk, clk_get_rate(&mpll_clk)); + clk_set_rate(&upll_clk, clk_get_rate(&upll_clk)); + +- mxc_timer_init(&gpt1_clk[0]); ++ mxc_timer_init(&gpt1_clk[1]); + return 0; + } +diff -purN -X linux-2.6.30-rc4-karo/Documentation/dontdiff linux-2.6.30-rc4-karo/arch/arm/mach-mx2/devices.h linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/devices.h +--- linux-2.6.30-rc4-karo/arch/arm/mach-mx2/devices.h 2009-06-02 17:59:16.000000000 +0200 ++++ linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/devices.h 2009-07-01 11:10:15.000000000 +0200 +@@ -20,6 +20,9 @@ extern struct platform_device mxc_i2c_de + extern struct platform_device mxc_i2c_device1; + extern struct platform_device mxc_sdhc_device0; + extern struct platform_device mxc_sdhc_device1; ++extern struct platform_device mxc_usbh1_device; ++extern struct platform_device mxc_usbh2_device; ++extern struct platform_device mxc_usbotg_device; + #ifdef CONFIG_MACH_MX25 + extern struct platform_device mx25_i2c_device0; + extern struct platform_device mx25_i2c_device1; +diff -purN -X linux-2.6.30-rc4-karo/Documentation/dontdiff linux-2.6.30-rc4-karo/arch/arm/mach-mx2/devices_mx25.c linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/devices_mx25.c +--- linux-2.6.30-rc4-karo/arch/arm/mach-mx2/devices_mx25.c 2009-06-02 17:59:17.000000000 +0200 ++++ linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/devices_mx25.c 2009-06-29 10:48:40.000000000 +0200 +@@ -142,12 +142,12 @@ struct platform_device mxc_fb_device = { + * Resource definition for the CSPI1 + */ + static struct resource mx25_spi1_resources[] = { +- [0] = { ++ { + .start = CSPI1_BASE_ADDR, + .end = CSPI1_BASE_ADDR + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +- [1] = { ++ { + .start = MXC_INT_CSPI1, + .end = MXC_INT_CSPI1, + .flags = IORESOURCE_IRQ, +@@ -178,12 +178,12 @@ static struct platform_device mx25_spi1_ + * Resource definition for the CSPI2 + */ + static struct resource mx25_spi2_resources[] = { +- [0] = { ++ { + .start = CSPI2_BASE_ADDR, + .end = CSPI2_BASE_ADDR + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +- [1] = { ++ { + .start = MXC_INT_CSPI2, + .end = MXC_INT_CSPI2, + .flags = IORESOURCE_IRQ, +@@ -213,12 +213,12 @@ static struct platform_device mx25_spi2_ + * Resource definition for the CSPI3 + */ + static struct resource mx25_spi3_resources[] = { +- [0] = { ++ { + .start = CSPI3_BASE_ADDR, + .end = CSPI3_BASE_ADDR + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +- [1] = { ++ { + .start = MXC_INT_CSPI3, + .end = MXC_INT_CSPI3, + .flags = IORESOURCE_IRQ, +@@ -267,6 +267,56 @@ static inline void mx25_init_spi(void) + } + #endif + ++#if defined(CONFIG_USB_EHCI_MXC) || defined(CONFIG_USB_EHCI_MXC_MODULE) ++static struct resource mxc_usbotg_resources[] = { ++ { ++ .start = OTG_BASE_ADDR, ++ .end = OTG_BASE_ADDR + 0x1ff, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_USB_OTG, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static u64 usbotg_dmamask = (u32)~0; ++ ++struct platform_device mxc_usbotg_device = { ++ .name = "mxc-ehci", ++ .id = 0, ++ .dev = { ++ .coherent_dma_mask = 0xffffffff, ++ .dma_mask = &usbotg_dmamask, ++ }, ++ .num_resources = ARRAY_SIZE(mxc_usbotg_resources), ++ .resource = mxc_usbotg_resources, ++}; ++ ++static struct resource mxc_usbh2_resources[] = { ++ { ++ .start = USBH2_BASE_ADDR, ++ .end = USBH2_BASE_ADDR + 0x1ff, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_USB_H2, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static u64 usbh2_dmamask = (u32)~0; ++ ++struct platform_device mxc_usbh2_device = { ++ .name = "mxc-ehci", ++ .id = 1, ++ .dev = { ++ .coherent_dma_mask = 0xffffffff, ++ .dma_mask = &usbh2_dmamask, ++ }, ++ .num_resources = ARRAY_SIZE(mxc_usbh2_resources), ++ .resource = mxc_usbh2_resources, ++}; ++#endif ++ + /* I2C controller and device data */ + #if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) + +@@ -274,12 +324,12 @@ static inline void mx25_init_spi(void) + * Resource definition for the I2C1 + */ + static struct resource mx25_i2c1_resources[] = { +- [0] = { ++ { + .start = I2C_BASE_ADDR, + .end = I2C_BASE_ADDR + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +- [1] = { ++ { + .start = MXC_INT_I2C, + .end = MXC_INT_I2C, + .flags = IORESOURCE_IRQ, +@@ -290,12 +340,12 @@ static struct resource mx25_i2c1_resourc + * Resource definition for the I2C2 + */ + static struct resource mx25_i2c2_resources[] = { +- [0] = { ++ { + .start = I2C2_BASE_ADDR, + .end = I2C2_BASE_ADDR + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +- [1] = { ++ { + .start = MXC_INT_I2C2, + .end = MXC_INT_I2C2, + .flags = IORESOURCE_IRQ, +@@ -306,12 +356,12 @@ static struct resource mx25_i2c2_resourc + * Resource definition for the I2C3 + */ + static struct resource mx25_i2c3_resources[] = { +- [0] = { ++ { + .start = I2C3_BASE_ADDR, + .end = I2C3_BASE_ADDR + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +- [1] = { ++ { + .start = MXC_INT_I2C3, + .end = MXC_INT_I2C3, + .flags = IORESOURCE_IRQ, +diff -purN -X linux-2.6.30-rc4-karo/Documentation/dontdiff linux-2.6.30-rc4-karo/arch/arm/mach-mx2/karo-tx25.c linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/karo-tx25.c +--- linux-2.6.30-rc4-karo/arch/arm/mach-mx2/karo-tx25.c 2009-07-06 17:32:59.000000000 +0200 ++++ linux-2.6.30-rc4-karo2/arch/arm/mach-mx2/karo-tx25.c 2009-07-06 16:02:49.000000000 +0200 +@@ -31,8 +31,6 @@ + #include <linux/clk.h> + #include <linux/delay.h> + #include <linux/fb.h> +-//#include <linux/i2c.h> +-//#include <linux/i2c/at24.h> + #include <linux/spi/spi.h> + #include <linux/serial_8250.h> + #include <linux/fec_enet.h> +@@ -61,15 +59,12 @@ + #include <mach/irqs.h> + #include <mach/clock.h> + #include <mach/imxfb.h> +-//#include <mach/imx_spi.h> +-//#include <mach/i2c.h> + #include <mach/mmc.h> + #include <mach/imx-uart.h> + #include <mach/mxc_nand.h> +-//#include <mach/ulpi.h> +-//#include <mach/mxc_ehci.h> +-//#include <mach/board-tx25.h> ++#include <mach/mxc_ehci.h> + #include <mach/mxc_tsadcc.h> ++#include <mach/mxc_can.h> + + #include "crm_regs.h" + #include "devices.h" +@@ -83,161 +78,172 @@ static int tx25_debug; + module_param(tx25_debug, int, 0); + #endif + +-//#include "karo.h" +- + int karo_board_type = 0; + int karo_mod_type = -1; + + +-#ifdef CONFIG_USB_EHCI_MXC +- +-#define SMSC_VENDOR_ID 0x0424 +-#define USB3317_PROD_ID 0x0006 +-#define ULPI_FCTL 7 +- +-static inline const char *ulpi_name(void __iomem *view) +-{ +- if ((unsigned long)view & 0x400) { +- return "USBH2"; +- } else { +- return "USBOTG"; +- } +-} +- +-static int usb3317_init(void __iomem *view) ++static int karo_tx25_gpio_config(struct pad_desc *pd, int num) + { +- int vid, pid, ret; +-#if 1 +- /* This is a kludge until we know why we sometimes read a wrong +- * vendor or product ID! +- */ +- int retries = 3; +- +- retry: +-#endif +- ret = ulpi_read(ISP1504_VID_HIGH, view); +- if (ret < 0) { +- goto err; +- } +- vid = ret << 8; ++ int ret; ++ int i; ++ int count = 0; + +- ret = ulpi_read(ISP1504_VID_LOW, view); +- if (ret < 0) { +- goto err; ++ for (i = 0; i < num; i++) { ++ ret = mxc_iomux_v3_setup_pad(&pd[i]); ++ if (ret == 0) { ++ DBG(0, "%s: PAD[%d] %s set up as GPIO\n", __FUNCTION__, i, ++ MXC_PAD_NAME(&pd[i])); ++ count++; ++ mxc_iomux_v3_release_pad(&pd[i]); ++ } else { ++ DBG(0, "%s: PAD[%d] %s skipped\n", __FUNCTION__, i, ++ MXC_PAD_NAME(&pd[i])); ++ } + } +- vid |= ret; ++ return count; ++} + +- ret = ulpi_read(ISP1504_PID_HIGH, view); +- if (ret < 0) { +- goto err; +- } +- pid = ret << 8; ++#ifdef CONFIG_USB_EHCI_MXC + +- ret = ulpi_read(ISP1504_PID_LOW, view); +- if (ret < 0) { +- goto err; +- } +- pid |= ret; ++/* USB register offsets */ ++#define REG_USBCTRL 0x600 ++#define REG_PHY_CTRL 0x608 ++ ++#define PHY_CTRL_USBEN (1 << 24) ++ ++/* USB Host/OTG register offsets referenced to ULPI view port */ ++#define REG_USBCMD 0x140 ++#define REG_USBSTS 0x144 ++#define REG_PORTSC1 0x184 ++#define REG_USBMODE 0x1a8 ++ ++#define USBCMD_RST (1 << 1) ++#define USBCMD_RUN (1 << 0) ++ ++#define USBSTS_HCH (1 << 12) ++ ++/* USB_CTRL register bits */ ++#define USBCTRL_OCPOL_HST (1 << 2) ++#define USBCTRL_OCPOL_OTG (1 << 3) ++#define USBCTRL_USBTE (1 << 4) ++#define USBCTRL_HSDT (1 << 5) ++#define USBCTRL_XCSH (1 << 9) ++#define USBCTRL_XCSO (1 << 10) ++#define USBCTRL_PP_OTG (1 << 11) ++#define USBCTRL_HLKEN (1 << 12) ++#define USBCTRL_OLKEN (1 << 13) ++#define USBCTRL_HPM (1 << 16) ++#define USBCTRL_PP_HST (1 << 18) ++#define USBCTRL_HWIE (1 << 19) ++#define USBCTRL_HUIE (1 << 20) ++#define USBCTRL_OPM (1 << 24) ++#define USBCTRL_OEXTEN (1 << 25) ++#define USBCTRL_HEXTEN (1 << 26) ++#define USBCTRL_OWIE (1 << 27) ++#define USBCTRL_OUIE (1 << 28) + +- pr_info("ULPI on %s port Vendor ID 0x%x Product ID 0x%x\n", +- ulpi_name(view), vid, pid); +- if (vid != SMSC_VENDOR_ID || pid != USB3317_PROD_ID) { +- if (retries-- < 0) { +- pr_err("No USB3317 found\n"); +- return -ENODEV; ++static int tx25_usb_init(struct platform_device *pdev, void __iomem *base, int host_mode) ++{ ++ u32 val; ++ unsigned long flags; ++ const char __maybe_unused *name = pdev->id ? "USBH2" : "USBOTG"; ++ unsigned int loops = 0; ++ void __iomem *otg_base = IO_ADDRESS(OTG_BASE_ADDR); ++ ++ if (!(__raw_readl(base + REG_USBSTS) & USBSTS_HCH)) { ++ DBG(0, "%s: %s[%p] is busy: %08x\n", __FUNCTION__, name, ++ base + REG_USBSTS, __raw_readl(base + REG_USBSTS)); ++ __raw_writel(__raw_readl(base + REG_USBCTRL) & ~USBCMD_RUN, ++ base + REG_USBCTRL); ++ while (__raw_readl(base + REG_USBCTRL) & USBCMD_RUN) { ++ cpu_relax(); + } +- goto retry; + } +- err: +- if (ret < 0) { +- printk(KERN_ERR "ULPI read on %s port failed with error %d\n", +- ulpi_name(view), ret); +- return ret; ++ DBG(0, "%s: PHY_CTRL[%p]=%08x\n", __FUNCTION__, otg_base + REG_PHY_CTRL, ++ __raw_readl(otg_base + REG_PHY_CTRL)); ++ DBG(0, "%s: USBCMD[%p]=%08x\n", __FUNCTION__, base + REG_USBCMD, ++ __raw_readl(base + REG_USBCMD)); ++ DBG(0, "%s: USBSTS[%p]=%08x\n", __FUNCTION__, base + REG_USBSTS, ++ __raw_readl(base + REG_USBSTS)); ++ ++ /* reset USB Host controller */ ++ __raw_writel(USBCMD_RST, base + REG_USBCMD); ++ while (__raw_readl(base + REG_USBCMD) & USBCMD_RST) { ++ cpu_relax(); ++ loops++; + } +- return 0; +-} +- +-static int usb3317_set_vbus_power(void __iomem *view, int on) +-{ +- int ret; +- +- DBG(0, "%s: Switching %s port VBUS power %s\n", __FUNCTION__, +- ulpi_name(view), on ? "on" : "off"); ++ DBG(0, "USB controller reset finished after %u loops\n", loops); ++ local_irq_save(flags); ++ val = __raw_readl(otg_base + REG_USBCTRL); ++ if (pdev->id == 1) { ++ val &= ~(USBCTRL_OCPOL_HST | USBCTRL_HPM | ++ USBCTRL_HEXTEN | USBCTRL_HWIE); ++ val |= USBCTRL_PP_HST | USBCTRL_HSDT | USBCTRL_USBTE | ++ USBCTRL_XCSH; ++ } else { ++ val &= ~(USBCTRL_OCPOL_OTG | USBCTRL_OPM | ++ USBCTRL_OEXTEN | USBCTRL_OWIE); ++ val |= USBCTRL_PP_OTG | USBCTRL_XCSO; ++ } ++ DBG(0, "%s: Changing %s_USBCTRL from %08x to %08x\n", __FUNCTION__, name, ++ __raw_readl(otg_base + REG_USBCTRL), val); ++ __raw_writel(val, otg_base + REG_USBCTRL); ++ local_irq_restore(flags); + +- if (on) { +- ret = ulpi_set(DRV_VBUS_EXT | /* enable external Vbus */ +- DRV_VBUS | /* enable internal Vbus */ +- CHRG_VBUS, /* charge Vbus */ +- ISP1504_OTGCTL, view); ++ val = __raw_readl(base + REG_PORTSC1); ++ if (pdev->id == 1) { ++ /* select serial transceiver */ ++ val = (val & ~(3 << 30)) | (3 << 30) | (1 << 28); + } else { +- ret = ulpi_clear(DRV_VBUS_EXT | /* disable external Vbus */ +- DRV_VBUS, /* disable internal Vbus */ +- ISP1504_OTGCTL, view); +- if (ret == 0) { +- ret = ulpi_set(DISCHRG_VBUS, /* discharge Vbus */ +- ISP1504_OTGCTL, view); +- } +- } +- if (ret < 0) { +- printk(KERN_ERR "ULPI read on %s port failed with error %d\n", +- ulpi_name(view), ret); +- return ret; ++ /* select UTMI transceiver */ ++ val = (val & ~(3 << 30)) | (0 << 30) | (1 << 28); + } ++ DBG(0, "%s: Changing %s_PORTSC1 from %08x to %08x\n", __FUNCTION__, name, ++ __raw_readl(base + REG_PORTSC1), val); ++ __raw_writel(val, base + REG_PORTSC1); ++ ++ val = __raw_readl(otg_base + REG_PHY_CTRL); ++ __raw_writel(val & ~PHY_CTRL_USBEN, otg_base + REG_PHY_CTRL); ++ //__raw_writel(val | PHY_CTRL_USBEN, otg_base + REG_PHY_CTRL); ++ DBG(0, "%s: PHY_CTRL[%p]=%08x\n", __FUNCTION__, otg_base + REG_PHY_CTRL, ++ __raw_readl(otg_base + REG_PHY_CTRL)); ++ ++ /* Switch to Host mode */ ++ val = __raw_readl(base + REG_USBMODE); ++ DBG(0, "%s: Changing %s_USBMODE from %08x to %08x\n", __FUNCTION__, name, ++ val, val | (host_mode ? 0x3 : 0x02)); ++ __raw_writel(val | (host_mode ? 0x3 : 0x02), base + REG_USBMODE); ++ + return 0; + } + ++#ifdef CONFIG_ARCH_MXC_EHCI_USBH2 ++static struct pad_desc karo_tx25_usbh2_pads[] = { ++ MX25_PAD_D9__USBH2_PWR, ++ MX25_PAD_D8__USBH2_OC, ++}; ++ + static int tx25_usbh2_init(struct platform_device *pdev) + { |
