diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2008-01-18 15:30:09 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-25 06:52:51 -0500 |
commit | 034e0ab54bfe57bc980452f991d3ab443f1b085a (patch) | |
tree | a58c442aafab2bd29eb00d58b23fc919b77e7e28 /arch | |
parent | cda563fb9ca2c26ff720110b25e96205b71d3bae (diff) |
[POWERPC] PS3: Make bus_id and dev_id u64
Change the PS3 bus_id and dev_id from type unsigned int to u64. These
IDs are 64-bit in the repository, and the special storage notification
device has a device ID of ULONG_MAX.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/ps3/device-init.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/mm.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/platform.h | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/repository.c | 21 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/system-bus.c | 14 |
5 files changed, 27 insertions, 32 deletions
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index fd063fe0c9b3..5642dc0d050e 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c | |||
@@ -297,7 +297,7 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo) | |||
297 | u64 dev_port; | 297 | u64 dev_port; |
298 | } *notify_event; | 298 | } *notify_event; |
299 | 299 | ||
300 | pr_debug(" -> %s:%u: (%u:%u:%u)\n", __func__, __LINE__, repo->bus_id, | 300 | pr_debug(" -> %s:%u: (%lu:%lu:%u)\n", __func__, __LINE__, repo->bus_id, |
301 | repo->dev_id, repo->dev_type); | 301 | repo->dev_id, repo->dev_type); |
302 | 302 | ||
303 | buf = kzalloc(512, GFP_KERNEL); | 303 | buf = kzalloc(512, GFP_KERNEL); |
@@ -384,7 +384,7 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo) | |||
384 | 384 | ||
385 | if (notify_event->dev_id == repo->dev_id && | 385 | if (notify_event->dev_id == repo->dev_id && |
386 | notify_event->dev_type == PS3_DEV_TYPE_NOACCESS) { | 386 | notify_event->dev_type == PS3_DEV_TYPE_NOACCESS) { |
387 | pr_debug("%s:%u: no access: dev_id %u\n", __func__, | 387 | pr_debug("%s:%u: no access: dev_id %lu\n", __func__, |
388 | __LINE__, repo->dev_id); | 388 | __LINE__, repo->dev_id); |
389 | break; | 389 | break; |
390 | } | 390 | } |
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c index 7bb3e1620974..6ce2fabd745c 100644 --- a/arch/powerpc/platforms/ps3/mm.c +++ b/arch/powerpc/platforms/ps3/mm.c | |||
@@ -359,7 +359,7 @@ static unsigned long dma_sb_lpar_to_bus(struct ps3_dma_region *r, | |||
359 | static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r, | 359 | static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r, |
360 | const char *func, int line) | 360 | const char *func, int line) |
361 | { | 361 | { |
362 | DBG("%s:%d: dev %u:%u\n", func, line, r->dev->bus_id, | 362 | DBG("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, |
363 | r->dev->dev_id); | 363 | r->dev->dev_id); |
364 | DBG("%s:%d: page_size %u\n", func, line, r->page_size); | 364 | DBG("%s:%d: page_size %u\n", func, line, r->page_size); |
365 | DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); | 365 | DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); |
@@ -394,7 +394,7 @@ struct dma_chunk { | |||
394 | static void _dma_dump_chunk (const struct dma_chunk* c, const char* func, | 394 | static void _dma_dump_chunk (const struct dma_chunk* c, const char* func, |
395 | int line) | 395 | int line) |
396 | { | 396 | { |
397 | DBG("%s:%d: r.dev %u:%u\n", func, line, | 397 | DBG("%s:%d: r.dev %lu:%lu\n", func, line, |
398 | c->region->dev->bus_id, c->region->dev->dev_id); | 398 | c->region->dev->bus_id, c->region->dev->dev_id); |
399 | DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr); | 399 | DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr); |
400 | DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size); | 400 | DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size); |
@@ -658,7 +658,7 @@ static int dma_sb_region_create(struct ps3_dma_region *r) | |||
658 | BUG_ON(!r); | 658 | BUG_ON(!r); |
659 | 659 | ||
660 | if (!r->dev->bus_id) { | 660 | if (!r->dev->bus_id) { |
661 | pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__, | 661 | pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, |
662 | r->dev->bus_id, r->dev->dev_id); | 662 | r->dev->bus_id, r->dev->dev_id); |
663 | return 0; | 663 | return 0; |
664 | } | 664 | } |
@@ -724,7 +724,7 @@ static int dma_sb_region_free(struct ps3_dma_region *r) | |||
724 | BUG_ON(!r); | 724 | BUG_ON(!r); |
725 | 725 | ||
726 | if (!r->dev->bus_id) { | 726 | if (!r->dev->bus_id) { |
727 | pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__, | 727 | pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__, |
728 | r->dev->bus_id, r->dev->dev_id); | 728 | r->dev->bus_id, r->dev->dev_id); |
729 | return 0; | 729 | return 0; |
730 | } | 730 | } |
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h index 01f0c9506e11..aa9dddf50172 100644 --- a/arch/powerpc/platforms/ps3/platform.h +++ b/arch/powerpc/platforms/ps3/platform.h | |||
@@ -95,7 +95,7 @@ enum ps3_dev_type { | |||
95 | 95 | ||
96 | int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str, | 96 | int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str, |
97 | u64 *value); | 97 | u64 *value); |
98 | int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id); | 98 | int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id); |
99 | int ps3_repository_read_bus_type(unsigned int bus_index, | 99 | int ps3_repository_read_bus_type(unsigned int bus_index, |
100 | enum ps3_bus_type *bus_type); | 100 | enum ps3_bus_type *bus_type); |
101 | int ps3_repository_read_bus_num_dev(unsigned int bus_index, | 101 | int ps3_repository_read_bus_num_dev(unsigned int bus_index, |
@@ -119,7 +119,7 @@ enum ps3_reg_type { | |||
119 | int ps3_repository_read_dev_str(unsigned int bus_index, | 119 | int ps3_repository_read_dev_str(unsigned int bus_index, |
120 | unsigned int dev_index, const char *dev_str, u64 *value); | 120 | unsigned int dev_index, const char *dev_str, u64 *value); |
121 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, | 121 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, |
122 | unsigned int *dev_id); | 122 | u64 *dev_id); |
123 | int ps3_repository_read_dev_type(unsigned int bus_index, | 123 | int ps3_repository_read_dev_type(unsigned int bus_index, |
124 | unsigned int dev_index, enum ps3_dev_type *dev_type); | 124 | unsigned int dev_index, enum ps3_dev_type *dev_type); |
125 | int ps3_repository_read_dev_intr(unsigned int bus_index, | 125 | int ps3_repository_read_dev_intr(unsigned int bus_index, |
@@ -138,12 +138,12 @@ int ps3_repository_read_dev_reg(unsigned int bus_index, | |||
138 | /* repository bus enumerators */ | 138 | /* repository bus enumerators */ |
139 | 139 | ||
140 | struct ps3_repository_device { | 140 | struct ps3_repository_device { |
141 | enum ps3_bus_type bus_type; | ||
142 | unsigned int bus_index; | 141 | unsigned int bus_index; |
143 | unsigned int bus_id; | ||
144 | enum ps3_dev_type dev_type; | ||
145 | unsigned int dev_index; | 142 | unsigned int dev_index; |
146 | unsigned int dev_id; | 143 | enum ps3_bus_type bus_type; |
144 | enum ps3_dev_type dev_type; | ||
145 | u64 bus_id; | ||
146 | u64 dev_id; | ||
147 | }; | 147 | }; |
148 | 148 | ||
149 | static inline struct ps3_repository_device *ps3_repository_bump_device( | 149 | static inline struct ps3_repository_device *ps3_repository_bump_device( |
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c index 1c94824f7b63..8baf0503d92b 100644 --- a/arch/powerpc/platforms/ps3/repository.c +++ b/arch/powerpc/platforms/ps3/repository.c | |||
@@ -168,18 +168,15 @@ int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str, | |||
168 | value, 0); | 168 | value, 0); |
169 | } | 169 | } |
170 | 170 | ||
171 | int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id) | 171 | int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id) |
172 | { | 172 | { |
173 | int result; | 173 | int result; |
174 | u64 v1; | ||
175 | u64 v2; /* unused */ | ||
176 | 174 | ||
177 | result = read_node(PS3_LPAR_ID_PME, | 175 | result = read_node(PS3_LPAR_ID_PME, |
178 | make_first_field("bus", bus_index), | 176 | make_first_field("bus", bus_index), |
179 | make_field("id", 0), | 177 | make_field("id", 0), |
180 | 0, 0, | 178 | 0, 0, |
181 | &v1, &v2); | 179 | bus_id, NULL); |
182 | *bus_id = v1; | ||
183 | return result; | 180 | return result; |
184 | } | 181 | } |
185 | 182 | ||
@@ -225,18 +222,16 @@ int ps3_repository_read_dev_str(unsigned int bus_index, | |||
225 | } | 222 | } |
226 | 223 | ||
227 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, | 224 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, |
228 | unsigned int *dev_id) | 225 | u64 *dev_id) |
229 | { | 226 | { |
230 | int result; | 227 | int result; |
231 | u64 v1; | ||
232 | 228 | ||
233 | result = read_node(PS3_LPAR_ID_PME, | 229 | result = read_node(PS3_LPAR_ID_PME, |
234 | make_first_field("bus", bus_index), | 230 | make_first_field("bus", bus_index), |
235 | make_field("dev", dev_index), | 231 | make_field("dev", dev_index), |
236 | make_field("id", 0), | 232 | make_field("id", 0), |
237 | 0, | 233 | 0, |
238 | &v1, 0); | 234 | dev_id, 0); |
239 | *dev_id = v1; | ||
240 | return result; | 235 | return result; |
241 | } | 236 | } |
242 | 237 | ||
@@ -332,7 +327,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo) | |||
332 | return result; | 327 | return result; |
333 | } | 328 | } |
334 | 329 | ||
335 | pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %u, num_dev %u\n", | 330 | pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n", |
336 | __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id, | 331 | __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id, |
337 | num_dev); | 332 | num_dev); |
338 | 333 | ||
@@ -387,7 +382,7 @@ int ps3_repository_find_device(struct ps3_repository_device *repo) | |||
387 | return result; | 382 | return result; |
388 | } | 383 | } |
389 | 384 | ||
390 | pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %u\n", | 385 | pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n", |
391 | __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id); | 386 | __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id); |
392 | 387 | ||
393 | *repo = tmp; | 388 | *repo = tmp; |
@@ -1034,7 +1029,7 @@ static int dump_device_info(struct ps3_repository_device *repo, | |||
1034 | continue; | 1029 | continue; |
1035 | } | 1030 | } |
1036 | 1031 | ||
1037 | pr_debug("%s:%d (%u:%u): dev_type %u, dev_id %u\n", __func__, | 1032 | pr_debug("%s:%d (%u:%u): dev_type %u, dev_id %lu\n", __func__, |
1038 | __LINE__, repo->bus_index, repo->dev_index, | 1033 | __LINE__, repo->bus_index, repo->dev_index, |
1039 | repo->dev_type, repo->dev_id); | 1034 | repo->dev_type, repo->dev_id); |
1040 | 1035 | ||
@@ -1091,7 +1086,7 @@ int ps3_repository_dump_bus_info(void) | |||
1091 | continue; | 1086 | continue; |
1092 | } | 1087 | } |
1093 | 1088 | ||
1094 | pr_debug("%s:%d bus_%u: bus_type %u, bus_id %u, num_dev %u\n", | 1089 | pr_debug("%s:%d bus_%u: bus_type %u, bus_id %lu, num_dev %u\n", |
1095 | __func__, __LINE__, repo.bus_index, repo.bus_type, | 1090 | __func__, __LINE__, repo.bus_index, repo.bus_type, |
1096 | repo.bus_id, num_dev); | 1091 | repo.bus_id, num_dev); |
1097 | 1092 | ||
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index 6405f4a36763..872d68892ab1 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -42,8 +42,8 @@ struct { | |||
42 | int gpu; | 42 | int gpu; |
43 | } static usage_hack; | 43 | } static usage_hack; |
44 | 44 | ||
45 | static int ps3_is_device(struct ps3_system_bus_device *dev, | 45 | static int ps3_is_device(struct ps3_system_bus_device *dev, u64 bus_id, |
46 | unsigned int bus_id, unsigned int dev_id) | 46 | u64 dev_id) |
47 | { | 47 | { |
48 | return dev->bus_id == bus_id && dev->dev_id == dev_id; | 48 | return dev->bus_id == bus_id && dev->dev_id == dev_id; |
49 | } | 49 | } |
@@ -182,8 +182,8 @@ int ps3_open_hv_device(struct ps3_system_bus_device *dev) | |||
182 | case PS3_MATCH_ID_SYSTEM_MANAGER: | 182 | case PS3_MATCH_ID_SYSTEM_MANAGER: |
183 | pr_debug("%s:%d: unsupported match_id: %u\n", __func__, | 183 | pr_debug("%s:%d: unsupported match_id: %u\n", __func__, |
184 | __LINE__, dev->match_id); | 184 | __LINE__, dev->match_id); |
185 | pr_debug("%s:%d: bus_id: %u\n", __func__, | 185 | pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, |
186 | __LINE__, dev->bus_id); | 186 | dev->bus_id); |
187 | BUG(); | 187 | BUG(); |
188 | return -EINVAL; | 188 | return -EINVAL; |
189 | 189 | ||
@@ -220,8 +220,8 @@ int ps3_close_hv_device(struct ps3_system_bus_device *dev) | |||
220 | case PS3_MATCH_ID_SYSTEM_MANAGER: | 220 | case PS3_MATCH_ID_SYSTEM_MANAGER: |
221 | pr_debug("%s:%d: unsupported match_id: %u\n", __func__, | 221 | pr_debug("%s:%d: unsupported match_id: %u\n", __func__, |
222 | __LINE__, dev->match_id); | 222 | __LINE__, dev->match_id); |
223 | pr_debug("%s:%d: bus_id: %u\n", __func__, | 223 | pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__, |
224 | __LINE__, dev->bus_id); | 224 | dev->bus_id); |
225 | BUG(); | 225 | BUG(); |
226 | return -EINVAL; | 226 | return -EINVAL; |
227 | 227 | ||
@@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device); | |||
240 | static void _dump_mmio_region(const struct ps3_mmio_region* r, | 240 | static void _dump_mmio_region(const struct ps3_mmio_region* r, |
241 | const char* func, int line) | 241 | const char* func, int line) |
242 | { | 242 | { |
243 | pr_debug("%s:%d: dev %u:%u\n", func, line, r->dev->bus_id, | 243 | pr_debug("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id, |
244 | r->dev->dev_id); | 244 | r->dev->dev_id); |
245 | pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); | 245 | pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr); |
246 | pr_debug("%s:%d: len %lxh\n", func, line, r->len); | 246 | pr_debug("%s:%d: len %lxh\n", func, line, r->len); |