Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67532
b: refs/heads/rpi-3.2.27
c: 01263e8
h: refs/heads/rpi-3.2.27
  • Loading branch information
Geoff Levand authored and paulusmack committed Oct 9, 2007
1 parent d033de1 commit e2d09e4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/rpi-3.2.27: ca94297f0c169710848a095a2fd986195e546cb3
refs/heads/rpi-3.2.27: 01263e88c3b8c4ec9621062a40b42814e0859e92
44 changes: 19 additions & 25 deletions trunk/arch/powerpc/platforms/ps3/os-area.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,12 @@ struct os_area_params {
#define SECONDS_FROM_1970_TO_2000 946684800LL

/**
* struct saved_params - Static working copies of data from the 'Other OS' area.
*
* For the convinience of the guest, the HV makes a copy of the 'Other OS' area
* in flash to a high address in the boot memory region and then puts that RAM
* address and the byte count into the repository for retreval by the guest.
* We copy the data we want into a static variable and allow the memory setup
* by the HV to be claimed by the lmb manager.
* struct saved_params - Static working copies of data from the PS3 'os area'.
*/

struct saved_params {
/* param 0 */
s64 rtc_diff;
unsigned int av_multi_out;
unsigned int ctrl_button;
/* param 1 */
u8 static_ip_addr[4];
u8 network_mask[4];
u8 default_gateway[4];
/* param 2 */
u8 dns_primary[4];
u8 dns_secondary[4];
} static saved_params;

#define dump_header(_a) _dump_header(_a, __func__, __LINE__)
Expand Down Expand Up @@ -201,20 +186,32 @@ static int __init verify_header(const struct os_area_header *header)
return 0;
}

int __init ps3_os_area_init(void)
/**
* ps3_os_area_save_params - Copy data from os area mirror to @saved_params.
*
* For the convenience of the guest, the HV makes a copy of the os area in
* flash to a high address in the boot memory region and then puts that RAM
* address and the byte count into the repository for retreval by the guest.
* We copy the data we want into a static variable and allow the memory setup
* by the HV to be claimed by the lmb manager.
*/

void __init ps3_os_area_save_params(void)
{
int result;
u64 lpar_addr;
unsigned int size;
struct os_area_header *header;
struct os_area_params *params;

pr_debug(" -> %s:%d\n", __func__, __LINE__);

result = ps3_repository_read_boot_dat_info(&lpar_addr, &size);

if (result) {
pr_debug("%s:%d ps3_repository_read_boot_dat_info failed\n",
__func__, __LINE__);
return result;
return;
}

header = (struct os_area_header *)__va(lpar_addr);
Expand All @@ -226,21 +223,18 @@ int __init ps3_os_area_init(void)
if (result) {
pr_debug("%s:%d verify_header failed\n", __func__, __LINE__);
dump_header(header);
return -EIO;
return;
}

dump_header(header);
dump_params(params);

saved_params.rtc_diff = params->rtc_diff;
saved_params.av_multi_out = params->av_multi_out;
saved_params.ctrl_button = params->ctrl_button;
memcpy(saved_params.static_ip_addr, params->static_ip_addr, 4);
memcpy(saved_params.network_mask, params->network_mask, 4);
memcpy(saved_params.default_gateway, params->default_gateway, 4);
memcpy(saved_params.dns_secondary, params->dns_secondary, 4);

return result;
memset(header, 0, sizeof(*header));

pr_debug(" <- %s:%d\n", __func__, __LINE__);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/ps3/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int ps3_set_rtc_time(struct rtc_time *time);

/* os area */

int __init ps3_os_area_init(void);
void __init ps3_os_area_save_params(void);
u64 ps3_os_area_rtc_diff(void);

/* spu */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/ps3/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static int __init ps3_probe(void)

powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE;

ps3_os_area_init();
ps3_os_area_save_params();
ps3_mm_init();
ps3_mm_vas_create(&htab_size);
ps3_hpte_init(htab_size);
Expand Down

0 comments on commit e2d09e4

Please sign in to comment.