diff options
author | Tejun Heo <tj@kernel.org> | 2010-02-02 00:38:15 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-02-02 00:38:15 -0500 |
commit | ab386128f20c44c458a90039ab1bdc265ac474c9 (patch) | |
tree | 2ad188744922b1bb951fd10ff50dc04c83acce22 /arch/mips/include/asm | |
parent | dbfc196a3cc1a2514ad0737a82f764de23bd65e6 (diff) | |
parent | ab658321f32770b903a4426e2a6fae0392757755 (diff) |
Merge branch 'master' into percpu
Diffstat (limited to 'arch/mips/include/asm')
-rw-r--r-- | arch/mips/include/asm/irq.h | 1 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-ip27/topology.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-powertv/asic_reg_map.h | 90 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-powertv/asic_regs.h | 135 | ||||
-rw-r--r-- | arch/mips/include/asm/mipsregs.h | 12 |
5 files changed, 157 insertions, 85 deletions
diff --git a/arch/mips/include/asm/irq.h b/arch/mips/include/asm/irq.h index 06960364c96b..dea4aed6478f 100644 --- a/arch/mips/include/asm/irq.h +++ b/arch/mips/include/asm/irq.h | |||
@@ -135,6 +135,7 @@ extern void free_irqno(unsigned int irq); | |||
135 | #define CP0_LEGACY_COMPARE_IRQ 7 | 135 | #define CP0_LEGACY_COMPARE_IRQ 7 |
136 | 136 | ||
137 | extern int cp0_compare_irq; | 137 | extern int cp0_compare_irq; |
138 | extern int cp0_compare_irq_shift; | ||
138 | extern int cp0_perfcount_irq; | 139 | extern int cp0_perfcount_irq; |
139 | 140 | ||
140 | #endif /* _ASM_IRQ_H */ | 141 | #endif /* _ASM_IRQ_H */ |
diff --git a/arch/mips/include/asm/mach-ip27/topology.h b/arch/mips/include/asm/mach-ip27/topology.h index 09a59bcc1b07..1b1a7d1632b9 100644 --- a/arch/mips/include/asm/mach-ip27/topology.h +++ b/arch/mips/include/asm/mach-ip27/topology.h | |||
@@ -24,7 +24,9 @@ extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS]; | |||
24 | 24 | ||
25 | #define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid) | 25 | #define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid) |
26 | #define parent_node(node) (node) | 26 | #define parent_node(node) (node) |
27 | #define cpumask_of_node(node) (&hub_data(node)->h_cpus) | 27 | #define cpumask_of_node(node) ((node) == -1 ? \ |
28 | cpu_all_mask : \ | ||
29 | &hub_data(node)->h_cpus) | ||
28 | struct pci_bus; | 30 | struct pci_bus; |
29 | extern int pcibus_to_node(struct pci_bus *); | 31 | extern int pcibus_to_node(struct pci_bus *); |
30 | 32 | ||
diff --git a/arch/mips/include/asm/mach-powertv/asic_reg_map.h b/arch/mips/include/asm/mach-powertv/asic_reg_map.h new file mode 100644 index 000000000000..6f26cb09828e --- /dev/null +++ b/arch/mips/include/asm/mach-powertv/asic_reg_map.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | * asic_reg_map.h | ||
3 | * | ||
4 | * A macro-enclosed list of the elements for the register_map structure for | ||
5 | * use in defining and manipulating the structure. | ||
6 | * | ||
7 | * Copyright (C) 2009 Cisco Systems, Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | */ | ||
23 | |||
24 | REGISTER_MAP_ELEMENT(eic_slow0_strt_add) | ||
25 | REGISTER_MAP_ELEMENT(eic_cfg_bits) | ||
26 | REGISTER_MAP_ELEMENT(eic_ready_status) | ||
27 | REGISTER_MAP_ELEMENT(chipver3) | ||
28 | REGISTER_MAP_ELEMENT(chipver2) | ||
29 | REGISTER_MAP_ELEMENT(chipver1) | ||
30 | REGISTER_MAP_ELEMENT(chipver0) | ||
31 | REGISTER_MAP_ELEMENT(uart1_intstat) | ||
32 | REGISTER_MAP_ELEMENT(uart1_inten) | ||
33 | REGISTER_MAP_ELEMENT(uart1_config1) | ||
34 | REGISTER_MAP_ELEMENT(uart1_config2) | ||
35 | REGISTER_MAP_ELEMENT(uart1_divisorhi) | ||
36 | REGISTER_MAP_ELEMENT(uart1_divisorlo) | ||
37 | REGISTER_MAP_ELEMENT(uart1_data) | ||
38 | REGISTER_MAP_ELEMENT(uart1_status) | ||
39 | REGISTER_MAP_ELEMENT(int_stat_3) | ||
40 | REGISTER_MAP_ELEMENT(int_stat_2) | ||
41 | REGISTER_MAP_ELEMENT(int_stat_1) | ||
42 | REGISTER_MAP_ELEMENT(int_stat_0) | ||
43 | REGISTER_MAP_ELEMENT(int_config) | ||
44 | REGISTER_MAP_ELEMENT(int_int_scan) | ||
45 | REGISTER_MAP_ELEMENT(ien_int_3) | ||
46 | REGISTER_MAP_ELEMENT(ien_int_2) | ||
47 | REGISTER_MAP_ELEMENT(ien_int_1) | ||
48 | REGISTER_MAP_ELEMENT(ien_int_0) | ||
49 | REGISTER_MAP_ELEMENT(int_level_3_3) | ||
50 | REGISTER_MAP_ELEMENT(int_level_3_2) | ||
51 | REGISTER_MAP_ELEMENT(int_level_3_1) | ||
52 | REGISTER_MAP_ELEMENT(int_level_3_0) | ||
53 | REGISTER_MAP_ELEMENT(int_level_2_3) | ||
54 | REGISTER_MAP_ELEMENT(int_level_2_2) | ||
55 | REGISTER_MAP_ELEMENT(int_level_2_1) | ||
56 | REGISTER_MAP_ELEMENT(int_level_2_0) | ||
57 | REGISTER_MAP_ELEMENT(int_level_1_3) | ||
58 | REGISTER_MAP_ELEMENT(int_level_1_2) | ||
59 | REGISTER_MAP_ELEMENT(int_level_1_1) | ||
60 | REGISTER_MAP_ELEMENT(int_level_1_0) | ||
61 | REGISTER_MAP_ELEMENT(int_level_0_3) | ||
62 | REGISTER_MAP_ELEMENT(int_level_0_2) | ||
63 | REGISTER_MAP_ELEMENT(int_level_0_1) | ||
64 | REGISTER_MAP_ELEMENT(int_level_0_0) | ||
65 | REGISTER_MAP_ELEMENT(int_docsis_en) | ||
66 | REGISTER_MAP_ELEMENT(mips_pll_setup) | ||
67 | REGISTER_MAP_ELEMENT(usb_fs) | ||
68 | REGISTER_MAP_ELEMENT(test_bus) | ||
69 | REGISTER_MAP_ELEMENT(crt_spare) | ||
70 | REGISTER_MAP_ELEMENT(usb2_ohci_int_mask) | ||
71 | REGISTER_MAP_ELEMENT(usb2_strap) | ||
72 | REGISTER_MAP_ELEMENT(ehci_hcapbase) | ||
73 | REGISTER_MAP_ELEMENT(ohci_hc_revision) | ||
74 | REGISTER_MAP_ELEMENT(bcm1_bs_lmi_steer) | ||
75 | REGISTER_MAP_ELEMENT(usb2_control) | ||
76 | REGISTER_MAP_ELEMENT(usb2_stbus_obc) | ||
77 | REGISTER_MAP_ELEMENT(usb2_stbus_mess_size) | ||
78 | REGISTER_MAP_ELEMENT(usb2_stbus_chunk_size) | ||
79 | REGISTER_MAP_ELEMENT(pcie_regs) | ||
80 | REGISTER_MAP_ELEMENT(tim_ch) | ||
81 | REGISTER_MAP_ELEMENT(tim_cl) | ||
82 | REGISTER_MAP_ELEMENT(gpio_dout) | ||
83 | REGISTER_MAP_ELEMENT(gpio_din) | ||
84 | REGISTER_MAP_ELEMENT(gpio_dir) | ||
85 | REGISTER_MAP_ELEMENT(watchdog) | ||
86 | REGISTER_MAP_ELEMENT(front_panel) | ||
87 | REGISTER_MAP_ELEMENT(misc_clk_ctl1) | ||
88 | REGISTER_MAP_ELEMENT(misc_clk_ctl2) | ||
89 | REGISTER_MAP_ELEMENT(crt_ext_ctl) | ||
90 | REGISTER_MAP_ELEMENT(register_maps) | ||
diff --git a/arch/mips/include/asm/mach-powertv/asic_regs.h b/arch/mips/include/asm/mach-powertv/asic_regs.h index 9a65c93782f9..1e11236c6dbc 100644 --- a/arch/mips/include/asm/mach-powertv/asic_regs.h +++ b/arch/mips/include/asm/mach-powertv/asic_regs.h | |||
@@ -35,11 +35,12 @@ enum asic_type { | |||
35 | #define CRONUS_11 0x0B4C1C21 | 35 | #define CRONUS_11 0x0B4C1C21 |
36 | #define CRONUSLITE_10 0x0B4C1C40 | 36 | #define CRONUSLITE_10 0x0B4C1C40 |
37 | 37 | ||
38 | #define NAND_FLASH_BASE 0x03000000 | 38 | #define NAND_FLASH_BASE 0x03000000 |
39 | #define ZEUS_IO_BASE 0x09000000 | ||
40 | #define CALLIOPE_IO_BASE 0x08000000 | 39 | #define CALLIOPE_IO_BASE 0x08000000 |
41 | #define CRONUS_IO_BASE 0x09000000 | 40 | #define CRONUS_IO_BASE 0x09000000 |
42 | #define ASIC_IO_SIZE 0x01000000 | 41 | #define ZEUS_IO_BASE 0x09000000 |
42 | |||
43 | #define ASIC_IO_SIZE 0x01000000 | ||
43 | 44 | ||
44 | /* Definitions for backward compatibility */ | 45 | /* Definitions for backward compatibility */ |
45 | #define UART1_INTSTAT uart1_intstat | 46 | #define UART1_INTSTAT uart1_intstat |
@@ -52,96 +53,62 @@ enum asic_type { | |||
52 | #define UART1_STATUS uart1_status | 53 | #define UART1_STATUS uart1_status |
53 | 54 | ||
54 | /* ASIC register enumeration */ | 55 | /* ASIC register enumeration */ |
56 | union register_map_entry { | ||
57 | unsigned long phys; | ||
58 | u32 *virt; | ||
59 | }; | ||
60 | |||
61 | #define REGISTER_MAP_ELEMENT(x) union register_map_entry x; | ||
55 | struct register_map { | 62 | struct register_map { |
56 | u32 eic_slow0_strt_add; | 63 | #include <asm/mach-powertv/asic_reg_map.h> |
57 | u32 eic_cfg_bits; | ||
58 | u32 eic_ready_status; | ||
59 | |||
60 | u32 chipver3; | ||
61 | u32 chipver2; | ||
62 | u32 chipver1; | ||
63 | u32 chipver0; | ||
64 | |||
65 | u32 uart1_intstat; | ||
66 | u32 uart1_inten; | ||
67 | u32 uart1_config1; | ||
68 | u32 uart1_config2; | ||
69 | u32 uart1_divisorhi; | ||
70 | u32 uart1_divisorlo; | ||
71 | u32 uart1_data; | ||
72 | u32 uart1_status; | ||
73 | |||
74 | u32 int_stat_3; | ||
75 | u32 int_stat_2; | ||
76 | u32 int_stat_1; | ||
77 | u32 int_stat_0; | ||
78 | u32 int_config; | ||
79 | u32 int_int_scan; | ||
80 | u32 ien_int_3; | ||
81 | u32 ien_int_2; | ||
82 | u32 ien_int_1; | ||
83 | u32 ien_int_0; | ||
84 | u32 int_level_3_3; | ||
85 | u32 int_level_3_2; | ||
86 | u32 int_level_3_1; | ||
87 | u32 int_level_3_0; | ||
88 | u32 int_level_2_3; | ||
89 | u32 int_level_2_2; | ||
90 | u32 int_level_2_1; | ||
91 | u32 int_level_2_0; | ||
92 | u32 int_level_1_3; | ||
93 | u32 int_level_1_2; | ||
94 | u32 int_level_1_1; | ||
95 | u32 int_level_1_0; | ||
96 | u32 int_level_0_3; | ||
97 | u32 int_level_0_2; | ||
98 | u32 int_level_0_1; | ||
99 | u32 int_level_0_0; | ||
100 | u32 int_docsis_en; | ||
101 | |||
102 | u32 mips_pll_setup; | ||
103 | u32 usb_fs; | ||
104 | u32 test_bus; | ||
105 | u32 crt_spare; | ||
106 | u32 usb2_ohci_int_mask; | ||
107 | u32 usb2_strap; | ||
108 | u32 ehci_hcapbase; | ||
109 | u32 ohci_hc_revision; | ||
110 | u32 bcm1_bs_lmi_steer; | ||
111 | u32 usb2_control; | ||
112 | u32 usb2_stbus_obc; | ||
113 | u32 usb2_stbus_mess_size; | ||
114 | u32 usb2_stbus_chunk_size; | ||
115 | |||
116 | u32 pcie_regs; | ||
117 | u32 tim_ch; | ||
118 | u32 tim_cl; | ||
119 | u32 gpio_dout; | ||
120 | u32 gpio_din; | ||
121 | u32 gpio_dir; | ||
122 | u32 watchdog; | ||
123 | u32 front_panel; | ||
124 | |||
125 | u32 register_maps; | ||
126 | }; | 64 | }; |
65 | #undef REGISTER_MAP_ELEMENT | ||
66 | |||
67 | /** | ||
68 | * register_map_offset_phys - add an offset to the physical address | ||
69 | * @map: Pointer to the &struct register_map | ||
70 | * @offset: Value to add | ||
71 | * | ||
72 | * Only adds the base to non-zero physical addresses | ||
73 | */ | ||
74 | static inline void register_map_offset_phys(struct register_map *map, | ||
75 | unsigned long offset) | ||
76 | { | ||
77 | #define REGISTER_MAP_ELEMENT(x) do { \ | ||
78 | if (map->x.phys != 0) \ | ||
79 | map->x.phys += offset; \ | ||
80 | } while (false); | ||
81 | |||
82 | #include <asm/mach-powertv/asic_reg_map.h> | ||
83 | #undef REGISTER_MAP_ELEMENT | ||
84 | } | ||
85 | |||
86 | /** | ||
87 | * register_map_virtualize - Convert ®ister_map to virtual addresses | ||
88 | * @map: Pointer to ®ister_map to virtualize | ||
89 | */ | ||
90 | static inline void register_map_virtualize(struct register_map *map) | ||
91 | { | ||
92 | #define REGISTER_MAP_ELEMENT(x) do { \ | ||
93 | map->x.virt = (!map->x.phys) ? NULL : \ | ||
94 | UNCAC_ADDR(phys_to_virt(map->x.phys)); \ | ||
95 | } while (false); | ||
96 | |||
97 | #include <asm/mach-powertv/asic_reg_map.h> | ||
98 | #undef REGISTER_MAP_ELEMENT | ||
99 | } | ||
127 | 100 | ||
128 | extern enum asic_type asic; | 101 | extern struct register_map _asic_register_map; |
129 | extern const struct register_map *register_map; | ||
130 | extern unsigned long asic_phy_base; /* Physical address of ASIC */ | ||
131 | extern unsigned long asic_base; /* Virtual address of ASIC */ | ||
132 | 102 | ||
133 | /* | 103 | /* |
134 | * Macros to interface to registers through their ioremapped address | 104 | * Macros to interface to registers through their ioremapped address |
135 | * asic_reg_offset Returns the offset of a given register from the start | ||
136 | * of the ASIC address space | ||
137 | * asic_reg_phys_addr Returns the physical address of the given register | 105 | * asic_reg_phys_addr Returns the physical address of the given register |
138 | * asic_reg_addr Returns the iomapped virtual address of the given | 106 | * asic_reg_addr Returns the iomapped virtual address of the given |
139 | * register. | 107 | * register. |
140 | */ | 108 | */ |
141 | #define asic_reg_offset(x) (register_map->x) | 109 | #define asic_reg_addr(x) (_asic_register_map.x.virt) |
142 | #define asic_reg_phys_addr(x) (asic_phy_base + asic_reg_offset(x)) | 110 | #define asic_reg_phys_addr(x) (virt_to_phys((void *) CAC_ADDR( \ |
143 | #define asic_reg_addr(x) \ | 111 | (unsigned long) asic_reg_addr(x)))) |
144 | ((unsigned int *) (asic_base + asic_reg_offset(x))) | ||
145 | 112 | ||
146 | /* | 113 | /* |
147 | * The asic_reg macro is gone. It should be replaced by either asic_read or | 114 | * The asic_reg macro is gone. It should be replaced by either asic_read or |
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index a581d60cbcc2..f4ab3139d737 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
@@ -406,6 +406,16 @@ | |||
406 | #define ST0_XX 0x80000000 /* MIPS IV naming */ | 406 | #define ST0_XX 0x80000000 /* MIPS IV naming */ |
407 | 407 | ||
408 | /* | 408 | /* |
409 | * Bitfields and bit numbers in the coprocessor 0 IntCtl register. (MIPSR2) | ||
410 | * | ||
411 | * Refer to your MIPS R4xx0 manual, chapter 5 for explanation. | ||
412 | */ | ||
413 | #define INTCTLB_IPPCI 26 | ||
414 | #define INTCTLF_IPPCI (_ULCAST_(7) << INTCTLB_IPPCI) | ||
415 | #define INTCTLB_IPTI 29 | ||
416 | #define INTCTLF_IPTI (_ULCAST_(7) << INTCTLB_IPTI) | ||
417 | |||
418 | /* | ||
409 | * Bitfields and bit numbers in the coprocessor 0 cause register. | 419 | * Bitfields and bit numbers in the coprocessor 0 cause register. |
410 | * | 420 | * |
411 | * Refer to your MIPS R4xx0 manual, chapter 5 for explanation. | 421 | * Refer to your MIPS R4xx0 manual, chapter 5 for explanation. |
@@ -434,6 +444,8 @@ | |||
434 | #define CAUSEF_IV (_ULCAST_(1) << 23) | 444 | #define CAUSEF_IV (_ULCAST_(1) << 23) |
435 | #define CAUSEB_CE 28 | 445 | #define CAUSEB_CE 28 |
436 | #define CAUSEF_CE (_ULCAST_(3) << 28) | 446 | #define CAUSEF_CE (_ULCAST_(3) << 28) |
447 | #define CAUSEB_TI 30 | ||
448 | #define CAUSEF_TI (_ULCAST_(1) << 30) | ||
437 | #define CAUSEB_BD 31 | 449 | #define CAUSEB_BD 31 |
438 | #define CAUSEF_BD (_ULCAST_(1) << 31) | 450 | #define CAUSEF_BD (_ULCAST_(1) << 31) |
439 | 451 | ||