diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/ps3/os-area.c | 44 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/platform.h | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 2 |
3 files changed, 21 insertions, 27 deletions
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c index ee463d0f87ad..f5112248802b 100644 --- a/arch/powerpc/platforms/ps3/os-area.c +++ b/arch/powerpc/platforms/ps3/os-area.c | |||
@@ -114,27 +114,12 @@ struct os_area_params { | |||
114 | #define SECONDS_FROM_1970_TO_2000 946684800LL | 114 | #define SECONDS_FROM_1970_TO_2000 946684800LL |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * struct saved_params - Static working copies of data from the 'Other OS' area. | 117 | * struct saved_params - Static working copies of data from the PS3 'os area'. |
118 | * | ||
119 | * For the convinience of the guest, the HV makes a copy of the 'Other OS' area | ||
120 | * in flash to a high address in the boot memory region and then puts that RAM | ||
121 | * address and the byte count into the repository for retreval by the guest. | ||
122 | * We copy the data we want into a static variable and allow the memory setup | ||
123 | * by the HV to be claimed by the lmb manager. | ||
124 | */ | 118 | */ |
125 | 119 | ||
126 | struct saved_params { | 120 | struct saved_params { |
127 | /* param 0 */ | ||
128 | s64 rtc_diff; | 121 | s64 rtc_diff; |
129 | unsigned int av_multi_out; | 122 | unsigned int av_multi_out; |
130 | unsigned int ctrl_button; | ||
131 | /* param 1 */ | ||
132 | u8 static_ip_addr[4]; | ||
133 | u8 network_mask[4]; | ||
134 | u8 default_gateway[4]; | ||
135 | /* param 2 */ | ||
136 | u8 dns_primary[4]; | ||
137 | u8 dns_secondary[4]; | ||
138 | } static saved_params; | 123 | } static saved_params; |
139 | 124 | ||
140 | #define dump_header(_a) _dump_header(_a, __func__, __LINE__) | 125 | #define dump_header(_a) _dump_header(_a, __func__, __LINE__) |
@@ -201,7 +186,17 @@ static int __init verify_header(const struct os_area_header *header) | |||
201 | return 0; | 186 | return 0; |
202 | } | 187 | } |
203 | 188 | ||
204 | int __init ps3_os_area_init(void) | 189 | /** |
190 | * ps3_os_area_save_params - Copy data from os area mirror to @saved_params. | ||
191 | * | ||
192 | * For the convenience of the guest, the HV makes a copy of the os area in | ||
193 | * flash to a high address in the boot memory region and then puts that RAM | ||
194 | * address and the byte count into the repository for retreval by the guest. | ||
195 | * We copy the data we want into a static variable and allow the memory setup | ||
196 | * by the HV to be claimed by the lmb manager. | ||
197 | */ | ||
198 | |||
199 | void __init ps3_os_area_save_params(void) | ||
205 | { | 200 | { |
206 | int result; | 201 | int result; |
207 | u64 lpar_addr; | 202 | u64 lpar_addr; |
@@ -209,12 +204,14 @@ int __init ps3_os_area_init(void) | |||
209 | struct os_area_header *header; | 204 | struct os_area_header *header; |
210 | struct os_area_params *params; | 205 | struct os_area_params *params; |
211 | 206 | ||
207 | pr_debug(" -> %s:%d\n", __func__, __LINE__); | ||
208 | |||
212 | result = ps3_repository_read_boot_dat_info(&lpar_addr, &size); | 209 | result = ps3_repository_read_boot_dat_info(&lpar_addr, &size); |
213 | 210 | ||
214 | if (result) { | 211 | if (result) { |
215 | pr_debug("%s:%d ps3_repository_read_boot_dat_info failed\n", | 212 | pr_debug("%s:%d ps3_repository_read_boot_dat_info failed\n", |
216 | __func__, __LINE__); | 213 | __func__, __LINE__); |
217 | return result; | 214 | return; |
218 | } | 215 | } |
219 | 216 | ||
220 | header = (struct os_area_header *)__va(lpar_addr); | 217 | header = (struct os_area_header *)__va(lpar_addr); |
@@ -226,7 +223,7 @@ int __init ps3_os_area_init(void) | |||
226 | if (result) { | 223 | if (result) { |
227 | pr_debug("%s:%d verify_header failed\n", __func__, __LINE__); | 224 | pr_debug("%s:%d verify_header failed\n", __func__, __LINE__); |
228 | dump_header(header); | 225 | dump_header(header); |
229 | return -EIO; | 226 | return; |
230 | } | 227 | } |
231 | 228 | ||
232 | dump_header(header); | 229 | dump_header(header); |
@@ -234,13 +231,10 @@ int __init ps3_os_area_init(void) | |||
234 | 231 | ||
235 | saved_params.rtc_diff = params->rtc_diff; | 232 | saved_params.rtc_diff = params->rtc_diff; |
236 | saved_params.av_multi_out = params->av_multi_out; | 233 | saved_params.av_multi_out = params->av_multi_out; |
237 | saved_params.ctrl_button = params->ctrl_button; | ||
238 | memcpy(saved_params.static_ip_addr, params->static_ip_addr, 4); | ||
239 | memcpy(saved_params.network_mask, params->network_mask, 4); | ||
240 | memcpy(saved_params.default_gateway, params->default_gateway, 4); | ||
241 | memcpy(saved_params.dns_secondary, params->dns_secondary, 4); | ||
242 | 234 | ||
243 | return result; | 235 | memset(header, 0, sizeof(*header)); |
236 | |||
237 | pr_debug(" <- %s:%d\n", __func__, __LINE__); | ||
244 | } | 238 | } |
245 | 239 | ||
246 | /** | 240 | /** |
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h index 27c7d099816a..9109c313e492 100644 --- a/arch/powerpc/platforms/ps3/platform.h +++ b/arch/powerpc/platforms/ps3/platform.h | |||
@@ -62,7 +62,7 @@ int ps3_set_rtc_time(struct rtc_time *time); | |||
62 | 62 | ||
63 | /* os area */ | 63 | /* os area */ |
64 | 64 | ||
65 | int __init ps3_os_area_init(void); | 65 | void __init ps3_os_area_save_params(void); |
66 | u64 ps3_os_area_rtc_diff(void); | 66 | u64 ps3_os_area_rtc_diff(void); |
67 | 67 | ||
68 | /* spu */ | 68 | /* spu */ |
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index 609945dbe394..f0d5ec51ef17 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c | |||
@@ -228,7 +228,7 @@ static int __init ps3_probe(void) | |||
228 | 228 | ||
229 | powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE; | 229 | powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE; |
230 | 230 | ||
231 | ps3_os_area_init(); | 231 | ps3_os_area_save_params(); |
232 | ps3_mm_init(); | 232 | ps3_mm_init(); |
233 | ps3_mm_vas_create(&htab_size); | 233 | ps3_mm_vas_create(&htab_size); |
234 | ps3_hpte_init(htab_size); | 234 | ps3_hpte_init(htab_size); |