w7o.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * (C) Copyright 2001
  3. * Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef _W7O_H_
  24. #define _W7O_H_
  25. #include <config.h>
  26. /* AMCC 405GP PowerPC GPIO registers */
  27. #define PPC405GP_GPIO0_OR 0xef600700L /* GPIO Output */
  28. #define PPC405GP_GPIO0_TCR 0xef600704L /* GPIO Three-State Control */
  29. #define PPC405GP_GPIO0_ODR 0xef600718L /* GPIO Open Drain */
  30. #define PPC405GP_GPIO0_IR 0xef60071cL /* GPIO Input */
  31. /* AMCC 405GP DCRs */
  32. #define CPC0_CR0 0xb1 /* Chip control register 0 */
  33. /* LMG FPGA <=> CPU GPIO signals */
  34. #define LMG_XCV_INIT 0x10000000L
  35. #define LMG_XCV_PROG 0x04000000L
  36. #define LMG_XCV_DONE 0x00400000L
  37. #define LMG_XCV_CNFG_0 0x08000000L
  38. #define LMG_XCV_IRQ_0 0x0L
  39. /* LMC FPGA <=> CPU GPIO signals */
  40. #define LMC_XCV_INIT 0x00800000L
  41. #define LMC_XCV_PROG 0x40000000L
  42. #define LMC_XCV_DONE 0x01000000L
  43. #define LMC_XCV_CNFG_0 0x00004000L /* Shared with IRQ 0 */
  44. #define LMC_XCV_CNFG_1 0x00002000L /* Shared with IRQ 1 */
  45. #define LMC_XCV_CNFG_2 0x00001000L /* Shared with IRQ 2 */
  46. #define LMC_XCV_IRQ_0 0x00080000L /* Shared with GPIO 17 */
  47. #define LMC_XCV_IRQ_1 0x00040000L /* Shared with GPIO 18 */
  48. #define LMC_XCV_IRQ_3 0x00020000L /* Shared tiwht GPIO 19 */
  49. /*
  50. * Setup FPGA <=> GPIO mappings
  51. */
  52. #if defined(CONFIG_W7OLMG)
  53. # define GPIO_XCV_INIT LMG_XCV_INIT
  54. # define GPIO_XCV_PROG LMG_XCV_PROG
  55. # define GPIO_XCV_DONE LMG_XCV_DONE
  56. # define GPIO_XCV_CNFG LMG_XCV_CNFG_0
  57. # define GPIO_XCV_IRQ LMG_XCV_IRQ_0
  58. # define GPIO_GPIO_1 0x40000000L
  59. # define GPIO_GPIO_6 0x02000000L
  60. # define GPIO_GPIO_7 0x01000000L
  61. # define GPIO_GPIO_8 0x00800000L
  62. #elif defined(CONFIG_W7OLMC)
  63. # define GPIO_XCV_INIT LMC_XCV_INIT
  64. # define GPIO_XCV_PROG LMC_XCV_PROG
  65. # define GPIO_XCV_DONE LMC_XCV_DONE
  66. # define GPIO_XCV_CNFG LMC_XCV_CNFG_0
  67. # define GPIO_XCV_IRQ LMC_XCV_IRQ_0
  68. #else
  69. # error "Unknown W7O board configuration"
  70. #endif
  71. /* Power On Self Tests */
  72. extern void post2(void);
  73. extern int test_led(void);
  74. extern int test_sdram(unsigned long size);
  75. extern void test_fpga(unsigned short *daddr);
  76. /* FGPA */
  77. extern int init_fpga(void);
  78. /* Misc */
  79. extern int temp_uart_init(void);
  80. extern void init_fsboot(void);
  81. #endif /* _W7O_H_ */