hawkboard.c 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Modified for Hawkboard - Syed Mohammed Khasim <khasim@beagleboard.org>
  3. *
  4. * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc. <nsekhar@ti.com>
  5. * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  6. * Copyright (C) 2004 Texas Instruments.
  7. *
  8. * ----------------------------------------------------------------------------
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. * ----------------------------------------------------------------------------
  23. */
  24. #include <common.h>
  25. #include <asm/errno.h>
  26. #include <asm/arch/hardware.h>
  27. #include <asm/io.h>
  28. #include <asm/arch/davinci_misc.h>
  29. #include <asm/arch/pinmux_defs.h>
  30. #include <ns16550.h>
  31. DECLARE_GLOBAL_DATA_PTR;
  32. const struct pinmux_resource pinmuxes[] = {
  33. PINMUX_ITEM(emac_pins_mii),
  34. PINMUX_ITEM(emac_pins_mdio),
  35. PINMUX_ITEM(emifa_pins_cs3),
  36. PINMUX_ITEM(emifa_pins_cs4),
  37. PINMUX_ITEM(emifa_pins_nand),
  38. PINMUX_ITEM(uart2_pins_txrx),
  39. PINMUX_ITEM(uart2_pins_rtscts),
  40. };
  41. const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
  42. const struct lpsc_resource lpsc[] = {
  43. { DAVINCI_LPSC_AEMIF }, /* NAND, NOR */
  44. { DAVINCI_LPSC_SPI1 }, /* Serial Flash */
  45. { DAVINCI_LPSC_EMAC }, /* image download */
  46. { DAVINCI_LPSC_UART2 }, /* console */
  47. { DAVINCI_LPSC_GPIO },
  48. };
  49. const int lpsc_size = ARRAY_SIZE(lpsc);
  50. int board_init(void)
  51. {
  52. /* arch number of the board */
  53. gd->bd->bi_arch_number = MACH_TYPE_OMAPL138_HAWKBOARD;
  54. /* address of boot parameters */
  55. gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
  56. return 0;
  57. }
  58. int board_early_init_f(void)
  59. {
  60. /*
  61. * Kick Registers need to be set to allow access to Pin Mux registers
  62. */
  63. writel(DV_SYSCFG_KICK0_UNLOCK, &davinci_syscfg_regs->kick0);
  64. writel(DV_SYSCFG_KICK1_UNLOCK, &davinci_syscfg_regs->kick1);
  65. /* set cfgchip3 to select mii */
  66. writel(readl(&davinci_syscfg_regs->cfgchip3) &
  67. ~(1 << 8), &davinci_syscfg_regs->cfgchip3);
  68. return 0;
  69. }
  70. int misc_init_r(void)
  71. {
  72. char buf[32];
  73. printf("ARM Clock : %s MHz\n",
  74. strmhz(buf, clk_get(DAVINCI_ARM_CLKID)));
  75. return 0;
  76. }