linux-ti33x-psp 3.2: i2c and cape fixes
authorKoen Kooi <koen@dominion.thruhere.net>
Tue, 22 May 2012 12:42:55 +0000 (14:42 +0200)
committerDenys Dmytriyenko <denys@ti.com>
Wed, 30 May 2012 17:48:52 +0000 (13:48 -0400)
* Fix I2C prescaler to run at full speed instead of 1/4 speed
* fix led/spidev/w1 check
* move RS232 cape to ttyO2

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0057-i2c-prescalar-fix-i2c-fixed-prescalar-setting-issue.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0058-beaglebone-annotate-default-beaglebone-pinmux.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0059-beaglebone-fix-pin-free-thinko-this-method-doesn-t-g.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0060-beaglebone-switch-RS232-cape-to-ttyO2.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0061-beaglebone-make-uart2-pinmux-match-the-uart0-pinmux.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp_3.2.bb

diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0057-i2c-prescalar-fix-i2c-fixed-prescalar-setting-issue.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0057-i2c-prescalar-fix-i2c-fixed-prescalar-setting-issue.patch
new file mode 100644 (file)
index 0000000..da75695
--- /dev/null
@@ -0,0 +1,58 @@
+From 2436d7177f75ffa852dc008ce5fe63e92cec963a Mon Sep 17 00:00:00 2001
+From: Al Pacifico <adpacifico@users.sourceforge.net>
+Date: Mon, 21 May 2012 11:50:32 -0700
+Subject: [PATCH 57/61] i2c-prescalar-fix: i2c: fixed prescalar setting issue
+
+Applied Steve's i2c prescalar fix patches.
+See https://groups.google.com/d/msg/beagleboard/Q1pDr1lT7Gk/jvxOxgg8_2MJ
+
+Signed-off-by: Al Pacifico <adpacifico@users.sourceforge.net>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/omap_hwmod_33xx_data.c |    3 ++-
+ drivers/i2c/busses/i2c-omap.c              |    2 ++
+ include/linux/i2c-omap.h                   |    1 +
+ 3 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+index 9d3c9a5..946e6b5 100644
+--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
++++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+@@ -1243,7 +1243,8 @@ static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = {
+ static struct omap_i2c_dev_attr i2c_dev_attr = {
+       .flags          = OMAP_I2C_FLAG_BUS_SHIFT_NONE |
+-                                      OMAP_I2C_FLAG_RESET_REGS_POSTIDLE,
++                                      OMAP_I2C_FLAG_RESET_REGS_POSTIDLE |
++                                      OMAP_I2C_FLAG_FORCE_12000_INT_CLK,
+ };
+ static struct omap_hwmod_class i2c_class = {
+diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
+index e0733b7..0ca6960 100644
+--- a/drivers/i2c/busses/i2c-omap.c
++++ b/drivers/i2c/busses/i2c-omap.c
+@@ -408,6 +408,8 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
+               if (dev->speed > 400 ||
+                              pdata->flags & OMAP_I2C_FLAG_FORCE_19200_INT_CLK)
+                       internal_clk = 19200;
++              else if (pdata->flags & OMAP_I2C_FLAG_FORCE_12000_INT_CLK)
++                      internal_clk = 12000;
+               else if (dev->speed > 100)
+                       internal_clk = 9600;
+               else
+diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
+index fd38249..818f5bf 100644
+--- a/include/linux/i2c-omap.h
++++ b/include/linux/i2c-omap.h
+@@ -24,6 +24,7 @@
+ #define OMAP_I2C_FLAG_APPLY_ERRATA_I207       BIT(4)
+ #define OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK       BIT(5)
+ #define OMAP_I2C_FLAG_FORCE_19200_INT_CLK     BIT(6)
++#define OMAP_I2C_FLAG_FORCE_12000_INT_CLK        BIT(9)
+ /* how the CPU address bus must be translated for I2C unit access */
+ #define OMAP_I2C_FLAG_BUS_SHIFT_NONE 0
+ #define OMAP_I2C_FLAG_BUS_SHIFT_1             BIT(7)
+-- 
+1.7.7.6
+
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0058-beaglebone-annotate-default-beaglebone-pinmux.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0058-beaglebone-annotate-default-beaglebone-pinmux.patch
new file mode 100644 (file)
index 0000000..66fb0de
--- /dev/null
@@ -0,0 +1,32 @@
+From 178d60b5a56c1f8eff29d23c27cc14bc6c0a9e4c Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 22 May 2012 10:58:53 +0200
+Subject: [PATCH 58/61] beaglebone: annotate default beaglebone pinmux
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-am335xevm.c |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
+index 68ddfe2..b079279 100644
+--- a/arch/arm/mach-omap2/board-am335xevm.c
++++ b/arch/arm/mach-omap2/board-am335xevm.c
+@@ -1431,10 +1431,10 @@ static struct platform_device lcd7_leds_gpio = {
+ static struct pinmux_config bone_pin_mux[] = {
+       /* User LED gpios (gpio1_21 to gpio1_24) */
+-    {"gpmc_a5.rgmii2_td0", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+-    {"gpmc_a6.rgmii2_tclk", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+-    {"gpmc_a7.rgmii2_rclk", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+-    {"gpmc_a8.rgmii2_rd3", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
++    {"gpmc_a5.rgmii2_td0", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, // USR0
++    {"gpmc_a6.rgmii2_tclk", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, // USR1
++    {"gpmc_a7.rgmii2_rclk", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, // USR2
++    {"gpmc_a8.rgmii2_rd3", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, // USR3
+     /* Grounding gpio1_6 (pin 3 Conn A) signals bone tester to start diag tests */
+     {"gpmc_ad6.gpio1_6", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
+       {NULL, 0},
+-- 
+1.7.7.6
+
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0059-beaglebone-fix-pin-free-thinko-this-method-doesn-t-g.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0059-beaglebone-fix-pin-free-thinko-this-method-doesn-t-g.patch
new file mode 100644 (file)
index 0000000..1b55abf
--- /dev/null
@@ -0,0 +1,78 @@
+From f0f728e400d0512788e59a2d7a17e3aa8584c033 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 22 May 2012 11:00:00 +0200
+Subject: [PATCH 59/61] beaglebone: fix pin-free thinko, this method doesn't
+ get called when there's a cape at 0x57
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-am335xevm.c |   46 +++++++++++++++------------------
+ 1 files changed, 21 insertions(+), 25 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
+index b079279..dfe8df5 100644
+--- a/arch/arm/mach-omap2/board-am335xevm.c
++++ b/arch/arm/mach-omap2/board-am335xevm.c
+@@ -2542,25 +2542,6 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
+       ret = mem_acc->read(mem_acc, (char *)&cape_config, 0, sizeof(cape_config));
+       if (ret != sizeof(cape_config)) {
+               pr_warning("BeagleBone cape EEPROM: could not read eeprom at address 0x%x\n", capecount + 0x53);
+-              if (capecount > 3) {
+-                      if (beaglebone_tsadcpins_free == 1) {
+-                              pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
+-                              bone_tsc_init(0,0);
+-                              beaglebone_tsadcpins_free = 0;
+-                      }
+-                      if (beaglebone_leds_free == 1) {
+-                              boneleds_init(0,0);
+-                      }
+-                      if(beaglebone_spi1_free == 1) {
+-                              beaglebone_spi1_free = 0;
+-                              pr_info("BeagleBone cape: exporting SPI pins as spidev\n");
+-                              setup_pin_mux(spi1_pin_mux);
+-                              spi_register_board_info(bone_spidev2_info, ARRAY_SIZE(bone_spidev2_info));
+-                      }
+-                      if(beaglebone_w1gpio_free == 1) {
+-                              bonew1_gpio_init(0,0);
+-                      }
+-              }
+               return;
+       }
+@@ -2693,12 +2674,27 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
+               pr_info("BeagleBone cape: recognized Camera cape\n");
+               beaglebone_w1gpio_free = 0;
+       }
+-      
+-      if ((capecount > 3) && (beaglebone_tsadcpins_free == 1)) {
+-              pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
+-              bone_tsc_init(0,0);
+-              beaglebone_tsadcpins_free = 0;
+-      }
++
++      if (capecount > 3) {
++              if (beaglebone_tsadcpins_free == 1) {
++                      pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
++                      bone_tsc_init(0,0);
++                      beaglebone_tsadcpins_free = 0;
++              }
++              if (beaglebone_leds_free == 1) {
++                      pr_info("Beaglebone: initializing onboard LEDs");
++                      boneleds_init(0,0);
++              }
++              if(beaglebone_spi1_free == 1) {
++                      beaglebone_spi1_free = 0;
++                      pr_info("BeagleBone cape: exporting SPI pins as spidev\n");
++                      setup_pin_mux(spi1_pin_mux);
++                      spi_register_board_info(bone_spidev2_info, ARRAY_SIZE(bone_spidev2_info));
++              }
++              if(beaglebone_w1gpio_free == 1) {
++                      bonew1_gpio_init(0,0);
++              }
++      }       
+       
+       return;
+ out:
+-- 
+1.7.7.6
+
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0060-beaglebone-switch-RS232-cape-to-ttyO2.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0060-beaglebone-switch-RS232-cape-to-ttyO2.patch
new file mode 100644 (file)
index 0000000..063b2b3
--- /dev/null
@@ -0,0 +1,29 @@
+From b594d005ab1e622b9c3cbf45c2699dde4af3706f Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 22 May 2012 11:00:35 +0200
+Subject: [PATCH 60/61] beaglebone: switch RS232 cape to ttyO2
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-am335xevm.c |    5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
+index dfe8df5..5902df0 100644
+--- a/arch/arm/mach-omap2/board-am335xevm.c
++++ b/arch/arm/mach-omap2/board-am335xevm.c
+@@ -2657,8 +2657,9 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
+       }
+               if (!strncmp("BB-BONE-SERL-03", cape_config.partnumber, 15)) {
+               pr_info("BeagleBone cape: initializing RS232 cape\n");
+-              pr_info("BeagleBone cape: only uart1 is supported!\n");
+-              setup_pin_mux(uart1_pin_mux);
++              pr_info("BeagleBone RS232 cape: only uart2/ttyO2 is supported.\n");
++              pr_info("BeagleBone RS232 cape: Jumper J27 and J23.\n");
++              setup_pin_mux(uart2_pin_mux);
+       }
+               if (!strncmp("BB-BONE-SERL-04", cape_config.partnumber, 15)) {
+               pr_info("BeagleBone cape: not initializing RS485 cape\n");
+-- 
+1.7.7.6
+
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0061-beaglebone-make-uart2-pinmux-match-the-uart0-pinmux.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0061-beaglebone-make-uart2-pinmux-match-the-uart0-pinmux.patch
new file mode 100644 (file)
index 0000000..91f324c
--- /dev/null
@@ -0,0 +1,31 @@
+From 9c7b14dcac75a1c6456e2cd4ae3e1737ed1c5f47 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 22 May 2012 12:25:33 +0200
+Subject: [PATCH 61/61] beaglebone: make uart2 pinmux match the uart0 pinmux
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-am335xevm.c |    7 ++-----
+ 1 files changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
+index 5902df0..e8ce381 100644
+--- a/arch/arm/mach-omap2/board-am335xevm.c
++++ b/arch/arm/mach-omap2/board-am335xevm.c
+@@ -885,11 +885,8 @@ static struct pinmux_config uart1_pin_mux[] = {
+ /* Module pin mux for uart2 */
+ static struct pinmux_config uart2_pin_mux[] = {
+-      {"spi0_sclk.uart2_rxd", OMAP_MUX_MODE1 | AM33XX_SLEWCTRL_SLOW |
+-                                              AM33XX_PIN_INPUT_PULLUP},
+-      {"spi0_d0.uart2_txd", OMAP_MUX_MODE1 | AM33XX_PULL_UP |
+-                                              AM33XX_PULL_DISA |
+-                                              AM33XX_SLEWCTRL_SLOW},
++      {"spi0_d0.uart2_txd", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
++      {"spi0_sclk.uart2_rxd", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
+       {NULL, 0},
+ };
+-- 
+1.7.7.6
+
index 82fa5ebebf96ae3da2473a67ee1779b5b00b11ac..7df217d02bbbfa0792e51ad2685b94ed2265ac7b 100644 (file)
@@ -12,7 +12,7 @@ MULTI_CONFIG_BASE_SUFFIX = ""
 
 BRANCH = "v3.2-staging"
 SRCREV = "720e07b4c1f687b61b147b31c698cb6816d72f01"
-MACHINE_KERNEL_PR_append = "n+gitr${SRCREV}"
+MACHINE_KERNEL_PR_append = "o+gitr${SRCREV}"
 
 COMPATIBLE_MACHINE = "(ti33x)"
 
@@ -992,4 +992,9 @@ PATCHES_OVER_PSP = " \
        file://beaglebone/0054-Workaround-for-boards-with-mistaken-ASCII-interpreta.patch \
        file://beaglebone/0055-Workaround-for-EEPROM-contents-blocking-further-I2C-.patch \
        file://beaglebone/0056-Added-check-on-EEPROM-revision-to-prevent-interpreti.patch \
+       file://beaglebone/0057-i2c-prescalar-fix-i2c-fixed-prescalar-setting-issue.patch \
+       file://beaglebone/0058-beaglebone-annotate-default-beaglebone-pinmux.patch \
+       file://beaglebone/0059-beaglebone-fix-pin-free-thinko-this-method-doesn-t-g.patch \
+       file://beaglebone/0060-beaglebone-switch-RS232-cape-to-ttyO2.patch \
+       file://beaglebone/0061-beaglebone-make-uart2-pinmux-match-the-uart0-pinmux.patch \
 "