ib62x0.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2011-2012
  4. * Gerald Kerma <dreagle@doukki.net>
  5. * Luka Perkov <luka@openwrt.org>
  6. * Simon Baatz <gmbnomis@gmail.com>
  7. */
  8. #include <common.h>
  9. #include <init.h>
  10. #include <miiphy.h>
  11. #include <asm/io.h>
  12. #include <asm/arch/cpu.h>
  13. #include <asm/arch/soc.h>
  14. #include <asm/arch/mpp.h>
  15. #include "ib62x0.h"
  16. DECLARE_GLOBAL_DATA_PTR;
  17. int board_early_init_f(void)
  18. {
  19. /*
  20. * default gpio configuration
  21. * There are maximum 64 gpios controlled through 2 sets of registers
  22. * the below configuration configures mainly initial LED status
  23. */
  24. mvebu_config_gpio(IB62x0_OE_VAL_LOW,
  25. IB62x0_OE_VAL_HIGH,
  26. IB62x0_OE_LOW, IB62x0_OE_HIGH);
  27. /* Set SATA activity LEDs to default off */
  28. writel(MVSATAHC_LED_POLARITY_CTRL, MVSATAHC_LED_CONF_REG);
  29. /* Multi-Purpose Pins Functionality configuration */
  30. static const u32 kwmpp_config[] = {
  31. MPP0_NF_IO2,
  32. MPP1_NF_IO3,
  33. MPP2_NF_IO4,
  34. MPP3_NF_IO5,
  35. MPP4_NF_IO6,
  36. MPP5_NF_IO7,
  37. MPP6_SYSRST_OUTn,
  38. MPP8_TW_SDA,
  39. MPP9_TW_SCK,
  40. MPP10_UART0_TXD,
  41. MPP11_UART0_RXD,
  42. MPP18_NF_IO0,
  43. MPP19_NF_IO1,
  44. MPP20_SATA1_ACTn,
  45. MPP21_SATA0_ACTn,
  46. MPP22_GPIO, /* Power LED red */
  47. MPP24_GPIO, /* Power off device */
  48. MPP25_GPIO, /* Power LED green */
  49. MPP27_GPIO, /* USB transfer LED */
  50. MPP28_GPIO, /* Reset button */
  51. MPP29_GPIO, /* USB Copy button */
  52. 0
  53. };
  54. kirkwood_mpp_conf(kwmpp_config, NULL);
  55. return 0;
  56. }
  57. int board_init(void)
  58. {
  59. /* adress of boot parameters */
  60. gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
  61. return 0;
  62. }