Subversion Repositories HelenOS

Rev

Rev 4669 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (c) 2009 Vineeth Pillai
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * - Redistributions of source code must retain the above copyright
  10.  *   notice, this list of conditions and the following disclaimer.
  11.  * - Redistributions in binary form must reproduce the above copyright
  12.  *   notice, this list of conditions and the following disclaimer in the
  13.  *   documentation and/or other materials provided with the distribution.
  14.  * - The name of the author may not be used to endorse or promote products
  15.  *   derived from this software without specific prior written permission.
  16.  *
  17.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  18.  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  19.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  21.  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  22.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26.  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27.  */
  28.  
  29. /** @addtogroup arm32integratorcp
  30.  *  @brief Integratorcp machine specific parts.
  31.  *  @ingroup arm32
  32.  * @{
  33.  */
  34. /** @file
  35.  *  @brief Integratorcp peripheries drivers declarations.
  36.  */
  37.  
  38. #ifndef KERN_arm32_ICP_H_
  39. #define KERN_arm32_ICP_H_
  40.  
  41. #include <arch/machine_func.h>
  42.  
  43. /** Last interrupt number (beginning from 0) whose status is probed
  44.  * from interrupt controller
  45.  */
  46. #define ICP_IRQC_MAX_IRQ  8
  47. #define ICP_KBD_IRQ       3
  48. #define ICP_TIMER_IRQ    6
  49.  
  50. /** Timer frequency */
  51. #define ICP_TIMER_FREQ  10000
  52.  
  53. #define ICP_UART            0x16000000
  54. #define ICP_KBD             0x18000000
  55. #define ICP_KBD_STAT            0x04
  56. #define ICP_KBD_DATA            0x08
  57. #define ICP_KBD_INTR_STAT       0x10
  58. #define ICP_RTC             0x13000000
  59. #define ICP_RTC1_LOAD_OFFSET        0x100
  60. #define ICP_RTC1_READ_OFFSET        0x104
  61. #define ICP_RTC1_CTL_OFFSET     0x108
  62. #define ICP_RTC1_INTRCLR_OFFSET     0x10C
  63. #define ICP_RTC1_INTRSTAT_OFFSET    0x114
  64. #define ICP_RTC1_BGLOAD_OFFSET      0x118
  65. #define ICP_RTC_CTL_VALUE       0x00E2
  66. #define ICP_IRQC            0x14000000
  67. #define ICP_IRQC_MASK_OFFSET        0xC
  68. #define ICP_IRQC_UNMASK_OFFSET      0x8
  69. #define ICP_FB              0x00800000
  70. #define ICP_FB_FRAME            (ICP_FB >> 12)
  71. #define ICP_FB_NUM_FRAME        512
  72. #define ICP_VGA             0xC0000000
  73. #define ICP_CMCR            0x10000000
  74. #define ICP_SDRAM_MASK          0x1C
  75. #define ICP_SDRAMCR_OFFSET      0x20
  76.  
  77. typedef struct {
  78.         uintptr_t uart;
  79.         uintptr_t kbd_ctrl;
  80.         uintptr_t kbd_stat;
  81.         uintptr_t kbd_data;
  82.         uintptr_t kbd_intstat;
  83.         uintptr_t rtc;
  84.         uintptr_t rtc1_load;
  85.         uintptr_t rtc1_read;
  86.         uintptr_t rtc1_ctl;
  87.         uintptr_t rtc1_intrclr;
  88.         uintptr_t rtc1_intrstat;
  89.         uintptr_t rtc1_bgload;
  90.         uintptr_t irqc;
  91.         uintptr_t irqc_mask;
  92.         uintptr_t irqc_unmask;
  93.         uintptr_t vga;
  94.         uintptr_t cmcr;
  95.         uintptr_t sdramcr;
  96. } icp_hw_map_t;
  97.  
  98.  
  99. extern void icp_init(void);
  100. extern void icp_fb_init(void);
  101. extern void icp_output_init(void);
  102. extern void icp_input_init(void);
  103. extern void icp_release_console(void);
  104. extern void icp_grab_console(void);
  105. extern void icp_timer_irq_start(void);
  106. extern void icp_cpu_halt(void);
  107. extern void icp_irq_exception(int exc_no, istate_t *istate);
  108. extern uintptr_t icp_get_memory_size(void);
  109. extern uintptr_t icp_get_fb_address(void);
  110. extern void icp_fb_init(void);
  111. extern void icp_frame_init(void);
  112.  
  113. #endif
  114.  
  115. /** @}
  116.  */
  117.