[Cbe-oss-dev] Proposed changes to the linux source tree for compatibility with ps3:otheros++
Durandal Dokuchayev
durandal at gitbrew.org
Thu Jun 30 06:22:33 EST 2011
Hello, I am contacting all of you on behalf of gitbrew.org. we have made a
few changes to the kernel source in order to allow it to run on the new
PS3:otheros++ platform. I would like any input or criticism any of you have
to offer on these changes. Thank you all for your time and effort.
Attached is a patch containing our modifications.
Durandal
Gitbrew admin
diff --git a/arch/powerpc/include/asm/Kbuild
b/arch/powerpc/include/asm/Kbuild
index d51df17..b0da2ba 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -17,6 +17,13 @@ header-y += param.h
header-y += poll.h
header-y += posix_types.h
header-y += ps3fb.h
+header-y += ps3smproxy.h
+header-y += ps3dm.h
+header-y += ps3dmproxy.h
+header-y += ps3encdec.h
+header-y += ps3stormgr.h
+header-y += ps3ram.h
+header-y += ps3hvc.h
header-y += resource.h
header-y += seccomp.h
header-y += sembuf.h
diff --git a/arch/powerpc/include/asm/lv1call.h
b/arch/powerpc/include/asm/lv1call.h
index 81713ac..1c04e8f 100644
--- a/arch/powerpc/include/asm/lv1call.h
+++ b/arch/powerpc/include/asm/lv1call.h
@@ -52,6 +52,7 @@
#define LV1_5_IN_0_OUT_ARG_DECL LV1_5_IN_ARG_DECL
#define LV1_6_IN_0_OUT_ARG_DECL LV1_6_IN_ARG_DECL
#define LV1_7_IN_0_OUT_ARG_DECL LV1_7_IN_ARG_DECL
+#define LV1_8_IN_0_OUT_ARG_DECL LV1_8_IN_ARG_DECL
#define LV1_0_IN_1_OUT_ARG_DECL LV1_1_OUT_ARG_DECL
#define LV1_1_IN_1_OUT_ARG_DECL LV1_1_IN_ARG_DECL, LV1_1_OUT_ARG_DECL
@@ -142,6 +143,7 @@
#define LV1_5_IN_0_OUT_ARGS LV1_5_IN_ARGS
#define LV1_6_IN_0_OUT_ARGS LV1_6_IN_ARGS
#define LV1_7_IN_0_OUT_ARGS LV1_7_IN_ARGS
+#define LV1_8_IN_0_OUT_ARGS LV1_8_IN_ARGS
#define LV1_0_IN_1_OUT_ARGS LV1_1_OUT_ARGS
#define LV1_1_IN_1_OUT_ARGS LV1_1_IN_ARGS, LV1_1_OUT_ARGS
@@ -233,6 +235,7 @@ LV1_CALL(invalidate_htab_entries,
5, 0, 3 )
LV1_CALL(get_virtual_address_space_id_of_ppe, 1, 1, 4 )
LV1_CALL(query_logical_partition_address_region_info, 1, 5, 6 )
LV1_CALL(select_virtual_address_space, 1, 0, 7 )
+LV1_CALL(undocumented_function_8, 0, 1, 8 )
LV1_CALL(pause, 1, 0, 9 )
LV1_CALL(destruct_virtual_address_space, 1, 0, 10 )
LV1_CALL(configure_irq_state_bitmap, 3, 0, 11 )
@@ -252,6 +255,7 @@ LV1_CALL(shutdown_logical_partition,
1, 0, 44 )
LV1_CALL(destruct_logical_spe, 1, 0, 54 )
LV1_CALL(construct_logical_spe, 7, 6, 57 )
LV1_CALL(set_spe_interrupt_mask, 3, 0, 61 )
+LV1_CALL(undocumented_function_62, 5, 0, 62 )
LV1_CALL(set_spe_transition_notifier, 3, 0, 64 )
LV1_CALL(disable_logical_spe, 2, 0, 65 )
LV1_CALL(clear_spe_interrupt_status, 4, 0, 66 )
@@ -262,13 +266,19 @@ LV1_CALL(get_logical_partition_id,
0, 1, 74 )
LV1_CALL(configure_execution_time_variable, 1, 0, 77 )
LV1_CALL(get_spe_irq_outlet, 2, 1, 78 )
LV1_CALL(set_spe_privilege_state_area_1_register, 3, 0, 79 )
-LV1_CALL(create_repository_node, 6, 0, 90 )
+LV1_CALL(create_repository_node, 7, 0, 90 )
LV1_CALL(get_repository_node_value, 5, 2, 91 )
-LV1_CALL(modify_repository_node_value, 6, 0, 92 )
-LV1_CALL(remove_repository_node, 4, 0, 93 )
+LV1_CALL(modify_repository_node_value, 7, 0, 92 )
+LV1_CALL(remove_repository_node, 5, 0, 93 )
LV1_CALL(read_htab_entries, 2, 5, 95 )
LV1_CALL(set_dabr, 2, 0, 96 )
+LV1_CALL(undocumented_function_99, 2, 0, 99 )
+LV1_CALL(undocumented_function_102, 0, 1, 102 )
LV1_CALL(get_total_execution_time, 2, 1, 103 )
+LV1_CALL(undocumented_function_107, 6, 0, 107 )
+LV1_CALL(undocumented_function_109, 1, 0, 109 )
+LV1_CALL(undocumented_function_114, 3, 1, 114 )
+LV1_CALL(undocumented_function_115, 1, 0, 115 )
LV1_CALL(allocate_io_segment, 3, 1, 116 )
LV1_CALL(release_io_segment, 2, 0, 117 )
LV1_CALL(construct_io_irq_outlet, 1, 1, 120 )
@@ -276,12 +286,15 @@ LV1_CALL(destruct_io_irq_outlet,
1, 0, 121 )
LV1_CALL(map_htab, 1, 1, 122 )
LV1_CALL(unmap_htab, 1, 0, 123 )
LV1_CALL(get_version_info, 0, 1, 127 )
+LV1_CALL(undocumented_function_138, 2, 0, 138 )
LV1_CALL(insert_htab_entry, 6, 3, 158 )
LV1_CALL(read_virtual_uart, 3, 1, 162 )
LV1_CALL(write_virtual_uart, 3, 1, 163 )
LV1_CALL(set_virtual_uart_param, 3, 0, 164 )
LV1_CALL(get_virtual_uart_param, 2, 1, 165 )
LV1_CALL(configure_virtual_uart_irq, 1, 1, 166 )
+LV1_CALL(undocumented_function_167, 2, 1, 167 )
+LV1_CALL(undocumented_function_168, 3, 0, 168 )
LV1_CALL(open_device, 3, 0, 170 )
LV1_CALL(close_device, 2, 0, 171 )
LV1_CALL(map_device_mmio_region, 5, 1, 172 )
@@ -290,6 +303,8 @@ LV1_CALL(allocate_device_dma_region,
5, 1, 174 )
LV1_CALL(free_device_dma_region, 3, 0, 175 )
LV1_CALL(map_device_dma_region, 6, 0, 176 )
LV1_CALL(unmap_device_dma_region, 4, 0, 177 )
+LV1_CALL(undocumented_function_182, 1, 1, 182 )
+LV1_CALL(undocumented_function_183, 2, 0, 183 )
LV1_CALL(net_add_multicast_address, 4, 0, 185 )
LV1_CALL(net_remove_multicast_address, 4, 0, 186 )
LV1_CALL(net_start_tx_dma, 4, 0, 187 )
@@ -299,11 +314,15 @@ LV1_CALL(net_stop_rx_dma,
3, 0, 190 )
LV1_CALL(net_set_interrupt_status_indicator, 4, 0, 191 )
LV1_CALL(net_set_interrupt_mask, 4, 0, 193 )
LV1_CALL(net_control, 6, 2, 194 )
+LV1_CALL(undocumented_function_195, 3, 0, 195 )
+LV1_CALL(undocumented_function_196, 3, 0, 196 )
LV1_CALL(connect_interrupt_event_receive_port, 4, 0, 197 )
LV1_CALL(disconnect_interrupt_event_receive_port, 4, 0, 198 )
LV1_CALL(get_spe_all_interrupt_statuses, 1, 1, 199 )
+LV1_CALL(undocumented_function_200, 1, 0, 200 )
LV1_CALL(deconfigure_virtual_uart_irq, 0, 0, 202 )
LV1_CALL(enable_logical_spe, 2, 0, 207 )
+LV1_CALL(undocumented_function_209, 8, 0, 209 )
LV1_CALL(gpu_open, 1, 0, 210 )
LV1_CALL(gpu_close, 0, 0, 211 )
LV1_CALL(gpu_device_map, 1, 2, 212 )
@@ -316,6 +335,7 @@ LV1_CALL(gpu_context_iomap,
5, 0, 221 )
LV1_CALL(gpu_context_attribute, 6, 0, 225 )
LV1_CALL(gpu_context_intr, 1, 1, 227 )
LV1_CALL(gpu_attribute, 5, 0, 228 )
+LV1_CALL(undocumented_function_231, 1, 0, 231 )
LV1_CALL(get_rtc, 0, 2, 232 )
LV1_CALL(set_ppe_periodic_tracer_frequency, 1, 0, 240 )
LV1_CALL(start_ppe_periodic_tracer, 5, 0, 241 )
@@ -324,6 +344,10 @@ LV1_CALL(storage_read,
6, 1, 245 )
LV1_CALL(storage_write, 6, 1, 246 )
LV1_CALL(storage_send_device_command, 6, 1, 248 )
LV1_CALL(storage_get_async_status, 1, 2, 249 )
+LV1_CALL(undocumented_function_250, 5, 2, 250 )
+LV1_CALL(undocumented_function_251, 2, 1, 251 )
+LV1_CALL(undocumented_function_252, 4, 1, 252 )
+LV1_CALL(undocumented_function_253, 3, 2, 253 )
LV1_CALL(storage_check_async_status, 2, 1, 254 )
LV1_CALL(panic, 1, 0, 255 )
LV1_CALL(construct_lpm, 6, 3, 140 )
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index 7f065e1..57a68d7 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -326,6 +326,9 @@ enum ps3_match_id {
PS3_MATCH_ID_SOUND = 9,
PS3_MATCH_ID_GPU = 10,
PS3_MATCH_ID_LPM = 11,
+ PS3_MATCH_ID_STOR_VFLASH = 12,
+ PS3_MATCH_ID_DISPATCHER_MANAGER = 13,
+ PS3_MATCH_ID_STOR_ENCDEC = 14,
};
enum ps3_match_sub_id {
@@ -333,18 +336,21 @@ enum ps3_match_sub_id {
PS3_MATCH_SUB_ID_GPU_RAMDISK = 2,
};
-#define PS3_MODULE_ALIAS_EHCI "ps3:1:0"
-#define PS3_MODULE_ALIAS_OHCI "ps3:2:0"
-#define PS3_MODULE_ALIAS_GELIC "ps3:3:0"
-#define PS3_MODULE_ALIAS_AV_SETTINGS "ps3:4:0"
-#define PS3_MODULE_ALIAS_SYSTEM_MANAGER "ps3:5:0"
-#define PS3_MODULE_ALIAS_STOR_DISK "ps3:6:0"
-#define PS3_MODULE_ALIAS_STOR_ROM "ps3:7:0"
-#define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8:0"
-#define PS3_MODULE_ALIAS_SOUND "ps3:9:0"
-#define PS3_MODULE_ALIAS_GPU_FB "ps3:10:1"
-#define PS3_MODULE_ALIAS_GPU_RAMDISK "ps3:10:2"
-#define PS3_MODULE_ALIAS_LPM "ps3:11:0"
+#define PS3_MODULE_ALIAS_EHCI "ps3:1:0"
+#define PS3_MODULE_ALIAS_OHCI "ps3:2:0"
+#define PS3_MODULE_ALIAS_GELIC "ps3:3:0"
+#define PS3_MODULE_ALIAS_AV_SETTINGS "ps3:4:0"
+#define PS3_MODULE_ALIAS_SYSTEM_MANAGER "ps3:5:0"
+#define PS3_MODULE_ALIAS_STOR_DISK "ps3:6:0"
+#define PS3_MODULE_ALIAS_STOR_ROM "ps3:7:0"
+#define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8:0"
+#define PS3_MODULE_ALIAS_SOUND "ps3:9:0"
+#define PS3_MODULE_ALIAS_GPU_FB "ps3:10:1"
+#define PS3_MODULE_ALIAS_GPU_RAMDISK "ps3:10:2"
+#define PS3_MODULE_ALIAS_LPM "ps3:11:0"
+#define PS3_MODULE_ALIAS_STOR_VFLASH "ps3:12:0"
+#define PS3_MODULE_ALIAS_DISPATCHER_MANAGER "ps3:13:0"
+#define PS3_MODULE_ALIAS_STOR_ENCDEC "ps3:14:0"
enum ps3_system_bus_device_type {
PS3_DEVICE_TYPE_IOC0 = 1,
@@ -446,12 +452,17 @@ struct ps3_sys_manager_ops {
struct ps3_system_bus_device *dev;
void (*power_off)(struct ps3_system_bus_device *dev);
void (*restart)(struct ps3_system_bus_device *dev);
+ int (*do_request)(struct ps3_system_bus_device *dev,
+ const void *sendbuf, unsigned int sendbuf_size,
+ void *recvbuf, unsigned int recvbuf_size);
};
void ps3_sys_manager_register_ops(const struct ps3_sys_manager_ops *ops);
void __noreturn ps3_sys_manager_power_off(void);
void __noreturn ps3_sys_manager_restart(void);
void __noreturn ps3_sys_manager_halt(void);
+int ps3_sys_manager_do_request(const void *sendbuf, unsigned int
sendbuf_size,
+ void *recvbuf, unsigned int recvbuf_size);
int ps3_sys_manager_get_wol(void);
void ps3_sys_manager_set_wol(int state);
diff --git a/arch/powerpc/include/asm/ps3dm.h
b/arch/powerpc/include/asm/ps3dm.h
new file mode 100644
index 0000000..1c6cc50
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3dm.h
@@ -0,0 +1,38 @@
+
+/*
+ * PS3 DM backend support.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
+ */
+
+#ifndef _ASM_POWERPC_PS3DM_H_
+#define _ASM_POWERPC_PS3DM_H_
+
+struct ps3dm_hdr {
+ u32 request_id;
+ u32 function_id;
+ u32 request_size;
+ u32 response_size;
+};
+
+#define PS3DM_HDR_SIZE sizeof(struct ps3dm_hdr)
+
+extern int ps3dm_write(const void *buf, unsigned int size);
+
+extern int ps3dm_read(void *buf, unsigned int size);
+
+extern int ps3dm_do_request(struct ps3dm_hdr *sendbuf, unsigned int
sendbuf_size,
+ struct ps3dm_hdr *recvbuf, unsigned int recvbuf_size);
+
+#endif /* _ASM_POWERPC_PS3DM_H_ */
diff --git a/arch/powerpc/include/asm/ps3dmproxy.h
b/arch/powerpc/include/asm/ps3dmproxy.h
new file mode 100644
index 0000000..e4053df
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3dmproxy.h
@@ -0,0 +1,45 @@
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _ASM_POWERPC_PS3DMPROXY_H_
+#define _ASM_POWERPC_PS3DMPROXY_H_
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define PS3DMPROXY_IOCTL_USER_TO_LPAR_ADDR _IOWR('d', 0, int) /* user
to lpar address */
+#define PS3DMPROXY_IOCTL_GET_REPO_NODE_VAL _IOWR('d', 1, int) /* get
repository node value */
+#define PS3DMPROXY_IOCTL_DO_REQUEST _IOWR('d', 2, int) /* send a
request and receive a response */
+
+struct ps3dmproxy_ioctl_user_to_lpar_addr {
+ __u64 user_addr;
+ __u64 lpar_addr;
+};
+
+struct ps3dmproxy_ioctl_get_repo_node_val {
+ __u64 lpar_id;
+ __u64 key[4];
+ __u64 val[2];
+};
+
+struct ps3dmproxy_ioctl_do_request {
+ __u64 sendbuf;
+ __u64 sendbuf_size;
+ __u64 recvbuf;
+ __u64 recvbuf_size;
+};
+
+#endif /* _ASM_POWERPC_PS3DMPROXY_H_ */
diff --git a/arch/powerpc/include/asm/ps3encdec.h
b/arch/powerpc/include/asm/ps3encdec.h
new file mode 100644
index 0000000..27f1628
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3encdec.h
@@ -0,0 +1,33 @@
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _ASM_POWERPC_PS3ENCDEC_H_
+#define _ASM_POWERPC_PS3ENCDEC_H_
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define PS3ENCDEC_IOCTL_DO_REQUEST _IOWR('e', 0, int) /* send a
request and receive a response */
+
+struct ps3encdec_ioctl_do_request {
+ __u64 cmd;
+ __u64 cmdbuf;
+ __u64 cmdbuf_size;
+ __u64 respbuf;
+ __u64 respbuf_size;
+};
+
+#endif /* _ASM_POWERPC_PS3ENCDEC_H_ */
diff --git a/arch/powerpc/include/asm/ps3hvc.h
b/arch/powerpc/include/asm/ps3hvc.h
new file mode 100644
index 0000000..55989ea
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3hvc.h
@@ -0,0 +1,54 @@
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _ASM_POWERPC_PS3HVC_H_
+#define _ASM_POWERPC_PS3HVC_H_
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_8 8
+#define PS3HVC_HVCALL_CONNECT_IRQ_PLUG_EXT 12
+#define PS3HVC_HVCALL_DISCONNECT_IRQ_PLUG_EXT 17
+#define PS3HVC_HVCALL_CONSTRUCT_EVENT_RECEIVE_PORT 18
+#define PS3HVC_HVCALL_DESTRUCT_EVENT_RECEIVE_PORT 19
+#define PS3HVC_HVCALL_GET_LPAR_ID 74
+#define PS3HVC_HVCALL_CREATE_REPO_NODE 90
+#define PS3HVC_HVCALL_GET_REPO_NODE_VAL 91
+#define PS3HVC_HVCALL_MODIFY_REPO_NODE_VAL 92
+#define PS3HVC_HVCALL_RM_REPO_NODE 93
+#define PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_102 102
+#define PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_107 107
+#define PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_109 109
+#define PS3HVC_HVCALL_GET_VERSION_INFO 127
+#define PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_182 182
+#define PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_183 183
+#define PS3HVC_HVCALL_NET_CONTROL 194
+#define PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_231 231
+#define PS3HVC_HVCALL_GET_RTC 232
+#define PS3HVC_HVCALL_PANIC 255
+
+#define PS3HVC_IOCTL_HVCALL _IOWR('h',
0, int) /* hvcall */
+
+struct ps3hvc_ioctl_hvcall {
+ __u64 number;
+ __s64 result;
+ __u64 in_args;
+ __u64 out_args;
+ __u64 args[0];
+};
+
+#endif /* _ASM_POWERPC_PS3HVC_H_ */
diff --git a/arch/powerpc/include/asm/ps3ram.h
b/arch/powerpc/include/asm/ps3ram.h
new file mode 100644
index 0000000..20bd434
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3ram.h
@@ -0,0 +1,30 @@
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _ASM_POWERPC_PS3RAM_H_
+#define _ASM_POWERPC_PS3RAM_H_
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define PS3RAM_IOCTL_USER_TO_LPAR_ADDR _IOWR('r', 0, int) /* user
to lpar address */
+
+struct ps3ram_ioctl_user_to_lpar_addr {
+ __u64 user_addr;
+ __u64 lpar_addr;
+};
+
+#endif /* _ASM_POWERPC_PS3RAM_H_ */
diff --git a/arch/powerpc/include/asm/ps3smproxy.h
b/arch/powerpc/include/asm/ps3smproxy.h
new file mode 100644
index 0000000..fb84726
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3smproxy.h
@@ -0,0 +1,32 @@
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _ASM_POWERPC_PS3SMPROXY_H_
+#define _ASM_POWERPC_PS3SMPROXY_H_
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define PS3SMPROXY_IOCTL_DO_REQUEST _IOWR('s', 0, int) /* send a
request and receive a response */
+
+struct ps3smproxy_ioctl_do_request {
+ __u64 sendbuf;
+ __u64 sendbuf_size;
+ __u64 recvbuf;
+ __u64 recvbuf_size;
+};
+
+#endif /* _ASM_POWERPC_PS3SMPROXY_H_ */
diff --git a/arch/powerpc/include/asm/ps3stor.h
b/arch/powerpc/include/asm/ps3stor.h
index 6fcaf71..eb57c10 100644
--- a/arch/powerpc/include/asm/ps3stor.h
+++ b/arch/powerpc/include/asm/ps3stor.h
@@ -30,6 +30,7 @@ struct ps3_storage_region {
unsigned int id;
u64 start;
u64 size;
+ u64 flags;
};
struct ps3_storage_device {
@@ -50,7 +51,6 @@ struct ps3_storage_device {
unsigned int num_regions;
unsigned long accessible_regions;
- unsigned int region_idx; /* first accessible region
*/
struct ps3_storage_region regions[0]; /* Must be last */
};
@@ -62,8 +62,8 @@ static inline struct ps3_storage_device
*to_ps3_storage_device(struct device *de
extern int ps3stor_setup(struct ps3_storage_device *dev,
irq_handler_t handler);
extern void ps3stor_teardown(struct ps3_storage_device *dev);
-extern u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64
lpar,
- u64 start_sector, u64 sectors,
+extern u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64
lpar, unsigned int region_idx,
+ u64 start_sector, u64 sectors, u64
flags,
int write);
extern u64 ps3stor_send_command(struct ps3_storage_device *dev, u64 cmd,
u64 arg1, u64 arg2, u64 arg3, u64 arg4);
diff --git a/arch/powerpc/include/asm/ps3stormgr.h
b/arch/powerpc/include/asm/ps3stormgr.h
new file mode 100644
index 0000000..39b215e
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3stormgr.h
@@ -0,0 +1,56 @@
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _ASM_POWERPC_PS3STORMGR_H_
+#define _ASM_POWERPC_PS3STORMGR_H_
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+#define PS3STORMGR_IOCTL_CREATE_REGION _IOWR('s', 0, int) /* create
region */
+#define PS3STORMGR_IOCTL_DELETE_REGION _IOW('s', 1, int) /* delete
region */
+#define PS3STORMGR_IOCTL_SET_REGION_ACL _IOW('s', 2, int) /*
set region ACL */
+#define PS3STORMGR_IOCTL_GET_REGION_ACL _IOWR('s', 3, int)
/* get region ACL */
+
+struct ps3stormgr_ioctl_create_region {
+ __u64 dev_id;
+ __u64 start_sector;
+ __u64 sector_count;
+ __u64 laid;
+ __u64 region_id;
+};
+
+struct ps3stormgr_ioctl_delete_region {
+ __u64 dev_id;
+ __u64 region_id;
+};
+
+struct ps3stormgr_ioctl_set_region_acl {
+ __u64 dev_id;
+ __u64 region_id;
+ __u64 laid;
+ __u64 access_rights;
+};
+
+struct ps3stormgr_ioctl_get_region_acl {
+ __u64 dev_id;
+ __u64 region_id;
+ __u64 entry_index;
+ __u64 laid;
+ __u64 access_rights;
+};
+
+#endif /* _ASM_POWERPC_PS3STORMGR_H_ */
diff --git a/arch/powerpc/platforms/ps3/Kconfig
b/arch/powerpc/platforms/ps3/Kconfig
index dfe316b..4815ae1 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -88,6 +88,37 @@ config PS3_SYS_MANAGER
This support is required for system control. In
general, all users will say Y or M.
+config PS3_SMPROXY
+ depends on PPC_PS3
+ tristate "PS3 System Manager Proxy driver"
+ select PS3_SYS_MANAGER
+ help
+ Include support for the PS3 System Manager Proxy.
+
+ This support is required to access the PS3 system manager proxy.
+ In general, all users will say Y or M.
+
+config PS3_PS3DM
+ depends on PPC_PS3
+ tristate "PS3 Dispatcher Manager driver" if PS3_ADVANCED
+ select PS3_VUART
+ default y
+ help
+ Include support for the PS3 Dispatcher Manager.
+
+ This support is required to access the PS3 dispatcher manager. In
+ general, all users will say Y or M.
+
+config PS3_DMPROXY
+ depends on PPC_PS3
+ tristate "PS3 Dispatcher Manager Proxy driver"
+ select PS3_PS3DM
+ help
+ Include support for the PS3 Dispatcher Manager Proxy.
+
+ This support is required to access the PS3 dispatcher manager
proxy.
+ In general, all users will say Y or M.
+
config PS3_STORAGE
depends on PPC_PS3
tristate
@@ -148,4 +179,98 @@ config PS3_LPM
profiling support of the Cell processor with programs like
oprofile and perfmon2, then say Y or M, otherwise say N.
+config PS3_NFLASH
+ tristate "PS3 NFLASH Storage Driver"
+ depends on PPC_PS3 && BLOCK
+ select PS3_STORAGE
+ help
+ Include support for the PS3 NOR FLASH Storage.
+
+ This support is required to access the PS3 nor flash disk.
+ In general, all users will say Y or M.
+
+config PS3_VFLASH
+ tristate "PS3 VFLASH Storage Driver"
+ depends on PPC_PS3 && BLOCK && PS3_FLASH!=y && PS3_FLASH!=m
+ select PS3_STORAGE
+ help
+ Include support for the PS3 Virtual FLASH Storage.
+
+ This support is required to access the PS3 virtual flash disk.
+ In general, all users will say Y or M.
+
+config PS3_ENCDEC
+ tristate "PS3 ENCDEC Storage Driver"
+ depends on PPC_PS3
+ select PS3_STORAGE
+ help
+ Include support for the PS3 ENCDEC.
+
+ This support is required to access the PS3 ENCDEC device.
+ In general, all users will say Y or M.
+
+config PS3_STORMGR
+ tristate "PS3 Storage Manager Driver"
+ depends on PPC_PS3
+ select PS3_STORAGE
+ help
+ Include support for the PS3 Storage Manager.
+
+ This support is required to access the PS3 storage manager device.
+ In general, all users will say Y or M.
+
+config PS3_RAM
+ tristate "PS3 RAM Driver"
+ depends on PPC_PS3
+ help
+ Include support for the PS3 RAM.
+
+ This support is required to access the PS3 ram.
+ In general, all users will say Y or M.
+
+config PS3_SPEMMIO
+ tristate "PS3 SPE MMIO Driver"
+ depends on PPC_PS3
+ help
+ Include support for the PS3 SPE MMIO.
+
+ This support is required to access the PS3 SPE MMIO registers.
+ In general, all users will say Y or M.
+
+config PS3_SBMMIO
+ tristate "PS3 SB Bus MMIO Driver"
+ depends on PPC_PS3
+ help
+ Include support for the PS3 SB Bus MMIO.
+
+ This support is required to access the PS3 SB Bus MMIO registers.
+ In general, all users will say Y or M.
+
+config PS3_RSXMMIO
+ tristate "PS3 RSX MMIO Driver"
+ depends on PPC_PS3
+ help
+ Include support for the PS3 RSX MMIO.
+
+ This support is required to access the PS3 RSX MMIO registers.
+ In general, all users will say Y or M.
+
+config PS3_HVC
+ tristate "PS3 HVC Driver"
+ depends on PPC_PS3
+ help
+ Include support for the PS3 HVC.
+
+ This support is required to access the PS3 hvcalls.
+ In general, all users will say Y or M.
+
+config PS3_HTAB
+ tristate "PS3 HTAB Driver"
+ depends on PPC_PS3
+ help
+ Include support for the PS3 HTAB.
+
+ This support is required to access the PS3 htab.
+ In general, all users will say Y or M.
+
endmenu
diff --git a/arch/powerpc/platforms/ps3/device-init.c
b/arch/powerpc/platforms/ps3/device-init.c
index 6c4b583..18a9987 100644
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -32,6 +32,24 @@
#include "platform.h"
+
+static unsigned int ps3_stor_disk_region_flags[] =
+{
+ 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+};
+static unsigned int ps3_stor_rom_region_flags[] =
+{
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+};
+static unsigned int ps3_stor_vflash_region_flags[] =
+{
+ 0x6, 0x2, 0x4, 0x4, 0x4, 0x0, 0x2, 0x0,
+};
+static unsigned int ps3_stor_flash_region_flags[] =
+{
+ 0x2, 0x2, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0,
+};
+
static int __init ps3_register_lpm_devices(void)
{
int result;
@@ -401,6 +419,28 @@ static int ps3_setup_storage_dev(const struct
ps3_repository_device *repo,
p->regions[i].id = id;
p->regions[i].start = start;
p->regions[i].size = size;
+
+ switch (match_id)
+ {
+ case PS3_MATCH_ID_STOR_DISK:
+ p->regions[i].flags = ps3_stor_disk_region_flags[i];
+ break;
+
+ case PS3_MATCH_ID_STOR_ROM:
+ p->regions[i].flags = ps3_stor_rom_region_flags[i];
+ break;
+
+ case PS3_MATCH_ID_STOR_VFLASH:
+ p->regions[i].flags =
ps3_stor_vflash_region_flags[i];
+ break;
+
+ case PS3_MATCH_ID_STOR_FLASH:
+ p->regions[i].flags =
ps3_stor_flash_region_flags[i];
+ break;
+
+ default:
+ p->regions[i].flags = 0x0;
+ }
}
result = ps3_system_bus_device_register(&p->sbd);
@@ -444,6 +484,12 @@ static int __init ps3_register_vuart_devices(void)
port_number);
WARN_ON(result);
+ port_number = 10; /* dispmgr default */
+
+ result = ps3_setup_vuart_device(PS3_MATCH_ID_DISPATCHER_MANAGER,
+ port_number);
+ WARN_ON(result);
+
pr_debug(" <- %s:%d\n", __func__, __LINE__);
return result;
}
@@ -566,10 +612,10 @@ static int ps3_setup_dynamic_device(const struct
ps3_repository_device *repo)
case PS3_DEV_TYPE_STOR_DISK:
result = ps3_setup_storage_dev(repo,
PS3_MATCH_ID_STOR_DISK);
- /* Some devices are not accessible from the Other OS lpar.
*/
+ /* Some devices are not accessable from the Other OS lpar.
*/
if (result == -ENODEV) {
result = 0;
- pr_debug("%s:%u: not accessible\n", __func__,
+ pr_debug("%s:%u: not accessable\n", __func__,
__LINE__);
}
@@ -592,6 +638,20 @@ static int ps3_setup_dynamic_device(const struct
ps3_repository_device *repo)
__func__, __LINE__);
break;
+ case PS3_DEV_TYPE_STOR_VFLASH:
+ result = ps3_setup_storage_dev(repo,
PS3_MATCH_ID_STOR_VFLASH);
+ if (result)
+ pr_debug("%s:%u ps3_setup_storage_dev failed\n",
+ __func__, __LINE__);
+ break;
+
+ case PS3_DEV_TYPE_STOR_ENCDEC:
+ result = ps3_setup_storage_dev(repo,
PS3_MATCH_ID_STOR_ENCDEC);
+ if (result)
+ pr_debug("%s:%u ps3_setup_storage_dev failed\n",
+ __func__, __LINE__);
+ break;
+
default:
result = 0;
pr_debug("%s:%u: unsupported dev_type %u\n", __func__,
__LINE__,
diff --git a/arch/powerpc/platforms/ps3/hvcall.S
b/arch/powerpc/platforms/ps3/hvcall.S
index 54be652..3cc9245 100644
--- a/arch/powerpc/platforms/ps3/hvcall.S
+++ b/arch/powerpc/platforms/ps3/hvcall.S
@@ -45,6 +45,7 @@ _GLOBAL(_##API_NAME) \
#define LV1_5_IN_0_OUT LV1_N_IN_0_OUT
#define LV1_6_IN_0_OUT LV1_N_IN_0_OUT
#define LV1_7_IN_0_OUT LV1_N_IN_0_OUT
+#define LV1_8_IN_0_OUT LV1_N_IN_0_OUT
#define LV1_0_IN_1_OUT(API_NAME, API_NUMBER) \
_GLOBAL(_##API_NAME) \
diff --git a/arch/powerpc/platforms/ps3/platform.h
b/arch/powerpc/platforms/ps3/platform.h
index 9a196a8..d89d5a6 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -86,7 +86,9 @@ enum ps3_dev_type {
PS3_DEV_TYPE_SB_USB = 4,
PS3_DEV_TYPE_STOR_ROM = TYPE_ROM, /* 5 */
PS3_DEV_TYPE_SB_GPIO = 6,
- PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC, /* 14 */
+ PS3_DEV_TYPE_STOR_VFLASH = TYPE_RBC, /* 14 */
+ PS3_DEV_TYPE_STOR_FLASH = 254,
+ PS3_DEV_TYPE_STOR_ENCDEC = 255,
};
int ps3_repository_read_bus_str(unsigned int bus_index, const char
*bus_str,
diff --git a/arch/powerpc/platforms/ps3/system-bus.c
b/arch/powerpc/platforms/ps3/system-bus.c
index 23083c3..34db20a 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -174,6 +174,8 @@ int ps3_open_hv_device(struct ps3_system_bus_device
*dev)
case PS3_MATCH_ID_STOR_DISK:
case PS3_MATCH_ID_STOR_ROM:
case PS3_MATCH_ID_STOR_FLASH:
+ case PS3_MATCH_ID_STOR_VFLASH:
+ case PS3_MATCH_ID_STOR_ENCDEC:
return ps3_open_hv_device_sb(dev);
case PS3_MATCH_ID_SOUND:
@@ -182,6 +184,7 @@ int ps3_open_hv_device(struct ps3_system_bus_device
*dev)
case PS3_MATCH_ID_AV_SETTINGS:
case PS3_MATCH_ID_SYSTEM_MANAGER:
+ case PS3_MATCH_ID_DISPATCHER_MANAGER:
pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
__LINE__, dev->match_id);
pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
@@ -212,6 +215,8 @@ int ps3_close_hv_device(struct ps3_system_bus_device
*dev)
case PS3_MATCH_ID_STOR_DISK:
case PS3_MATCH_ID_STOR_ROM:
case PS3_MATCH_ID_STOR_FLASH:
+ case PS3_MATCH_ID_STOR_VFLASH:
+ case PS3_MATCH_ID_STOR_ENCDEC:
return ps3_close_hv_device_sb(dev);
case PS3_MATCH_ID_SOUND:
@@ -220,6 +225,7 @@ int ps3_close_hv_device(struct ps3_system_bus_device
*dev)
case PS3_MATCH_ID_AV_SETTINGS:
case PS3_MATCH_ID_SYSTEM_MANAGER:
+ case PS3_MATCH_ID_DISPATCHER_MANAGER:
pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
__LINE__, dev->match_id);
pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 40528ba..cd87d4f 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -11,6 +11,8 @@ obj-$(CONFIG_BLK_DEV_FD) += floppy.o
obj-$(CONFIG_AMIGA_FLOPPY) += amiflop.o
obj-$(CONFIG_PS3_DISK) += ps3disk.o
obj-$(CONFIG_PS3_VRAM) += ps3vram.o
+obj-$(CONFIG_PS3_NFLASH) += ps3nflash.o
+obj-$(CONFIG_PS3_VFLASH) += ps3vflash.o
obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o
obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
obj-$(CONFIG_BLK_DEV_RAM) += brd.o
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index 8e1ce2e..5bc4738 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -31,7 +31,6 @@
#define BOUNCE_SIZE (64*1024)
-#define PS3DISK_MAX_DISKS 16
#define PS3DISK_MINORS 16
@@ -41,11 +40,11 @@
struct ps3disk_private {
spinlock_t lock; /* Request queue spinlock */
struct request_queue *queue;
- struct gendisk *gendisk;
unsigned int blocking_factor;
struct request *req;
u64 raw_capacity;
unsigned char model[ATA_ID_PROD_LEN+1];
+ struct gendisk *gendisk[0];
};
@@ -125,7 +124,9 @@ static int ps3disk_submit_request_sg(struct
ps3_storage_device *dev,
int write = rq_data_dir(req), res;
const char *op = write ? "write" : "read";
u64 start_sector, sectors;
- unsigned int region_id = dev->regions[dev->region_idx].id;
+ unsigned int region_idx = MINOR(disk_devt(req->rq_disk)) /
PS3DISK_MINORS;
+ unsigned int region_id = dev->regions[region_idx].id;
+ unsigned int region_flags = dev->regions[region_idx].flags;
#ifdef DEBUG
unsigned int n = 0;
@@ -148,11 +149,11 @@ static int ps3disk_submit_request_sg(struct
ps3_storage_device *dev,
ps3disk_scatter_gather(dev, req, 1);
res = lv1_storage_write(dev->sbd.dev_id, region_id,
- start_sector, sectors, 0,
+ start_sector, sectors, region_flags,
dev->bounce_lpar, &dev->tag);
} else {
res = lv1_storage_read(dev->sbd.dev_id, region_id,
- start_sector, sectors, 0,
+ start_sector, sectors, region_flags,
dev->bounce_lpar, &dev->tag);
}
if (res) {
@@ -396,10 +397,6 @@ static int ps3disk_identify(struct ps3_storage_device
*dev)
return 0;
}
-static unsigned long ps3disk_mask;
-
-static DEFINE_MUTEX(ps3disk_mask_mutex);
-
static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
{
struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
@@ -416,19 +413,7 @@ static int __devinit ps3disk_probe(struct
ps3_system_bus_device *_dev)
return -EINVAL;
}
- BUILD_BUG_ON(PS3DISK_MAX_DISKS > BITS_PER_LONG);
- mutex_lock(&ps3disk_mask_mutex);
- devidx = find_first_zero_bit(&ps3disk_mask, PS3DISK_MAX_DISKS);
- if (devidx >= PS3DISK_MAX_DISKS) {
- dev_err(&dev->sbd.core, "%s:%u: Too many disks\n", __func__,
- __LINE__);
- mutex_unlock(&ps3disk_mask_mutex);
- return -ENOSPC;
- }
- __set_bit(devidx, &ps3disk_mask);
- mutex_unlock(&ps3disk_mask_mutex);
-
- priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+ priv = kzalloc(sizeof(*priv) + dev->num_regions * sizeof(gendisk),
GFP_KERNEL);
if (!priv) {
error = -ENOMEM;
goto fail;
@@ -473,33 +458,40 @@ static int __devinit ps3disk_probe(struct
ps3_system_bus_device *_dev)
blk_queue_max_segments(queue, -1);
blk_queue_max_segment_size(queue, dev->bounce_size);
- gendisk = alloc_disk(PS3DISK_MINORS);
- if (!gendisk) {
- dev_err(&dev->sbd.core, "%s:%u: alloc_disk failed\n",
__func__,
- __LINE__);
- error = -ENOMEM;
- goto fail_cleanup_queue;
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ gendisk = alloc_disk(PS3DISK_MINORS);
+ if (!gendisk) {
+ dev_err(&dev->sbd.core, "%s:%u: alloc_disk
failed\n", __func__,
+ __LINE__);
+ error = -ENOMEM;
+ goto fail_cleanup_queue;
+ }
+
+ priv->gendisk[devidx] = gendisk;
+ gendisk->major = ps3disk_major;
+ gendisk->first_minor = devidx * PS3DISK_MINORS;
+ gendisk->fops = &ps3disk_fops;
+ gendisk->queue = queue;
+ gendisk->private_data = dev;
+ gendisk->driverfs_dev = &dev->sbd.core;
+ snprintf(gendisk->disk_name, sizeof(gendisk->disk_name),
PS3DISK_NAME,
+ devidx+'a');
+ priv->blocking_factor = dev->blk_size >> 9;
+ set_capacity(gendisk,
+ dev->regions[devidx].size*priv->blocking_factor);
+
+ dev_info(&dev->sbd.core,
+ "%s is a %s (%llu MiB total, %lu MiB region)\n",
+ gendisk->disk_name, priv->model, priv->raw_capacity
>> 11,
+ get_capacity(gendisk) >> 11);
+
+ add_disk(gendisk);
}
- priv->gendisk = gendisk;
- gendisk->major = ps3disk_major;
- gendisk->first_minor = devidx * PS3DISK_MINORS;
- gendisk->fops = &ps3disk_fops;
- gendisk->queue = queue;
- gendisk->private_data = dev;
- gendisk->driverfs_dev = &dev->sbd.core;
- snprintf(gendisk->disk_name, sizeof(gendisk->disk_name),
PS3DISK_NAME,
- devidx+'a');
- priv->blocking_factor = dev->blk_size >> 9;
- set_capacity(gendisk,
-
dev->regions[dev->region_idx].size*priv->blocking_factor);
-
- dev_info(&dev->sbd.core,
- "%s is a %s (%llu MiB total, %lu MiB for OtherOS)\n",
- gendisk->disk_name, priv->model, priv->raw_capacity >> 11,
- get_capacity(gendisk) >> 11);
-
- add_disk(gendisk);
return 0;
fail_cleanup_queue:
@@ -512,9 +504,6 @@ fail_free_priv:
kfree(priv);
ps3_system_bus_set_drvdata(_dev, NULL);
fail:
- mutex_lock(&ps3disk_mask_mutex);
- __clear_bit(devidx, &ps3disk_mask);
- mutex_unlock(&ps3disk_mask_mutex);
return error;
}
@@ -522,14 +511,26 @@ static int ps3disk_remove(struct ps3_system_bus_device
*_dev)
{
struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
struct ps3disk_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+ unsigned int devidx;
+
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ del_gendisk(priv->gendisk[devidx]);
+ }
- mutex_lock(&ps3disk_mask_mutex);
- __clear_bit(MINOR(disk_devt(priv->gendisk)) / PS3DISK_MINORS,
- &ps3disk_mask);
- mutex_unlock(&ps3disk_mask_mutex);
- del_gendisk(priv->gendisk);
blk_cleanup_queue(priv->queue);
- put_disk(priv->gendisk);
+
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ put_disk(priv->gendisk[devidx]);
+ }
+
dev_notice(&dev->sbd.core, "Synchronizing disk cache\n");
ps3disk_sync_cache(dev);
ps3stor_teardown(dev);
diff --git a/drivers/block/ps3nflash.c b/drivers/block/ps3nflash.c
new file mode 100644
index 0000000..f2356fb
--- /dev/null
+++ b/drivers/block/ps3nflash.c
@@ -0,0 +1,412 @@
+/*
+ * PS3 NOR FLASH Storage Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/ata.h>
+#include <linux/blkdev.h>
+#include <linux/slab.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3stor.h>
+#include <asm/firmware.h>
+
+
+#define DEVICE_NAME "ps3nflash"
+
+#define BOUNCE_SIZE (64*1024)
+
+#define PS3NFLASH_MINORS 16
+
+
+#define PS3NFLASH_NAME "ps3nflash%c"
+
+
+struct ps3nflash_private {
+ spinlock_t lock; /* Request queue spinlock */
+ struct request_queue *queue;
+ unsigned int blocking_factor;
+ struct request *req;
+ u64 raw_capacity;
+ struct gendisk *gendisk[0];
+};
+
+
+static int ps3nflash_major;
+
+
+static const struct block_device_operations ps3nflash_fops = {
+ .owner = THIS_MODULE,
+};
+
+
+static void ps3nflash_scatter_gather(struct ps3_storage_device *dev,
+ struct request *req, int gather)
+{
+ unsigned int offset = 0;
+ struct req_iterator iter;
+ struct bio_vec *bvec;
+ unsigned int i = 0;
+ size_t size;
+ void *buf;
+
+ rq_for_each_segment(bvec, req, iter) {
+ unsigned long flags;
+ dev_dbg(&dev->sbd.core,
+ "%s:%u: bio %u: %u segs %u sectors from %lu\n",
+ __func__, __LINE__, i, bio_segments(iter.bio),
+ bio_sectors(iter.bio), iter.bio->bi_sector);
+
+ size = bvec->bv_len;
+ buf = bvec_kmap_irq(bvec, &flags);
+ if (gather)
+ memcpy(dev->bounce_buf+offset, buf, size);
+ else
+ memcpy(buf, dev->bounce_buf+offset, size);
+ offset += size;
+ flush_kernel_dcache_page(bvec->bv_page);
+ bvec_kunmap_irq(buf, &flags);
+ i++;
+ }
+}
+
+static int ps3nflash_submit_request_sg(struct ps3_storage_device *dev,
+ struct request *req)
+{
+ struct ps3nflash_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+ int write = rq_data_dir(req), res;
+ const char *op = write ? "write" : "read";
+ u64 start_sector, sectors;
+ unsigned int region_idx = MINOR(disk_devt(req->rq_disk)) /
PS3NFLASH_MINORS;
+ unsigned int region_id = dev->regions[region_idx].id;
+ unsigned int region_flags = dev->regions[region_idx].flags;
+
+#ifdef DEBUG
+ unsigned int n = 0;
+ struct bio_vec *bv;
+ struct req_iterator iter;
+
+ rq_for_each_segment(bv, req, iter)
+ n++;
+ dev_dbg(&dev->sbd.core,
+ "%s:%u: %s req has %u bvecs for %u sectors\n",
+ __func__, __LINE__, op, n, blk_rq_sectors(req));
+#endif
+
+ start_sector = blk_rq_pos(req) * priv->blocking_factor;
+ sectors = blk_rq_sectors(req) * priv->blocking_factor;
+ dev_dbg(&dev->sbd.core, "%s:%u: %s %llu sectors starting at %llu\n",
+ __func__, __LINE__, op, sectors, start_sector);
+
+ if (write) {
+ ps3nflash_scatter_gather(dev, req, 1);
+
+ res = lv1_storage_write(dev->sbd.dev_id, region_id,
+ start_sector, sectors, region_flags,
+ dev->bounce_lpar, &dev->tag);
+ } else {
+ res = lv1_storage_read(dev->sbd.dev_id, region_id,
+ start_sector, sectors, region_flags,
+ dev->bounce_lpar, &dev->tag);
+ }
+ if (res) {
+ dev_err(&dev->sbd.core, "%s:%u: %s failed %d\n", __func__,
+ __LINE__, op, res);
+ __blk_end_request_all(req, -EIO);
+ return 0;
+ }
+
+ priv->req = req;
+ return 1;
+}
+
+static void ps3nflash_do_request(struct ps3_storage_device *dev,
+ struct request_queue *q)
+{
+ struct request *req;
+
+ dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__);
+
+ while ((req = blk_fetch_request(q))) {
+ if (req->cmd_type == REQ_TYPE_FS) {
+ if (ps3nflash_submit_request_sg(dev, req))
+ break;
+ } else {
+ blk_dump_rq_flags(req, DEVICE_NAME " bad request");
+ __blk_end_request_all(req, -EIO);
+ continue;
+ }
+ }
+}
+
+static void ps3nflash_request(struct request_queue *q)
+{
+ struct ps3_storage_device *dev = q->queuedata;
+ struct ps3nflash_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+
+ if (priv->req) {
+ dev_dbg(&dev->sbd.core, "%s:%u busy\n", __func__, __LINE__);
+ return;
+ }
+
+ ps3nflash_do_request(dev, q);
+}
+
+static irqreturn_t ps3nflash_interrupt(int irq, void *data)
+{
+ struct ps3_storage_device *dev = data;
+ struct ps3nflash_private *priv;
+ struct request *req;
+ int res, read, error;
+ u64 tag, status;
+ const char *op;
+
+ res = lv1_storage_get_async_status(dev->sbd.dev_id, &tag, &status);
+
+ if (tag != dev->tag)
+ dev_err(&dev->sbd.core,
+ "%s:%u: tag mismatch, got %llx, expected %llx\n",
+ __func__, __LINE__, tag, dev->tag);
+
+ if (res) {
+ dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n",
+ __func__, __LINE__, res, status);
+ return IRQ_HANDLED;
+ }
+
+ priv = ps3_system_bus_get_drvdata(&dev->sbd);
+ req = priv->req;
+ if (!req) {
+ dev_dbg(&dev->sbd.core,
+ "%s:%u non-block layer request completed\n",
__func__,
+ __LINE__);
+ dev->lv1_status = status;
+ complete(&dev->done);
+ return IRQ_HANDLED;
+ }
+
+ read = !rq_data_dir(req);
+ op = read ? "read" : "write";
+
+ if (status) {
+ dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n",
__func__,
+ __LINE__, op, status);
+ error = -EIO;
+ } else {
+ dev_dbg(&dev->sbd.core, "%s:%u: %s completed\n", __func__,
+ __LINE__, op);
+ error = 0;
+ if (read)
+ ps3nflash_scatter_gather(dev, req, 0);
+ }
+
+ spin_lock(&priv->lock);
+ __blk_end_request_all(req, error);
+ priv->req = NULL;
+ ps3nflash_do_request(dev, priv->queue);
+ spin_unlock(&priv->lock);
+
+ return IRQ_HANDLED;
+}
+
+static int __devinit ps3nflash_probe(struct ps3_system_bus_device *_dev)
+{
+ struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
+ struct ps3nflash_private *priv;
+ int error;
+ unsigned int devidx;
+ struct request_queue *queue;
+ struct gendisk *gendisk;
+
+ if (dev->blk_size < 512) {
+ dev_err(&dev->sbd.core,
+ "%s:%u: cannot handle block size %llu\n", __func__,
+ __LINE__, dev->blk_size);
+ return -EINVAL;
+ }
+
+ priv = kzalloc(sizeof(*priv) + dev->num_regions * sizeof(gendisk),
GFP_KERNEL);
+ if (!priv) {
+ error = -ENOMEM;
+ goto fail;
+ }
+
+ ps3_system_bus_set_drvdata(_dev, priv);
+ spin_lock_init(&priv->lock);
+
+ dev->bounce_size = BOUNCE_SIZE;
+ dev->bounce_buf = kmalloc(BOUNCE_SIZE, GFP_DMA);
+ if (!dev->bounce_buf) {
+ error = -ENOMEM;
+ goto fail_free_priv;
+ }
+
+ error = ps3stor_setup(dev, ps3nflash_interrupt);
+ if (error)
+ goto fail_free_bounce;
+
+ priv->raw_capacity = dev->regions[0].size;
+
+ queue = blk_init_queue(ps3nflash_request, &priv->lock);
+ if (!queue) {
+ dev_err(&dev->sbd.core, "%s:%u: blk_init_queue failed\n",
+ __func__, __LINE__);
+ error = -ENOMEM;
+ goto fail_teardown;
+ }
+
+ priv->queue = queue;
+ queue->queuedata = dev;
+
+ blk_queue_bounce_limit(queue, BLK_BOUNCE_HIGH);
+
+ blk_queue_max_hw_sectors(queue, dev->bounce_size >> 9);
+ blk_queue_segment_boundary(queue, -1UL);
+ blk_queue_dma_alignment(queue, dev->blk_size-1);
+ blk_queue_logical_block_size(queue, dev->blk_size);
+
+ blk_queue_flush(queue, REQ_FLUSH);
+
+ blk_queue_max_segments(queue, -1);
+ blk_queue_max_segment_size(queue, dev->bounce_size);
+
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ gendisk = alloc_disk(PS3NFLASH_MINORS);
+ if (!gendisk) {
+ dev_err(&dev->sbd.core, "%s:%u: alloc_disk
failed\n", __func__,
+ __LINE__);
+ error = -ENOMEM;
+ goto fail_cleanup_queue;
+ }
+
+ priv->gendisk[devidx] = gendisk;
+ gendisk->major = ps3nflash_major;
+ gendisk->first_minor = devidx * PS3NFLASH_MINORS;
+ gendisk->fops = &ps3nflash_fops;
+ gendisk->queue = queue;
+ gendisk->private_data = dev;
+ gendisk->driverfs_dev = &dev->sbd.core;
+ snprintf(gendisk->disk_name, sizeof(gendisk->disk_name),
PS3NFLASH_NAME,
+ devidx+'a');
+ priv->blocking_factor = dev->blk_size >> 9;
+ set_capacity(gendisk,
+ dev->regions[devidx].size*priv->blocking_factor);
+
+ dev_info(&dev->sbd.core,
+ "%s (%llu MiB total, %lu MiB region)\n",
+ gendisk->disk_name, priv->raw_capacity >> 11,
+ get_capacity(gendisk) >> 11);
+
+ add_disk(gendisk);
+ }
+
+ return 0;
+
+fail_cleanup_queue:
+ blk_cleanup_queue(queue);
+fail_teardown:
+ ps3stor_teardown(dev);
+fail_free_bounce:
+ kfree(dev->bounce_buf);
+fail_free_priv:
+ kfree(priv);
+ ps3_system_bus_set_drvdata(_dev, NULL);
+fail:
+ return error;
+}
+
+static int ps3nflash_remove(struct ps3_system_bus_device *_dev)
+{
+ struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
+ struct ps3nflash_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+ unsigned int devidx;
+
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ del_gendisk(priv->gendisk[devidx]);
+ }
+
+ blk_cleanup_queue(priv->queue);
+
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ put_disk(priv->gendisk[devidx]);
+ }
+
+ ps3stor_teardown(dev);
+ kfree(dev->bounce_buf);
+ kfree(priv);
+ ps3_system_bus_set_drvdata(_dev, NULL);
+ return 0;
+}
+
+static struct ps3_system_bus_driver ps3nflash = {
+ .match_id = PS3_MATCH_ID_STOR_FLASH,
+ .core.name = DEVICE_NAME,
+ .core.owner = THIS_MODULE,
+ .probe = ps3nflash_probe,
+ .remove = ps3nflash_remove,
+ .shutdown = ps3nflash_remove,
+};
+
+
+static int __init ps3nflash_init(void)
+{
+ int error;
+
+ if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
+ return -ENODEV;
+
+ error = register_blkdev(0, DEVICE_NAME);
+ if (error <= 0) {
+ printk(KERN_ERR "%s:%u: register_blkdev failed %d\n",
__func__,
+ __LINE__, error);
+ return error;
+ }
+ ps3nflash_major = error;
+
+ pr_info("%s:%u: registered block device major %d\n", __func__,
+ __LINE__, ps3nflash_major);
+
+ error = ps3_system_bus_driver_register(&ps3nflash);
+ if (error)
+ unregister_blkdev(ps3nflash_major, DEVICE_NAME);
+
+ return error;
+}
+
+static void __exit ps3nflash_exit(void)
+{
+ ps3_system_bus_driver_unregister(&ps3nflash);
+ unregister_blkdev(ps3nflash_major, DEVICE_NAME);
+}
+
+module_init(ps3nflash_init);
+module_exit(ps3nflash_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("PS3 NOR FLASH Storage Driver");
+MODULE_AUTHOR("Graf Chokolo");
+MODULE_ALIAS(PS3_MODULE_ALIAS_STOR_FLASH);
diff --git a/drivers/block/ps3vflash.c b/drivers/block/ps3vflash.c
new file mode 100644
index 0000000..8d9a0fa
--- /dev/null
+++ b/drivers/block/ps3vflash.c
@@ -0,0 +1,442 @@
+/*
+ * PS3 VFLASH Storage Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/ata.h>
+#include <linux/blkdev.h>
+#include <linux/slab.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3stor.h>
+#include <asm/firmware.h>
+
+
+#define DEVICE_NAME "ps3vflash"
+
+#define BOUNCE_SIZE (64*1024)
+
+#define PS3VFLASH_MINORS 16
+
+
+#define PS3VFLASH_NAME "ps3vflash%c"
+
+#define LV1_STORAGE_ATA_FLUSH_CACHE_EXT (0x31)
+
+struct ps3vflash_private {
+ spinlock_t lock; /* Request queue spinlock */
+ struct request_queue *queue;
+ unsigned int blocking_factor;
+ struct request *req;
+ u64 raw_capacity;
+ struct gendisk *gendisk[0];
+};
+
+
+static int ps3vflash_major;
+
+
+static const struct block_device_operations ps3vflash_fops = {
+ .owner = THIS_MODULE,
+};
+
+
+static void ps3vflash_scatter_gather(struct ps3_storage_device *dev,
+ struct request *req, int gather)
+{
+ unsigned int offset = 0;
+ struct req_iterator iter;
+ struct bio_vec *bvec;
+ unsigned int i = 0;
+ size_t size;
+ void *buf;
+
+ rq_for_each_segment(bvec, req, iter) {
+ unsigned long flags;
+ dev_dbg(&dev->sbd.core,
+ "%s:%u: bio %u: %u segs %u sectors from %lu\n",
+ __func__, __LINE__, i, bio_segments(iter.bio),
+ bio_sectors(iter.bio), iter.bio->bi_sector);
+
+ size = bvec->bv_len;
+ buf = bvec_kmap_irq(bvec, &flags);
+ if (gather)
+ memcpy(dev->bounce_buf+offset, buf, size);
+ else
+ memcpy(buf, dev->bounce_buf+offset, size);
+ offset += size;
+ flush_kernel_dcache_page(bvec->bv_page);
+ bvec_kunmap_irq(buf, &flags);
+ i++;
+ }
+}
+
+static int ps3vflash_submit_request_sg(struct ps3_storage_device *dev,
+ struct request *req)
+{
+ struct ps3vflash_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+ int write = rq_data_dir(req), res;
+ const char *op = write ? "write" : "read";
+ u64 start_sector, sectors;
+ unsigned int region_idx = MINOR(disk_devt(req->rq_disk)) /
PS3VFLASH_MINORS;
+ unsigned int region_id = dev->regions[region_idx].id;
+ unsigned int region_flags = dev->regions[region_idx].flags;
+
+#ifdef DEBUG
+ unsigned int n = 0;
+ struct bio_vec *bv;
+ struct req_iterator iter;
+
+ rq_for_each_segment(bv, req, iter)
+ n++;
+ dev_dbg(&dev->sbd.core,
+ "%s:%u: %s req has %u bvecs for %u sectors\n",
+ __func__, __LINE__, op, n, blk_rq_sectors(req));
+#endif
+
+ start_sector = blk_rq_pos(req) * priv->blocking_factor;
+ sectors = blk_rq_sectors(req) * priv->blocking_factor;
+ dev_dbg(&dev->sbd.core, "%s:%u: %s %llu sectors starting at %llu\n",
+ __func__, __LINE__, op, sectors, start_sector);
+
+ if (write) {
+ ps3vflash_scatter_gather(dev, req, 1);
+
+ res = lv1_storage_write(dev->sbd.dev_id, region_id,
+ start_sector, sectors, region_flags,
+ dev->bounce_lpar, &dev->tag);
+ } else {
+ res = lv1_storage_read(dev->sbd.dev_id, region_id,
+ start_sector, sectors, region_flags,
+ dev->bounce_lpar, &dev->tag);
+ }
+ if (res) {
+ dev_err(&dev->sbd.core, "%s:%u: %s failed %d\n", __func__,
+ __LINE__, op, res);
+ __blk_end_request_all(req, -EIO);
+ return 0;
+ }
+
+ priv->req = req;
+ return 1;
+}
+
+static int ps3vflash_submit_flush_request(struct ps3_storage_device *dev,
+ struct request *req)
+{
+ struct ps3vflash_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+ u64 res;
+
+ dev_dbg(&dev->sbd.core, "%s:%u: flush request\n", __func__,
__LINE__);
+
+ res = lv1_storage_send_device_command(dev->sbd.dev_id,
+
LV1_STORAGE_ATA_FLUSH_CACHE_EXT, 0, 0, 0,
+ 0, &dev->tag);
+ if (res) {
+ dev_err(&dev->sbd.core, "%s:%u: sync cache failed 0x%llx\n",
+ __func__, __LINE__, res);
+ __blk_end_request_all(req, -EIO);
+ return 0;
+ }
+
+ priv->req = req;
+ return 1;
+}
+
+static void ps3vflash_do_request(struct ps3_storage_device *dev,
+ struct request_queue *q)
+{
+ struct request *req;
+
+ dev_dbg(&dev->sbd.core, "%s:%u\n", __func__, __LINE__);
+
+ while ((req = blk_fetch_request(q))) {
+ if (req->cmd_flags & REQ_FLUSH) {
+ if (ps3vflash_submit_flush_request(dev, req))
+ break;
+ } else if (req->cmd_type == REQ_TYPE_FS) {
+ if (ps3vflash_submit_request_sg(dev, req))
+ break;
+ } else {
+ blk_dump_rq_flags(req, DEVICE_NAME " bad request");
+ __blk_end_request_all(req, -EIO);
+ continue;
+ }
+ }
+}
+
+static void ps3vflash_request(struct request_queue *q)
+{
+ struct ps3_storage_device *dev = q->queuedata;
+ struct ps3vflash_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+
+ if (priv->req) {
+ dev_dbg(&dev->sbd.core, "%s:%u busy\n", __func__, __LINE__);
+ return;
+ }
+
+ ps3vflash_do_request(dev, q);
+}
+
+static irqreturn_t ps3vflash_interrupt(int irq, void *data)
+{
+ struct ps3_storage_device *dev = data;
+ struct ps3vflash_private *priv;
+ struct request *req;
+ int res, read, error;
+ u64 tag, status;
+ const char *op;
+
+ res = lv1_storage_get_async_status(dev->sbd.dev_id, &tag, &status);
+
+ if (tag != dev->tag)
+ dev_err(&dev->sbd.core,
+ "%s:%u: tag mismatch, got %llx, expected %llx\n",
+ __func__, __LINE__, tag, dev->tag);
+
+ if (res) {
+ dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n",
+ __func__, __LINE__, res, status);
+ return IRQ_HANDLED;
+ }
+
+ priv = ps3_system_bus_get_drvdata(&dev->sbd);
+ req = priv->req;
+ if (!req) {
+ dev_dbg(&dev->sbd.core,
+ "%s:%u non-block layer request completed\n",
__func__,
+ __LINE__);
+ dev->lv1_status = status;
+ complete(&dev->done);
+ return IRQ_HANDLED;
+ }
+
+ if (req->cmd_flags & REQ_FLUSH) {
+ read = 0;
+ op = "flush";
+ } else {
+ read = !rq_data_dir(req);
+ op = read ? "read" : "write";
+ }
+ if (status) {
+ dev_dbg(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n",
__func__,
+ __LINE__, op, status);
+ error = -EIO;
+ } else {
+ dev_dbg(&dev->sbd.core, "%s:%u: %s completed\n", __func__,
+ __LINE__, op);
+ error = 0;
+ if (read)
+ ps3vflash_scatter_gather(dev, req, 0);
+ }
+
+ spin_lock(&priv->lock);
+ __blk_end_request_all(req, error);
+ priv->req = NULL;
+ ps3vflash_do_request(dev, priv->queue);
+ spin_unlock(&priv->lock);
+
+ return IRQ_HANDLED;
+}
+
+static int __devinit ps3vflash_probe(struct ps3_system_bus_device *_dev)
+{
+ struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
+ struct ps3vflash_private *priv;
+ int error;
+ unsigned int devidx;
+ struct request_queue *queue;
+ struct gendisk *gendisk;
+
+ if (dev->blk_size < 512) {
+ dev_err(&dev->sbd.core,
+ "%s:%u: cannot handle block size %llu\n", __func__,
+ __LINE__, dev->blk_size);
+ return -EINVAL;
+ }
+
+ priv = kzalloc(sizeof(*priv) + dev->num_regions * sizeof(gendisk),
GFP_KERNEL);
+ if (!priv) {
+ error = -ENOMEM;
+ goto fail;
+ }
+
+ ps3_system_bus_set_drvdata(_dev, priv);
+ spin_lock_init(&priv->lock);
+
+ dev->bounce_size = BOUNCE_SIZE;
+ dev->bounce_buf = kmalloc(BOUNCE_SIZE, GFP_DMA);
+ if (!dev->bounce_buf) {
+ error = -ENOMEM;
+ goto fail_free_priv;
+ }
+
+ error = ps3stor_setup(dev, ps3vflash_interrupt);
+ if (error)
+ goto fail_free_bounce;
+
+ priv->raw_capacity = dev->regions[0].size;
+
+ queue = blk_init_queue(ps3vflash_request, &priv->lock);
+ if (!queue) {
+ dev_err(&dev->sbd.core, "%s:%u: blk_init_queue failed\n",
+ __func__, __LINE__);
+ error = -ENOMEM;
+ goto fail_teardown;
+ }
+
+ priv->queue = queue;
+ queue->queuedata = dev;
+
+ blk_queue_bounce_limit(queue, BLK_BOUNCE_HIGH);
+
+ blk_queue_max_hw_sectors(queue, dev->bounce_size >> 9);
+ blk_queue_segment_boundary(queue, -1UL);
+ blk_queue_dma_alignment(queue, dev->blk_size-1);
+ blk_queue_logical_block_size(queue, dev->blk_size);
+
+ blk_queue_flush(queue, REQ_FLUSH);
+
+ blk_queue_max_segments(queue, -1);
+ blk_queue_max_segment_size(queue, dev->bounce_size);
+
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ gendisk = alloc_disk(PS3VFLASH_MINORS);
+ if (!gendisk) {
+ dev_err(&dev->sbd.core, "%s:%u: alloc_disk
failed\n", __func__,
+ __LINE__);
+ error = -ENOMEM;
+ goto fail_cleanup_queue;
+ }
+
+ priv->gendisk[devidx] = gendisk;
+ gendisk->major = ps3vflash_major;
+ gendisk->first_minor = devidx * PS3VFLASH_MINORS;
+ gendisk->fops = &ps3vflash_fops;
+ gendisk->queue = queue;
+ gendisk->private_data = dev;
+ gendisk->driverfs_dev = &dev->sbd.core;
+ snprintf(gendisk->disk_name, sizeof(gendisk->disk_name),
PS3VFLASH_NAME,
+ devidx+'a');
+ priv->blocking_factor = dev->blk_size >> 9;
+ set_capacity(gendisk,
+ dev->regions[devidx].size*priv->blocking_factor);
+
+ dev_info(&dev->sbd.core,
+ "%s (%llu MiB total, %lu MiB region)\n",
+ gendisk->disk_name, priv->raw_capacity >> 11,
+ get_capacity(gendisk) >> 11);
+
+ add_disk(gendisk);
+ }
+
+ return 0;
+
+fail_cleanup_queue:
+ blk_cleanup_queue(queue);
+fail_teardown:
+ ps3stor_teardown(dev);
+fail_free_bounce:
+ kfree(dev->bounce_buf);
+fail_free_priv:
+ kfree(priv);
+ ps3_system_bus_set_drvdata(_dev, NULL);
+fail:
+ return error;
+}
+
+static int ps3vflash_remove(struct ps3_system_bus_device *_dev)
+{
+ struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
+ struct ps3vflash_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+ unsigned int devidx;
+
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ del_gendisk(priv->gendisk[devidx]);
+ }
+
+ blk_cleanup_queue(priv->queue);
+
+ for (devidx = 0; devidx < dev->num_regions; devidx++)
+ {
+ if (test_bit(devidx, &dev->accessible_regions) == 0)
+ continue;
+
+ put_disk(priv->gendisk[devidx]);
+ }
+
+ ps3stor_teardown(dev);
+ kfree(dev->bounce_buf);
+ kfree(priv);
+ ps3_system_bus_set_drvdata(_dev, NULL);
+ return 0;
+}
+
+static struct ps3_system_bus_driver ps3vflash = {
+ .match_id = PS3_MATCH_ID_STOR_VFLASH,
+ .core.name = DEVICE_NAME,
+ .core.owner = THIS_MODULE,
+ .probe = ps3vflash_probe,
+ .remove = ps3vflash_remove,
+ .shutdown = ps3vflash_remove,
+};
+
+
+static int __init ps3vflash_init(void)
+{
+ int error;
+
+ if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
+ return -ENODEV;
+
+ error = register_blkdev(0, DEVICE_NAME);
+ if (error <= 0) {
+ printk(KERN_ERR "%s:%u: register_blkdev failed %d\n",
__func__,
+ __LINE__, error);
+ return error;
+ }
+ ps3vflash_major = error;
+
+ pr_info("%s:%u: registered block device major %d\n", __func__,
+ __LINE__, ps3vflash_major);
+
+ error = ps3_system_bus_driver_register(&ps3vflash);
+ if (error)
+ unregister_blkdev(ps3vflash_major, DEVICE_NAME);
+
+ return error;
+}
+
+static void __exit ps3vflash_exit(void)
+{
+ ps3_system_bus_driver_unregister(&ps3vflash);
+ unregister_blkdev(ps3vflash_major, DEVICE_NAME);
+}
+
+module_init(ps3vflash_init);
+module_exit(ps3vflash_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("PS3 VFLASH Storage Driver");
+MODULE_AUTHOR("Graf Chokolo");
+MODULE_ALIAS(PS3_MODULE_ALIAS_STOR_VFLASH);
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 7a00672..2d5fb24 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -59,6 +59,16 @@ obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o
obj-$(CONFIG_TCG_TPM) += tpm/
obj-$(CONFIG_PS3_FLASH) += ps3flash.o
+obj-$(CONFIG_PS3_RAM) += ps3ram.o
+obj-$(CONFIG_PS3_SMPROXY) += ps3smproxy.o
+obj-$(CONFIG_PS3_DMPROXY) += ps3dmproxy.o
+obj-$(CONFIG_PS3_ENCDEC) += ps3encdec.o
+obj-$(CONFIG_PS3_STORMGR) += ps3stormgr.o
+obj-$(CONFIG_PS3_SPEMMIO) += ps3spemmio.o
+obj-$(CONFIG_PS3_SBMMIO) += ps3sbmmio.o
+obj-$(CONFIG_PS3_RSXMMIO) += ps3rsxmmio.o
+obj-$(CONFIG_PS3_HVC) += ps3hvc.o
+obj-$(CONFIG_PS3_HTAB) += ps3htab.o
obj-$(CONFIG_RAMOOPS) += ramoops.o
obj-$(CONFIG_JS_RTC) += js-rtc.o
diff --git a/drivers/char/ps3dmproxy.c b/drivers/char/ps3dmproxy.c
new file mode 100644
index 0000000..b43b76d
--- /dev/null
+++ b/drivers/char/ps3dmproxy.c
@@ -0,0 +1,322 @@
+
+/*
+ * PS3 Dispatcher Manager Proxy Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
+#include <linux/mm.h>
+#include <linux/pagemap.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+#include <asm/ps3dm.h>
+#include <asm/ps3dmproxy.h>
+
+#define DEVICE_NAME "ps3dmproxy"
+
+static ssize_t ps3dmproxy_read(struct file *file, char __user *buf,
+ size_t count, loff_t *pos)
+{
+ char *p;
+ int res;
+
+ if (!count)
+ return 0;
+
+ if (buf) {
+ p = kmalloc(count, GFP_KERNEL);
+ if (!p)
+ return -ENOMEM;
+
+ res = ps3dm_read(p, count);
+ if (res)
+ goto fail_free;
+
+ if (copy_to_user(buf, p, count))
+ count = -EFAULT;
+
+ kfree(p);
+ }
+
+ if (count > 0)
+ *pos += count;
+
+ return count;
+
+fail_free:
+
+ kfree(p);
+
+ return res;
+}
+
+static ssize_t ps3dmproxy_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *pos)
+{
+ char *p;
+ int res;
+
+ if (!count)
+ return 0;
+
+ if (buf) {
+ p = kmalloc(count, GFP_KERNEL);
+ if (!p)
+ return -ENOMEM;
+
+ if (copy_from_user(p, buf, count)) {
+ res = -EFAULT;
+ goto fail_free;
+ }
+
+ res = ps3dm_write(p, count);
+ if (res)
+ count = res;
+
+ kfree(p);
+ }
+
+ if (count > 0)
+ *pos += count;
+
+ return count;
+
+fail_free:
+
+ kfree(p);
+
+ return res;
+}
+
+static int ps3dmproxy_user_to_lpar_addr(u64 user_addr, u64 *lpar_addr)
+{
+ struct page **pages;
+ int res;
+
+ pr_debug(" -> %s:%d\n", __func__, __LINE__);
+
+ pages = kmalloc(1 * sizeof(struct page *), GFP_KERNEL);
+ if (!pages) {
+ pr_debug("%s:%d: kmalloc failed\n", __func__, __LINE__);
+ return -ENOMEM;
+ }
+
+ down_read(¤t->mm->mmap_sem);
+
+ res = get_user_pages(current, current->mm, user_addr & PAGE_MASK, 1,
0, 0, pages, NULL);
+ if (!res) {
+ pr_debug("%s:%d: get_user_pages failed (%d)\n", __func__,
__LINE__, res);
+ goto fail_get_user_pages;
+ }
+
+ up_read(¤t->mm->mmap_sem);
+
+ *lpar_addr = ps3_mm_phys_to_lpar(__pa(page_address(pages[0])));
+
+ page_cache_release(pages[0]);
+
+ kfree(pages);
+
+ pr_debug(" <- %s:%d: ok\n", __func__, __LINE__);
+
+ return 0;
+
+fail_get_user_pages:
+
+ up_read(¤t->mm->mmap_sem);
+
+ kfree(pages);
+
+ pr_debug(" <- %s:%d: failed\n", __func__, __LINE__);
+
+ return res;
+}
+
+static long ps3dmproxy_ioctl(struct file *file, unsigned int cmd, unsigned
long arg)
+{
+ void __user *argp = (void __user *) arg;
+ int res;
+
+ pr_debug("%s:%d cmd %x\n", __func__, __LINE__, cmd);
+
+ switch (cmd) {
+ case PS3DMPROXY_IOCTL_USER_TO_LPAR_ADDR:
+ {
+ struct ps3dmproxy_ioctl_user_to_lpar_addr
user_to_lpar_addr;
+
+ if (copy_from_user(&user_to_lpar_addr, argp,
sizeof(user_to_lpar_addr))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ res =
ps3dmproxy_user_to_lpar_addr(user_to_lpar_addr.user_addr & PAGE_MASK,
+ &user_to_lpar_addr.lpar_addr);
+ if (res) {
+ pr_debug("%s:%d:
ps3dmproxy_user_to_lpar_addr failed (%d)\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ user_to_lpar_addr.lpar_addr +=
user_to_lpar_addr.user_addr & ~PAGE_MASK;
+
+ if (copy_to_user(argp, &user_to_lpar_addr,
sizeof(user_to_lpar_addr))) {
+ pr_debug("%s:%d: copy_to_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ return 0;
+ }
+
+ case PS3DMPROXY_IOCTL_GET_REPO_NODE_VAL:
+ {
+ struct ps3dmproxy_ioctl_get_repo_node_val
get_repo_node_val;
+
+ if (copy_from_user(&get_repo_node_val, argp,
sizeof(get_repo_node_val))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ res =
lv1_get_repository_node_value(get_repo_node_val.lpar_id,
+ get_repo_node_val.key[0],
get_repo_node_val.key[1],
+ get_repo_node_val.key[2],
get_repo_node_val.key[3],
+ &get_repo_node_val.val[0],
&get_repo_node_val.val[1]);
+ if (res) {
+ pr_debug("%s:%d:
lv1_get_repository_node_value failed (%d)\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ if (copy_to_user(argp, &get_repo_node_val,
sizeof(get_repo_node_val))) {
+ pr_debug("%s:%d: copy_to_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ return 0;
+ }
+
+ case PS3DMPROXY_IOCTL_DO_REQUEST:
+ {
+ struct ps3dmproxy_ioctl_do_request do_request;
+ struct ps3dm_hdr *sendbuf, *recvbuf;
+
+ if (copy_from_user(&do_request, argp,
sizeof(do_request))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ WARN_ON(do_request.sendbuf_size > 4096);
+ WARN_ON(do_request.recvbuf_size > 4096);
+
+ pr_debug("%s:%d: sendbuf_size (%lld) recvbuf_size
(%lld)\n",
+ __func__, __LINE__, do_request.sendbuf_size,
do_request.recvbuf_size);
+
+ sendbuf = kmalloc(do_request.sendbuf_size,
GFP_KERNEL);
+ if (!sendbuf) {
+ pr_debug("%s:%d: kmalloc failed\n",
__func__, __LINE__);
+ return -ENOMEM;
+ }
+
+ if (copy_from_user(sendbuf, (const void __user *)
do_request.sendbuf,
+ do_request.sendbuf_size)) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_sendbuf;
+ }
+
+ recvbuf = kmalloc(do_request.recvbuf_size,
GFP_KERNEL);
+ if (!recvbuf) {
+ pr_debug("%s:%d: kmalloc failed\n",
__func__, __LINE__);
+ res = -ENOMEM;
+ goto kfree_sendbuf;
+ }
+
+ res = ps3dm_do_request(sendbuf,
do_request.sendbuf_size,
+ recvbuf, do_request.recvbuf_size);
+ if (res) {
+ pr_debug("%s:%d: ps3dm_do_request failed
(%d)\n", __func__, __LINE__, res);
+ goto kfree_recvbuf;
+ }
+
+ if (copy_to_user((void __user *) do_request.recvbuf,
recvbuf,
+ do_request.recvbuf_size)) {
+ pr_debug("%s:%d: copy_to_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_recvbuf;
+ }
+
+ res = 0;
+
+ kfree_recvbuf:
+
+ kfree(recvbuf);
+
+ kfree_sendbuf:
+
+ kfree(sendbuf);
+
+ return res;
+ }
+ }
+
+ return -EFAULT;
+}
+
+static const struct file_operations ps3dmproxy_fops = {
+ .owner = THIS_MODULE,
+ .read = ps3dmproxy_read,
+ .write = ps3dmproxy_write,
+ .unlocked_ioctl = ps3dmproxy_ioctl,
+ .compat_ioctl = ps3dmproxy_ioctl,
+};
+
+static struct miscdevice ps3dmproxy_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3dmproxy_fops,
+};
+
+static int __init ps3dmproxy_init(void)
+{
+ int res;
+
+ res = misc_register(&ps3dmproxy_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3dmproxy_misc.minor);
+
+ return 0;
+}
+
+static void __exit ps3dmproxy_exit(void)
+{
+ misc_deregister(&ps3dmproxy_misc);
+}
+
+module_init(ps3dmproxy_init);
+module_exit(ps3dmproxy_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 Dispatcher Manager Proxy Driver");
+MODULE_AUTHOR("Graf Chokolo");
diff --git a/drivers/char/ps3encdec.c b/drivers/char/ps3encdec.c
new file mode 100644
index 0000000..15211a3
--- /dev/null
+++ b/drivers/char/ps3encdec.c
@@ -0,0 +1,261 @@
+
+/*
+ * PS3 ENCDEC Storage Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3stor.h>
+#include <asm/ps3encdec.h>
+
+#define DEVICE_NAME "ps3encdec"
+
+#define BOUNCE_SIZE (64 * 1024)
+
+struct ps3encdec_private {
+ struct mutex mutex;
+};
+
+static struct ps3_storage_device *ps3encdec_dev;
+
+static long ps3encdec_ioctl(struct file *file, unsigned int cmd, unsigned
long arg)
+{
+ struct ps3_storage_device *dev = ps3encdec_dev;
+ struct ps3encdec_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
+ void __user *argp = (void __user *) arg;
+ int res = -EFAULT;
+
+ mutex_lock(&priv->mutex);
+
+ pr_debug("%s:%d cmd %x\n", __func__, __LINE__, cmd);
+
+ switch (cmd) {
+ case PS3ENCDEC_IOCTL_DO_REQUEST:
+ {
+ struct ps3encdec_ioctl_do_request do_request;
+ void *cmdbuf;
+ u64 cmdbuf_lpar;
+
+ if (copy_from_user(&do_request, argp,
sizeof(do_request))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ break;
+ }
+
+ BUG_ON(do_request.respbuf_size > BOUNCE_SIZE);
+
+ pr_debug("%s:%d: cmd (%llx) cmdbuf_size (%lld)
respbuf_size (%lld)\n",
+ __func__, __LINE__, do_request.cmd,
do_request.cmdbuf_size,
+ do_request.respbuf_size);
+
+ cmdbuf = kmalloc(do_request.cmdbuf_size,
GFP_KERNEL);
+ if (!cmdbuf) {
+ pr_debug("%s:%d: kmalloc failed\n",
__func__, __LINE__);
+ res = -ENOMEM;
+ break;
+ }
+
+ if (copy_from_user(cmdbuf, (const void __user *)
do_request.cmdbuf,
+ do_request.cmdbuf_size)) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_cmdbuf;
+ }
+
+ cmdbuf_lpar = ps3_mm_phys_to_lpar(__pa(cmdbuf));
+
+ res = ps3stor_send_command(dev, do_request.cmd,
+ cmdbuf_lpar, do_request.cmdbuf_size,
+ dev->bounce_lpar, do_request.respbuf_size);
+ if (res) {
+ pr_debug("%s:%d: ps3stor_send_command failed
(%d)\n",
+ __func__, __LINE__, res);
+ res = -EFAULT;
+ goto kfree_cmdbuf;
+ }
+
+ if (copy_to_user((void __user *) do_request.respbuf,
dev->bounce_buf,
+ do_request.respbuf_size)) {
+ pr_debug("%s:%d: copy_to_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_cmdbuf;
+ }
+
+ res = 0;
+
+ kfree_cmdbuf:
+
+ kfree(cmdbuf);
+
+ break;
+ }
+ }
+
+ mutex_unlock(&priv->mutex);
+
+ return res;
+}
+
+static irqreturn_t ps3encdec_interrupt(int irq, void *data)
+{
+ struct ps3_storage_device *dev = data;
+ int res;
+ u64 tag, status;
+
+ res = lv1_storage_get_async_status(dev->sbd.dev_id, &tag, &status);
+
+ if (tag != dev->tag)
+ dev_err(&dev->sbd.core,
+ "%s:%u: tag mismatch, got %llx, expected %llx\n",
+ __func__, __LINE__, tag, dev->tag);
+
+ if (res) {
+ dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n",
+ __func__, __LINE__, res, status);
+ } else {
+ dev->lv1_status = status;
+ complete(&dev->done);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static const struct file_operations ps3encdec_fops = {
+ .owner = THIS_MODULE,
+ .unlocked_ioctl = ps3encdec_ioctl,
+ .compat_ioctl = ps3encdec_ioctl,
+};
+
+static struct miscdevice ps3encdec_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3encdec_fops,
+};
+
+static int __devinit ps3encdec_probe(struct ps3_system_bus_device *_dev)
+{
+ struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
+ struct ps3encdec_private *priv;
+ int error;
+
+ if (ps3encdec_dev) {
+ dev_err(&dev->sbd.core,
+ "Only one ENCDEC device is supported\n");
+ return -EBUSY;
+ }
+
+ ps3encdec_dev = dev;
+
+ priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+ if (!priv) {
+ error = -ENOMEM;
+ goto fail;
+ }
+
+ ps3_system_bus_set_drvdata(&dev->sbd, priv);
+ mutex_init(&priv->mutex);
+
+ dev->bounce_size = BOUNCE_SIZE;
+ dev->bounce_buf = kmalloc(BOUNCE_SIZE, GFP_DMA);
+ if (!dev->bounce_buf) {
+ error = -ENOMEM;
+ goto fail_free_priv;
+ }
+
+ error = ps3stor_setup(dev, ps3encdec_interrupt);
+ if (error)
+ goto fail_free_bounce;
+
+ ps3encdec_misc.parent = &dev->sbd.core;
+
+ error = misc_register(&ps3encdec_misc);
+ if (error) {
+ dev_err(&dev->sbd.core, "%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, error);
+ goto fail_teardown;
+ }
+
+ dev_info(&dev->sbd.core, "%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3encdec_misc.minor);
+
+ return 0;
+
+fail_teardown:
+
+ ps3stor_teardown(dev);
+
+fail_free_bounce:
+
+ kfree(dev->bounce_buf);
+
+fail_free_priv:
+
+ kfree(priv);
+ ps3_system_bus_set_drvdata(&dev->sbd, NULL);
+
+fail:
+
+ ps3encdec_dev = NULL;
+
+ return error;
+}
+
+static int ps3encdec_remove(struct ps3_system_bus_device *_dev)
+{
+ struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
+
+ misc_deregister(&ps3encdec_misc);
+ ps3stor_teardown(dev);
+ kfree(ps3_system_bus_get_drvdata(&dev->sbd));
+ ps3_system_bus_set_drvdata(&dev->sbd, NULL);
+ kfree(dev->bounce_buf);
+ ps3encdec_dev = NULL;
+
+ return 0;
+}
+
+static struct ps3_system_bus_driver ps3encdec = {
+ .match_id = PS3_MATCH_ID_STOR_ENCDEC,
+ .core.name = DEVICE_NAME,
+ .core.owner = THIS_MODULE,
+ .probe = ps3encdec_probe,
+ .remove = ps3encdec_remove,
+ .shutdown = ps3encdec_remove,
+};
+
+
+static int __init ps3encdec_init(void)
+{
+ return ps3_system_bus_driver_register(&ps3encdec);
+}
+
+static void __exit ps3encdec_exit(void)
+{
+ ps3_system_bus_driver_unregister(&ps3encdec);
+}
+
+module_init(ps3encdec_init);
+module_exit(ps3encdec_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 ENCDEC Storage Driver");
+MODULE_AUTHOR("Graf Chokolo");
+MODULE_ALIAS(PS3_MODULE_ALIAS_STOR_ENCDEC);
diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c
index 85c004a..841cd4b 100644
--- a/drivers/char/ps3flash.c
+++ b/drivers/char/ps3flash.c
@@ -45,9 +45,12 @@ static int ps3flash_read_write_sectors(struct
ps3_storage_device *dev,
u64 start_sector, int write)
{
struct ps3flash_private *priv =
ps3_system_bus_get_drvdata(&dev->sbd);
- u64 res = ps3stor_read_write_sectors(dev, dev->bounce_lpar,
+ unsigned int region_idx = 5;
+ unsigned int flags = 0;
+
+ u64 res = ps3stor_read_write_sectors(dev, dev->bounce_lpar,
region_idx,
start_sector,
priv->chunk_sectors,
- write);
+ flags, write);
if (res) {
dev_err(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n",
__func__,
__LINE__, write ? "write" : "read", res);
@@ -97,6 +100,7 @@ static int ps3flash_fetch(struct ps3_storage_device *dev,
u64 start_sector)
static loff_t ps3flash_llseek(struct file *file, loff_t offset, int origin)
{
struct ps3_storage_device *dev = ps3flash_dev;
+ unsigned int region_idx = 5;
loff_t res;
mutex_lock(&file->f_mapping->host->i_mutex);
@@ -105,7 +109,7 @@ static loff_t ps3flash_llseek(struct file *file, loff_t
offset, int origin)
offset += file->f_pos;
break;
case 2:
- offset += dev->regions[dev->region_idx].size*dev->blk_size;
+ offset += dev->regions[region_idx].size*dev->blk_size;
break;
}
if (offset < 0) {
@@ -130,12 +134,13 @@ static ssize_t ps3flash_read(char __user *userbuf,
void *kernelbuf,
int res;
size_t remaining, n;
const void *src;
+ unsigned int region_idx = 5;
dev_dbg(&dev->sbd.core,
"%s:%u: Reading %zu bytes at position %lld to
U0x%p/K0x%p\n",
__func__, __LINE__, count, *pos, userbuf, kernelbuf);
- size = dev->regions[dev->region_idx].size*dev->blk_size;
+ size = dev->regions[region_idx].size*dev->blk_size;
if (*pos >= size || !count)
return 0;
@@ -199,12 +204,13 @@ static ssize_t ps3flash_write(const char __user
*userbuf,
int res = 0;
size_t remaining, n;
void *dst;
+ unsigned int region_idx = 5;
dev_dbg(&dev->sbd.core,
"%s:%u: Writing %zu bytes at position %lld from
U0x%p/K0x%p\n",
__func__, __LINE__, count, *pos, userbuf, kernelbuf);
- size = dev->regions[dev->region_idx].size*dev->blk_size;
+ size = dev->regions[region_idx].size*dev->blk_size;
if (*pos >= size || !count)
return 0;
@@ -359,15 +365,16 @@ static int __devinit ps3flash_probe(struct
ps3_system_bus_device *_dev)
struct ps3flash_private *priv;
int error;
unsigned long tmp;
+ unsigned int region_idx = 5;
- tmp = dev->regions[dev->region_idx].start*dev->blk_size;
+ tmp = dev->regions[region_idx].start*dev->blk_size;
if (tmp % FLASH_BLOCK_SIZE) {
dev_err(&dev->sbd.core,
"%s:%u region start %lu is not aligned\n", __func__,
__LINE__, tmp);
return -EINVAL;
}
- tmp = dev->regions[dev->region_idx].size*dev->blk_size;
+ tmp = dev->regions[region_idx].size*dev->blk_size;
if (tmp % FLASH_BLOCK_SIZE) {
dev_err(&dev->sbd.core,
"%s:%u region size %lu is not aligned\n", __func__,
diff --git a/drivers/char/ps3htab.c b/drivers/char/ps3htab.c
new file mode 100644
index 0000000..88ecceb
--- /dev/null
+++ b/drivers/char/ps3htab.c
@@ -0,0 +1,222 @@
+
+/*
+ * PS3 HTAB Driver
+ *
+ * Copyright (C) 2011 glevand (geoffrey.levand at mail.ru)
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
+#include <linux/mm.h>
+#include <linux/pagemap.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+
+#define DEVICE_NAME "ps3htab"
+
+#define HTAB_SIZE (1 << CONFIG_PS3_HTAB_SIZE)
+
+static u64 ps3htab_lpar_addr;
+
+static u8 *ps3htab;
+
+static loff_t ps3htab_llseek(struct file *file, loff_t offset, int origin)
+{
+ loff_t res;
+
+ mutex_lock(&file->f_mapping->host->i_mutex);
+
+ switch (origin) {
+ case 1:
+ offset += file->f_pos;
+ break;
+ case 2:
+ offset += HTAB_SIZE;
+ break;
+ }
+
+ if (offset < 0) {
+ res = -EINVAL;
+ goto out;
+ }
+
+ file->f_pos = offset;
+ res = file->f_pos;
+
+out:
+
+ mutex_unlock(&file->f_mapping->host->i_mutex);
+
+ return res;
+}
+
+static ssize_t ps3htab_read(struct file *file, char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *src;
+ int res;
+
+ pr_debug("%s:%u: Reading %zu bytes at position %lld to U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = HTAB_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ src = ps3htab + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from 0x%p to U0x%p\n",
+ __func__, __LINE__, count, src, buf);
+
+ if (buf) {
+ if (copy_to_user(buf, src, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static ssize_t ps3htab_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *dst;
+ int res;
+
+ pr_debug("%s:%u: Writing %zu bytes at position %lld from U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = HTAB_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ dst = ps3htab + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from U0x%p to 0x%p\n",
+ __func__, __LINE__, count, buf, dst);
+
+ if (buf) {
+ if (copy_from_user(dst, buf, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static const struct file_operations ps3htab_fops = {
+ .owner = THIS_MODULE,
+ .llseek = ps3htab_llseek,
+ .read = ps3htab_read,
+ .write = ps3htab_write,
+};
+
+static struct miscdevice ps3htab_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3htab_fops,
+};
+
+static int __init ps3htab_init(void)
+{
+ int res;
+
+ res = lv1_map_htab(0, &ps3htab_lpar_addr);
+ if (res) {
+ pr_debug("%s:%u: htab map failed %d\n", __func__, __LINE__,
res);
+ res = -EFAULT;
+ goto fail;
+ }
+
+ ps3htab = ioremap(ps3htab_lpar_addr, HTAB_SIZE);
+ if (!ps3htab) {
+ pr_debug("%s:%d: ioremap failed\n", __func__, __LINE__);
+ res = -EFAULT;
+ goto fail_lpar_unmap;
+ }
+
+ res = misc_register(&ps3htab_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ goto fail_iounmap;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3htab_misc.minor);
+
+ return 0;
+
+fail_iounmap:
+
+ iounmap(ps3htab);
+
+fail_lpar_unmap:
+
+ lv1_unmap_htab(ps3htab_lpar_addr);
+
+fail:
+
+ return res;
+}
+
+static void __exit ps3htab_exit(void)
+{
+ misc_deregister(&ps3htab_misc);
+
+ iounmap(ps3htab);
+
+ lv1_unmap_htab(ps3htab_lpar_addr);
+}
+
+module_init(ps3htab_init);
+module_exit(ps3htab_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("PS3 HTAB Driver");
+MODULE_AUTHOR("glevand");
diff --git a/drivers/char/ps3hvc.c b/drivers/char/ps3hvc.c
new file mode 100644
index 0000000..a8601c8
--- /dev/null
+++ b/drivers/char/ps3hvc.c
@@ -0,0 +1,408 @@
+
+/*
+ * PS3 HVC Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+#include <asm/ps3hvc.h>
+
+#define DEVICE_NAME "ps3hvc"
+
+static long ps3hvc_ioctl(struct file *file, unsigned int cmd, unsigned long
arg)
+{
+ void __user *argp = (void __user *) arg;
+ int res = -EFAULT;
+
+ pr_debug("%s:%d cmd %x\n", __func__, __LINE__, cmd);
+
+ switch (cmd) {
+ case PS3HVC_IOCTL_HVCALL:
+ {
+ struct ps3hvc_ioctl_hvcall *hvcall;
+
+ hvcall = kmalloc(sizeof(struct ps3hvc_ioctl_hvcall)
+ 16 * sizeof(u64), GFP_KERNEL);
+ if (!hvcall) {
+ pr_debug("%s:%d: kmalloc failed\n",
__func__, __LINE__);
+ res = -ENOMEM;
+ break;
+ }
+
+ if (copy_from_user(hvcall, argp, sizeof(struct
ps3hvc_ioctl_hvcall))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ if ((hvcall->in_args + hvcall->out_args) > 16) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ if (copy_from_user(hvcall, argp, sizeof(struct
ps3hvc_ioctl_hvcall) +
+ (hvcall->in_args + hvcall->out_args) *
sizeof(u64))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ switch (hvcall->number) {
+ /* lv1_undocumented_function_8 */
+ case PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_8:
+ {
+ if ((hvcall->in_args != 0) &&
(hvcall->out_args != 1)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_undocumented_function_8(&hvcall->args[0]);
+
+ break;
+ }
+
+ /* lv1_connect_irq_plug_ext */
+ case PS3HVC_HVCALL_CONNECT_IRQ_PLUG_EXT:
+ {
+ if ((hvcall->in_args != 5) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_connect_irq_plug_ext(hvcall->args[0],
+ hvcall->args[1],
hvcall->args[2], hvcall->args[3],
+ hvcall->args[4]);
+
+ break;
+ }
+
+ /* lv1_disconnect_irq_plug_ext */
+ case PS3HVC_HVCALL_DISCONNECT_IRQ_PLUG_EXT:
+ {
+ if ((hvcall->in_args != 3) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_disconnect_irq_plug_ext(hvcall->args[0],
+ hvcall->args[1],
hvcall->args[2]);
+
+ break;
+ }
+
+ /* lv1_construct_event_receive_port */
+ case PS3HVC_HVCALL_CONSTRUCT_EVENT_RECEIVE_PORT:
+ {
+ if ((hvcall->in_args != 0) &&
(hvcall->out_args != 1)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_construct_event_receive_port(&hvcall->args[0]);
+
+ break;
+ }
+
+ /* lv1_destruct_event_receive_port */
+ case PS3HVC_HVCALL_DESTRUCT_EVENT_RECEIVE_PORT:
+ {
+ if ((hvcall->in_args != 1) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_destruct_event_receive_port(hvcall->args[0]);
+
+ break;
+ }
+
+ /* lv1_get_logical_partition_id */
+ case PS3HVC_HVCALL_GET_LPAR_ID:
+ {
+ if ((hvcall->in_args != 0) &&
(hvcall->out_args != 1)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_get_logical_partition_id(&hvcall->args[0]);
+
+ break;
+ }
+
+ /* lv1_create_repository_node */
+ case PS3HVC_HVCALL_CREATE_REPO_NODE:
+ {
+ if ((hvcall->in_args != 7) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_create_repository_node(hvcall->args[0],
+ hvcall->args[1],
hvcall->args[2], hvcall->args[3],
+ hvcall->args[4],
hvcall->args[5], hvcall->args[6]);
+
+ break;
+ }
+
+ /* lv1_get_repository_node_value */
+ case PS3HVC_HVCALL_GET_REPO_NODE_VAL:
+ {
+ if ((hvcall->in_args != 5) &&
(hvcall->out_args != 2)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_get_repository_node_value(hvcall->args[0],
+ hvcall->args[1],
hvcall->args[2], hvcall->args[3],
+ hvcall->args[4],
&hvcall->args[5], &hvcall->args[6]);
+
+ break;
+ }
+
+ /* lv1_modify_repository_node_value */
+ case PS3HVC_HVCALL_MODIFY_REPO_NODE_VAL:
+ {
+ if ((hvcall->in_args != 7) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_modify_repository_node_value(hvcall->args[0],
+ hvcall->args[1],
hvcall->args[2], hvcall->args[3],
+ hvcall->args[4],
hvcall->args[5], hvcall->args[6]);
+
+ break;
+ }
+
+ /* lv1_remove_repository_node */
+ case PS3HVC_HVCALL_RM_REPO_NODE:
+ {
+ if ((hvcall->in_args != 5) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_remove_repository_node(hvcall->args[0],
+ hvcall->args[1],
hvcall->args[2], hvcall->args[3], hvcall->args[4]);
+
+ break;
+ }
+
+ /* lv1_undocumented_function_102 */
+ case PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_102:
+ {
+ if ((hvcall->in_args != 0) &&
(hvcall->out_args != 1)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_undocumented_function_102(&hvcall->args[0]);
+
+ break;
+ }
+
+ /* lv1_undocumented_function_107 */
+ case PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_107:
+ {
+ if ((hvcall->in_args != 6) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_undocumented_function_107(hvcall->args[0], hvcall->args[1],
+ hvcall->args[2],
hvcall->args[3], hvcall->args[4], hvcall->args[5]);
+
+ break;
+ }
+
+ /* lv1_undocumented_function_109 */
+ case PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_109:
+ {
+ if ((hvcall->in_args != 1) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_undocumented_function_109(hvcall->args[0]);
+
+ break;
+ }
+
+ /* lv1_get_version_info */
+ case PS3HVC_HVCALL_GET_VERSION_INFO:
+ {
+ if ((hvcall->in_args != 0) &&
(hvcall->out_args != 1)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_get_version_info(&hvcall->args[0]);
+
+ break;
+ }
+
+ /* lv1_undocumented_function_182 */
+ case PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_182:
+ {
+ if ((hvcall->in_args != 1) &&
(hvcall->out_args != 1)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_undocumented_function_182(hvcall->args[0], &hvcall->args[1]);
+
+ break;
+ }
+
+ /* lv1_undocumented_function_183 */
+ case PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_183:
+ {
+ if ((hvcall->in_args != 2) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_undocumented_function_183(hvcall->args[0], hvcall->args[1]);
+
+ break;
+ }
+
+ /* lv1_net_control */
+ case PS3HVC_HVCALL_NET_CONTROL:
+ {
+ if ((hvcall->in_args != 6) &&
(hvcall->out_args != 2)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_net_control(hvcall->args[0], hvcall->args[1], hvcall->args[2],
+ hvcall->args[3],
hvcall->args[4], hvcall->args[5],
+ &hvcall->args[6],
&hvcall->args[7]);
+
+ break;
+ }
+
+ /* lv1_undocumented_function_231 */
+ case PS3HVC_HVCALL_UNDOCUMENTED_FUNCTION_231:
+ {
+ if ((hvcall->in_args != 1) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_undocumented_function_231(hvcall->args[0]);
+
+ break;
+ }
+
+ /* lv1_get_rtc */
+ case PS3HVC_HVCALL_GET_RTC:
+ {
+ if ((hvcall->in_args != 0) &&
(hvcall->out_args != 2)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_get_rtc(&hvcall->args[0], &hvcall->args[1]);
+
+ break;
+ }
+
+ /* lv1_panic */
+ case PS3HVC_HVCALL_PANIC:
+ {
+ if ((hvcall->in_args != 1) &&
(hvcall->out_args != 0)) {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ hvcall->result =
lv1_panic(hvcall->args[0]);
+
+ break;
+ }
+
+ default:
+ {
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+ }
+
+ if (copy_to_user(argp, hvcall, sizeof(struct
ps3hvc_ioctl_hvcall) +
+ (hvcall->in_args + hvcall->out_args) *
sizeof(u64))) {
+ pr_debug("%s:%d: copy_to_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_arg;
+ }
+
+ res = 0;
+
+ kfree_arg:
+
+ kfree(hvcall);
+
+ break;
+ }
+ }
+
+ return res;
+}
+
+static const struct file_operations ps3hvc_fops = {
+ .owner = THIS_MODULE,
+ .unlocked_ioctl = ps3hvc_ioctl,
+ .compat_ioctl = ps3hvc_ioctl,
+};
+
+static struct miscdevice ps3hvc_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3hvc_fops,
+};
+
+static int __init ps3hvc_init(void)
+{
+ int res;
+
+ res = misc_register(&ps3hvc_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3hvc_misc.minor);
+
+ return 0;
+}
+
+static void __exit ps3hvc_exit(void)
+{
+ misc_deregister(&ps3hvc_misc);
+}
+
+module_init(ps3hvc_init);
+module_exit(ps3hvc_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 HVC Driver");
+MODULE_AUTHOR("Graf Chokolo");
diff --git a/drivers/char/ps3ram.c b/drivers/char/ps3ram.c
new file mode 100644
index 0000000..02bbe75
--- /dev/null
+++ b/drivers/char/ps3ram.c
@@ -0,0 +1,286 @@
+
+/*
+ * PS3 RAM Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
+#include <linux/mm.h>
+#include <linux/pagemap.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+#include <asm/ps3ram.h>
+
+#define DEVICE_NAME "ps3ram"
+
+#define RAM_SIZE (256 * 1024 * 1024)
+
+static u64 ps3ram_lpar_addr;
+
+static u8 *ps3ram;
+
+static loff_t ps3ram_llseek(struct file *file, loff_t offset, int origin)
+{
+ loff_t res;
+
+ mutex_lock(&file->f_mapping->host->i_mutex);
+
+ switch (origin) {
+ case 1:
+ offset += file->f_pos;
+ break;
+ case 2:
+ offset += RAM_SIZE;
+ break;
+ }
+
+ if (offset < 0) {
+ res = -EINVAL;
+ goto out;
+ }
+
+ file->f_pos = offset;
+ res = file->f_pos;
+
+out:
+ mutex_unlock(&file->f_mapping->host->i_mutex);
+
+ return res;
+}
+
+static ssize_t ps3ram_read(struct file *file, char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *src;
+ int res;
+
+ pr_debug("%s:%u: Reading %zu bytes at position %lld to U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = RAM_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ src = ps3ram + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from 0x%p to U0x%p\n",
+ __func__, __LINE__, count, src, buf);
+
+ if (buf) {
+ if (copy_to_user(buf, src, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static ssize_t ps3ram_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *dst;
+ int res;
+
+ pr_debug("%s:%u: Writing %zu bytes at position %lld from U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = RAM_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ dst = ps3ram + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from U0x%p to 0x%p\n",
+ __func__, __LINE__, count, buf, dst);
+
+ if (buf) {
+ if (copy_from_user(dst, buf, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static int ps3ram_user_to_lpar_addr(u64 user_addr, u64 *lpar_addr)
+{
+ struct page **pages;
+ int res;
+
+ pages = kmalloc(1 * sizeof(struct page *), GFP_KERNEL);
+ if (!pages)
+ return -ENOMEM;
+
+ down_read(¤t->mm->mmap_sem);
+
+ res = get_user_pages(current, current->mm, user_addr & PAGE_MASK, 1,
0, 0, pages, NULL);
+ if (!res)
+ goto fail_get_user_pages;
+
+ up_read(¤t->mm->mmap_sem);
+
+ *lpar_addr = ps3_mm_phys_to_lpar(__pa(page_address(pages[0])));
+
+ page_cache_release(pages[0]);
+
+ kfree(pages);
+
+ return 0;
+
+fail_get_user_pages:
+
+ up_read(¤t->mm->mmap_sem);
+
+ kfree(pages);
+
+ return res;
+}
+
+static long ps3ram_ioctl(struct file *file, unsigned int cmd, unsigned long
arg)
+{
+ void __user *argp = (void __user *) arg;
+ int res;
+
+ switch (cmd) {
+ case PS3RAM_IOCTL_USER_TO_LPAR_ADDR:
+ {
+ struct ps3ram_ioctl_user_to_lpar_addr
user_to_lpar_addr;
+
+ if (copy_from_user(&user_to_lpar_addr, argp,
sizeof(user_to_lpar_addr)))
+ return -EFAULT;
+
+ res =
ps3ram_user_to_lpar_addr(user_to_lpar_addr.user_addr & PAGE_MASK,
+ &user_to_lpar_addr.lpar_addr);
+ if (res)
+ return res;
+
+ user_to_lpar_addr.lpar_addr +=
user_to_lpar_addr.user_addr & ~PAGE_MASK;
+
+ if (copy_to_user(argp, &user_to_lpar_addr,
sizeof(user_to_lpar_addr)))
+ return -EFAULT;
+
+ return 0;
+ }
+ }
+
+ return -EFAULT;
+}
+
+static const struct file_operations ps3ram_fops = {
+ .owner = THIS_MODULE,
+ .llseek = ps3ram_llseek,
+ .read = ps3ram_read,
+ .write = ps3ram_write,
+ .unlocked_ioctl = ps3ram_ioctl,
+ .compat_ioctl = ps3ram_ioctl,
+};
+
+static struct miscdevice ps3ram_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3ram_fops,
+};
+
+static int __init ps3ram_init(void)
+{
+ int res;
+
+ res = lv1_undocumented_function_114(0, PAGE_SHIFT, RAM_SIZE,
&ps3ram_lpar_addr);
+ if (res) {
+ pr_debug("%s:%u: lpar map failed %d\n", __func__, __LINE__,
res);
+ res = -EFAULT;
+ goto fail;
+ }
+
+ ps3ram = ioremap(ps3ram_lpar_addr, RAM_SIZE);
+ if (!ps3ram) {
+ pr_debug("%s:%d: ioremap failed\n", __func__, __LINE__);
+ res = -EFAULT;
+ goto fail_lpar_unmap;
+ }
+
+ res = misc_register(&ps3ram_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ goto fail_iounmap;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3ram_misc.minor);
+
+ return 0;
+
+fail_iounmap:
+
+ iounmap(ps3ram);
+
+fail_lpar_unmap:
+
+ lv1_undocumented_function_115(ps3ram_lpar_addr);
+
+fail:
+
+ return res;
+}
+
+static void __exit ps3ram_exit(void)
+{
+ misc_deregister(&ps3ram_misc);
+
+ iounmap(ps3ram);
+
+ lv1_undocumented_function_115(ps3ram_lpar_addr);
+}
+
+module_init(ps3ram_init);
+module_exit(ps3ram_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("PS3 RAM Driver");
+MODULE_AUTHOR("Graf Chokolo");
diff --git a/drivers/char/ps3rsxmmio.c b/drivers/char/ps3rsxmmio.c
new file mode 100644
index 0000000..a0e06a0
--- /dev/null
+++ b/drivers/char/ps3rsxmmio.c
@@ -0,0 +1,220 @@
+
+/*
+ * PS3 RSX MMIO Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include <linux/mmzone.h>
+#include <linux/io.h>
+#include <linux/mm.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+
+#define DEVICE_NAME "ps3rsxmmio"
+
+#define MMAP_START_ADDR 0x28000000000ull
+#define MMAP_SIZE 0x00800000000ull
+
+static u64 ps3rsxmmio_lpar_addr;
+
+static u8 *ps3rsxmmio;
+
+static loff_t ps3rsxmmio_llseek(struct file *file, loff_t offset, int
origin)
+{
+ loff_t res;
+
+ mutex_lock(&file->f_mapping->host->i_mutex);
+
+ switch (origin) {
+ case 1:
+ offset += file->f_pos;
+ break;
+ case 2:
+ offset += MMAP_SIZE;
+ break;
+ }
+
+ if (offset < 0) {
+ res = -EINVAL;
+ goto out;
+ }
+
+ file->f_pos = offset;
+ res = file->f_pos;
+
+out:
+ mutex_unlock(&file->f_mapping->host->i_mutex);
+
+ return res;
+}
+
+static ssize_t ps3rsxmmio_read(struct file *file, char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *src;
+ int res;
+
+ pr_debug("%s:%u: Reading %zu bytes at position %lld to U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = MMAP_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ src = ps3rsxmmio + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from 0x%p to U0x%p\n",
+ __func__, __LINE__, count, src, buf);
+
+ if (buf) {
+ if (copy_to_user(buf, src, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static ssize_t ps3rsxmmio_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *dst;
+ int res;
+
+ pr_debug("%s:%u: Writing %zu bytes at position %lld from U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = MMAP_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ dst = ps3rsxmmio + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from U0x%p to 0x%p\n",
+ __func__, __LINE__, count, buf, dst);
+
+ if (buf) {
+ if (copy_from_user(dst, buf, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static const struct file_operations ps3rsxmmio_fops = {
+ .owner = THIS_MODULE,
+ .llseek = ps3rsxmmio_llseek,
+ .read = ps3rsxmmio_read,
+ .write = ps3rsxmmio_write,
+};
+
+static struct miscdevice ps3rsxmmio_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3rsxmmio_fops,
+};
+
+static int __init ps3rsxmmio_init(void)
+{
+ int res;
+
+ res = lv1_undocumented_function_114(MMAP_START_ADDR, PAGE_SHIFT,
MMAP_SIZE, &ps3rsxmmio_lpar_addr);
+ if (res) {
+ pr_debug("%s:%u: lpar map failed %d\n", __func__, __LINE__,
res);
+ res = -EFAULT;
+ goto fail;
+ }
+
+ ps3rsxmmio = ioremap_flags(ps3rsxmmio_lpar_addr, MMAP_SIZE,
_PAGE_NO_CACHE);
+ if (!ps3rsxmmio) {
+ pr_debug("%s:%d: ioremap_flags failed\n", __func__,
__LINE__);
+ res = -EFAULT;
+ goto fail_lpar_unmap;
+ }
+
+ res = misc_register(&ps3rsxmmio_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ goto fail_iounmap;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3rsxmmio_misc.minor);
+
+ return 0;
+
+fail_iounmap:
+
+ iounmap(ps3rsxmmio);
+
+fail_lpar_unmap:
+
+ lv1_undocumented_function_115(ps3rsxmmio_lpar_addr);
+
+fail:
+
+ return res;
+}
+
+static void __exit ps3rsxmmio_exit(void)
+{
+ misc_deregister(&ps3rsxmmio_misc);
+
+ iounmap(ps3rsxmmio);
+
+ lv1_undocumented_function_115(ps3rsxmmio_lpar_addr);
+}
+
+module_init(ps3rsxmmio_init);
+module_exit(ps3rsxmmio_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 RSX MMIO Driver");
+MODULE_AUTHOR("Graf Chokolo");
diff --git a/drivers/char/ps3sbmmio.c b/drivers/char/ps3sbmmio.c
new file mode 100644
index 0000000..801b00e
--- /dev/null
+++ b/drivers/char/ps3sbmmio.c
@@ -0,0 +1,220 @@
+
+/*
+ * PS3 SB Bus MMIO Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include <linux/mmzone.h>
+#include <linux/io.h>
+#include <linux/mm.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+
+#define DEVICE_NAME "ps3sbmmio"
+
+#define MMAP_START_ADDR 0x24000000000ull
+#define MMAP_SIZE 0x00800000000ull
+
+static u64 ps3sbmmio_lpar_addr;
+
+static u8 *ps3sbmmio;
+
+static loff_t ps3sbmmio_llseek(struct file *file, loff_t offset, int
origin)
+{
+ loff_t res;
+
+ mutex_lock(&file->f_mapping->host->i_mutex);
+
+ switch (origin) {
+ case 1:
+ offset += file->f_pos;
+ break;
+ case 2:
+ offset += MMAP_SIZE;
+ break;
+ }
+
+ if (offset < 0) {
+ res = -EINVAL;
+ goto out;
+ }
+
+ file->f_pos = offset;
+ res = file->f_pos;
+
+out:
+ mutex_unlock(&file->f_mapping->host->i_mutex);
+
+ return res;
+}
+
+static ssize_t ps3sbmmio_read(struct file *file, char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *src;
+ int res;
+
+ pr_debug("%s:%u: Reading %zu bytes at position %lld to U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = MMAP_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ src = ps3sbmmio + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from 0x%p to U0x%p\n",
+ __func__, __LINE__, count, src, buf);
+
+ if (buf) {
+ if (copy_to_user(buf, src, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static ssize_t ps3sbmmio_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *dst;
+ int res;
+
+ pr_debug("%s:%u: Writing %zu bytes at position %lld from U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = MMAP_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ dst = ps3sbmmio + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from U0x%p to 0x%p\n",
+ __func__, __LINE__, count, buf, dst);
+
+ if (buf) {
+ if (copy_from_user(dst, buf, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static const struct file_operations ps3sbmmio_fops = {
+ .owner = THIS_MODULE,
+ .llseek = ps3sbmmio_llseek,
+ .read = ps3sbmmio_read,
+ .write = ps3sbmmio_write,
+};
+
+static struct miscdevice ps3sbmmio_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3sbmmio_fops,
+};
+
+static int __init ps3sbmmio_init(void)
+{
+ int res;
+
+ res = lv1_undocumented_function_114(MMAP_START_ADDR, PAGE_SHIFT,
MMAP_SIZE, &ps3sbmmio_lpar_addr);
+ if (res) {
+ pr_debug("%s:%u: lpar map failed %d\n", __func__, __LINE__,
res);
+ res = -EFAULT;
+ goto fail;
+ }
+
+ ps3sbmmio = ioremap_flags(ps3sbmmio_lpar_addr, MMAP_SIZE,
_PAGE_NO_CACHE);
+ if (!ps3sbmmio) {
+ pr_debug("%s:%d: ioremap_flags failed\n", __func__,
__LINE__);
+ res = -EFAULT;
+ goto fail_lpar_unmap;
+ }
+
+ res = misc_register(&ps3sbmmio_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ goto fail_iounmap;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3sbmmio_misc.minor);
+
+ return 0;
+
+fail_iounmap:
+
+ iounmap(ps3sbmmio);
+
+fail_lpar_unmap:
+
+ lv1_undocumented_function_115(ps3sbmmio_lpar_addr);
+
+fail:
+
+ return res;
+}
+
+static void __exit ps3sbmmio_exit(void)
+{
+ misc_deregister(&ps3sbmmio_misc);
+
+ iounmap(ps3sbmmio);
+
+ lv1_undocumented_function_115(ps3sbmmio_lpar_addr);
+}
+
+module_init(ps3sbmmio_init);
+module_exit(ps3sbmmio_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 SB Bus MMIO Driver");
+MODULE_AUTHOR("Graf Chokolo");
diff --git a/drivers/char/ps3smproxy.c b/drivers/char/ps3smproxy.c
new file mode 100644
index 0000000..86e4744
--- /dev/null
+++ b/drivers/char/ps3smproxy.c
@@ -0,0 +1,152 @@
+
+/*
+ * PS3 System Manager Proxy Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
+#include <linux/mm.h>
+#include <linux/pagemap.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+#include <asm/ps3smproxy.h>
+
+#define DEVICE_NAME "ps3smproxy"
+
+static long ps3smproxy_ioctl(struct file *file, unsigned int cmd, unsigned
long arg)
+{
+ void __user *argp = (void __user *) arg;
+ int res;
+
+ pr_debug("%s:%d cmd %x\n", __func__, __LINE__, cmd);
+
+ switch (cmd) {
+ case PS3SMPROXY_IOCTL_DO_REQUEST:
+ {
+ struct ps3smproxy_ioctl_do_request do_request;
+ void *sendbuf, *recvbuf = NULL;
+
+ if (copy_from_user(&do_request, argp,
sizeof(do_request))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ WARN_ON(do_request.sendbuf_size > 4096);
+ WARN_ON(do_request.recvbuf_size > 4096);
+
+ pr_debug("%s:%d: sendbuf_size (%lld) recvbuf_size
(%lld)\n",
+ __func__, __LINE__, do_request.sendbuf_size,
do_request.recvbuf_size);
+
+ sendbuf = kmalloc(do_request.sendbuf_size,
GFP_KERNEL);
+ if (!sendbuf) {
+ pr_debug("%s:%d: kmalloc failed\n",
__func__, __LINE__);
+ return -ENOMEM;
+ }
+
+ if (copy_from_user(sendbuf, (const void __user *)
do_request.sendbuf,
+ do_request.sendbuf_size)) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_sendbuf;
+ }
+
+ if (do_request.recvbuf_size) {
+ recvbuf = kmalloc(do_request.recvbuf_size,
GFP_KERNEL);
+ if (!recvbuf) {
+ pr_debug("%s:%d: kmalloc failed\n",
__func__, __LINE__);
+ res = -ENOMEM;
+ goto kfree_sendbuf;
+ }
+ }
+
+ res = ps3_sys_manager_do_request(sendbuf,
do_request.sendbuf_size,
+ recvbuf, do_request.recvbuf_size);
+ if (res) {
+ pr_debug("%s:%d: ps3_sys_manager_do_request
failed (%d)\n", __func__, __LINE__, res);
+ goto kfree_recvbuf;
+ }
+
+ if (do_request.recvbuf_size) {
+ if (copy_to_user((void __user *)
do_request.recvbuf, recvbuf,
+ do_request.recvbuf_size)) {
+ pr_debug("%s:%d: copy_to_user
failed\n", __func__, __LINE__);
+ res = -EFAULT;
+ goto kfree_recvbuf;
+ }
+ }
+
+ res = 0;
+
+ kfree_recvbuf:
+
+ if (recvbuf)
+ kfree(recvbuf);
+
+ kfree_sendbuf:
+
+ kfree(sendbuf);
+
+ return res;
+ }
+ }
+
+ return -EFAULT;
+}
+
+static const struct file_operations ps3smproxy_fops = {
+ .owner = THIS_MODULE,
+ .unlocked_ioctl = ps3smproxy_ioctl,
+ .compat_ioctl = ps3smproxy_ioctl,
+};
+
+static struct miscdevice ps3smproxy_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3smproxy_fops,
+};
+
+static int __init ps3smproxy_init(void)
+{
+ int res;
+
+ res = misc_register(&ps3smproxy_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3smproxy_misc.minor);
+
+ return 0;
+}
+
+static void __exit ps3smproxy_exit(void)
+{
+ misc_deregister(&ps3smproxy_misc);
+}
+
+module_init(ps3smproxy_init);
+module_exit(ps3smproxy_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 System Manager Proxy Driver");
+MODULE_AUTHOR("glevand");
diff --git a/drivers/char/ps3spemmio.c b/drivers/char/ps3spemmio.c
new file mode 100644
index 0000000..240b49e
--- /dev/null
+++ b/drivers/char/ps3spemmio.c
@@ -0,0 +1,221 @@
+
+/*
+ * PS3 SPE MMIO Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include <linux/mmzone.h>
+#include <linux/io.h>
+#include <linux/mm.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+
+#define DEVICE_NAME "ps3spemmio"
+
+#define NUM_SPE 8
+#define MMAP_START_ADDR 0x20000000000ull
+#define MMAP_SIZE (NUM_SPE * 0x80000ull + NUM_SPE * 0x2000ull)
+
+static u64 ps3spemmio_lpar_addr;
+
+static u8 *ps3spemmio;
+
+static loff_t ps3spemmio_llseek(struct file *file, loff_t offset, int
origin)
+{
+ loff_t res;
+
+ mutex_lock(&file->f_mapping->host->i_mutex);
+
+ switch (origin) {
+ case 1:
+ offset += file->f_pos;
+ break;
+ case 2:
+ offset += MMAP_SIZE;
+ break;
+ }
+
+ if (offset < 0) {
+ res = -EINVAL;
+ goto out;
+ }
+
+ file->f_pos = offset;
+ res = file->f_pos;
+
+out:
+ mutex_unlock(&file->f_mapping->host->i_mutex);
+
+ return res;
+}
+
+static ssize_t ps3spemmio_read(struct file *file, char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *src;
+ int res;
+
+ pr_debug("%s:%u: Reading %zu bytes at position %lld to U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = MMAP_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ src = ps3spemmio + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from 0x%p to U0x%p\n",
+ __func__, __LINE__, count, src, buf);
+
+ if (buf) {
+ if (copy_to_user(buf, src, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static ssize_t ps3spemmio_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *pos)
+{
+ u64 size;
+ u8 *dst;
+ int res;
+
+ pr_debug("%s:%u: Writing %zu bytes at position %lld from U0x%p\n",
+ __func__, __LINE__, count, *pos, buf);
+
+ size = MMAP_SIZE;
+ if (*pos >= size || !count)
+ return 0;
+
+ if (*pos + count > size) {
+ pr_debug("%s:%u Truncating count from %zu to %llu\n",
__func__,
+ __LINE__, count, size - *pos);
+ count = size - *pos;
+ }
+
+ dst = ps3spemmio + *pos;
+
+ pr_debug("%s:%u: copy %lu bytes from U0x%p to 0x%p\n",
+ __func__, __LINE__, count, buf, dst);
+
+ if (buf) {
+ if (copy_from_user(dst, buf, count)) {
+ res = -EFAULT;
+ goto fail;
+ }
+ }
+
+ *pos += count;
+
+ return count;
+
+fail:
+
+ return res;
+}
+
+static const struct file_operations ps3spemmio_fops = {
+ .owner = THIS_MODULE,
+ .llseek = ps3spemmio_llseek,
+ .read = ps3spemmio_read,
+ .write = ps3spemmio_write,
+};
+
+static struct miscdevice ps3spemmio_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3spemmio_fops,
+};
+
+static int __init ps3spemmio_init(void)
+{
+ int res;
+
+ res = lv1_undocumented_function_114(MMAP_START_ADDR, PAGE_SHIFT,
MMAP_SIZE, &ps3spemmio_lpar_addr);
+ if (res) {
+ pr_debug("%s:%u: lpar map failed %d\n", __func__, __LINE__,
res);
+ res = -EFAULT;
+ goto fail;
+ }
+
+ ps3spemmio = ioremap_flags(ps3spemmio_lpar_addr, MMAP_SIZE,
_PAGE_NO_CACHE | 3);
+ if (!ps3spemmio) {
+ pr_debug("%s:%d: ioremap_flags failed\n", __func__,
__LINE__);
+ res = -EFAULT;
+ goto fail_lpar_unmap;
+ }
+
+ res = misc_register(&ps3spemmio_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ goto fail_iounmap;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3spemmio_misc.minor);
+
+ return 0;
+
+fail_iounmap:
+
+ iounmap(ps3spemmio);
+
+fail_lpar_unmap:
+
+ lv1_undocumented_function_115(ps3spemmio_lpar_addr);
+
+fail:
+
+ return res;
+}
+
+static void __exit ps3spemmio_exit(void)
+{
+ misc_deregister(&ps3spemmio_misc);
+
+ iounmap(ps3spemmio);
+
+ lv1_undocumented_function_115(ps3spemmio_lpar_addr);
+}
+
+module_init(ps3spemmio_init);
+module_exit(ps3spemmio_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 SPE MMIO Driver");
+MODULE_AUTHOR("Graf Chokolo");
diff --git a/drivers/char/ps3stormgr.c b/drivers/char/ps3stormgr.c
new file mode 100644
index 0000000..d344575
--- /dev/null
+++ b/drivers/char/ps3stormgr.c
@@ -0,0 +1,176 @@
+
+/*
+ * PS3 Storage Manager Driver
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/fs.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/io.h>
+#include <linux/uaccess.h>
+
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+#include <asm/ps3stormgr.h>
+
+#define DEVICE_NAME "ps3stormgr"
+
+static long ps3stormgr_ioctl(struct file *file, unsigned int cmd, unsigned
long arg)
+{
+ void __user *argp = (void __user *) arg;
+ int res;
+
+ pr_debug("%s:%d cmd %x\n", __func__, __LINE__, cmd);
+
+ switch (cmd) {
+ case PS3STORMGR_IOCTL_CREATE_REGION:
+ {
+ struct ps3stormgr_ioctl_create_region create_region;
+ u64 tag;
+
+ if (copy_from_user(&create_region, argp,
sizeof(create_region))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ res =
lv1_undocumented_function_250(create_region.dev_id,
create_region.start_sector,
+ create_region.sector_count, 0,
create_region.laid,
+ &create_region.region_id, &tag);
+ if (res) {
+ pr_debug("%s:%d:
lv1_undocumented_function_250 failed (%d)\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ if (copy_to_user(argp, &create_region,
sizeof(create_region))) {
+ pr_debug("%s:%d: copy_to_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ return 0;
+ }
+
+ case PS3STORMGR_IOCTL_DELETE_REGION:
+ {
+ struct ps3stormgr_ioctl_delete_region delete_region;
+ u64 tag;
+
+ if (copy_from_user(&delete_region, argp,
sizeof(delete_region))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ res =
lv1_undocumented_function_251(delete_region.dev_id, delete_region.region_id,
+ &tag);
+ if (res) {
+ pr_debug("%s:%d:
lv1_undocumented_function_251 failed (%d)\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ return 0;
+ }
+
+ case PS3STORMGR_IOCTL_SET_REGION_ACL:
+ {
+ struct ps3stormgr_ioctl_set_region_acl
set_region_acl;
+ u64 tag;
+
+ if (copy_from_user(&set_region_acl, argp,
sizeof(set_region_acl))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ res =
lv1_undocumented_function_252(set_region_acl.dev_id,
set_region_acl.region_id,
+ set_region_acl.laid,
set_region_acl.access_rights, &tag);
+ if (res) {
+ pr_debug("%s:%d:
lv1_undocumented_function_252 failed (%d)\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ return 0;
+ }
+
+ case PS3STORMGR_IOCTL_GET_REGION_ACL:
+ {
+ struct ps3stormgr_ioctl_get_region_acl
get_region_acl;
+
+ if (copy_from_user(&get_region_acl, argp,
sizeof(get_region_acl))) {
+ pr_debug("%s:%d: copy_from_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ res =
lv1_undocumented_function_253(get_region_acl.dev_id,
get_region_acl.region_id,
+ get_region_acl.entry_index,
&get_region_acl.laid, &get_region_acl.access_rights);
+ if (res) {
+ pr_debug("%s:%d:
lv1_undocumented_function_253 failed (%d)\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ if (copy_to_user(argp, &get_region_acl,
sizeof(get_region_acl))) {
+ pr_debug("%s:%d: copy_to_user failed\n",
__func__, __LINE__);
+ return -EFAULT;
+ }
+
+ return 0;
+ }
+ }
+
+ return -EFAULT;
+}
+
+static const struct file_operations ps3stormgr_fops = {
+ .owner = THIS_MODULE,
+ .unlocked_ioctl = ps3stormgr_ioctl,
+ .compat_ioctl = ps3stormgr_ioctl,
+};
+
+static struct miscdevice ps3stormgr_misc = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = DEVICE_NAME,
+ .fops = &ps3stormgr_fops,
+};
+
+static int __init ps3stormgr_init(void)
+{
+ int res;
+
+ res = misc_register(&ps3stormgr_misc);
+ if (res) {
+ pr_debug("%s:%u: misc_register failed %d\n",
+ __func__, __LINE__, res);
+ return res;
+ }
+
+ pr_debug("%s:%u: registered misc device %d\n",
+ __func__, __LINE__, ps3stormgr_misc.minor);
+
+ return 0;
+}
+
+static void __exit ps3stormgr_exit(void)
+{
+ misc_deregister(&ps3stormgr_misc);
+}
+
+module_init(ps3stormgr_init);
+module_exit(ps3stormgr_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 Storage Manager Driver");
+MODULE_AUTHOR("Graf Chokolo");
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index ffdf734..32067c2 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -26,8 +26,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#undef DEBUG
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
diff --git a/drivers/net/ps3_gelic_wireless.c
b/drivers/net/ps3_gelic_wireless.c
index b5ae29d..f338cb6 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -17,7 +17,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#undef DEBUG
#include <linux/kernel.h>
#include <linux/module.h>
@@ -183,7 +182,7 @@ static void gelic_eurus_sync_cmd_worker(struct
work_struct *work)
&cmd->tag, &cmd->size);
if (cmd->status) {
complete(&cmd->done);
- pr_info("%s: cmd issue failed\n", __func__);
+ pr_info("%s: cmd issue failed %d\n", __func__, cmd->status);
return;
}
diff --git a/drivers/ps3/Makefile b/drivers/ps3/Makefile
index 50cb1e1..2e9073a 100644
--- a/drivers/ps3/Makefile
+++ b/drivers/ps3/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_PPC_PS3) += sys-manager-core.o
obj-$(CONFIG_PS3_SYS_MANAGER) += ps3-sys-manager.o
obj-$(CONFIG_PS3_STORAGE) += ps3stor_lib.o
obj-$(CONFIG_PS3_LPM) += ps3-lpm.o
+obj-$(CONFIG_PS3_PS3DM) += ps3dm.o
diff --git a/drivers/ps3/ps3-sys-manager.c b/drivers/ps3/ps3-sys-manager.c
index 1b98367..84bb993 100644
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/workqueue.h>
#include <linux/reboot.h>
+#include <linux/delay.h>
#include <asm/firmware.h>
#include <asm/lv1call.h>
@@ -233,6 +234,9 @@ enum ps3_sys_manager_cmd {
static unsigned int ps3_sm_force_power_off;
+static int timeout = 5000; /* in msec ( 5 sec ) */
+module_param(timeout, int, 0644);
+
/**
* ps3_sys_manager_write - Helper to write a two part message to the vuart.
*
@@ -257,6 +261,35 @@ static int ps3_sys_manager_write(struct
ps3_system_bus_device *dev,
return result;
}
+#define POLLING_INTERVAL 25 /* in msec */
+
+/**
+ * ps3_sys_manager_read - Helper to read data from the vuart.
+ *
+ */
+
+static int ps3_sys_manager_read(struct ps3_system_bus_device *dev,
+ void *buf, unsigned int size, int timeout)
+{
+ int error;
+ int loopcnt = 0;
+
+ timeout = (timeout + POLLING_INTERVAL - 1) / POLLING_INTERVAL;
+
+ while (loopcnt++ <= timeout) {
+ error = ps3_vuart_read(dev, buf, size);
+ if (!error)
+ return size;
+
+ if (error != -EAGAIN)
+ return error;
+
+ msleep(POLLING_INTERVAL);
+ }
+
+ return -EWOULDBLOCK;
+}
+
/**
* ps3_sys_manager_send_attr - Send a 'set attribute' to the system
manager.
*
@@ -656,13 +689,56 @@ static void ps3_sys_manager_final_restart(struct
ps3_system_bus_device *dev)
ps3_vuart_cancel_async(dev);
ps3_sys_manager_send_attr(dev, 0);
- ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_REBOOT,
+ ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_LPAR_REBOOT,
user_wake_sources);
ps3_sys_manager_fin(dev);
}
/**
+ * ps3_sys_manager_do_req - Sends a request and optionally reads a request.
+ */
+
+static int ps3_sys_manager_do_req(struct ps3_system_bus_device *dev,
+ const void *sendbuf, unsigned int sendbuf_size,
+ void *recvbuf, unsigned int recvbuf_size)
+{
+ struct ps3_sys_manager_header *header;
+ int result;
+
+ BUG_ON(!dev);
+ BUG_ON(sendbuf_size < sizeof(struct ps3_sys_manager_header));
+
+ dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+ ps3_vuart_cancel_async(dev);
+
+ result = ps3_vuart_write(dev, sendbuf, sendbuf_size);
+ if (result)
+ goto done;
+
+ if (recvbuf) {
+ header = (struct ps3_sys_manager_header *) recvbuf;
+
+ result = ps3_sys_manager_read(dev, header, sizeof(struct
ps3_sys_manager_header), timeout);
+ if (result != sizeof(struct ps3_sys_manager_header))
+ goto done;
+
+ result = ps3_sys_manager_read(dev, header + 1,
header->payload_size, timeout);
+ if (result != header->payload_size)
+ goto done;
+ }
+
+ result = 0;
+
+done:
+
+ ps3_vuart_read_async(dev, PS3_SM_RX_MSG_LEN_MIN);
+
+ return result;
+}
+
+/**
* ps3_sys_manager_get_wol - Get wake-on-lan setting.
*/
@@ -715,6 +791,7 @@ static int __devinit ps3_sys_manager_probe(struct
ps3_system_bus_device *dev)
ops.power_off = ps3_sys_manager_final_power_off;
ops.restart = ps3_sys_manager_final_restart;
+ ops.do_request = ps3_sys_manager_do_req;
ops.dev = dev;
/* ps3_sys_manager_register_ops copies ops. */
diff --git a/drivers/ps3/ps3-vuart.c b/drivers/ps3/ps3-vuart.c
index d9fb729..7af328b 100644
--- a/drivers/ps3/ps3-vuart.c
+++ b/drivers/ps3/ps3-vuart.c
@@ -39,6 +39,7 @@ MODULE_DESCRIPTION("PS3 vuart");
* vuart - An inter-partition data link service.
* port 0: PS3 AV Settings.
* port 2: PS3 System Manager.
+ * port 10: PS3 Dispatcher Manager.
*
* The vuart provides a bi-directional byte stream data link between
logical
* partitions. Its primary role is as a communications link between the
guest
@@ -46,7 +47,7 @@ MODULE_DESCRIPTION("PS3 vuart");
* connections other than those listed.
*/
-enum {PORT_COUNT = 3,};
+enum {PORT_COUNT = 11,};
enum vuart_param {
PARAM_TX_TRIGGER = 0,
@@ -926,7 +927,7 @@ static int ps3_vuart_bus_interrupt_get(void)
vuart_bus_priv.use_count++;
- BUG_ON(vuart_bus_priv.use_count > 2);
+ BUG_ON(vuart_bus_priv.use_count > 3);
if (vuart_bus_priv.use_count != 1)
return 0;
diff --git a/drivers/ps3/ps3dm.c b/drivers/ps3/ps3dm.c
new file mode 100644
index 0000000..04f1930
--- /dev/null
+++ b/drivers/ps3/ps3dm.c
@@ -0,0 +1,247 @@
+
+/*
+ * PS3 Dispatcher Manager.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+
+#include <asm/firmware.h>
+#include <asm/lv1call.h>
+#include <asm/ps3.h>
+#include <asm/ps3dm.h>
+
+#include "vuart.h"
+
+static struct ps3dm {
+ struct mutex mutex;
+ struct ps3_system_bus_device *dev;
+} *ps3dm;
+
+static int timeout = 5000; /* in msec ( 5 sec ) */
+module_param(timeout, int, 0644);
+
+static int ps3dm_vuart_write(struct ps3_system_bus_device *dev,
+ const void *buf, unsigned int size)
+{
+ int error;
+
+ dev_dbg(&dev->core, " -> %s:%d\n", __func__, __LINE__);
+
+ error = ps3_vuart_write(dev, buf, size);
+
+ dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
+
+ return error ? error : size;
+}
+
+#define POLLING_INTERVAL 25 /* in msec */
+
+static int ps3dm_vuart_read(struct ps3_system_bus_device *dev,
+ void *buf, unsigned int size, int timeout)
+{
+ int error;
+ int loopcnt = 0;
+
+ dev_dbg(&dev->core, " -> %s:%d\n", __func__, __LINE__);
+
+ timeout = (timeout + POLLING_INTERVAL - 1) / POLLING_INTERVAL;
+
+ while (loopcnt++ <= timeout) {
+ error = ps3_vuart_read(dev, buf, size);
+ if (!error)
+ return size;
+
+ if (error != -EAGAIN) {
+ printk(KERN_ERR "%s: ps3_vuart_read failed %d\n",
+ __func__, error);
+ return error;
+ }
+
+ msleep(POLLING_INTERVAL);
+ }
+
+ return -EWOULDBLOCK;
+}
+
+int ps3dm_write(const void *buf, unsigned int size)
+{
+ int error;
+
+ BUG_ON(!ps3dm);
+
+ mutex_lock(&ps3dm->mutex);
+
+ error = ps3dm_vuart_write(ps3dm->dev, buf, size);
+
+ mutex_unlock(&ps3dm->mutex);
+
+ return error ? error : size;
+}
+
+EXPORT_SYMBOL_GPL(ps3dm_write);
+
+int ps3dm_read(void *buf, unsigned int size)
+{
+ int error;
+
+ BUG_ON(!ps3dm);
+
+ mutex_lock(&ps3dm->mutex);
+
+ error = ps3dm_vuart_read(ps3dm->dev, buf, size, timeout);
+
+ mutex_unlock(&ps3dm->mutex);
+
+ return error ? error : size;
+}
+
+EXPORT_SYMBOL_GPL(ps3dm_read);
+
+int ps3dm_do_request(struct ps3dm_hdr *sendbuf, unsigned int sendbuf_size,
+ struct ps3dm_hdr *recvbuf, unsigned int recvbuf_size)
+{
+ int res;
+
+ BUG_ON(!ps3dm);
+ BUG_ON(sendbuf_size < PS3DM_HDR_SIZE);
+ BUG_ON(recvbuf_size < PS3DM_HDR_SIZE);
+
+ mutex_lock(&ps3dm->mutex);
+
+ res = ps3dm_vuart_write(ps3dm->dev, sendbuf, sendbuf_size);
+ if (res != sendbuf_size) {
+ printk(KERN_ERR
+ "%s: ps3dm_vuart_write() failed (result=%d)\n",
+ __func__, res);
+ goto err;
+ }
+
+ res = ps3dm_vuart_read(ps3dm->dev, recvbuf, PS3DM_HDR_SIZE,
timeout);
+ if (res != PS3DM_HDR_SIZE) {
+ printk(KERN_ERR
+ "%s: ps3dm_vuart_read() failed (result=%d)\n",
+ __func__, res);
+ goto err;
+ }
+
+ res = ps3dm_vuart_read(ps3dm->dev, recvbuf + 1,
recvbuf->response_size, timeout);
+ if (res < 0) {
+ printk(KERN_ERR
+ "%s: ps3dm_vuart_read() failed (result=%d)\n",
+ __func__, res);
+ goto err;
+ }
+
+ mutex_unlock(&ps3dm->mutex);
+
+ return 0;
+
+err:
+
+ mutex_unlock(&ps3dm->mutex);
+
+ return res;
+}
+
+EXPORT_SYMBOL_GPL(ps3dm_do_request);
+
+static int __devinit ps3dm_probe(struct ps3_system_bus_device *dev)
+{
+ dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+ if (ps3dm) {
+ dev_err(&dev->core, "Only one ps3dm device is supported\n");
+ return -EBUSY;
+ }
+
+ ps3dm = kzalloc(sizeof(*ps3dm), GFP_KERNEL);
+ if (!ps3dm)
+ return -ENOMEM;
+
+ mutex_init(&ps3dm->mutex);
+ ps3dm->dev = dev;
+
+ return 0;
+}
+
+static int ps3dm_remove(struct ps3_system_bus_device *dev)
+{
+ dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+
+ if (ps3dm) {
+ kfree(ps3dm);
+ ps3dm = NULL;
+ }
+
+ dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
+
+ return 0;
+}
+
+static void ps3dm_shutdown(struct ps3_system_bus_device *dev)
+{
+ dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+ ps3dm_remove(dev);
+ dev_dbg(&dev->core, "%s:%d\n", __func__, __LINE__);
+}
+
+static struct ps3_vuart_port_driver ps3dm_driver = {
+ .core.match_id = PS3_MATCH_ID_DISPATCHER_MANAGER,
+ .core.core.name = "ps3dm",
+ .probe = ps3dm_probe,
+ .remove = ps3dm_remove,
+ .shutdown = ps3dm_shutdown,
+};
+
+static int __init ps3dm_module_init(void)
+{
+ int error;
+
+ if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
+ return -ENODEV;
+
+ pr_debug(" <- %s:%d\n", __func__, __LINE__);
+
+ error = ps3_vuart_port_driver_register(&ps3dm_driver);
+ if (error) {
+ printk(KERN_ERR
+ "%s: ps3_vuart_port_driver_register failed %d\n",
+ __func__, error);
+ return error;
+ }
+
+ pr_debug(" <- %s:%d\n", __func__, __LINE__);
+
+ return error;
+}
+
+static void __exit ps3dm_module_exit(void)
+{
+ pr_debug(" -> %s:%d\n", __func__, __LINE__);
+ ps3_vuart_port_driver_unregister(&ps3dm_driver);
+ pr_debug(" <- %s:%d\n", __func__, __LINE__);
+}
+
+subsys_initcall(ps3dm_module_init);
+module_exit(ps3dm_module_exit);
+
+MODULE_AUTHOR("Graf Chokolo");
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("PS3 Dispatcher Manager");
+MODULE_ALIAS(PS3_MODULE_ALIAS_DISPATCHER_MANAGER);
diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c
index af0afa1..ee0bfa2 100644
--- a/drivers/ps3/ps3stor_lib.c
+++ b/drivers/ps3/ps3stor_lib.c
@@ -89,8 +89,9 @@ static int ps3stor_probe_access(struct ps3_storage_device
*dev)
unsigned int i;
unsigned long n;
- if (dev->sbd.match_id == PS3_MATCH_ID_STOR_ROM) {
- /* special case: CD-ROM is assumed always accessible */
+ if ((dev->sbd.match_id == PS3_MATCH_ID_STOR_ROM) ||
+ (dev->sbd.match_id == PS3_MATCH_ID_STOR_ENCDEC)) {
+ /* special case: CD-ROM and ENCDEC are assumed always
accessible */
dev->accessible_regions = 1;
return 0;
}
@@ -101,9 +102,8 @@ static int ps3stor_probe_access(struct
ps3_storage_device *dev)
"%s:%u: checking accessibility of region %u\n",
__func__, __LINE__, i);
- dev->region_idx = i;
- res = ps3stor_read_write_sectors(dev, dev->bounce_lpar, 0,
1,
- 0);
+ res = ps3stor_read_write_sectors(dev, dev->bounce_lpar, i,
0, 1,
+ dev->regions[i].flags, 0);
if (res) {
dev_dbg(&dev->sbd.core, "%s:%u: read failed, "
"region %u is not accessible\n", __func__,
@@ -115,6 +115,10 @@ static int ps3stor_probe_access(struct
ps3_storage_device *dev)
__func__, __LINE__, i);
set_bit(i, &dev->accessible_regions);
+ dev_info(&dev->sbd.core,
+ "accessible region %u start %llu size %llu\n",
+ i, dev->regions[i].start, dev->regions[i].size);
+
/* We can access at least one region */
error = 0;
}
@@ -124,14 +128,8 @@ static int ps3stor_probe_access(struct
ps3_storage_device *dev)
n = hweight_long(dev->accessible_regions);
if (n > 1)
dev_info(&dev->sbd.core,
- "%s:%u: %lu accessible regions found. Only the
first "
- "one will be used\n",
+ "%s:%u: %lu accessible regions found\n",
__func__, __LINE__, n);
- dev->region_idx = __ffs(dev->accessible_regions);
- dev_info(&dev->sbd.core,
- "First accessible region has index %u start %llu size
%llu\n",
- dev->region_idx, dev->regions[dev->region_idx].start,
- dev->regions[dev->region_idx].size);
return 0;
}
@@ -265,17 +263,19 @@ EXPORT_SYMBOL_GPL(ps3stor_teardown);
* ps3stor_read_write_sectors - read/write from/to a storage device
* @dev: Pointer to a struct ps3_storage_device
* @lpar: HV logical partition address
+ * @region_idx: Region index
* @start_sector: First sector to read/write
* @sectors: Number of sectors to read/write
+ * @flags: Flags
* @write: Flag indicating write (non-zero) or read (zero)
*
* Returns 0 for success, -1 in case of failure to submit the command,
or
* an LV1 status value in case of other errors
*/
-u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
- u64 start_sector, u64 sectors, int write)
+u64 ps3stor_read_write_sectors(struct ps3_storage_device *dev, u64 lpar,
unsigned int region_idx,
+ u64 start_sector, u64 sectors, u64 flags, int
write)
{
- unsigned int region_id = dev->regions[dev->region_idx].id;
+ unsigned int region_id = dev->regions[region_idx].id;
const char *op = write ? "write" : "read";
int res;
@@ -284,10 +284,10 @@ u64 ps3stor_read_write_sectors(struct
ps3_storage_device *dev, u64 lpar,
init_completion(&dev->done);
res = write ? lv1_storage_write(dev->sbd.dev_id, region_id,
- start_sector, sectors, 0, lpar,
+ start_sector, sectors, flags, lpar,
&dev->tag)
: lv1_storage_read(dev->sbd.dev_id, region_id,
- start_sector, sectors, 0, lpar,
+ start_sector, sectors, flags, lpar,
&dev->tag);
if (res) {
dev_dbg(&dev->sbd.core, "%s:%u: %s failed %d\n", __func__,
diff --git a/drivers/ps3/sys-manager-core.c b/drivers/ps3/sys-manager-core.c
index 4742258..c7cafd3 100644
--- a/drivers/ps3/sys-manager-core.c
+++ b/drivers/ps3/sys-manager-core.c
@@ -70,3 +70,13 @@ void ps3_sys_manager_halt(void)
lv1_pause(1);
}
+int ps3_sys_manager_do_request(const void *sendbuf, unsigned int
sendbuf_size,
+ void *recvbuf, unsigned int recvbuf_size)
+{
+ if (ps3_sys_manager_ops.do_request)
+ return
ps3_sys_manager_ops.do_request(ps3_sys_manager_ops.dev,
+ sendbuf, sendbuf_size, recvbuf, recvbuf_size);
+ else
+ return -ENOSYS;
+}
+EXPORT_SYMBOL_GPL(ps3_sys_manager_do_request);
diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index cd178b9..e8a3564 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -172,12 +172,13 @@ static int ps3rom_read_request(struct
ps3_storage_device *dev,
u32 sectors)
{
int res;
+ unsigned int region_idx = 0;
dev_dbg(&dev->sbd.core, "%s:%u: read %u sectors starting at %u\n",
__func__, __LINE__, sectors, start_sector);
res = lv1_storage_read(dev->sbd.dev_id,
- dev->regions[dev->region_idx].id,
start_sector,
+ dev->regions[region_idx].id, start_sector,
sectors, 0, dev->bounce_lpar, &dev->tag);
if (res) {
dev_err(&dev->sbd.core, "%s:%u: read failed %d\n", __func__,
@@ -193,6 +194,7 @@ static int ps3rom_write_request(struct
ps3_storage_device *dev,
u32 sectors)
{
int res;
+ unsigned int region_idx = 0;
dev_dbg(&dev->sbd.core, "%s:%u: write %u sectors starting at %u\n",
__func__, __LINE__, sectors, start_sector);
@@ -200,7 +202,7 @@ static int ps3rom_write_request(struct
ps3_storage_device *dev,
scsi_sg_copy_to_buffer(cmd, dev->bounce_buf, dev->bounce_size);
res = lv1_storage_write(dev->sbd.dev_id,
- dev->regions[dev->region_idx].id,
start_sector,
+ dev->regions[region_idx].id, start_sector,
sectors, 0, dev->bounce_lpar, &dev->tag);
if (res) {
dev_err(&dev->sbd.core, "%s:%u: write failed %d\n",
__func__,
diff --git a/ps3_linux_config b/ps3_linux_config
new file mode 100644
index 0000000..85fb336
--- /dev/null
+++ b/ps3_linux_config
@@ -0,0 +1,1629 @@
+#
+# Automatically generated make config: don't edit
+# Linux/powerpc 2.6.39 Kernel Configuration
+# Wed Jun 29 00:39:52 2011
+#
+CONFIG_PPC64=y
+
+#
+# Processor support
+#
+CONFIG_PPC_BOOK3S_64=y
+# CONFIG_PPC_BOOK3E_64 is not set
+CONFIG_PPC_BOOK3S=y
+# CONFIG_POWER4_ONLY is not set
+CONFIG_POWER3=y
+CONFIG_POWER4=y
+CONFIG_TUNE_CELL=y
+CONFIG_PPC_FPU=y
+CONFIG_ALTIVEC=y
+# CONFIG_VSX is not set
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_64=y
+CONFIG_PPC_MM_SLICES=y
+CONFIG_VIRT_CPU_ACCOUNTING=y
+CONFIG_PPC_HAVE_PMU_SUPPORT=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=2
+CONFIG_64BIT=y
+CONFIG_WORD_SIZE=64
+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
+CONFIG_ARCH_DMA_ADDR_T_64BIT=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
+CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
+CONFIG_NR_IRQS=512
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_ARCH_HAS_ILOG2_U64=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_FIND_BIT_LE=y
+CONFIG_ARCH_NO_VIRT_TO_BUS=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_COMPAT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
+CONFIG_HAVE_IRQ_WORK=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_FHANDLE is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_HAVE_SPARSE_IRQ=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_SPARSE_IRQ=y
+
+#
+# RCU Subsystem
+#
+CONFIG_TREE_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=64
+# CONFIG_RCU_FANOUT_EXACT is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+# CONFIG_CGROUPS is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_XZ=y
+CONFIG_RD_LZO=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EXPERT=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+# CONFIG_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+# CONFIG_PERF_COUNTERS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_SYSCALL_WRAPPERS=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_USE_GENERIC_SMP_HELPERS=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_STOP_MACHINE=y
+CONFIG_BLOCK=y
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLOCK_COMPAT=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_SPIN_UNLOCK is not set
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_READ_UNLOCK is not set
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_WRITE_UNLOCK is not set
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
+# CONFIG_FREEZER is not set
+
+#
+# Platform support
+#
+# CONFIG_PPC_PSERIES is not set
+# CONFIG_PPC_ISERIES is not set
+# CONFIG_PPC_PMAC is not set
+# CONFIG_PPC_MAPLE is not set
+# CONFIG_PPC_PASEMI is not set
+CONFIG_PPC_PS3=y
+
+#
+# PS3 Platform Options
+#
+CONFIG_PS3_ADVANCED=y
+CONFIG_PS3_HTAB_SIZE=20
+# CONFIG_PS3_DYNAMIC_DMA is not set
+CONFIG_PS3_VUART=y
+CONFIG_PS3_PS3AV=y
+CONFIG_PS3_SYS_MANAGER=y
+CONFIG_PS3_SMPROXY=m
+CONFIG_PS3_PS3DM=m
+CONFIG_PS3_DMPROXY=m
+CONFIG_PS3_STORAGE=y
+CONFIG_PS3_DISK=y
+CONFIG_PS3_ROM=y
+# CONFIG_PS3_FLASH is not set
+CONFIG_PS3_VRAM=m
+CONFIG_PS3_LPM=m
+CONFIG_PS3_NFLASH=m
+CONFIG_PS3_VFLASH=m
+CONFIG_PS3_ENCDEC=m
+CONFIG_PS3_STORMGR=m
+CONFIG_PS3_RAM=m
+CONFIG_PS3_SPEMMIO=m
+CONFIG_PS3_SBMMIO=m
+CONFIG_PS3_RSXMMIO=m
+CONFIG_PS3_HVC=m
+CONFIG_PS3_HTAB=m
+CONFIG_PPC_CELL=y
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PPC_IBM_CELL_BLADE is not set
+# CONFIG_PPC_CELLEB is not set
+# CONFIG_PPC_CELL_QPACE is not set
+
+#
+# Cell Broadband Engine options
+#
+CONFIG_SPU_FS=m
+CONFIG_SPU_FS_64K_LS=y
+CONFIG_SPU_BASE=y
+# CONFIG_PQ2ADS is not set
+# CONFIG_KVM_GUEST is not set
+# CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set
+# CONFIG_IPIC is not set
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_U3_DART is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_MPIC_U3_HT_IRQS is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_FSL_ULI1575 is not set
+# CONFIG_SIMPLE_GPIO is not set
+
+#
+# Kernel options
+#
+CONFIG_TICK_ONESHOT=y
+# CONFIG_NO_HZ is not set
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_SCHED_HRTICK=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_COMPAT_BINFMT_ELF=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+# CONFIG_HAVE_AOUT is not set
+CONFIG_BINFMT_MISC=y
+CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y
+CONFIG_IOMMU_HELPER=y
+# CONFIG_SWIOTLB is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+CONFIG_KEXEC=y
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_IRQ_ALL_CPUS is not set
+# CONFIG_NUMA is not set
+CONFIG_MAX_ACTIVE_REGIONS=256
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SYS_SUPPORTS_HUGETLBFS=y
+CONFIG_SELECT_MEMORY_MODEL=y
+# CONFIG_FLATMEM_MANUAL is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+# CONFIG_SPARSEMEM_VMEMMAP is not set
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_MEMORY_HOTPLUG=y
+CONFIG_MEMORY_HOTPLUG_SPARSE=y
+CONFIG_MEMORY_HOTREMOVE=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=999999
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_ARCH_MEMORY_PROBE=y
+CONFIG_PPC_HAS_HASH_64K=y
+CONFIG_PPC_4K_PAGES=y
+# CONFIG_PPC_64K_PAGES is not set
+CONFIG_FORCE_MAX_ZONEORDER=13
+CONFIG_SCHED_SMT=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+CONFIG_EXTRA_TARGETS=""
+# CONFIG_HIBERNATION is not set
+# CONFIG_PM_RUNTIME is not set
+# CONFIG_SECCOMP is not set
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_SG_DMA_LENGTH=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PPC_PCI_CHOICE=y
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+# CONFIG_HAS_RAPIDIO is not set
+# CONFIG_RELOCATABLE is not set
+CONFIG_PAGE_OFFSET=0xc000000000000000
+CONFIG_KERNEL_START=0xc000000000000000
+CONFIG_PHYSICAL_START=0x00000000
+CONFIG_NET=y
+CONFIG_COMPAT_NETLINK_MESSAGES=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+CONFIG_INET_TUNNEL=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IPV6=y
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=y
+CONFIG_INET6_XFRM_MODE_TUNNEL=y
+CONFIG_INET6_XFRM_MODE_BEET=y
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
+# CONFIG_IPV6_SIT_6RD is not set
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+CONFIG_RPS=y
+CONFIG_RFS_ACCEL=y
+CONFIG_XPS=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=m
+# CONFIG_BT_HCIUART is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_BT_MRVL is not set
+# CONFIG_BT_ATH3K is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_WIRELESS=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_CFG80211=y
+# CONFIG_NL80211_TESTMODE is not set
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+CONFIG_CFG80211_DEBUGFS=y
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_WEXT=y
+# CONFIG_WIRELESS_EXT_SYSFS is not set
+# CONFIG_LIB80211 is not set
+CONFIG_MAC80211=y
+CONFIG_MAC80211_HAS_RC=y
+CONFIG_MAC80211_RC_PID=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL_HT=y
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+# CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT="pid"
+CONFIG_MAC80211_MESH=y
+CONFIG_MAC80211_DEBUGFS=y
+# CONFIG_MAC80211_DEBUG_MENU is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_DEVTMPFS is not set
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+CONFIG_DTC=y
+CONFIG_OF=y
+
+#
+# Device Tree and Open Firmware support
+#
+CONFIG_PROC_DEVICETREE=y
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_DYNAMIC=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_DEVICE=y
+CONFIG_OF_NET=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+
+#
+# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
+#
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65535
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+CONFIG_CHR_DEV_SG=m
+# CONFIG_CHR_DEV_SCH is not set
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+# CONFIG_BLK_DEV_MD is not set
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+# CONFIG_DM_CRYPT is not set
+# CONFIG_DM_SNAPSHOT is not set
+# CONFIG_DM_MIRROR is not set
+# CONFIG_DM_RAID is not set
+# CONFIG_DM_ZERO is not set
+# CONFIG_DM_MULTIPATH is not set
+# CONFIG_DM_DELAY is not set
+# CONFIG_DM_UEVENT is not set
+# CONFIG_DM_FLAKEY is not set
+# CONFIG_TARGET_CORE is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_MII=m
+# CONFIG_PHYLIB is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NETDEV_1000=y
+CONFIG_GELIC_NET=m
+CONFIG_GELIC_WIRELESS=y
+# CONFIG_XILINX_LL_TEMAC is not set
+# CONFIG_STMMAC_ETH is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_WLAN=y
+# CONFIG_LIBERTAS_THINFIRM is not set
+# CONFIG_AT76C50X_USB is not set
+# CONFIG_USB_ZD1201 is not set
+# CONFIG_USB_NET_RNDIS_WLAN is not set
+# CONFIG_RTL8187 is not set
+# CONFIG_MAC80211_HWSIM is not set
+# CONFIG_ATH_COMMON is not set
+# CONFIG_B43 is not set
+# CONFIG_B43LEGACY is not set
+# CONFIG_HOSTAP is not set
+# CONFIG_LIBERTAS is not set
+# CONFIG_P54_COMMON is not set
+# CONFIG_RT2X00 is not set
+# CONFIG_RTL8192CU is not set
+# CONFIG_WL1251 is not set
+# CONFIG_WL12XX_MENU is not set
+# CONFIG_ZD1211RW is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_IPHETH is not set
+# CONFIG_WAN is not set
+
+#
+# CAIF transport drivers
+#
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=y
+CONFIG_PPP_SYNC_TTY=y
+CONFIG_PPP_DEFLATE=y
+CONFIG_PPP_BSDCOMP=y
+# CONFIG_PPP_MPPE is not set
+CONFIG_PPPOE=y
+CONFIG_SLIP=y
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLHC=y
+# CONFIG_SLIP_SMART is not set
+# CONFIG_SLIP_MODE_SLIP6 is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=y
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=y
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+CONFIG_DEVKMEM=y
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_TIMBERDALE is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_TTY_PRINTK is not set
+# CONFIG_HVC_UDBG is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_RAMOOPS is not set
+# CONFIG_I2C is not set
+# CONFIG_SPI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+# CONFIG_MFD_SUPPORT is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_IMAGEBLIT=y
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+CONFIG_FB_SYS_FOPS=y
+# CONFIG_FB_WMT_GE_ROPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_OF is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_UDL is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+CONFIG_FB_PS3=y
+CONFIG_FB_PS3_DEFAULT_SIZE_M=9
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+CONFIG_FB_LOGO_EXTRA=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_HRTIMER is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+# CONFIG_SND_RAWMIDI_SEQ is not set
+# CONFIG_SND_OPL3_LIB_SEQ is not set
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+# CONFIG_SND_EMU10K1_SEQ is not set
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_ALOOP is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+CONFIG_SND_PPC=y
+CONFIG_SND_PS3=m
+CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
+# CONFIG_SND_USB is not set
+# CONFIG_SND_SOC is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_3M_PCT is not set
+# CONFIG_HID_A4TECH is not set
+# CONFIG_HID_ACRUX is not set
+CONFIG_HID_APPLE=m
+CONFIG_HID_BELKIN=m
+# CONFIG_HID_CANDO is not set
+CONFIG_HID_CHERRY=m
+# CONFIG_HID_CHICONY is not set
+# CONFIG_HID_PRODIKEYS is not set
+# CONFIG_HID_CYPRESS is not set
+# CONFIG_HID_DRAGONRISE is not set
+# CONFIG_HID_EMS_FF is not set
+# CONFIG_HID_ELECOM is not set
+CONFIG_HID_EZKEY=m
+# CONFIG_HID_KEYTOUCH is not set
+# CONFIG_HID_KYE is not set
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
+# CONFIG_HID_GYRATION is not set
+CONFIG_HID_TWINHAN=m
+# CONFIG_HID_KENSINGTON is not set
+# CONFIG_HID_LCPOWER is not set
+CONFIG_HID_LOGITECH=m
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+# CONFIG_LOGIG940_FF is not set
+# CONFIG_LOGIWII_FF is not set
+# CONFIG_HID_MAGICMOUSE is not set
+CONFIG_HID_MICROSOFT=m
+# CONFIG_HID_MOSART is not set
+# CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_MULTITOUCH is not set
+# CONFIG_HID_NTRIG is not set
+# CONFIG_HID_ORTEK is not set
+# CONFIG_HID_PANTHERLORD is not set
+# CONFIG_HID_PETALYNX is not set
+# CONFIG_HID_PICOLCD is not set
+# CONFIG_HID_QUANTA is not set
+# CONFIG_HID_ROCCAT is not set
+# CONFIG_HID_ROCCAT_ARVO is not set
+# CONFIG_HID_ROCCAT_KONE is not set
+# CONFIG_HID_ROCCAT_KONEPLUS is not set
+# CONFIG_HID_ROCCAT_KOVAPLUS is not set
+# CONFIG_HID_ROCCAT_PYRA is not set
+# CONFIG_HID_SAMSUNG is not set
+CONFIG_HID_SONY=m
+# CONFIG_HID_STANTUM is not set
+CONFIG_HID_SUNPLUS=m
+# CONFIG_HID_GREENASIA is not set
+CONFIG_HID_SMARTJOYPLUS=m
+# CONFIG_SMARTJOYPLUS_FF is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_ZEROPLUS is not set
+# CONFIG_HID_ZYDACRON is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=m
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
+# CONFIG_USB_EHCI_HCD_PPC_OF is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+# CONFIG_USB_ISP1362_HCD is not set
+CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
+# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
+# CONFIG_USB_OHCI_HCD_PPC_OF is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+
+#
+# Enable Host or Gadget support to see Inventra options
+#
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_REALTEK is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_STORAGE_ENE_UB6250 is not set
+# CONFIG_USB_UAS is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_YUREX is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_NOP_USB_XCEIV is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_NFC_DEVICES is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=m
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_MSM6242 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_RP5C01 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_RTC_DRV_GENERIC is not set
+CONFIG_RTC_DRV_PS3=m
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+CONFIG_EXT2_FS_XIP=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_XATTR=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_FS_XIP=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=y
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+CONFIG_REISERFS_FS_XATTR=y
+# CONFIG_REISERFS_FS_POSIX_ACL is not set
+# CONFIG_REISERFS_FS_SECURITY is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+# CONFIG_QUOTA_DEBUG is not set
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=y
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_LOGFS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+CONFIG_UFS_FS=y
+CONFIG_UFS_FS_WRITE=y
+CONFIG_UFS_DEBUG=y
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_PNFS_FILE_LAYOUT=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFS_USE_NEW_IDMAPPER is not set
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_CEPH_FS is not set
+CONFIG_CIFS=y
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_STATS2=y
+CONFIG_CIFS_WEAK_PW_HASH=y
+CONFIG_CIFS_UPCALL=y
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+CONFIG_CIFS_DFS_UPCALL=y
+# CONFIG_CIFS_ACL is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=y
+CONFIG_NLS_CODEPAGE_852=y
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+CONFIG_NLS_CODEPAGE_866=y
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+CONFIG_NLS_CODEPAGE_1250=y
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=y
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DECOMPRESS_XZ=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_CPU_RMAP=y
+CONFIG_NLATTR=y
+CONFIG_AVERAGE=y
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_LOCK_ALLOC=y
+CONFIG_PROVE_LOCKING=y
+# CONFIG_PROVE_RCU is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+CONFIG_LOCKDEP=y
+# CONFIG_LOCK_STAT is not set
+CONFIG_DEBUG_LOCKDEP=y
+CONFIG_TRACE_IRQFLAGS=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_INFO_REDUCED is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_DEBUG_WRITECOUNT=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_DEBUG_LIST=y
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_LKDTM is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_PPC_DISABLE_WERROR is not set
+CONFIG_PPC_WERROR=y
+CONFIG_PRINT_STACK_DEPTH=64
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PER_CPU_MAPS is not set
+# CONFIG_PPC_EMULATED_STATS is not set
+# CONFIG_CODE_PATCHING_SELFTEST is not set
+# CONFIG_FTR_FIXUP_SELFTEST is not set
+# CONFIG_MSI_BITMAP_SELFTEST is not set
+# CONFIG_XMON is not set
+# CONFIG_VIRQ_DEBUG is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_KEYS_COMPAT=y
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_PCOMP2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+CONFIG_CRYPTO_GF128MUL=y
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_PCRYPT is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=y
+CONFIG_CRYPTO_GCM=y
+CONFIG_CRYPTO_SEQIV=y
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=y
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=y
+CONFIG_CRYPTO_XTS=y
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_GHASH=y
+CONFIG_CRYPTO_MD4=y
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA512=y
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=y
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+CONFIG_CRYPTO_SALSA20=y
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+CONFIG_CRYPTO_TEA=y
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+CONFIG_CRYPTO_ZLIB=y
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_PPC_CLOCK is not set
+# CONFIG_VIRTUALIZATION is not set
More information about the cbe-oss-dev
mailing list