Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6
[sfrench/cifs-2.6.git] / arch / mips / include / asm / mach-loongson / loongson.h
1 /*
2  * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
3  * Author: Wu Zhangjin <wuzj@lemote.com>
4  *
5  * This program is free software; you can redistribute  it and/or modify it
6  * under  the terms of  the GNU General  Public License as published by the
7  * Free Software Foundation;  either version 2 of the  License, or (at your
8  * option) any later version.
9  *
10  */
11
12 #ifndef __ASM_MACH_LOONGSON_LOONGSON_H
13 #define __ASM_MACH_LOONGSON_LOONGSON_H
14
15 #include <linux/io.h>
16 #include <linux/init.h>
17
18 /* there is an internal bonito64-compatiable northbridge in loongson2e/2f */
19 #include <asm/mips-boards/bonito64.h>
20
21 /* loongson internal northbridge initialization */
22 extern void bonito_irq_init(void);
23
24 /* machine-specific reboot/halt operation */
25 extern void mach_prepare_reboot(void);
26 extern void mach_prepare_shutdown(void);
27
28 /* environment arguments from bootloader */
29 extern unsigned long bus_clock, cpu_clock_freq;
30 extern unsigned long memsize, highmemsize;
31
32 /* loongson-specific command line, env and memory initialization */
33 extern void __init prom_init_memory(void);
34 extern void __init prom_init_cmdline(void);
35 extern void __init prom_init_env(void);
36
37 /* irq operation functions */
38 extern void bonito_irqdispatch(void);
39 extern void __init bonito_irq_init(void);
40 extern void __init set_irq_trigger_mode(void);
41 extern void __init mach_init_irq(void);
42 extern void mach_irq_dispatch(unsigned int pending);
43
44 /* PCI Configuration Registers */
45 #define LOONGSON_PCI_ISR4C  BONITO_PCI_REG(0x4c)
46
47 /* PCI_Hit*_Sel_* */
48
49 #define LOONGSON_PCI_HIT0_SEL_L     BONITO(BONITO_REGBASE + 0x50)
50 #define LOONGSON_PCI_HIT0_SEL_H     BONITO(BONITO_REGBASE + 0x54)
51 #define LOONGSON_PCI_HIT1_SEL_L     BONITO(BONITO_REGBASE + 0x58)
52 #define LOONGSON_PCI_HIT1_SEL_H     BONITO(BONITO_REGBASE + 0x5c)
53 #define LOONGSON_PCI_HIT2_SEL_L     BONITO(BONITO_REGBASE + 0x60)
54 #define LOONGSON_PCI_HIT2_SEL_H     BONITO(BONITO_REGBASE + 0x64)
55
56 /* PXArb Config & Status */
57
58 #define LOONGSON_PXARB_CFG      BONITO(BONITO_REGBASE + 0x68)
59 #define LOONGSON_PXARB_STATUS       BONITO(BONITO_REGBASE + 0x6c)
60
61 /* loongson2-specific perf counter IRQ */
62 #define LOONGSON2_PERFCNT_IRQ   (MIPS_CPU_IRQ_BASE + 6)
63
64 #endif /* __ASM_MACH_LOONGSON_LOONGSON_H */