microblaze-generic.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * (C) Copyright 2007 Michal Simek
  3. *
  4. * Michal SIMEK <monstr@monstr.eu>
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. /* This is a board specific file. It's OK to include board specific
  25. * header files */
  26. #include <common.h>
  27. #include <config.h>
  28. #include <netdev.h>
  29. #include <asm/microblaze_intc.h>
  30. #include <asm/asm.h>
  31. void do_reset (void)
  32. {
  33. #ifdef CONFIG_SYS_GPIO_0
  34. *((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR)) =
  35. ++(*((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR)));
  36. #endif
  37. #ifdef CONFIG_SYS_RESET_ADDRESS
  38. puts ("Reseting board\n");
  39. asm ("bra r0");
  40. #endif
  41. }
  42. int gpio_init (void)
  43. {
  44. #ifdef CONFIG_SYS_GPIO_0
  45. *((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR)) = 0xFFFFFFFF;
  46. #endif
  47. return 0;
  48. }
  49. #ifdef CONFIG_SYS_FSL_2
  50. void fsl_isr2 (void *arg) {
  51. volatile int num;
  52. *((unsigned int *)(CONFIG_SYS_GPIO_0_ADDR + 0x4)) =
  53. ++(*((unsigned int *)(CONFIG_SYS_GPIO_0_ADDR + 0x4)));
  54. GET (num, 2);
  55. NGET (num, 2);
  56. puts("*");
  57. }
  58. int fsl_init2 (void) {
  59. puts("fsl_init2\n");
  60. install_interrupt_handler (FSL_INTR_2, fsl_isr2, NULL);
  61. return 0;
  62. }
  63. #endif
  64. int board_eth_init(bd_t *bis)
  65. {
  66. /*
  67. * This board either has PCI NICs or uses the CPU's TSECs
  68. * pci_eth_init() will return 0 if no NICs found, so in that case
  69. * returning -1 will force cpu_eth_init() to be called.
  70. */
  71. #ifdef CONFIG_XILINX_EMACLITE
  72. return xilinx_emaclite_initialize(bis, XILINX_EMACLITE_BASEADDR);
  73. #endif
  74. }