walnut.c 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * (C) Copyright 2000-2005
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <common.h>
  8. #include <asm/processor.h>
  9. #include <spd_sdram.h>
  10. int board_early_init_f(void)
  11. {
  12. /*-------------------------------------------------------------------------+
  13. | Interrupt controller setup for the Walnut/Sycamore board.
  14. | Note: IRQ 0-15 405GP internally generated; active high; level sensitive
  15. | IRQ 16 405GP internally generated; active low; level sensitive
  16. | IRQ 17-24 RESERVED
  17. | IRQ 25 (EXT IRQ 0) FPGA; active high; level sensitive
  18. | IRQ 26 (EXT IRQ 1) SMI; active high; level sensitive
  19. | IRQ 27 (EXT IRQ 2) Not Used
  20. | IRQ 28 (EXT IRQ 3) PCI SLOT 3; active low; level sensitive
  21. | IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
  22. | IRQ 30 (EXT IRQ 5) PCI SLOT 1; active low; level sensitive
  23. | IRQ 31 (EXT IRQ 6) PCI SLOT 0; active low; level sensitive
  24. | Note for Walnut board:
  25. | An interrupt taken for the FPGA (IRQ 25) indicates that either
  26. | the Mouse, Keyboard, IRDA, or External Expansion caused the
  27. | interrupt. The FPGA must be read to determine which device
  28. | caused the interrupt. The default setting of the FPGA clears
  29. |
  30. +-------------------------------------------------------------------------*/
  31. mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
  32. mtdcr(UIC0ER, 0x00000000); /* disable all ints */
  33. mtdcr(UIC0CR, 0x00000020); /* set all but FPGA SMI to be non-critical */
  34. mtdcr(UIC0PR, 0xFFFFFFE0); /* set int polarities */
  35. mtdcr(UIC0TR, 0x10000000); /* set int trigger levels */
  36. mtdcr(UIC0VCR, 0x00000001); /* set vect base=0,INT0 highest priority */
  37. mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
  38. /* set UART1 control to select CTS/RTS */
  39. #define FPGA_BRDC 0xF0300004
  40. *(volatile char *)(FPGA_BRDC) |= 0x1;
  41. return 0;
  42. }
  43. /*
  44. * Check Board Identity:
  45. */
  46. int checkboard(void)
  47. {
  48. char buf[64];
  49. int i = getenv_f("serial#", buf, sizeof(buf));
  50. uint pvr = get_pvr();
  51. if (pvr == PVR_405GPR_RB) {
  52. puts("Board: Sycamore - AMCC PPC405GPr Evaluation Board");
  53. } else {
  54. puts("Board: Walnut - AMCC PPC405GP Evaluation Board");
  55. }
  56. if (i > 0) {
  57. puts(", serial# ");
  58. puts(buf);
  59. }
  60. putc('\n');
  61. return (0);
  62. }
  63. /*
  64. * initdram(int board_type) reads EEPROM via I2c. EEPROM contains all of
  65. * the necessary info for SDRAM controller configuration
  66. */
  67. phys_size_t initdram(int board_type)
  68. {
  69. return spd_sdram();
  70. }