diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2006-11-22 18:46:55 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:40:49 -0500 |
commit | 6e74b38a7ffa6b69f287ae629aae91e725916e6f (patch) | |
tree | 94ea4dc3174ff27760a3ac83fe37a208b225e08f /include | |
parent | c6cec72b7ca05822688a952df97b1c24e69a0ef6 (diff) |
[POWERPC] ps3: add repository support
Adds support for the PS3 repository.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/ps3.h | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h index d0109ffac50e..eb4bbb6cff57 100644 --- a/include/asm-powerpc/ps3.h +++ b/include/asm-powerpc/ps3.h | |||
@@ -247,4 +247,143 @@ static inline const char* ps3_result(int result) | |||
247 | #endif | 247 | #endif |
248 | } | 248 | } |
249 | 249 | ||
250 | /* repository bus info */ | ||
251 | |||
252 | enum ps3_bus_type { | ||
253 | PS3_BUS_TYPE_SB = 4, | ||
254 | PS3_BUS_TYPE_STORAGE = 5, | ||
255 | }; | ||
256 | |||
257 | enum ps3_dev_type { | ||
258 | PS3_DEV_TYPE_SB_GELIC = 3, | ||
259 | PS3_DEV_TYPE_SB_USB = 4, | ||
260 | PS3_DEV_TYPE_SB_GPIO = 6, | ||
261 | }; | ||
262 | |||
263 | int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str, | ||
264 | u64 *value); | ||
265 | int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id); | ||
266 | int ps3_repository_read_bus_type(unsigned int bus_index, | ||
267 | enum ps3_bus_type *bus_type); | ||
268 | int ps3_repository_read_bus_num_dev(unsigned int bus_index, | ||
269 | unsigned int *num_dev); | ||
270 | |||
271 | /* repository bus device info */ | ||
272 | |||
273 | enum ps3_interrupt_type { | ||
274 | PS3_INTERRUPT_TYPE_EVENT_PORT = 2, | ||
275 | PS3_INTERRUPT_TYPE_SB_OHCI = 3, | ||
276 | PS3_INTERRUPT_TYPE_SB_EHCI = 4, | ||
277 | PS3_INTERRUPT_TYPE_OTHER = 5, | ||
278 | }; | ||
279 | |||
280 | enum ps3_region_type { | ||
281 | PS3_REGION_TYPE_SB_OHCI = 3, | ||
282 | PS3_REGION_TYPE_SB_EHCI = 4, | ||
283 | PS3_REGION_TYPE_SB_GPIO = 5, | ||
284 | }; | ||
285 | |||
286 | int ps3_repository_read_dev_str(unsigned int bus_index, | ||
287 | unsigned int dev_index, const char *dev_str, u64 *value); | ||
288 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, | ||
289 | unsigned int *dev_id); | ||
290 | int ps3_repository_read_dev_type(unsigned int bus_index, | ||
291 | unsigned int dev_index, enum ps3_dev_type *dev_type); | ||
292 | int ps3_repository_read_dev_intr(unsigned int bus_index, | ||
293 | unsigned int dev_index, unsigned int intr_index, | ||
294 | enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id); | ||
295 | int ps3_repository_read_dev_reg_type(unsigned int bus_index, | ||
296 | unsigned int dev_index, unsigned int reg_index, | ||
297 | enum ps3_region_type *reg_type); | ||
298 | int ps3_repository_read_dev_reg_addr(unsigned int bus_index, | ||
299 | unsigned int dev_index, unsigned int reg_index, u64 *bus_addr, | ||
300 | u64 *len); | ||
301 | int ps3_repository_read_dev_reg(unsigned int bus_index, | ||
302 | unsigned int dev_index, unsigned int reg_index, | ||
303 | enum ps3_region_type *reg_type, u64 *bus_addr, u64 *len); | ||
304 | |||
305 | /* repository bus enumerators */ | ||
306 | |||
307 | struct ps3_repository_device { | ||
308 | unsigned int bus_index; | ||
309 | unsigned int dev_index; | ||
310 | struct ps3_device_id did; | ||
311 | }; | ||
312 | |||
313 | int ps3_repository_find_device(enum ps3_bus_type bus_type, | ||
314 | enum ps3_dev_type dev_type, | ||
315 | const struct ps3_repository_device *start_dev, | ||
316 | struct ps3_repository_device *dev); | ||
317 | static inline int ps3_repository_find_first_device( | ||
318 | enum ps3_bus_type bus_type, enum ps3_dev_type dev_type, | ||
319 | struct ps3_repository_device *dev) | ||
320 | { | ||
321 | return ps3_repository_find_device(bus_type, dev_type, NULL, dev); | ||
322 | } | ||
323 | int ps3_repository_find_interrupt(const struct ps3_repository_device *dev, | ||
324 | enum ps3_interrupt_type intr_type, unsigned int *interrupt_id); | ||
325 | int ps3_repository_find_region(const struct ps3_repository_device *dev, | ||
326 | enum ps3_region_type reg_type, u64 *bus_addr, u64 *len); | ||
327 | |||
328 | /* repository block device info */ | ||
329 | |||
330 | int ps3_repository_read_dev_port(unsigned int bus_index, | ||
331 | unsigned int dev_index, u64 *port); | ||
332 | int ps3_repository_read_dev_blk_size(unsigned int bus_index, | ||
333 | unsigned int dev_index, u64 *blk_size); | ||
334 | int ps3_repository_read_dev_num_blocks(unsigned int bus_index, | ||
335 | unsigned int dev_index, u64 *num_blocks); | ||
336 | int ps3_repository_read_dev_num_regions(unsigned int bus_index, | ||
337 | unsigned int dev_index, unsigned int *num_regions); | ||
338 | int ps3_repository_read_dev_region_id(unsigned int bus_index, | ||
339 | unsigned int dev_index, unsigned int region_index, | ||
340 | unsigned int *region_id); | ||
341 | int ps3_repository_read_dev_region_size(unsigned int bus_index, | ||
342 | unsigned int dev_index, unsigned int region_index, u64 *region_size); | ||
343 | int ps3_repository_read_dev_region_start(unsigned int bus_index, | ||
344 | unsigned int dev_index, unsigned int region_index, u64 *region_start); | ||
345 | |||
346 | /* repository pu and memory info */ | ||
347 | |||
348 | int ps3_repository_read_num_pu(unsigned int *num_pu); | ||
349 | int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id); | ||
350 | int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base); | ||
351 | int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size); | ||
352 | int ps3_repository_read_region_total(u64 *region_total); | ||
353 | int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size, | ||
354 | u64 *region_total); | ||
355 | |||
356 | /* repository pme info */ | ||
357 | |||
358 | int ps3_repository_read_num_be(unsigned int *num_be); | ||
359 | int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id); | ||
360 | int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq); | ||
361 | int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq); | ||
362 | |||
363 | /* repository 'Other OS' area */ | ||
364 | |||
365 | int ps3_repository_read_boot_dat_addr(u64 *lpar_addr); | ||
366 | int ps3_repository_read_boot_dat_size(unsigned int *size); | ||
367 | int ps3_repository_read_boot_dat_info(u64 *lpar_addr, unsigned int *size); | ||
368 | |||
369 | /* repository spu info */ | ||
370 | |||
371 | /** | ||
372 | * enum spu_resource_type - Type of spu resource. | ||
373 | * @spu_resource_type_shared: Logical spu is shared with other partions. | ||
374 | * @spu_resource_type_exclusive: Logical spu is not shared with other partions. | ||
375 | * | ||
376 | * Returned by ps3_repository_read_spu_resource_id(). | ||
377 | */ | ||
378 | |||
379 | enum ps3_spu_resource_type { | ||
380 | PS3_SPU_RESOURCE_TYPE_SHARED = 0, | ||
381 | PS3_SPU_RESOURCE_TYPE_EXCLUSIVE = 0x8000000000000000UL, | ||
382 | }; | ||
383 | |||
384 | int ps3_repository_read_num_spu_reserved(unsigned int *num_spu_reserved); | ||
385 | int ps3_repository_read_num_spu_resource_id(unsigned int *num_resource_id); | ||
386 | int ps3_repository_read_spu_resource_id(unsigned int res_index, | ||
387 | enum ps3_spu_resource_type* resource_type, unsigned int *resource_id); | ||
388 | |||
250 | #endif | 389 | #endif |