asic_regs.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * Copyright (C) 2009 Cisco Systems, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __ASM_MACH_POWERTV_ASIC_H_
  19. #define __ASM_MACH_POWERTV_ASIC_H_
  20. #include <linux/io.h>
  21. /* ASIC types */
  22. enum asic_type {
  23. ASIC_UNKNOWN,
  24. ASIC_ZEUS,
  25. ASIC_CALLIOPE,
  26. ASIC_CRONUS,
  27. ASIC_CRONUSLITE,
  28. ASICS
  29. };
  30. /* hardcoded values read from Chip Version registers */
  31. #define CRONUS_10 0x0B4C1C20
  32. #define CRONUS_11 0x0B4C1C21
  33. #define CRONUSLITE_10 0x0B4C1C40
  34. #define NAND_FLASH_BASE 0x03000000
  35. #define ZEUS_IO_BASE 0x09000000
  36. #define CALLIOPE_IO_BASE 0x08000000
  37. #define CRONUS_IO_BASE 0x09000000
  38. #define ASIC_IO_SIZE 0x01000000
  39. /* Definitions for backward compatibility */
  40. #define UART1_INTSTAT uart1_intstat
  41. #define UART1_INTEN uart1_inten
  42. #define UART1_CONFIG1 uart1_config1
  43. #define UART1_CONFIG2 uart1_config2
  44. #define UART1_DIVISORHI uart1_divisorhi
  45. #define UART1_DIVISORLO uart1_divisorlo
  46. #define UART1_DATA uart1_data
  47. #define UART1_STATUS uart1_status
  48. /* ASIC register enumeration */
  49. struct register_map {
  50. u32 eic_slow0_strt_add;
  51. u32 eic_cfg_bits;
  52. u32 eic_ready_status;
  53. u32 chipver3;
  54. u32 chipver2;
  55. u32 chipver1;
  56. u32 chipver0;
  57. u32 uart1_intstat;
  58. u32 uart1_inten;
  59. u32 uart1_config1;
  60. u32 uart1_config2;
  61. u32 uart1_divisorhi;
  62. u32 uart1_divisorlo;
  63. u32 uart1_data;
  64. u32 uart1_status;
  65. u32 int_stat_3;
  66. u32 int_stat_2;
  67. u32 int_stat_1;
  68. u32 int_stat_0;
  69. u32 int_config;
  70. u32 int_int_scan;
  71. u32 ien_int_3;
  72. u32 ien_int_2;
  73. u32 ien_int_1;
  74. u32 ien_int_0;
  75. u32 int_level_3_3;
  76. u32 int_level_3_2;
  77. u32 int_level_3_1;
  78. u32 int_level_3_0;
  79. u32 int_level_2_3;
  80. u32 int_level_2_2;
  81. u32 int_level_2_1;
  82. u32 int_level_2_0;
  83. u32 int_level_1_3;
  84. u32 int_level_1_2;
  85. u32 int_level_1_1;
  86. u32 int_level_1_0;
  87. u32 int_level_0_3;
  88. u32 int_level_0_2;
  89. u32 int_level_0_1;
  90. u32 int_level_0_0;
  91. u32 int_docsis_en;
  92. u32 mips_pll_setup;
  93. u32 usb_fs;
  94. u32 test_bus;
  95. u32 crt_spare;
  96. u32 usb2_ohci_int_mask;
  97. u32 usb2_strap;
  98. u32 ehci_hcapbase;
  99. u32 ohci_hc_revision;
  100. u32 bcm1_bs_lmi_steer;
  101. u32 usb2_control;
  102. u32 usb2_stbus_obc;
  103. u32 usb2_stbus_mess_size;
  104. u32 usb2_stbus_chunk_size;
  105. u32 pcie_regs;
  106. u32 tim_ch;
  107. u32 tim_cl;
  108. u32 gpio_dout;
  109. u32 gpio_din;
  110. u32 gpio_dir;
  111. u32 watchdog;
  112. u32 front_panel;
  113. u32 register_maps;
  114. };
  115. extern enum asic_type asic;
  116. extern const struct register_map *register_map;
  117. extern unsigned long asic_phy_base; /* Physical address of ASIC */
  118. extern unsigned long asic_base; /* Virtual address of ASIC */
  119. /*
  120. * Macros to interface to registers through their ioremapped address
  121. * asic_reg_offset Returns the offset of a given register from the start
  122. * of the ASIC address space
  123. * asic_reg_phys_addr Returns the physical address of the given register
  124. * asic_reg_addr Returns the iomapped virtual address of the given
  125. * register.
  126. */
  127. #define asic_reg_offset(x) (register_map->x)
  128. #define asic_reg_phys_addr(x) (asic_phy_base + asic_reg_offset(x))
  129. #define asic_reg_addr(x) \
  130. ((unsigned int *) (asic_base + asic_reg_offset(x)))
  131. /*
  132. * The asic_reg macro is gone. It should be replaced by either asic_read or
  133. * asic_write, as appropriate.
  134. */
  135. #define asic_read(x) readl(asic_reg_addr(x))
  136. #define asic_write(v, x) writel(v, asic_reg_addr(x))
  137. extern void asic_irq_init(void);
  138. #endif