linux-ti33x-psp 3.2: LCD7 A3 support, eMMC cape support, camera cape improvements
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / beaglebone / 0082-beaglebone-add-rudimentary-support-for-eMMC-cape.patch
1 From 9fd45d5967c0e09c57e2cf41e4bf26dadf31eb16 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Thu, 26 Jul 2012 22:30:34 +0200
4 Subject: [PATCH 82/84] beaglebone: add rudimentary support for eMMC cape
6 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7 ---
8  arch/arm/mach-omap2/board-am335xevm.c |   42 ++++++++++++++++++++++++--------
9  1 files changed, 31 insertions(+), 11 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
12 index 0c305b6..579df6c 100644
13 --- a/arch/arm/mach-omap2/board-am335xevm.c
14 +++ b/arch/arm/mach-omap2/board-am335xevm.c
15 @@ -913,6 +913,7 @@ static struct pinmux_config mmc1_pin_mux[] = {
16         {"gpmc_csn2.mmc1_cmd",  OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
17         {"gpmc_csn0.gpio1_29",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
18         {"gpmc_advn_ale.mmc1_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
19 +       {"uart1_rxd.mmc1_sdwp", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
20         {NULL, 0},
21  };
22  
23 @@ -2627,6 +2628,28 @@ static void mcasp0_init(int evm_id, int profile)
24         return;
25  }
26  
27 +static void mmc0_init(int evm_id, int profile)
28 +{
29 +       setup_pin_mux(mmc0_pin_mux);
30 +
31 +       omap2_hsmmc_init(am335x_mmc);
32 +       return;
33 +}
34 +
35 +static void emmc_bone_init(int evm_id, int profile)
36 +{
37 +       printk("cape: emmc_bone_init\n");
38 +       setup_pin_mux(mmc1_pin_mux);
39 +       am335x_mmc[1].mmc = 2;
40 +       am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA;
41 +       am335x_mmc[1].nonremovable = true;
42 +       am335x_mmc[1].gpio_cd = -EINVAL;
43 +       am335x_mmc[1].gpio_wp = -EINVAL;
44 +       am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 */
45 +       /* mmc will be initialized when mmc0_init is called */
46 +       return;
47 +}
48 +
49  static const char* cape_pins[] = {
50  /*
51    From SRM RevA5.0.1:
52 @@ -2923,7 +2946,6 @@ static int bone_io_config_from_cape_eeprom( void)
53         RULER( NR_ITEMS( cape_config.muxdata));
54         return 0;
55  }
56 -
57  static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context)
58  {
59         int ret;
60 @@ -3102,6 +3124,12 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
61                 #endif
62                 */
63         }
64 +
65 +       if (!strncmp("BB-BONE-eMMC1-01", cape_config.partnumber, 15)) {
66 +               pr_info("BeagleBone cape: initializing eMMC cape\n");
67 +               beaglebone_w1gpio_free = 0;
68 +               emmc_bone_init(0,0);
69 +       }
70         
71         if (!strncmp("BB-BONE-SERL-01", cape_config.partnumber, 15)) {
72                 pr_info("BeagleBone cape: initializing CAN cape\n");
73 @@ -3147,6 +3175,7 @@ out:
74         beaglebone_cape_detected = false;
75  out2:
76         if (capecount > 3) {
77 +               mmc0_init(0,0);
78                 if (beaglebone_tsadcpins_free == 1) {
79                         pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
80                         bone_tsc_init(0,0);
81 @@ -3338,14 +3367,6 @@ static void d_can_init(int evm_id, int profile)
82         }
83  }
84  
85 -static void mmc0_init(int evm_id, int profile)
86 -{
87 -       setup_pin_mux(mmc0_pin_mux);
88 -
89 -       omap2_hsmmc_init(am335x_mmc);
90 -       return;
91 -}
92 -
93  static struct i2c_board_info tps65217_i2c_boardinfo[] = {
94         {
95                 I2C_BOARD_INFO("tps65217", TPS65217_I2C_ID),
96 @@ -3589,11 +3610,10 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = {
97  /* Beaglebone Rev A3 and after */
98  static struct evm_dev_cfg beaglebone_dev_cfg[] = {
99         {tps65217_init, DEV_ON_BASEBOARD, PROFILE_NONE},
100 +       {i2c2_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
101         {mii1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
102         {usb0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
103         {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
104 -       {i2c2_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
105 -       {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
106         {NULL, 0, 0},
107  };
108  
109 -- 
110 1.7.7.6