ib62x0.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Copyright (C) 2011-2012
  3. * Gerald Kerma <dreagle@doukki.net>
  4. * Luka Perkov <uboot@lukaperkov.net>
  5. * Simon Baatz <gmbnomis@gmail.com>
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. */
  23. #include <common.h>
  24. #include <miiphy.h>
  25. #include <asm/arch/cpu.h>
  26. #include <asm/arch/kirkwood.h>
  27. #include <asm/arch/mpp.h>
  28. #include "ib62x0.h"
  29. DECLARE_GLOBAL_DATA_PTR;
  30. int board_early_init_f(void)
  31. {
  32. /*
  33. * default gpio configuration
  34. * There are maximum 64 gpios controlled through 2 sets of registers
  35. * the below configuration configures mainly initial LED status
  36. */
  37. kw_config_gpio(IB62x0_OE_VAL_LOW,
  38. IB62x0_OE_VAL_HIGH,
  39. IB62x0_OE_LOW, IB62x0_OE_HIGH);
  40. /* Multi-Purpose Pins Functionality configuration */
  41. u32 kwmpp_config[] = {
  42. MPP0_NF_IO2,
  43. MPP1_NF_IO3,
  44. MPP2_NF_IO4,
  45. MPP3_NF_IO5,
  46. MPP4_NF_IO6,
  47. MPP5_NF_IO7,
  48. MPP6_SYSRST_OUTn,
  49. MPP8_TW_SDA,
  50. MPP9_TW_SCK,
  51. MPP10_UART0_TXD,
  52. MPP11_UART0_RXD,
  53. MPP18_NF_IO0,
  54. MPP19_NF_IO1,
  55. MPP20_SATA1_ACTn,
  56. MPP21_SATA0_ACTn,
  57. MPP22_GPIO, /* Power LED red */
  58. MPP24_GPIO, /* Power off device */
  59. MPP25_GPIO, /* Power LED green */
  60. MPP27_GPIO, /* USB transfer LED */
  61. MPP28_GPIO, /* Reset button */
  62. MPP29_GPIO, /* USB Copy button */
  63. 0
  64. };
  65. kirkwood_mpp_conf(kwmpp_config);
  66. return 0;
  67. }
  68. int board_init(void)
  69. {
  70. /* adress of boot parameters */
  71. gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
  72. return 0;
  73. }