Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * linux/include/asm-mips/txx9/generic.h
0003  *
0004  * This file is subject to the terms and conditions of the GNU General Public
0005  * License.  See the file "COPYING" in the main directory of this archive
0006  * for more details.
0007  */
0008 #ifndef __ASM_TXX9_GENERIC_H
0009 #define __ASM_TXX9_GENERIC_H
0010 
0011 #include <linux/init.h>
0012 #include <linux/ioport.h>   /* for struct resource */
0013 
0014 extern struct resource txx9_ce_res[];
0015 #define TXX9_CE(n)  (unsigned long)(txx9_ce_res[(n)].start)
0016 extern unsigned int txx9_pcode;
0017 extern char txx9_pcode_str[8];
0018 void txx9_reg_res_init(unsigned int pcode, unsigned long base,
0019                unsigned long size);
0020 
0021 extern unsigned int txx9_master_clock;
0022 extern unsigned int txx9_cpu_clock;
0023 extern unsigned int txx9_gbus_clock;
0024 #define TXX9_IMCLK  (txx9_gbus_clock / 2)
0025 
0026 extern int txx9_ccfg_toeon;
0027 struct uart_port;
0028 int early_serial_txx9_setup(struct uart_port *port);
0029 
0030 struct pci_dev;
0031 struct txx9_board_vec {
0032     const char *system;
0033     void (*prom_init)(void);
0034     void (*mem_setup)(void);
0035     void (*irq_setup)(void);
0036     void (*time_init)(void);
0037     void (*arch_init)(void);
0038     void (*device_init)(void);
0039 #ifdef CONFIG_PCI
0040     int (*pci_map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
0041 #endif
0042 };
0043 extern struct txx9_board_vec *txx9_board_vec;
0044 extern int (*txx9_irq_dispatch)(int pending);
0045 const char *prom_getenv(const char *name);
0046 void txx9_wdt_init(unsigned long base);
0047 void txx9_wdt_now(unsigned long base);
0048 void txx9_spi_init(int busid, unsigned long base, int irq);
0049 void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr);
0050 void txx9_sio_init(unsigned long baseaddr, int irq,
0051            unsigned int line, unsigned int sclk, int nocts);
0052 #ifdef CONFIG_EARLY_PRINTK
0053 extern void (*txx9_prom_putchar)(char c);
0054 void txx9_sio_putchar_init(unsigned long baseaddr);
0055 #else
0056 static inline void txx9_sio_putchar_init(unsigned long baseaddr)
0057 {
0058 }
0059 #endif
0060 
0061 struct physmap_flash_data;
0062 void txx9_physmap_flash_init(int no, unsigned long addr, unsigned long size,
0063                  const struct physmap_flash_data *pdata);
0064 
0065 /* 8 bit version of __fls(): find first bit set (returns 0..7) */
0066 static inline unsigned int __fls8(unsigned char x)
0067 {
0068     int r = 7;
0069 
0070     if (!(x & 0xf0)) {
0071         r -= 4;
0072         x <<= 4;
0073     }
0074     if (!(x & 0xc0)) {
0075         r -= 2;
0076         x <<= 2;
0077     }
0078     if (!(x & 0x80))
0079         r -= 1;
0080     return r;
0081 }
0082 
0083 void txx9_iocled_init(unsigned long baseaddr,
0084               int basenum, unsigned int num, int lowactive,
0085               const char *color, char **deftriggers);
0086 
0087 /* 7SEG LED */
0088 void txx9_7segled_init(unsigned int num,
0089                void (*putc)(unsigned int pos, unsigned char val));
0090 int txx9_7segled_putc(unsigned int pos, char c);
0091 
0092 void __init txx9_aclc_init(unsigned long baseaddr, int irq,
0093                unsigned int dmac_id,
0094                unsigned int dma_chan_out,
0095                unsigned int dma_chan_in);
0096 void __init txx9_sramc_init(struct resource *r);
0097 
0098 #endif /* __ASM_TXX9_GENERIC_H */