alt_sys_init.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * alt_sys_init.c - HAL initialization source
  3. *
  4. * Machine generated for CPU 'nios2' in SOPC Builder design 'nios2_uc'
  5. * SOPC Builder design path: ../../nios2_uc.sopcinfo
  6. *
  7. * Generated: Thu Dec 03 15:55:47 CET 2020
  8. */
  9. /*
  10. * DO NOT MODIFY THIS FILE
  11. *
  12. * Changing this file will have subtle consequences
  13. * which will almost certainly lead to a nonfunctioning
  14. * system. If you do modify this file, be aware that your
  15. * changes will be overwritten and lost when this file
  16. * is generated again.
  17. *
  18. * DO NOT MODIFY THIS FILE
  19. */
  20. /*
  21. * License Agreement
  22. *
  23. * Copyright (c) 2008
  24. * Altera Corporation, San Jose, California, USA.
  25. * All rights reserved.
  26. *
  27. * Permission is hereby granted, free of charge, to any person obtaining a
  28. * copy of this software and associated documentation files (the "Software"),
  29. * to deal in the Software without restriction, including without limitation
  30. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  31. * and/or sell copies of the Software, and to permit persons to whom the
  32. * Software is furnished to do so, subject to the following conditions:
  33. *
  34. * The above copyright notice and this permission notice shall be included in
  35. * all copies or substantial portions of the Software.
  36. *
  37. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  38. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  39. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  40. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  41. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  42. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  43. * DEALINGS IN THE SOFTWARE.
  44. *
  45. * This agreement shall be governed in all respects by the laws of the State
  46. * of California and by the laws of the United States of America.
  47. */
  48. #include "system.h"
  49. #include "sys/alt_irq.h"
  50. #include "sys/alt_sys_init.h"
  51. #include <stddef.h>
  52. /*
  53. * Device headers
  54. */
  55. #include "altera_nios2_gen2_irq.h"
  56. #include "altera_avalon_jtag_uart.h"
  57. #include "altera_avalon_lcd_16207.h"
  58. /*
  59. * Allocate the device storage
  60. */
  61. ALTERA_NIOS2_GEN2_IRQ_INSTANCE ( NIOS2, nios2);
  62. ALTERA_AVALON_JTAG_UART_INSTANCE ( JTAG_UART, jtag_uart);
  63. ALTERA_AVALON_LCD_16207_INSTANCE ( LCD_16207, lcd_16207);
  64. /*
  65. * Initialize the interrupt controller devices
  66. * and then enable interrupts in the CPU.
  67. * Called before alt_sys_init().
  68. * The "base" parameter is ignored and only
  69. * present for backwards-compatibility.
  70. */
  71. void alt_irq_init ( const void* base )
  72. {
  73. ALTERA_NIOS2_GEN2_IRQ_INIT ( NIOS2, nios2);
  74. alt_irq_cpu_enable_interrupts();
  75. }
  76. /*
  77. * Initialize the non-interrupt controller devices.
  78. * Called after alt_irq_init().
  79. */
  80. void alt_sys_init( void )
  81. {
  82. ALTERA_AVALON_JTAG_UART_INIT ( JTAG_UART, jtag_uart);
  83. ALTERA_AVALON_LCD_16207_INIT ( LCD_16207, lcd_16207);
  84. }