power.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * (C) Copyright 2004-2008
  3. * Texas Instruments, <www.ti.com>
  4. *
  5. * Author :
  6. * Sunil Kumar <sunilsaini05@gmail.com>
  7. * Shashi Ranjan <shashiranjanmca05@gmail.com>
  8. *
  9. * Derived from Beagle Board and 3430 SDP code by
  10. * Richard Woodruff <r-woodruff2@ti.com>
  11. * Syed Mohammed Khasim <khasim@ti.com>
  12. *
  13. *
  14. * See file CREDITS for list of people who contributed to this
  15. * project.
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License as
  19. * published by the Free Software Foundation; either version 2 of
  20. * the License, or (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  30. * MA 02111-1307 USA
  31. */
  32. #include <common.h>
  33. #include <asm/arch/sys_proto.h>
  34. #include <i2c.h>
  35. /******************************************************************************
  36. * Routine: power_init_r
  37. * Description: Configure power supply
  38. *****************************************************************************/
  39. void power_init_r(void)
  40. {
  41. unsigned char byte;
  42. #ifdef CONFIG_DRIVER_OMAP34XX_I2C
  43. i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
  44. #endif
  45. /*
  46. * Configure OMAP3 supply voltages in power management
  47. * companion chip.
  48. */
  49. /* set VAUX3 to 2.8V */
  50. byte = DEV_GRP_P1;
  51. i2c_write(PWRMGT_ADDR_ID4, VAUX3_DEV_GRP, 1, &byte, 1);
  52. byte = VAUX3_VSEL_28;
  53. i2c_write(PWRMGT_ADDR_ID4, VAUX3_DEDICATED, 1, &byte, 1);
  54. /* set VPLL2 to 1.8V */
  55. byte = DEV_GRP_ALL;
  56. i2c_write(PWRMGT_ADDR_ID4, VPLL2_DEV_GRP, 1, &byte, 1);
  57. byte = VPLL2_VSEL_18;
  58. i2c_write(PWRMGT_ADDR_ID4, VPLL2_DEDICATED, 1, &byte, 1);
  59. /* set VDAC to 1.8V */
  60. byte = DEV_GRP_P1;
  61. i2c_write(PWRMGT_ADDR_ID4, VDAC_DEV_GRP, 1, &byte, 1);
  62. byte = VDAC_VSEL_18;
  63. i2c_write(PWRMGT_ADDR_ID4, VDAC_DEDICATED, 1, &byte, 1);
  64. /* enable LED */
  65. byte = LEDBPWM | LEDAPWM | LEDBON | LEDAON;
  66. i2c_write(PWRMGT_ADDR_ID3, LEDEN, 1, &byte, 1);
  67. }