ap325rxa.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*
  2. * Copyright (C) 2008 Renesas Solutions Corp.
  3. * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <netdev.h>
  9. #include <asm/io.h>
  10. #include <asm/processor.h>
  11. /* PRI control register */
  12. #define PRPRICR5 0xFF800048 /* LMB */
  13. #define PRPRICR5_D 0x2a
  14. /* FPGA control */
  15. #define FPGA_NAND_CTL 0xB410020C
  16. #define FPGA_NAND_RST 0x0008
  17. #define FPGA_NAND_INIT 0x0000
  18. #define FPGA_NAND_RST_WAIT 10000
  19. /* I/O port data */
  20. #define PACR_D 0x0000
  21. #define PBCR_D 0x0000
  22. #define PCCR_D 0x1000
  23. #define PDCR_D 0x0000
  24. #define PECR_D 0x0410
  25. #define PFCR_D 0xffff
  26. #define PGCR_D 0x0000
  27. #define PHCR_D 0x5011
  28. #define PJCR_D 0x4400
  29. #define PKCR_D 0x7c00
  30. #define PLCR_D 0x0000
  31. #define PMCR_D 0x0000
  32. #define PNCR_D 0x0000
  33. #define PQCR_D 0x0000
  34. #define PRCR_D 0x0000
  35. #define PSCR_D 0x0000
  36. #define PTCR_D 0x0010
  37. #define PUCR_D 0x0fff
  38. #define PVCR_D 0xffff
  39. #define PWCR_D 0x0000
  40. #define PXCR_D 0x7500
  41. #define PYCR_D 0x0000
  42. #define PZCR_D 0x5540
  43. /* Pin Function Controler data */
  44. #define PSELA_D 0x1410
  45. #define PSELB_D 0x0140
  46. #define PSELC_D 0x0000
  47. #define PSELD_D 0x0400
  48. /* I/O Buffer Hi-Z data */
  49. #define HIZCRA_D 0x0000
  50. #define HIZCRB_D 0x1000
  51. #define HIZCRC_D 0x0000
  52. #define HIZCRD_D 0x0000
  53. /* Module select reg data */
  54. #define MSELCRA_D 0x0014
  55. #define MSELCRB_D 0x0018
  56. /* Module Stop reg Data */
  57. #define MSTPCR2_D 0xFFD9F280
  58. /* CPLD loader */
  59. extern void init_cpld(void);
  60. int checkboard(void)
  61. {
  62. puts("BOARD: AP325RXA\n");
  63. return 0;
  64. }
  65. int board_init(void)
  66. {
  67. /* Pin Function Controler Init */
  68. outw(PSELA_D, PSELA);
  69. outw(PSELB_D, PSELB);
  70. outw(PSELC_D, PSELC);
  71. outw(PSELD_D, PSELD);
  72. /* I/O Buffer Hi-Z Init */
  73. outw(HIZCRA_D, HIZCRA);
  74. outw(HIZCRB_D, HIZCRB);
  75. outw(HIZCRC_D, HIZCRC);
  76. outw(HIZCRD_D, HIZCRD);
  77. /* Module select reg Init */
  78. outw(MSELCRA_D, MSELCRA);
  79. outw(MSELCRB_D, MSELCRB);
  80. /* Module Stop reg Init */
  81. outl(MSTPCR2_D, MSTPCR2);
  82. /* I/O ports */
  83. outw(PACR_D, PACR);
  84. outw(PBCR_D, PBCR);
  85. outw(PCCR_D, PCCR);
  86. outw(PDCR_D, PDCR);
  87. outw(PECR_D, PECR);
  88. outw(PFCR_D, PFCR);
  89. outw(PGCR_D, PGCR);
  90. outw(PHCR_D, PHCR);
  91. outw(PJCR_D, PJCR);
  92. outw(PKCR_D, PKCR);
  93. outw(PLCR_D, PLCR);
  94. outw(PMCR_D, PMCR);
  95. outw(PNCR_D, PNCR);
  96. outw(PQCR_D, PQCR);
  97. outw(PRCR_D, PRCR);
  98. outw(PSCR_D, PSCR);
  99. outw(PTCR_D, PTCR);
  100. outw(PUCR_D, PUCR);
  101. outw(PVCR_D, PVCR);
  102. outw(PWCR_D, PWCR);
  103. outw(PXCR_D, PXCR);
  104. outw(PYCR_D, PYCR);
  105. outw(PZCR_D, PZCR);
  106. /* PRI control register Init */
  107. outl(PRPRICR5_D, PRPRICR5);
  108. /* cpld init */
  109. init_cpld();
  110. return 0;
  111. }
  112. void led_set_state(unsigned short value)
  113. {
  114. }
  115. void ide_set_reset(int idereset)
  116. {
  117. outw(FPGA_NAND_RST, FPGA_NAND_CTL); /* NAND RESET */
  118. udelay(FPGA_NAND_RST_WAIT);
  119. outw(FPGA_NAND_INIT, FPGA_NAND_CTL);
  120. }
  121. int board_eth_init(bd_t *bis)
  122. {
  123. int rc = 0;
  124. #ifdef CONFIG_SMC911X
  125. rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
  126. #endif
  127. return rc;
  128. }