diff options
Diffstat (limited to 'arch/x86/kernel/summit_32.c')
-rw-r--r-- | arch/x86/kernel/summit_32.c | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/arch/x86/kernel/summit_32.c b/arch/x86/kernel/summit_32.c index 72f463401592..6878a9c2df5d 100644 --- a/arch/x86/kernel/summit_32.c +++ b/arch/x86/kernel/summit_32.c | |||
@@ -35,43 +35,47 @@ static struct rio_table_hdr *rio_table_hdr __initdata; | |||
35 | static struct scal_detail *scal_devs[MAX_NUMNODES] __initdata; | 35 | static struct scal_detail *scal_devs[MAX_NUMNODES] __initdata; |
36 | static struct rio_detail *rio_devs[MAX_NUMNODES*4] __initdata; | 36 | static struct rio_detail *rio_devs[MAX_NUMNODES*4] __initdata; |
37 | 37 | ||
38 | static int mp_bus_id_to_node[MAX_MP_BUSSES] __initdata; | ||
39 | |||
38 | static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus) | 40 | static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus) |
39 | { | 41 | { |
40 | int twister = 0, node = 0; | 42 | int twister = 0, node = 0; |
41 | int i, bus, num_buses; | 43 | int i, bus, num_buses; |
42 | 44 | ||
43 | for(i = 0; i < rio_table_hdr->num_rio_dev; i++){ | 45 | for (i = 0; i < rio_table_hdr->num_rio_dev; i++) { |
44 | if (rio_devs[i]->node_id == rio_devs[wpeg_num]->owner_id){ | 46 | if (rio_devs[i]->node_id == rio_devs[wpeg_num]->owner_id) { |
45 | twister = rio_devs[i]->owner_id; | 47 | twister = rio_devs[i]->owner_id; |
46 | break; | 48 | break; |
47 | } | 49 | } |
48 | } | 50 | } |
49 | if (i == rio_table_hdr->num_rio_dev){ | 51 | if (i == rio_table_hdr->num_rio_dev) { |
50 | printk(KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n", __FUNCTION__); | 52 | printk(KERN_ERR "%s: Couldn't find owner Cyclone for Winnipeg!\n", __func__); |
51 | return last_bus; | 53 | return last_bus; |
52 | } | 54 | } |
53 | 55 | ||
54 | for(i = 0; i < rio_table_hdr->num_scal_dev; i++){ | 56 | for (i = 0; i < rio_table_hdr->num_scal_dev; i++) { |
55 | if (scal_devs[i]->node_id == twister){ | 57 | if (scal_devs[i]->node_id == twister) { |
56 | node = scal_devs[i]->node_id; | 58 | node = scal_devs[i]->node_id; |
57 | break; | 59 | break; |
58 | } | 60 | } |
59 | } | 61 | } |
60 | if (i == rio_table_hdr->num_scal_dev){ | 62 | if (i == rio_table_hdr->num_scal_dev) { |
61 | printk(KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n", __FUNCTION__); | 63 | printk(KERN_ERR "%s: Couldn't find owner Twister for Cyclone!\n", __func__); |
62 | return last_bus; | 64 | return last_bus; |
63 | } | 65 | } |
64 | 66 | ||
65 | switch (rio_devs[wpeg_num]->type){ | 67 | switch (rio_devs[wpeg_num]->type) { |
66 | case CompatWPEG: | 68 | case CompatWPEG: |
67 | /* The Compatibility Winnipeg controls the 2 legacy buses, | 69 | /* |
70 | * The Compatibility Winnipeg controls the 2 legacy buses, | ||
68 | * the 66MHz PCI bus [2 slots] and the 2 "extra" buses in case | 71 | * the 66MHz PCI bus [2 slots] and the 2 "extra" buses in case |
69 | * a PCI-PCI bridge card is used in either slot: total 5 buses. | 72 | * a PCI-PCI bridge card is used in either slot: total 5 buses. |
70 | */ | 73 | */ |
71 | num_buses = 5; | 74 | num_buses = 5; |
72 | break; | 75 | break; |
73 | case AltWPEG: | 76 | case AltWPEG: |
74 | /* The Alternate Winnipeg controls the 2 133MHz buses [1 slot | 77 | /* |
78 | * The Alternate Winnipeg controls the 2 133MHz buses [1 slot | ||
75 | * each], their 2 "extra" buses, the 100MHz bus [2 slots] and | 79 | * each], their 2 "extra" buses, the 100MHz bus [2 slots] and |
76 | * the "extra" buses for each of those slots: total 7 buses. | 80 | * the "extra" buses for each of those slots: total 7 buses. |
77 | */ | 81 | */ |
@@ -79,17 +83,18 @@ static int __init setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus) | |||
79 | break; | 83 | break; |
80 | case LookOutAWPEG: | 84 | case LookOutAWPEG: |
81 | case LookOutBWPEG: | 85 | case LookOutBWPEG: |
82 | /* A Lookout Winnipeg controls 3 100MHz buses [2 slots each] | 86 | /* |
87 | * A Lookout Winnipeg controls 3 100MHz buses [2 slots each] | ||
83 | * & the "extra" buses for each of those slots: total 9 buses. | 88 | * & the "extra" buses for each of those slots: total 9 buses. |
84 | */ | 89 | */ |
85 | num_buses = 9; | 90 | num_buses = 9; |
86 | break; | 91 | break; |
87 | default: | 92 | default: |
88 | printk(KERN_INFO "%s: Unsupported Winnipeg type!\n", __FUNCTION__); | 93 | printk(KERN_INFO "%s: Unsupported Winnipeg type!\n", __func__); |
89 | return last_bus; | 94 | return last_bus; |
90 | } | 95 | } |
91 | 96 | ||
92 | for(bus = last_bus; bus < last_bus + num_buses; bus++) | 97 | for (bus = last_bus; bus < last_bus + num_buses; bus++) |
93 | mp_bus_id_to_node[bus] = node; | 98 | mp_bus_id_to_node[bus] = node; |
94 | return bus; | 99 | return bus; |
95 | } | 100 | } |
@@ -99,14 +104,14 @@ static int __init build_detail_arrays(void) | |||
99 | unsigned long ptr; | 104 | unsigned long ptr; |
100 | int i, scal_detail_size, rio_detail_size; | 105 | int i, scal_detail_size, rio_detail_size; |
101 | 106 | ||
102 | if (rio_table_hdr->num_scal_dev > MAX_NUMNODES){ | 107 | if (rio_table_hdr->num_scal_dev > MAX_NUMNODES) { |
103 | printk(KERN_WARNING "%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n", __FUNCTION__, MAX_NUMNODES, rio_table_hdr->num_scal_dev); | 108 | printk(KERN_WARNING "%s: MAX_NUMNODES too low! Defined as %d, but system has %d nodes.\n", __func__, MAX_NUMNODES, rio_table_hdr->num_scal_dev); |
104 | return 0; | 109 | return 0; |
105 | } | 110 | } |
106 | 111 | ||
107 | switch (rio_table_hdr->version){ | 112 | switch (rio_table_hdr->version) { |
108 | default: | 113 | default: |
109 | printk(KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n", __FUNCTION__, rio_table_hdr->version); | 114 | printk(KERN_WARNING "%s: Invalid Rio Grande Table Version: %d\n", __func__, rio_table_hdr->version); |
110 | return 0; | 115 | return 0; |
111 | case 2: | 116 | case 2: |
112 | scal_detail_size = 11; | 117 | scal_detail_size = 11; |
@@ -119,10 +124,10 @@ static int __init build_detail_arrays(void) | |||
119 | } | 124 | } |
120 | 125 | ||
121 | ptr = (unsigned long)rio_table_hdr + 3; | 126 | ptr = (unsigned long)rio_table_hdr + 3; |
122 | for(i = 0; i < rio_table_hdr->num_scal_dev; i++, ptr += scal_detail_size) | 127 | for (i = 0; i < rio_table_hdr->num_scal_dev; i++, ptr += scal_detail_size) |
123 | scal_devs[i] = (struct scal_detail *)ptr; | 128 | scal_devs[i] = (struct scal_detail *)ptr; |
124 | 129 | ||
125 | for(i = 0; i < rio_table_hdr->num_rio_dev; i++, ptr += rio_detail_size) | 130 | for (i = 0; i < rio_table_hdr->num_rio_dev; i++, ptr += rio_detail_size) |
126 | rio_devs[i] = (struct rio_detail *)ptr; | 131 | rio_devs[i] = (struct rio_detail *)ptr; |
127 | 132 | ||
128 | return 1; | 133 | return 1; |
@@ -140,9 +145,9 @@ void __init setup_summit(void) | |||
140 | 145 | ||
141 | rio_table_hdr = NULL; | 146 | rio_table_hdr = NULL; |
142 | offset = 0x180; | 147 | offset = 0x180; |
143 | while (offset){ | 148 | while (offset) { |
144 | /* The block id is stored in the 2nd word */ | 149 | /* The block id is stored in the 2nd word */ |
145 | if (*((unsigned short *)(ptr + offset + 2)) == 0x4752){ | 150 | if (*((unsigned short *)(ptr + offset + 2)) == 0x4752) { |
146 | /* set the pointer past the offset & block id */ | 151 | /* set the pointer past the offset & block id */ |
147 | rio_table_hdr = (struct rio_table_hdr *)(ptr + offset + 4); | 152 | rio_table_hdr = (struct rio_table_hdr *)(ptr + offset + 4); |
148 | break; | 153 | break; |
@@ -150,8 +155,8 @@ void __init setup_summit(void) | |||
150 | /* The next offset is stored in the 1st word. 0 means no more */ | 155 | /* The next offset is stored in the 1st word. 0 means no more */ |
151 | offset = *((unsigned short *)(ptr + offset)); | 156 | offset = *((unsigned short *)(ptr + offset)); |
152 | } | 157 | } |
153 | if (!rio_table_hdr){ | 158 | if (!rio_table_hdr) { |
154 | printk(KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __FUNCTION__); | 159 | printk(KERN_ERR "%s: Unable to locate Rio Grande Table in EBDA - bailing!\n", __func__); |
155 | return; | 160 | return; |
156 | } | 161 | } |
157 | 162 | ||
@@ -161,8 +166,8 @@ void __init setup_summit(void) | |||
161 | /* The first Winnipeg we're looking for has an index of 0 */ | 166 | /* The first Winnipeg we're looking for has an index of 0 */ |
162 | next_wpeg = 0; | 167 | next_wpeg = 0; |
163 | do { | 168 | do { |
164 | for(i = 0; i < rio_table_hdr->num_rio_dev; i++){ | 169 | for (i = 0; i < rio_table_hdr->num_rio_dev; i++) { |
165 | if (is_WPEG(rio_devs[i]) && rio_devs[i]->WP_index == next_wpeg){ | 170 | if (is_WPEG(rio_devs[i]) && rio_devs[i]->WP_index == next_wpeg) { |
166 | /* It's the Winnipeg we're looking for! */ | 171 | /* It's the Winnipeg we're looking for! */ |
167 | next_bus = setup_pci_node_map_for_wpeg(i, next_bus); | 172 | next_bus = setup_pci_node_map_for_wpeg(i, next_bus); |
168 | next_wpeg++; | 173 | next_wpeg++; |