Firmware for MNT ZZ9000 graphics and ARM coprocessor card for Amiga computers.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

platform.c 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2010 - 2015 Xilinx, Inc. All rights reserved.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * Use of the Software is limited solely to applications:
  16. * (a) running on a Xilinx device, or
  17. * (b) that interact with a Xilinx device through a bus or interconnect.
  18. *
  19. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  22. * XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  23. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
  24. * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  25. * SOFTWARE.
  26. *
  27. * Except as contained in this notice, the name of the Xilinx shall not be used
  28. * in advertising or otherwise to promote the sale, use or other dealings in
  29. * this Software without prior written authorization from Xilinx.
  30. *
  31. ******************************************************************************/
  32. #include "xparameters.h"
  33. #include "xil_cache.h"
  34. #include "platform_config.h"
  35. /*
  36. * Uncomment one of the following two lines, depending on the target,
  37. * if ps7/psu init source files are added in the source directory for
  38. * compiling example outside of SDK.
  39. */
  40. /*#include "ps7_init.h"*/
  41. /*#include "psu_init.h"*/
  42. #ifdef STDOUT_IS_16550
  43. #include "xuartns550_l.h"
  44. #define UART_BAUD 9600
  45. #endif
  46. void
  47. enable_caches()
  48. {
  49. #ifdef __PPC__
  50. Xil_ICacheEnableRegion(CACHEABLE_REGION_MASK);
  51. Xil_DCacheEnableRegion(CACHEABLE_REGION_MASK);
  52. #elif __MICROBLAZE__
  53. #ifdef XPAR_MICROBLAZE_USE_ICACHE
  54. Xil_ICacheEnable();
  55. #endif
  56. #ifdef XPAR_MICROBLAZE_USE_DCACHE
  57. Xil_DCacheEnable();
  58. #endif
  59. #endif
  60. }
  61. void
  62. disable_caches()
  63. {
  64. #ifdef __MICROBLAZE__
  65. #ifdef XPAR_MICROBLAZE_USE_DCACHE
  66. Xil_DCacheDisable();
  67. #endif
  68. #ifdef XPAR_MICROBLAZE_USE_ICACHE
  69. Xil_ICacheDisable();
  70. #endif
  71. #endif
  72. }
  73. void
  74. init_uart()
  75. {
  76. #ifdef STDOUT_IS_16550
  77. XUartNs550_SetBaud(STDOUT_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, UART_BAUD);
  78. XUartNs550_SetLineControlReg(STDOUT_BASEADDR, XUN_LCR_8_DATA_BITS);
  79. #endif
  80. /* Bootrom/BSP configures PS7/PSU UART to 115200 bps */
  81. }
  82. void
  83. init_platform()
  84. {
  85. /*
  86. * If you want to run this example outside of SDK,
  87. * uncomment one of the following two lines and also #include "ps7_init.h"
  88. * or #include "ps7_init.h" at the top, depending on the target.
  89. * Make sure that the ps7/psu_init.c and ps7/psu_init.h files are included
  90. * along with this example source files for compilation.
  91. */
  92. /* ps7_init();*/
  93. /* psu_init();*/
  94. enable_caches();
  95. init_uart();
  96. }
  97. void
  98. cleanup_platform()
  99. {
  100. disable_caches();
  101. }