paz00.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms and conditions of the GNU General Public License,
  9. * version 2, as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. */
  16. #include <common.h>
  17. #include <asm/io.h>
  18. #include <asm/arch/tegra2.h>
  19. #include <asm/arch/pinmux.h>
  20. #include <asm/arch/mmc.h>
  21. #include <asm/gpio.h>
  22. #ifdef CONFIG_TEGRA_MMC
  23. #include <mmc.h>
  24. #endif
  25. /*
  26. * Routine: gpio_config_uart
  27. * Description: Does nothing on Paz00 - no conflict w/SPI.
  28. */
  29. void gpio_config_uart(void)
  30. {
  31. }
  32. #ifdef CONFIG_TEGRA_MMC
  33. /*
  34. * Routine: pin_mux_mmc
  35. * Description: setup the pin muxes/tristate values for the SDMMC(s)
  36. */
  37. static void pin_mux_mmc(void)
  38. {
  39. /* SDMMC4: config 3, x8 on 2nd set of pins */
  40. pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
  41. pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
  42. pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
  43. pinmux_tristate_disable(PINGRP_ATB);
  44. pinmux_tristate_disable(PINGRP_GMA);
  45. pinmux_tristate_disable(PINGRP_GME);
  46. /* SDIO1: SDIO1_CLK, SDIO1_CMD, SDIO1_DAT[3:0] */
  47. pinmux_set_func(PINGRP_SDIO1, PMUX_FUNC_SDIO1);
  48. pinmux_tristate_disable(PINGRP_SDIO1);
  49. /* For power GPIO PV1 */
  50. pinmux_tristate_disable(PINGRP_UAC);
  51. /* For CD GPIO PV5 */
  52. pinmux_tristate_disable(PINGRP_GPV);
  53. }
  54. /* this is a weak define that we are overriding */
  55. int board_mmc_init(bd_t *bd)
  56. {
  57. debug("board_mmc_init called\n");
  58. /* Enable muxes, etc. for SDMMC controllers */
  59. pin_mux_mmc();
  60. debug("board_mmc_init: init eMMC\n");
  61. /* init dev 0, eMMC chip, with 4-bit bus */
  62. /* The board has an 8-bit bus, but 8-bit doesn't work yet */
  63. tegra2_mmc_init(0, 4, -1, -1);
  64. debug("board_mmc_init: init SD slot\n");
  65. /* init dev 3, SD slot, with 4-bit bus */
  66. tegra2_mmc_init(3, 4, GPIO_PV1, GPIO_PV5);
  67. return 0;
  68. }
  69. #endif