]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/commitdiff
linux-ti335x 3.1: enable i2c2 for beaglebone
authorKoen Kooi <koen@dominion.thruhere.net>
Thu, 17 Nov 2011 09:25:40 +0000 (10:25 +0100)
committerKoen Kooi <koen@dominion.thruhere.net>
Thu, 17 Nov 2011 09:25:40 +0000 (10:25 +0100)
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0001-arm-omap-mux33xx-Add-i2c2-pin-muix.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0002-omap-hwmod-33xx-Add-support-for-third-i2c-bus.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0003-arm-omap-board-Add-quick-hack-to-get-i2c2-bus-suppor.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp_3.1.bb

diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0001-arm-omap-mux33xx-Add-i2c2-pin-muix.patch b/recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0001-arm-omap-mux33xx-Add-i2c2-pin-muix.patch
new file mode 100644 (file)
index 0000000..0930774
--- /dev/null
@@ -0,0 +1,31 @@
+From cad762e20178949527118629d7cf1298e38658f2 Mon Sep 17 00:00:00 2001
+From: Steve Kipisz <s-kipisz2@ti.com>
+Date: Tue, 15 Nov 2011 10:47:40 -0600
+Subject: [PATCH 1/3] arm:omap:mux33xx: Add i2c2 pin muix
+
+Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/mux33xx.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/mux33xx.c b/arch/arm/mach-omap2/mux33xx.c
+index 4399003..06719df 100644
+--- a/arch/arm/mach-omap2/mux33xx.c
++++ b/arch/arm/mach-omap2/mux33xx.c
+@@ -315,10 +315,10 @@ static struct omap_mux __initdata am33xx_muxmodes[] = {
+               "uart0_txd", "spi1_cs1", NULL, NULL,
+               NULL, NULL, NULL, NULL),
+       _AM33XX_MUXENTRY(UART1_CTSN, 0,
+-              "uart1_ctsn", NULL, "d_can0_tx", NULL,
++              "uart1_ctsn", NULL, "d_can0_tx", "i2c2_sda",
+               "spi1_cs0", NULL, NULL, NULL),
+       _AM33XX_MUXENTRY(UART1_RTSN, 0,
+-              "uart1_rtsn", NULL, "d_can0_rx", NULL,
++              "uart1_rtsn", NULL, "d_can0_rx", "i2c2_scl",
+               "spi1_cs1", NULL, NULL, NULL),
+       _AM33XX_MUXENTRY(UART1_RXD, 0,
+               "uart1_rxd", "mmc1_sdwp", "d_can1_tx", NULL,
+-- 
+1.7.2.5
+
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0002-omap-hwmod-33xx-Add-support-for-third-i2c-bus.patch b/recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0002-omap-hwmod-33xx-Add-support-for-third-i2c-bus.patch
new file mode 100644 (file)
index 0000000..88a9bb1
--- /dev/null
@@ -0,0 +1,89 @@
+From 9d84b7ca76f00fc71a2fb4e32f4a172b0dd95b0d Mon Sep 17 00:00:00 2001
+From: Steve Kipisz <s-kipisz2@ti.com>
+Date: Wed, 16 Nov 2011 07:23:37 -0600
+Subject: [PATCH 2/3] omap:hwmod:33xx: Add support for third i2c bus
+
+Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/omap_hwmod_33xx_data.c |   50 ++++++++++++++++++++++++++++
+ 1 files changed, 50 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+index cad59f0e..663bd26 100644
+--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
++++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+@@ -59,6 +59,7 @@ static struct omap_hwmod am33xx_gpio2_hwmod;
+ static struct omap_hwmod am33xx_gpio3_hwmod;
+ static struct omap_hwmod am33xx_i2c1_hwmod;
+ static struct omap_hwmod am33xx_i2c2_hwmod;
++static struct omap_hwmod am33xx_i2c3_hwmod;
+ static struct omap_hwmod am33xx_usbss_hwmod;
+ static struct omap_hwmod am33xx_mmc0_hwmod;
+ static struct omap_hwmod am33xx_mmc1_hwmod;
+@@ -800,6 +801,54 @@ static struct omap_hwmod am33xx_i2c2_hwmod = {
+       .class          = &i2c_class,
+ };
++/* i2c3 */
++/* l4 per -> i2c3 */
++static struct omap_hwmod_addr_space am33xx_i2c3_addr_space[] = {
++      {
++              .pa_start       = 0x4819C000,
++              .pa_end         = 0x4819C000 + SZ_4K - 1,
++              .flags          = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
++      },
++};
++
++static struct omap_hwmod_ocp_if am335_l4_per_i2c3 = {
++      .master         = &am33xx_l4per_hwmod,
++      .slave          = &am33xx_i2c3_hwmod,
++      .addr           = am33xx_i2c3_addr_space,
++      .user           = OCP_USER_MPU,
++};
++
++static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = {
++      { .irq = 30 },
++      { .irq = -1 }
++};
++
++static struct omap_hwmod_dma_info i2c3_edma_reqs[] = {
++      { .name = "tx", .dma_req = 0, },
++      { .name = "rx", .dma_req = 0, },
++};
++
++static struct omap_hwmod_ocp_if *am33xx_i2c3_slaves[] = {
++      &am335_l4_per_i2c3,
++};
++
++static struct omap_hwmod am33xx_i2c3_hwmod = {
++      .name           = "i2c3",
++      .mpu_irqs       = i2c3_mpu_irqs,
++      .sdma_reqs      = i2c3_edma_reqs,
++      .main_clk       = "i2c3_fck",
++      .clkdm_name     = "l4ls_clkdm",
++      .prcm           = {
++              .omap4 = {
++                      .clkctrl_offs   = AM33XX_CM_PER_I2C2_CLKCTRL_OFFSET,
++                      .modulemode     = MODULEMODE_SWCTRL,
++              },
++      },
++      .slaves         = am33xx_i2c3_slaves,
++      .slaves_cnt     = ARRAY_SIZE(am33xx_i2c3_slaves),
++      .class          = &i2c_class,
++};
++
+ /* 'icss' class */
+ static struct omap_hwmod_class am33xx_icss_hwmod_class = {
+       .name = "icss",
+@@ -2430,6 +2479,7 @@ static __initdata struct omap_hwmod *am33xx_hwmods[] = {
+       /* i2c class */
+       &am33xx_i2c1_hwmod,
+       &am33xx_i2c2_hwmod,
++      &am33xx_i2c3_hwmod,
+       /* icss class */
+       &am33xx_icss_hwmod,
+       /* ieee5000 class */
+-- 
+1.7.2.5
+
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0003-arm-omap-board-Add-quick-hack-to-get-i2c2-bus-suppor.patch b/recipes-kernel/linux/linux-ti33x-psp-3.1/i2c/0003-arm-omap-board-Add-quick-hack-to-get-i2c2-bus-suppor.patch
new file mode 100644 (file)
index 0000000..0f911b5
--- /dev/null
@@ -0,0 +1,74 @@
+From 167a775857838679d6d9465587af8ba1bd8c97bd Mon Sep 17 00:00:00 2001
+From: Steve Kipisz <s-kipisz2@ti.com>
+Date: Wed, 16 Nov 2011 07:25:14 -0600
+Subject: [PATCH 3/3] arm:omap:board: Add quick hack to get i2c2 bus support
+
+* Only added aic address so that i2ctools can be used at runtime
+  to query eeprom and EDID, just to make sure i2c2 is working.
+
+Signed-off-by: Steve Kipisz <s-kipisz2@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-am335xevm.c |   25 +++++++++++++++++++++++++
+ 1 files changed, 25 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
+index 590c4ca..b27fb97 100644
+--- a/arch/arm/mach-omap2/board-am335xevm.c
++++ b/arch/arm/mach-omap2/board-am335xevm.c
+@@ -582,6 +582,14 @@ static struct pinmux_config i2c1_pin_mux[] = {
+       {NULL, 0},
+ };
++static struct pinmux_config i2c2_pin_mux[] = {
++      {"uart1_ctsn.i2c2_sda",    OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
++                                      AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
++      {"uart1_rtsn.i2c2_scl",   OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW |
++                                      AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
++      {NULL, 0},
++};
++
+ /* Module pin mux for mcasp1 */
+ static struct pinmux_config mcasp1_pin_mux[] = {
+       {"mii1_crs.mcasp1_aclkx", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT_PULLDOWN},
+@@ -1107,6 +1115,21 @@ static void i2c1_init(int evm_id, int profile)
+       return;
+ }
++/* There will be more additions to this board_info over time. */
++static struct i2c_board_info beaglebone_i2c_boardinfo2[] = {
++      {
++              I2C_BOARD_INFO("tlv320aic3x", 0x1b),
++      },
++};
++
++static void i2c2_init(int evm_id, int profile)
++{
++      setup_pin_mux(i2c2_pin_mux);
++      omap_register_i2c_bus(3, 100, beaglebone_i2c_boardinfo2,
++                      ARRAY_SIZE(beaglebone_i2c_boardinfo2));
++      return;
++}
++
+ /* Setup McASP 1 */
+ static void mcasp1_init(int evm_id, int profile)
+ {
+@@ -1529,6 +1552,7 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = {
+       {dvi_init,      DEV_ON_BASEBOARD, PROFILE_ALL},
+       {usb0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
++      {i2c2_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
+       {NULL, 0, 0},
+@@ -1540,6 +1564,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
+       {dvi_init,      DEV_ON_BASEBOARD, PROFILE_ALL},
+       {usb0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
++      {i2c2_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
+       {NULL, 0, 0},
+-- 
+1.7.2.5
+
index 096fbb28fb554da2ba62835f71d4d605e8f8e042..3d5a1475fd7ee06b85bb8d73e0080d7e2eeb8eee 100644 (file)
@@ -11,7 +11,7 @@ MULTI_CONFIG_BASE_SUFFIX = ""
 
 BRANCH = "v3.1-meta-ti-r1r+gitr1d84d8853fa30cf3db2571a5aec572accca4e29d"
 SRCREV = "1d84d8853fa30cf3db2571a5aec572accca4e29d"
-MACHINE_KERNEL_PR_append = "a+gitr${SRCREV}"
+MACHINE_KERNEL_PR_append = "b+gitr${SRCREV}"
 
 COMPATIBLE_MACHINE = "(ti33x)"
 
@@ -41,6 +41,9 @@ PATCHES_OVER_PSP = " \
        file://can/0003-can-d_can-DCAN-config-added-to-am335x_evm_defconfig.patch \
        file://can/0004-can-d_can-fix-for-cansend-loop-issue.patch \
        file://can/0005-can-d_can-fixes-the-rmmod-crash.patch \
+       file://i2c/0001-arm-omap-mux33xx-Add-i2c2-pin-muix.patch \
+       file://i2c/0002-omap-hwmod-33xx-Add-support-for-third-i2c-bus.patch \
+       file://i2c/0003-arm-omap-board-Add-quick-hack-to-get-i2c2-bus-suppor.patch      \
        "
 
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'tipspkernel', "", "${PATCHES_OVER_PSP}", d)}"