asic.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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/ioport.h>
  21. #include <linux/platform_device.h>
  22. #include <asm/mach-powertv/asic_regs.h>
  23. #define DVR_CAPABLE (1<<0)
  24. #define PCIE_CAPABLE (1<<1)
  25. #define FFS_CAPABLE (1<<2)
  26. #define DISPLAY_CAPABLE (1<<3)
  27. /* Platform Family types
  28. * For compitability, the new value must be added in the end */
  29. enum family_type {
  30. FAMILY_8500,
  31. FAMILY_8500RNG,
  32. FAMILY_4500,
  33. FAMILY_1500,
  34. FAMILY_8600,
  35. FAMILY_4600,
  36. FAMILY_4600VZA,
  37. FAMILY_8600VZB,
  38. FAMILY_1500VZE,
  39. FAMILY_1500VZF,
  40. FAMILY_8700,
  41. FAMILIES
  42. };
  43. /* Register maps for each ASIC */
  44. extern const struct register_map calliope_register_map;
  45. extern const struct register_map cronus_register_map;
  46. extern const struct register_map gaia_register_map;
  47. extern const struct register_map zeus_register_map;
  48. extern struct resource dvr_cronus_resources[];
  49. extern struct resource dvr_gaia_resources[];
  50. extern struct resource dvr_zeus_resources[];
  51. extern struct resource non_dvr_calliope_resources[];
  52. extern struct resource non_dvr_cronus_resources[];
  53. extern struct resource non_dvr_cronuslite_resources[];
  54. extern struct resource non_dvr_gaia_resources[];
  55. extern struct resource non_dvr_vz_calliope_resources[];
  56. extern struct resource non_dvr_vze_calliope_resources[];
  57. extern struct resource non_dvr_vzf_calliope_resources[];
  58. extern struct resource non_dvr_zeus_resources[];
  59. extern void powertv_platform_init(void);
  60. extern void platform_alloc_bootmem(void);
  61. extern enum asic_type platform_get_asic(void);
  62. extern enum family_type platform_get_family(void);
  63. extern int platform_supports_dvr(void);
  64. extern int platform_supports_ffs(void);
  65. extern int platform_supports_pcie(void);
  66. extern int platform_supports_display(void);
  67. extern void configure_platform(void);
  68. /* Platform Resources */
  69. #define ASIC_RESOURCE_GET_EXISTS 1
  70. extern struct resource *asic_resource_get(const char *name);
  71. extern void platform_release_memory(void *baddr, int size);
  72. /* USB configuration */
  73. struct usb_hcd; /* Forward reference */
  74. extern void platform_configure_usb_ehci(void);
  75. extern void platform_unconfigure_usb_ehci(void);
  76. extern void platform_configure_usb_ohci(void);
  77. extern void platform_unconfigure_usb_ohci(void);
  78. /* Resource for ASIC registers */
  79. extern struct resource asic_resource;
  80. extern int platform_usb_devices_init(struct platform_device **echi_dev,
  81. struct platform_device **ohci_dev);
  82. /* Reboot Cause */
  83. extern void set_reboot_cause(char code, unsigned int data, unsigned int data2);
  84. extern void set_locked_reboot_cause(char code, unsigned int data,
  85. unsigned int data2);
  86. enum sys_reboot_type {
  87. sys_unknown_reboot = 0x00, /* Unknown reboot cause */
  88. sys_davic_change = 0x01, /* Reboot due to change in DAVIC
  89. * mode */
  90. sys_user_reboot = 0x02, /* Reboot initiated by user */
  91. sys_system_reboot = 0x03, /* Reboot initiated by OS */
  92. sys_trap_reboot = 0x04, /* Reboot due to a CPU trap */
  93. sys_silent_reboot = 0x05, /* Silent reboot */
  94. sys_boot_ldr_reboot = 0x06, /* Bootloader reboot */
  95. sys_power_up_reboot = 0x07, /* Power on bootup. Older
  96. * drivers may report as
  97. * userReboot. */
  98. sys_code_change = 0x08, /* Reboot to take code change.
  99. * Older drivers may report as
  100. * userReboot. */
  101. sys_hardware_reset = 0x09, /* HW watchdog or front-panel
  102. * reset button reset. Older
  103. * drivers may report as
  104. * userReboot. */
  105. sys_watchdogInterrupt = 0x0A /* Pre-watchdog interrupt */
  106. };
  107. #endif /* _ASM_MACH_POWERTV_ASIC_H */