aria.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * (C) Copyright 2009 Wolfgang Denk <wd@denx.de>
  3. * (C) Copyright 2009 Dave Srl www.dave.eu
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <asm/bitops.h>
  9. #include <command.h>
  10. #include <asm/io.h>
  11. #include <asm/processor.h>
  12. #include <asm/mpc512x.h>
  13. #include <fdt_support.h>
  14. #ifdef CONFIG_MISC_INIT_R
  15. #include <i2c.h>
  16. #endif
  17. DECLARE_GLOBAL_DATA_PTR;
  18. phys_size_t initdram (int board_type)
  19. {
  20. return fixed_sdram(NULL, NULL, 0);
  21. }
  22. int misc_init_r(void)
  23. {
  24. u32 tmp;
  25. /* we use I2C-2 for on-board eeprom */
  26. i2c_set_bus_num(2);
  27. tmp = in_be32((u32*)CONFIG_SYS_ARIA_FPGA_BASE);
  28. printf("FPGA: %u-%u.%u.%u\n",
  29. (tmp & 0xFF000000) >> 24,
  30. (tmp & 0x00FF0000) >> 16,
  31. (tmp & 0x0000FF00) >> 8,
  32. tmp & 0x000000FF
  33. );
  34. return 0;
  35. }
  36. static iopin_t ioregs_init[] = {
  37. /*
  38. * FEC
  39. */
  40. /* FEC on PSCx_x*/
  41. {
  42. offsetof(struct ioctrl512x, io_control_psc0_0), 5, 0,
  43. IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
  44. IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
  45. },
  46. {
  47. offsetof(struct ioctrl512x, io_control_psc1_0), 10, 0,
  48. IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
  49. IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
  50. },
  51. {
  52. offsetof(struct ioctrl512x, io_control_spdif_txclk), 3, 0,
  53. IO_PIN_FMUX(1) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
  54. IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
  55. },
  56. /*
  57. * DIU
  58. */
  59. /* FUNC2=DIU CLK */
  60. {
  61. offsetof(struct ioctrl512x, io_control_psc6_0), 1, 0,
  62. IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
  63. IO_PIN_PUE(0) | IO_PIN_ST(1) | IO_PIN_DS(3)
  64. },
  65. /* FUNC2=DIU_HSYNC */
  66. {
  67. offsetof(struct ioctrl512x, io_control_psc6_1), 1, 0,
  68. IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
  69. IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
  70. },
  71. /* FUNC2=DIUVSYNC Sets Next 26 to DIU Pads */
  72. {
  73. offsetof(struct ioctrl512x, io_control_psc6_4), 26, 0,
  74. IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
  75. IO_PIN_PUE(0) | IO_PIN_ST(0) | IO_PIN_DS(3)
  76. },
  77. /*
  78. * On board SRAM
  79. */
  80. /* FUNC2=/LPC CS6 */
  81. {
  82. offsetof(struct ioctrl512x, io_control_j1850_rx), 1, 0,
  83. IO_PIN_FMUX(2) | IO_PIN_HOLD(0) | IO_PIN_PUD(0) |
  84. IO_PIN_PUE(1) | IO_PIN_ST(1) | IO_PIN_DS(3)
  85. },
  86. };
  87. int checkboard (void)
  88. {
  89. puts("Board: ARIA\n");
  90. /* initialize function mux & slew rate IO inter alia on IO Pins */
  91. iopin_initialize(ioregs_init, ARRAY_SIZE(ioregs_init));
  92. return 0;
  93. }
  94. #ifdef CONFIG_OF_BOARD_SETUP
  95. int ft_board_setup(void *blob, bd_t *bd)
  96. {
  97. ft_cpu_setup(blob, bd);
  98. return 0;
  99. }
  100. #endif /* CONFIG_OF_BOARD_SETUP */