generic.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. const char *prom_getenv(const char *name);
  41. void txx9_wdt_init(unsigned long base);
  42. void txx9_wdt_now(unsigned long base);
  43. void txx9_spi_init(int busid, unsigned long base, int irq);
  44. void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr);
  45. void txx9_sio_init(unsigned long baseaddr, int irq,
  46. unsigned int line, unsigned int sclk, int nocts);
  47. #ifdef CONFIG_EARLY_PRINTK
  48. extern void (*txx9_prom_putchar)(char c);
  49. void txx9_sio_putchar_init(unsigned long baseaddr);
  50. #else
  51. static inline void txx9_sio_putchar_init(unsigned long baseaddr)
  52. {
  53. }
  54. #endif
  55. struct physmap_flash_data;
  56. void txx9_physmap_flash_init(int no, unsigned long addr, unsigned long size,
  57. const struct physmap_flash_data *pdata);
  58. /* 8 bit version of __fls(): find first bit set (returns 0..7) */
  59. static inline unsigned int __fls8(unsigned char x)
  60. {
  61. int r = 7;
  62. if (!(x & 0xf0)) {
  63. r -= 4;
  64. x <<= 4;
  65. }
  66. if (!(x & 0xc0)) {
  67. r -= 2;
  68. x <<= 2;
  69. }
  70. if (!(x & 0x80))
  71. r -= 1;
  72. return r;
  73. }
  74. void txx9_iocled_init(unsigned long baseaddr,
  75. int basenum, unsigned int num, int lowactive,
  76. const char *color, char **deftriggers);
  77. /* 7SEG LED */
  78. void txx9_7segled_init(unsigned int num,
  79. void (*putc)(unsigned int pos, unsigned char val));
  80. int txx9_7segled_putc(unsigned int pos, char c);
  81. void __init txx9_aclc_init(unsigned long baseaddr, int irq,
  82. unsigned int dmac_id,
  83. unsigned int dma_chan_out,
  84. unsigned int dma_chan_in);
  85. void __init txx9_sramc_init(struct resource *r);
  86. #endif /* __ASM_TXX9_GENERIC_H */