diff options
author | Yinghai Lu <yinghai@kernel.org> | 2010-02-10 04:20:13 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-10 20:47:17 -0500 |
commit | e9a0064ad03b899938059bb576615ad9ed0f27f9 (patch) | |
tree | b1c7dd0c7844fb4b8f56bb991684ece56bcd6e1c /arch/x86/pci | |
parent | 284f933d45a1e60404328440910bc2651c0fb51d (diff) |
x86: Change range end to start+size
So make interface more consistent with early_res.
Later we can share some code with early_res.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <1265793639-15071-10-git-send-email-yinghai@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r-- | arch/x86/pci/amd_bus.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c index ea6072fcf3d4..fc1e8fe07e5c 100644 --- a/arch/x86/pci/amd_bus.c +++ b/arch/x86/pci/amd_bus.c | |||
@@ -145,7 +145,7 @@ static int __init early_fill_mp_bus_info(void) | |||
145 | def_link = (reg >> 8) & 0x03; | 145 | def_link = (reg >> 8) & 0x03; |
146 | 146 | ||
147 | memset(range, 0, sizeof(range)); | 147 | memset(range, 0, sizeof(range)); |
148 | range[0].end = 0xffff; | 148 | add_range(range, RANGE_NUM, 0, 0, 0xffff + 1); |
149 | /* io port resource */ | 149 | /* io port resource */ |
150 | for (i = 0; i < 4; i++) { | 150 | for (i = 0; i < 4; i++) { |
151 | reg = read_pci_config(bus, slot, 1, 0xc0 + (i << 3)); | 151 | reg = read_pci_config(bus, slot, 1, 0xc0 + (i << 3)); |
@@ -175,7 +175,7 @@ static int __init early_fill_mp_bus_info(void) | |||
175 | if (end > 0xffff) | 175 | if (end > 0xffff) |
176 | end = 0xffff; | 176 | end = 0xffff; |
177 | update_res(info, start, end, IORESOURCE_IO, 1); | 177 | update_res(info, start, end, IORESOURCE_IO, 1); |
178 | subtract_range(range, RANGE_NUM, start, end); | 178 | subtract_range(range, RANGE_NUM, start, end + 1); |
179 | } | 179 | } |
180 | /* add left over io port range to def node/link, [0, 0xffff] */ | 180 | /* add left over io port range to def node/link, [0, 0xffff] */ |
181 | /* find the position */ | 181 | /* find the position */ |
@@ -190,14 +190,16 @@ static int __init early_fill_mp_bus_info(void) | |||
190 | if (!range[i].end) | 190 | if (!range[i].end) |
191 | continue; | 191 | continue; |
192 | 192 | ||
193 | update_res(info, range[i].start, range[i].end, | 193 | update_res(info, range[i].start, range[i].end - 1, |
194 | IORESOURCE_IO, 1); | 194 | IORESOURCE_IO, 1); |
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
198 | memset(range, 0, sizeof(range)); | 198 | memset(range, 0, sizeof(range)); |
199 | /* 0xfd00000000-0xffffffffff for HT */ | 199 | /* 0xfd00000000-0xffffffffff for HT */ |
200 | range[0].end = cap_resource((0xfdULL<<32) - 1); | 200 | end = cap_resource((0xfdULL<<32) - 1); |
201 | end++; | ||
202 | add_range(range, RANGE_NUM, 0, 0, end); | ||
201 | 203 | ||
202 | /* need to take out [0, TOM) for RAM*/ | 204 | /* need to take out [0, TOM) for RAM*/ |
203 | address = MSR_K8_TOP_MEM1; | 205 | address = MSR_K8_TOP_MEM1; |
@@ -205,14 +207,15 @@ static int __init early_fill_mp_bus_info(void) | |||
205 | end = (val & 0xffffff800000ULL); | 207 | end = (val & 0xffffff800000ULL); |
206 | printk(KERN_INFO "TOM: %016llx aka %lldM\n", end, end>>20); | 208 | printk(KERN_INFO "TOM: %016llx aka %lldM\n", end, end>>20); |
207 | if (end < (1ULL<<32)) | 209 | if (end < (1ULL<<32)) |
208 | subtract_range(range, RANGE_NUM, 0, end - 1); | 210 | subtract_range(range, RANGE_NUM, 0, end); |
209 | 211 | ||
210 | /* get mmconfig */ | 212 | /* get mmconfig */ |
211 | get_pci_mmcfg_amd_fam10h_range(); | 213 | get_pci_mmcfg_amd_fam10h_range(); |
212 | /* need to take out mmconf range */ | 214 | /* need to take out mmconf range */ |
213 | if (fam10h_mmconf_end) { | 215 | if (fam10h_mmconf_end) { |
214 | printk(KERN_DEBUG "Fam 10h mmconf [%llx, %llx]\n", fam10h_mmconf_start, fam10h_mmconf_end); | 216 | printk(KERN_DEBUG "Fam 10h mmconf [%llx, %llx]\n", fam10h_mmconf_start, fam10h_mmconf_end); |
215 | subtract_range(range, RANGE_NUM, fam10h_mmconf_start, fam10h_mmconf_end); | 217 | subtract_range(range, RANGE_NUM, fam10h_mmconf_start, |
218 | fam10h_mmconf_end + 1); | ||
216 | } | 219 | } |
217 | 220 | ||
218 | /* mmio resource */ | 221 | /* mmio resource */ |
@@ -267,7 +270,8 @@ static int __init early_fill_mp_bus_info(void) | |||
267 | /* we got a hole */ | 270 | /* we got a hole */ |
268 | endx = fam10h_mmconf_start - 1; | 271 | endx = fam10h_mmconf_start - 1; |
269 | update_res(info, start, endx, IORESOURCE_MEM, 0); | 272 | update_res(info, start, endx, IORESOURCE_MEM, 0); |
270 | subtract_range(range, RANGE_NUM, start, endx); | 273 | subtract_range(range, RANGE_NUM, start, |
274 | endx + 1); | ||
271 | printk(KERN_CONT " ==> [%llx, %llx]", start, endx); | 275 | printk(KERN_CONT " ==> [%llx, %llx]", start, endx); |
272 | start = fam10h_mmconf_end + 1; | 276 | start = fam10h_mmconf_end + 1; |
273 | changed = 1; | 277 | changed = 1; |
@@ -284,7 +288,7 @@ static int __init early_fill_mp_bus_info(void) | |||
284 | 288 | ||
285 | update_res(info, cap_resource(start), cap_resource(end), | 289 | update_res(info, cap_resource(start), cap_resource(end), |
286 | IORESOURCE_MEM, 1); | 290 | IORESOURCE_MEM, 1); |
287 | subtract_range(range, RANGE_NUM, start, end); | 291 | subtract_range(range, RANGE_NUM, start, end + 1); |
288 | printk(KERN_CONT "\n"); | 292 | printk(KERN_CONT "\n"); |
289 | } | 293 | } |
290 | 294 | ||
@@ -299,7 +303,7 @@ static int __init early_fill_mp_bus_info(void) | |||
299 | rdmsrl(address, val); | 303 | rdmsrl(address, val); |
300 | end = (val & 0xffffff800000ULL); | 304 | end = (val & 0xffffff800000ULL); |
301 | printk(KERN_INFO "TOM2: %016llx aka %lldM\n", end, end>>20); | 305 | printk(KERN_INFO "TOM2: %016llx aka %lldM\n", end, end>>20); |
302 | subtract_range(range, RANGE_NUM, 1ULL<<32, end - 1); | 306 | subtract_range(range, RANGE_NUM, 1ULL<<32, end); |
303 | } | 307 | } |
304 | 308 | ||
305 | /* | 309 | /* |
@@ -319,7 +323,7 @@ static int __init early_fill_mp_bus_info(void) | |||
319 | continue; | 323 | continue; |
320 | 324 | ||
321 | update_res(info, cap_resource(range[i].start), | 325 | update_res(info, cap_resource(range[i].start), |
322 | cap_resource(range[i].end), | 326 | cap_resource(range[i].end - 1), |
323 | IORESOURCE_MEM, 1); | 327 | IORESOURCE_MEM, 1); |
324 | } | 328 | } |
325 | } | 329 | } |