patch-2.4.22 linux-2.4.22/arch/ppc/platforms/pmac_nvram.c
Next file: linux-2.4.22/arch/ppc/platforms/pmac_pci.c
Previous file: linux-2.4.22/arch/ppc/platforms/pmac_feature.c
Back to the patch index
Back to the overall index
- Lines: 118
- Date:
2003-08-25 04:44:40.000000000 -0700
- Orig file:
linux-2.4.21/arch/ppc/platforms/pmac_nvram.c
- Orig date:
2003-06-13 07:51:31.000000000 -0700
diff -urN linux-2.4.21/arch/ppc/platforms/pmac_nvram.c linux-2.4.22/arch/ppc/platforms/pmac_nvram.c
@@ -102,7 +102,7 @@
}
low %= 65521UL;
high %= 65521UL;
-
+
return (high << 16) | low;
}
@@ -114,7 +114,7 @@
if (hdr99->hdr.signature != CORE99_SIGNATURE) {
#ifdef DEBUG
printk("Invalid signature\n");
-#endif
+#endif
return 0;
}
if (hdr99->hdr.cksum != chrp_checksum(&hdr99->hdr)) {
@@ -136,9 +136,9 @@
core99_erase_bank(int bank)
{
int stat, i;
-
+
u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE;
-
+
out_8(base, CORE99_FLASH_CMD_ERASE_SETUP);
out_8(base, CORE99_FLASH_CMD_ERASE_CONFIRM);
do { stat = in_8(base); }
@@ -160,9 +160,9 @@
core99_write_bank(int bank, u8* datas)
{
int i, stat = 0;
-
+
u8* base = (u8 *)nvram_data + core99_bank*NVRAM_SIZE;
-
+
for (i=0; i<NVRAM_SIZE; i++) {
out_8(base+i, CORE99_FLASH_CMD_WRITE_SETUP);
out_8(base+i, datas[i]);
@@ -181,7 +181,7 @@
printk("nvram: flash write failed !\n");
return -ENXIO;
}
- return 0;
+ return 0;
}
static void __init
@@ -196,7 +196,7 @@
nvram_partitions[pmac_nvram_XPRAM] = -1;
nvram_partitions[pmac_nvram_NR] = -1;
hdr = (struct chrp_header *)buffer;
-
+
offset = 0;
buffer[16] = 0;
do {
@@ -214,12 +214,12 @@
nvram_partitions[pmac_nvram_OF] = 0x1800;
nvram_partitions[pmac_nvram_XPRAM] = 0x1300;
nvram_partitions[pmac_nvram_NR] = 0x1400;
- }
+ }
#ifdef DEBUG
printk("nvram: OF partition at 0x%x\n", nvram_partitions[pmac_nvram_OF]);
printk("nvram: XP partition at 0x%x\n", nvram_partitions[pmac_nvram_XPRAM]);
printk("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
-#endif
+#endif
}
void __init
@@ -239,7 +239,7 @@
if (is_core_99) {
int i;
u32 gen_bank0, gen_bank1;
-
+
if (nvram_naddrs < 1) {
printk(KERN_ERR "nvram: no address\n");
return;
@@ -287,7 +287,7 @@
pmac_nvram_update(void)
{
struct core99_header* hdr99;
-
+
if (!is_core_99 || !nvram_data || !nvram_image)
return;
if (!memcmp(nvram_image, (u8*)nvram_data + core99_bank*NVRAM_SIZE,
@@ -380,10 +380,10 @@
pmac_xpram_read(int xpaddr)
{
int offset = nvram_partitions[pmac_nvram_XPRAM];
-
+
if (offset < 0)
return 0;
-
+
return nvram_read_byte(xpaddr + offset);
}
@@ -391,9 +391,9 @@
pmac_xpram_write(int xpaddr, u8 data)
{
int offset = nvram_partitions[pmac_nvram_XPRAM];
-
+
if (offset < 0)
return;
-
+
nvram_write_byte(xpaddr + offset, data);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)