Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * PS3 Storage Devices
0004  *
0005  * Copyright (C) 2007 Sony Computer Entertainment Inc.
0006  * Copyright 2007 Sony Corp.
0007  */
0008 
0009 #ifndef _ASM_POWERPC_PS3STOR_H_
0010 #define _ASM_POWERPC_PS3STOR_H_
0011 
0012 #include <linux/interrupt.h>
0013 
0014 #include <asm/ps3.h>
0015 
0016 
0017 struct ps3_storage_region {
0018     unsigned int id;
0019     u64 start;
0020     u64 size;
0021 };
0022 
0023 struct ps3_storage_device {
0024     struct ps3_system_bus_device sbd;
0025 
0026     struct ps3_dma_region dma_region;
0027     unsigned int irq;
0028     u64 blk_size;
0029 
0030     u64 tag;
0031     u64 lv1_status;
0032     struct completion done;
0033 
0034     unsigned long bounce_size;
0035     void *bounce_buf;
0036     u64 bounce_lpar;
0037     dma_addr_t bounce_dma;
0038 
0039     unsigned int num_regions;
0040     unsigned long accessible_regions;
0041     unsigned int region_idx;        /* first accessible region */
0042     struct ps3_storage_region regions[];    /* Must be last */
0043 };
0044 
0045 static inline struct ps3_storage_device *to_ps3_storage_device(struct device *dev)
0046 {
0047     return container_of(dev, struct ps3_storage_device, sbd.core);
0048 }
0049 
0050 extern int ps3stor_setup(struct ps3_storage_device *dev,
0051              irq_handler_t handler);
0052 extern void ps3stor_teardown(struct ps3_storage_device *dev);
0053 extern u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
0054                       u64 start_sector, u64 sectors,
0055                       int write);
0056 extern u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd,
0057                 u64 arg1, u64 arg2, u64 arg3, u64 arg4);
0058 
0059 #endif /* _ASM_POWERPC_PS3STOR_H_ */