ps3stor.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * PS3 Storage Devices
  4. *
  5. * Copyright (C) 2007 Sony Computer Entertainment Inc.
  6. * Copyright 2007 Sony Corp.
  7. */
  8. #ifndef _ASM_POWERPC_PS3STOR_H_
  9. #define _ASM_POWERPC_PS3STOR_H_
  10. #include <linux/interrupt.h>
  11. #include <asm/ps3.h>
  12. struct ps3_storage_region {
  13. unsigned int id;
  14. u64 start;
  15. u64 size;
  16. };
  17. struct ps3_storage_device {
  18. struct ps3_system_bus_device sbd;
  19. struct ps3_dma_region dma_region;
  20. unsigned int irq;
  21. u64 blk_size;
  22. u64 tag;
  23. u64 lv1_status;
  24. struct completion done;
  25. unsigned long bounce_size;
  26. void *bounce_buf;
  27. u64 bounce_lpar;
  28. dma_addr_t bounce_dma;
  29. unsigned int num_regions;
  30. unsigned long accessible_regions;
  31. unsigned int region_idx; /* first accessible region */
  32. struct ps3_storage_region regions[]; /* Must be last */
  33. };
  34. static inline struct ps3_storage_device *to_ps3_storage_device(struct device *dev)
  35. {
  36. return container_of(dev, struct ps3_storage_device, sbd.core);
  37. }
  38. extern int ps3stor_setup(struct ps3_storage_device *dev,
  39. irq_handler_t handler);
  40. extern void ps3stor_teardown(struct ps3_storage_device *dev);
  41. extern u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
  42. u64 start_sector, u64 sectors,
  43. int write);
  44. extern u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd,
  45. u64 arg1, u64 arg2, u64 arg3, u64 arg4);
  46. #endif /* _ASM_POWERPC_PS3STOR_H_ */