generic.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * linux/include/asm-mips/txx9/generic.h
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. */
  8. #ifndef __ASM_TXX9_GENERIC_H
  9. #define __ASM_TXX9_GENERIC_H
  10. #include <linux/init.h>
  11. #include <linux/ioport.h> /* for struct resource */
  12. extern struct resource txx9_ce_res[];
  13. #define TXX9_CE(n) (unsigned long)(txx9_ce_res[(n)].start)
  14. extern unsigned int txx9_pcode;
  15. extern char txx9_pcode_str[8];
  16. void txx9_reg_res_init(unsigned int pcode, unsigned long base,
  17. unsigned long size);
  18. extern unsigned int txx9_master_clock;
  19. extern unsigned int txx9_cpu_clock;
  20. extern unsigned int txx9_gbus_clock;
  21. #define TXX9_IMCLK (txx9_gbus_clock / 2)
  22. extern int txx9_ccfg_toeon;
  23. struct uart_port;
  24. int early_serial_txx9_setup(struct uart_port *port);
  25. struct pci_dev;
  26. struct txx9_board_vec {
  27. const char *system;
  28. void (*prom_init)(void);
  29. void (*mem_setup)(void);
  30. void (*irq_setup)(void);
  31. void (*time_init)(void);
  32. void (*arch_init)(void);
  33. void (*device_init)(void);
  34. #ifdef CONFIG_PCI
  35. int (*pci_map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
  36. #endif
  37. };
  38. extern struct txx9_board_vec *txx9_board_vec;
  39. extern int (*txx9_irq_dispatch)(int pending);
  40. char *prom_getcmdline(void);
  41. const char *prom_getenv(const char *name);
  42. void txx9_wdt_init(unsigned long base);
  43. void txx9_wdt_now(unsigned long base);
  44. void txx9_spi_init(int busid, unsigned long base, int irq);
  45. void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr);
  46. void txx9_sio_init(unsigned long baseaddr, int irq,
  47. unsigned int line, unsigned int sclk, int nocts);
  48. void prom_putchar(char c);
  49. #ifdef CONFIG_EARLY_PRINTK
  50. extern void (*txx9_prom_putchar)(char c);
  51. void txx9_sio_putchar_init(unsigned long baseaddr);
  52. #else
  53. static inline void txx9_sio_putchar_init(unsigned long baseaddr)
  54. {
  55. }
  56. #endif
  57. struct physmap_flash_data;
  58. void txx9_physmap_flash_init(int no, unsigned long addr, unsigned long size,
  59. const struct physmap_flash_data *pdata);
  60. /* 8 bit version of __fls(): find first bit set (returns 0..7) */
  61. static inline unsigned int __fls8(unsigned char x)
  62. {
  63. int r = 7;
  64. if (!(x & 0xf0)) {
  65. r -= 4;
  66. x <<= 4;
  67. }
  68. if (!(x & 0xc0)) {
  69. r -= 2;
  70. x <<= 2;
  71. }
  72. if (!(x & 0x80))
  73. r -= 1;
  74. return r;
  75. }
  76. void txx9_iocled_init(unsigned long baseaddr,
  77. int basenum, unsigned int num, int lowactive,
  78. const char *color, char **deftriggers);
  79. /* 7SEG LED */
  80. void txx9_7segled_init(unsigned int num,
  81. void (*putc)(unsigned int pos, unsigned char val));
  82. int txx9_7segled_putc(unsigned int pos, char c);
  83. #endif /* __ASM_TXX9_GENERIC_H */