diff options
Diffstat (limited to 'arch/powerpc/platforms/ps3/platform.h')
-rw-r--r-- | arch/powerpc/platforms/ps3/platform.h | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h index 23b111bea9d0..ca04f03305c7 100644 --- a/arch/powerpc/platforms/ps3/platform.h +++ b/arch/powerpc/platforms/ps3/platform.h | |||
@@ -22,6 +22,9 @@ | |||
22 | #define _PS3_PLATFORM_H | 22 | #define _PS3_PLATFORM_H |
23 | 23 | ||
24 | #include <linux/rtc.h> | 24 | #include <linux/rtc.h> |
25 | #include <scsi/scsi.h> | ||
26 | |||
27 | #include <asm/ps3.h> | ||
25 | 28 | ||
26 | /* htab */ | 29 | /* htab */ |
27 | 30 | ||
@@ -65,4 +68,152 @@ void ps3_spu_set_platform (void); | |||
65 | static inline void ps3_spu_set_platform (void) {} | 68 | static inline void ps3_spu_set_platform (void) {} |
66 | #endif | 69 | #endif |
67 | 70 | ||
71 | /* repository bus info */ | ||
72 | |||
73 | enum ps3_bus_type { | ||
74 | PS3_BUS_TYPE_SB = 4, | ||
75 | PS3_BUS_TYPE_STORAGE = 5, | ||
76 | }; | ||
77 | |||
78 | enum ps3_dev_type { | ||
79 | PS3_DEV_TYPE_STOR_DISK = TYPE_DISK, /* 0 */ | ||
80 | PS3_DEV_TYPE_SB_GELIC = 3, | ||
81 | PS3_DEV_TYPE_SB_USB = 4, | ||
82 | PS3_DEV_TYPE_STOR_ROM = TYPE_ROM, /* 5 */ | ||
83 | PS3_DEV_TYPE_SB_GPIO = 6, | ||
84 | PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC, /* 14 */ | ||
85 | }; | ||
86 | |||
87 | int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str, | ||
88 | u64 *value); | ||
89 | int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id); | ||
90 | int ps3_repository_read_bus_type(unsigned int bus_index, | ||
91 | enum ps3_bus_type *bus_type); | ||
92 | int ps3_repository_read_bus_num_dev(unsigned int bus_index, | ||
93 | unsigned int *num_dev); | ||
94 | |||
95 | /* repository bus device info */ | ||
96 | |||
97 | enum ps3_interrupt_type { | ||
98 | PS3_INTERRUPT_TYPE_EVENT_PORT = 2, | ||
99 | PS3_INTERRUPT_TYPE_SB_OHCI = 3, | ||
100 | PS3_INTERRUPT_TYPE_SB_EHCI = 4, | ||
101 | PS3_INTERRUPT_TYPE_OTHER = 5, | ||
102 | }; | ||
103 | |||
104 | enum ps3_reg_type { | ||
105 | PS3_REG_TYPE_SB_OHCI = 3, | ||
106 | PS3_REG_TYPE_SB_EHCI = 4, | ||
107 | PS3_REG_TYPE_SB_GPIO = 5, | ||
108 | }; | ||
109 | |||
110 | int ps3_repository_read_dev_str(unsigned int bus_index, | ||
111 | unsigned int dev_index, const char *dev_str, u64 *value); | ||
112 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, | ||
113 | unsigned int *dev_id); | ||
114 | int ps3_repository_read_dev_type(unsigned int bus_index, | ||
115 | unsigned int dev_index, enum ps3_dev_type *dev_type); | ||
116 | int ps3_repository_read_dev_intr(unsigned int bus_index, | ||
117 | unsigned int dev_index, unsigned int intr_index, | ||
118 | enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id); | ||
119 | int ps3_repository_read_dev_reg_type(unsigned int bus_index, | ||
120 | unsigned int dev_index, unsigned int reg_index, | ||
121 | enum ps3_reg_type *reg_type); | ||
122 | int ps3_repository_read_dev_reg_addr(unsigned int bus_index, | ||
123 | unsigned int dev_index, unsigned int reg_index, u64 *bus_addr, | ||
124 | u64 *len); | ||
125 | int ps3_repository_read_dev_reg(unsigned int bus_index, | ||
126 | unsigned int dev_index, unsigned int reg_index, | ||
127 | enum ps3_reg_type *reg_type, u64 *bus_addr, u64 *len); | ||
128 | |||
129 | /* repository bus enumerators */ | ||
130 | |||
131 | struct ps3_repository_device { | ||
132 | unsigned int bus_index; | ||
133 | unsigned int dev_index; | ||
134 | struct ps3_device_id did; | ||
135 | }; | ||
136 | |||
137 | int ps3_repository_find_device(enum ps3_bus_type bus_type, | ||
138 | enum ps3_dev_type dev_type, | ||
139 | const struct ps3_repository_device *start_dev, | ||
140 | struct ps3_repository_device *dev); | ||
141 | static inline int ps3_repository_find_first_device( | ||
142 | enum ps3_bus_type bus_type, enum ps3_dev_type dev_type, | ||
143 | struct ps3_repository_device *dev) | ||
144 | { | ||
145 | return ps3_repository_find_device(bus_type, dev_type, NULL, dev); | ||
146 | } | ||
147 | int ps3_repository_find_interrupt(const struct ps3_repository_device *dev, | ||
148 | enum ps3_interrupt_type intr_type, unsigned int *interrupt_id); | ||
149 | int ps3_repository_find_reg(const struct ps3_repository_device *dev, | ||
150 | enum ps3_reg_type reg_type, u64 *bus_addr, u64 *len); | ||
151 | |||
152 | /* repository block device info */ | ||
153 | |||
154 | int ps3_repository_read_stor_dev_port(unsigned int bus_index, | ||
155 | unsigned int dev_index, u64 *port); | ||
156 | int ps3_repository_read_stor_dev_blk_size(unsigned int bus_index, | ||
157 | unsigned int dev_index, u64 *blk_size); | ||
158 | int ps3_repository_read_stor_dev_num_blocks(unsigned int bus_index, | ||
159 | unsigned int dev_index, u64 *num_blocks); | ||
160 | int ps3_repository_read_stor_dev_num_regions(unsigned int bus_index, | ||
161 | unsigned int dev_index, unsigned int *num_regions); | ||
162 | int ps3_repository_read_stor_dev_region_id(unsigned int bus_index, | ||
163 | unsigned int dev_index, unsigned int region_index, | ||
164 | unsigned int *region_id); | ||
165 | int ps3_repository_read_stor_dev_region_size(unsigned int bus_index, | ||
166 | unsigned int dev_index, unsigned int region_index, u64 *region_size); | ||
167 | int ps3_repository_read_stor_dev_region_start(unsigned int bus_index, | ||
168 | unsigned int dev_index, unsigned int region_index, u64 *region_start); | ||
169 | int ps3_repository_read_stor_dev_info(unsigned int bus_index, | ||
170 | unsigned int dev_index, u64 *port, u64 *blk_size, | ||
171 | u64 *num_blocks, unsigned int *num_regions); | ||
172 | int ps3_repository_read_stor_dev_region(unsigned int bus_index, | ||
173 | unsigned int dev_index, unsigned int region_index, | ||
174 | unsigned int *region_id, u64 *region_start, u64 *region_size); | ||
175 | |||
176 | /* repository pu and memory info */ | ||
177 | |||
178 | int ps3_repository_read_num_pu(unsigned int *num_pu); | ||
179 | int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id); | ||
180 | int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base); | ||
181 | int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size); | ||
182 | int ps3_repository_read_region_total(u64 *region_total); | ||
183 | int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size, | ||
184 | u64 *region_total); | ||
185 | |||
186 | /* repository pme info */ | ||
187 | |||
188 | int ps3_repository_read_num_be(unsigned int *num_be); | ||
189 | int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id); | ||
190 | int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq); | ||
191 | int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq); | ||
192 | |||
193 | /* repository 'Other OS' area */ | ||
194 | |||
195 | int ps3_repository_read_boot_dat_addr(u64 *lpar_addr); | ||
196 | int ps3_repository_read_boot_dat_size(unsigned int *size); | ||
197 | int ps3_repository_read_boot_dat_info(u64 *lpar_addr, unsigned int *size); | ||
198 | |||
199 | /* repository spu info */ | ||
200 | |||
201 | /** | ||
202 | * enum spu_resource_type - Type of spu resource. | ||
203 | * @spu_resource_type_shared: Logical spu is shared with other partions. | ||
204 | * @spu_resource_type_exclusive: Logical spu is not shared with other partions. | ||
205 | * | ||
206 | * Returned by ps3_repository_read_spu_resource_id(). | ||
207 | */ | ||
208 | |||
209 | enum ps3_spu_resource_type { | ||
210 | PS3_SPU_RESOURCE_TYPE_SHARED = 0, | ||
211 | PS3_SPU_RESOURCE_TYPE_EXCLUSIVE = 0x8000000000000000UL, | ||
212 | }; | ||
213 | |||
214 | int ps3_repository_read_num_spu_reserved(unsigned int *num_spu_reserved); | ||
215 | int ps3_repository_read_num_spu_resource_id(unsigned int *num_resource_id); | ||
216 | int ps3_repository_read_spu_resource_id(unsigned int res_index, | ||
217 | enum ps3_spu_resource_type* resource_type, unsigned int *resource_id); | ||
218 | |||
68 | #endif | 219 | #endif |