Commit dcf7f6f1cc05ed52eda02c8cf39afea785f639c6

Authored by Yegor Yefremov
Committed by Tom Rini
1 parent a970727067

arm: baltos: active mPCIe slot

Baltos devices provide a mPCIe slot, whose power is turned off by
default. This patch activates mPCIe slot in U-Boot, so that for example
GSM modem can be already available in user space.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>

Showing 1 changed file with 18 additions and 0 deletions Side-by-side Diff

board/vscom/baltos/board.c
... ... @@ -39,6 +39,7 @@
39 39 /* GPIO that controls power to DDR on EVM-SK */
40 40 #define GPIO_DDR_VTT_EN 7
41 41 #define DIP_S1 44
  42 +#define MPCIE_SW 100
42 43  
43 44 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
44 45  
... ... @@ -330,6 +331,11 @@
330 331 return 0;
331 332 }
332 333  
  334 +static struct module_pin_mux pcie_sw_pin_mux[] = {
  335 + {OFFSET(mii1_rxdv), (MODE(7) | PULLUDEN )}, /* GPIO3_4 */
  336 + {-1},
  337 +};
  338 +
333 339 static struct module_pin_mux dip_pin_mux[] = {
334 340 {OFFSET(gpmc_ad12), (MODE(7) | RXACTIVE )}, /* GPIO1_12 */
335 341 {OFFSET(gpmc_ad13), (MODE(7) | RXACTIVE )}, /* GPIO1_13 */
... ... @@ -355,6 +361,18 @@
355 361 baltos_set_console();
356 362 }
357 363 }
  364 +
  365 + /* turn power for the mPCIe slot */
  366 + configure_module_pin_mux(pcie_sw_pin_mux);
  367 + if (gpio_request(MPCIE_SW, "mpcie_sw")) {
  368 + printf("failed to export GPIO %d\n", MPCIE_SW);
  369 + return -ENODEV;
  370 + }
  371 + if (gpio_direction_output(MPCIE_SW, 1)) {
  372 + printf("failed to set GPIO %d direction\n", MPCIE_SW);
  373 + return -ENODEV;
  374 + }
  375 +
358 376 setenv("board_name", model);
359 377 #endif
360 378