sonata.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  3. *
  4. * Parts are shamelessly stolen from various TI sources, original copyright
  5. * follows:
  6. * -----------------------------------------------------------------
  7. *
  8. * Copyright (C) 2004 Texas Instruments.
  9. *
  10. * ----------------------------------------------------------------------------
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. * ----------------------------------------------------------------------------
  25. */
  26. #include <common.h>
  27. #include <asm/arch/hardware.h>
  28. #include "../common/psc.h"
  29. #include "../common/misc.h"
  30. DECLARE_GLOBAL_DATA_PTR;
  31. int board_init(void)
  32. {
  33. /* arch number of the board */
  34. gd->bd->bi_arch_number = MACH_TYPE_SONATA;
  35. /* address of boot parameters */
  36. gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
  37. /* Configure AEMIF pins (although this should be configured at boot time
  38. * with pull-up/pull-down resistors) */
  39. REG(PINMUX0) = 0x00000c1f;
  40. davinci_errata_workarounds();
  41. /* Power on required peripherals */
  42. lpsc_on(DAVINCI_LPSC_GPIO);
  43. #if !defined(CONFIG_SYS_USE_DSPLINK)
  44. /* Powerup the DSP */
  45. dsp_on();
  46. #endif /* CONFIG_SYS_USE_DSPLINK */
  47. davinci_enable_uart0();
  48. davinci_enable_emac();
  49. davinci_enable_i2c();
  50. lpsc_on(DAVINCI_LPSC_TIMER1);
  51. timer_init();
  52. return(0);
  53. }
  54. int misc_init_r(void)
  55. {
  56. uint8_t eeprom_enetaddr[6];
  57. dv_display_clk_infos();
  58. /* Read Ethernet MAC address from EEPROM if available. */
  59. if (dvevm_read_mac_address(eeprom_enetaddr))
  60. dv_configure_mac_address(eeprom_enetaddr);
  61. if (!eth_hw_init())
  62. printf("ethernet init failed!\n");
  63. return(0);
  64. }