c7e4b7867bb9fafa6ce8b896fe860d05ef932cae
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.1 / adc / 0002-ARM-OMAP-AM335x-Add-support-for-Beta-GP-EVM.patch
1 From 98d0446f94a6f89016f5ed73cb6bc304075cceb6 Mon Sep 17 00:00:00 2001
2 From: Patil, Rachna <rachna@ti.com>
3 Date: Fri, 11 Nov 2011 13:09:51 +0530
4 Subject: [PATCH 2/9] ARM: OMAP: AM335x: Add support for Beta GP EVM.
6 This patch adds support for BETA EVM.
7 BETA EVM is set as the default configuration.
8 Since the peripherals were supported only in profile 0 for
9 alpha EVM, It makes use of the exisiting GP EVM structure.
11 Changes have been made to MMC and audio.
13 Flag gp_evm_revision can be used to differentiate between the
14 revisions of the GP EVM.
16 Signed-off-by: Patil, Rachna <rachna@ti.com>
17 ---
18  arch/arm/mach-omap2/board-am335xevm.c |   57 ++++++++++++---------------------
19  1 files changed, 21 insertions(+), 36 deletions(-)
21 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
22 index 9ec56c6..d6bf7b1 100644
23 --- a/arch/arm/mach-omap2/board-am335xevm.c
24 +++ b/arch/arm/mach-omap2/board-am335xevm.c
25 @@ -329,6 +329,11 @@ struct am335x_evm_eeprom_config {
26  static struct am335x_evm_eeprom_config config;
27  static bool daughter_brd_detected;
28  
29 +#define GP_EVM_REV_IS_1_0A             0x1
30 +#define GP_EVM_REV_IS_1_1A             0x2
31 +#define GP_EVM_REV_IS_UNKNOWN          0xFF
32 +static unsigned int gp_evm_revision = GP_EVM_REV_IS_UNKNOWN;
33 +
34  #define EEPROM_MAC_ADDRESS_OFFSET      60 /* 4+8+4+12+32 */
35  #define EEPROM_NO_OF_MAC_ADDR          3
36  static char am335x_mac_addr[EEPROM_NO_OF_MAC_ADDR][ETH_ALEN];
37 @@ -629,25 +634,8 @@ static struct pinmux_config mmc1_pin_mux[] = {
38         {"gpmc_ad0.mmc1_dat0",  OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
39         {"gpmc_csn1.mmc1_clk",  OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
40         {"gpmc_csn2.mmc1_cmd",  OMAP_MUX_MODE2 | AM33XX_PIN_INPUT_PULLUP},
41 -       {"uart1_rxd.mmc1_sdwp", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
42 -       {"mcasp0_fsx.mmc1_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
43 -       {NULL, 0},
44 -};
45 -
46 -/* Module pin mux for mmc2 */
47 -static struct pinmux_config mmc2_pin_mux[] = {
48 -       {"gpmc_ad11.mmc2_dat7", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
49 -       {"gpmc_ad10.mmc2_dat6", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
50 -       {"gpmc_ad9.mmc2_dat5",  OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
51 -       {"gpmc_ad8.mmc2_dat4",  OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
52 -       {"gpmc_ad15.mmc2_dat3", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
53 -       {"gpmc_ad14.mmc2_dat2", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
54 -       {"gpmc_ad13.mmc2_dat1", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
55 -       {"gpmc_ad12.mmc2_dat0", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
56 -       {"gpmc_clk.mmc2_clk",   OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
57 -       {"gpmc_csn3.mmc2_cmd",  OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
58 -       {"spi0_cs0.mmc2_sdwp",  OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
59 -       {"mcasp0_axr0.mmc2_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
60 +       {"gpmc_csn0.mmc1_sdwp", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
61 +       {"gpmc_advn_ale.mmc1_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
62         {NULL, 0},
63  };
64  
65 @@ -1138,20 +1126,6 @@ static void mmc1_init(int evm_id, int profile)
66         return;
67  }
68  
69 -static void mmc2_init(int evm_id, int profile)
70 -{
71 -       setup_pin_mux(mmc2_pin_mux);
72 -
73 -       am335x_mmc[1].mmc = 3;
74 -       am335x_mmc[1].caps = MMC_CAP_4_BIT_DATA;
75 -       am335x_mmc[1].gpio_cd = GPIO_TO_PIN(3, 16);
76 -       am335x_mmc[1].gpio_wp = GPIO_TO_PIN(0, 5);
77 -       am335x_mmc[1].ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 */
78 -
79 -       /* mmc will be initialized when mmc0_init is called */
80 -       return;
81 -}
82 -
83  static void mmc2_wl12xx_init(int evm_id, int profile)
84  {
85         setup_pin_mux(mmc2_wl12xx_pin_mux);
86 @@ -1488,9 +1462,8 @@ static struct evm_dev_cfg gen_purp_evm_dev_cfg[] = {
87         {evm_nand_init, DEV_ON_DGHTR_BRD,
88                 (PROFILE_ALL & ~PROFILE_2 & ~PROFILE_3)},
89         {i2c1_init,     DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7)},
90 -       {mcasp1_init,   DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3) },
91 +       {mcasp1_init,   DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_3 | PROFILE_7) },
92         {mmc1_init,     DEV_ON_DGHTR_BRD, PROFILE_2},
93 -       {mmc2_init,     DEV_ON_DGHTR_BRD, PROFILE_4},
94         {mmc2_wl12xx_init,      DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 |
95                                                                 PROFILE_5)},
96         {mmc0_init,     DEV_ON_BASEBOARD, (PROFILE_ALL & ~PROFILE_5)},
97 @@ -1563,9 +1536,21 @@ static void setup_low_cost_evm(void)
98  static void setup_general_purpose_evm(void)
99  {
100         u32 prof_sel = am335x_get_profile_selection();
102         pr_info("The board is general purpose EVM in profile %d\n", prof_sel);
103  
104 +       if (!strncmp("1.1A", config.version, 4)) {
105 +               pr_info("EVM version is %s\n", config.version);
106 +               gp_evm_revision = GP_EVM_REV_IS_1_1A;
107 +       }
108 +       else if (!strncmp("1.0A", config.version, 4)) {
109 +               pr_info("EVM version is %s\n", config.version);
110 +               gp_evm_revision = GP_EVM_REV_IS_1_0A;
111 +       }
112 +       else {
113 +               pr_err("EVM version read fail, falling back to Rev1.1A");
114 +               gp_evm_revision = GP_EVM_REV_IS_1_1A;
115 +       }
117         _configure_device(GEN_PURP_EVM, gen_purp_evm_dev_cfg, (1L << prof_sel));
118  }
119  
120 -- 
121 1.7.4.1