diff --git a/board/mpc8641hpcn/mpc8641hpcn.c b/board/mpc8641hpcn/mpc8641hpcn.c
index 5023c1c..b2cf4a9 100644
--- a/board/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/mpc8641hpcn/mpc8641hpcn.c
@@ -50,12 +50,12 @@
 long int fixed_sdram(void);
 
 
-int board_early_init_f (void)
+int board_early_init_f(void)
 {
 	return 0;
 }
 
-int checkboard (void)
+int checkboard(void)
 {
 	puts("Board: MPC8641HPCN\n");
 
@@ -68,7 +68,7 @@
 	uint devdisr = gur->devdisr;
 	uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
 	uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
-	uint pex1_agent =  (host1_agent == 0) || (host1_agent == 1);
+	uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
 
 	if ((io_sel == 2 || io_sel == 3 || io_sel == 5
 	     || io_sel == 6 || io_sel == 7 || io_sel == 0xF)
@@ -80,7 +80,7 @@
 			debug(" with errors.  Clearing.  Now 0x%08x",
 			      pex1->pme_msg_det);
 		}
-		debug ("\n");
+		debug("\n");
 	} else {
 		puts("PCI-EXPRESS 1: Disabled\n");
 	}
@@ -99,9 +99,9 @@
 	long dram_size = 0;
 
 #if defined(CONFIG_SPD_EEPROM)
-	dram_size = spd_sdram ();
+	dram_size = spd_sdram();
 #else
-	dram_size = fixed_sdram ();
+	dram_size = fixed_sdram();
 #endif
 
 #if defined(CFG_RAMBOOT)
@@ -122,7 +122,8 @@
 
 
 #if defined(CFG_DRAM_TEST)
-int testdram(void)
+int
+testdram(void)
 {
 	uint *pstart = (uint *) CFG_MEMTEST_START;
 	uint *pend = (uint *) CFG_MEMTEST_END;
@@ -134,7 +135,7 @@
 
 	for (p = pstart; p < pend; p++) {
 		if (*p != 0xaaaaaaaa) {
-			printf ("SDRAM test fails at: %08x\n", (uint) p);
+			printf("SDRAM test fails at: %08x\n", (uint) p);
 			return 1;
 		}
 	}
@@ -145,7 +146,7 @@
 
 	for (p = pstart; p < pend; p++) {
 		if (*p != 0x55555555) {
-			printf ("SDRAM test fails at: %08x\n", (uint) p);
+			printf("SDRAM test fails at: %08x\n", (uint) p);
 			return 1;
 		}
 	}
@@ -160,11 +161,12 @@
 /*
  * Fixed sdram init -- doesn't use serial presence detect.
  */
-long int fixed_sdram(void)
+long int
+fixed_sdram(void)
 {
 #if !defined(CFG_RAMBOOT)
-	volatile immap_t *immap = (immap_t *)CFG_IMMR;
-	volatile ccsr_ddr_t *ddr= &immap->im_ddr1;
+	volatile immap_t *immap = (immap_t *) CFG_IMMR;
+	volatile ccsr_ddr_t *ddr = &immap->im_ddr1;
 
 	ddr->cs0_bnds = CFG_DDR_CS0_BNDS;
 	ddr->cs0_config = CFG_DDR_CS0_CONFIG;
@@ -211,28 +213,25 @@
 
 #ifndef CONFIG_PCI_PNP
 static struct pci_config_table pci_fsl86xxads_config_table[] = {
-    { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
-      PCI_IDSEL_NUMBER, PCI_ANY_ID,
-      pci_cfgfunc_config_device, { PCI_ENET0_IOADDR,
-				   PCI_ENET0_MEMADDR,
-				   PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
-      } },
-    { }
+	{PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+	 PCI_IDSEL_NUMBER, PCI_ANY_ID,
+	 pci_cfgfunc_config_device, {PCI_ENET0_IOADDR,
+				     PCI_ENET0_MEMADDR,
+				     PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER}},
+	{}
 };
 #endif
 
 
 static struct pci_controller hose = {
 #ifndef CONFIG_PCI_PNP
-	config_table: pci_mpc86xxcts_config_table,
+      config_table:pci_mpc86xxcts_config_table,
 #endif
 };
 
-#endif	/* CONFIG_PCI */
-
+#endif /* CONFIG_PCI */
 
-void
-pci_init_board(void)
+void pci_init_board(void)
 {
 #ifdef CONFIG_PCI
 	extern void pci_mpc86xx_init(struct pci_controller *hose);
@@ -260,7 +259,7 @@
 
 
 void
-mpc8641_reset_board(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+mpc8641_reset_board(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
 	char cmd;
 	ulong val;
@@ -276,7 +275,7 @@
 
 	cmd = argv[1][1];
 	switch (cmd) {
-	case 'f':    /* reset with frequency changed */
+	case 'f':		/* reset with frequency changed */
 		if (argc < 5)
 			goto my_usage;
 		read_from_px_regs(0);
@@ -294,7 +293,7 @@
 		} else
 			goto my_usage;
 
-		while (1); /* Not reached */
+		while (1) ;	/* Not reached */
 
 	case 'l':
 		if (argv[2][1] == 'f') {
@@ -305,7 +304,8 @@
 
 			corepll = strfractoint(argv[4]);
 			val = val + set_px_corepll(corepll);
-			val = val + set_px_mpxpll(simple_strtoul(argv[5], NULL, 10));
+			val = val + set_px_mpxpll(simple_strtoul(argv[5],
+								 NULL, 10));
 			if (val == 3) {
 				puts("Setting registers VCFGEN0, VCFGEN1, VBOOT, and VCTL\n");
 				set_altbank();
@@ -316,9 +316,9 @@
 			} else
 				goto my_usage;
 
-			while(1); /* Not reached */
+			while (1) ;	/* Not reached */
 
-		} else if(argv[2][1] == 'd'){
+		} else if (argv[2][1] == 'd') {
 			/*
 			 * Reset from alternate bank without changing
 			 * frequencies but with watchdog timer enabled.
@@ -330,7 +330,7 @@
 			read_from_px_regs_altbank(1);
 			puts("Enabling watchdog timer on the FPGA and resetting board to boot from the other bank....\n");
 			set_px_go_with_watchdog();
-			while(1); /* Not reached */
+			while (1) ;	/* Not reached */
 
 		} else {
 			/*
@@ -339,7 +339,7 @@
 			 */
 			read_from_px_regs(0);
 			read_from_px_regs_altbank(0);
-			if(argc > 2)
+			if (argc > 2)
 				goto my_usage;
 			puts("Setting registers VCFGNE1, VBOOT, and VCTL\n");
 			set_altbank();
@@ -360,12 +360,14 @@
 	puts("See MPC8641HPCN Design Workbook for valid values of command line parameters.\n");
 }
 
+
 /*
  * get_board_sys_clk
  *      Reads the FPGA on board for CONFIG_SYS_CLK_FREQ
  */
 
-unsigned long get_board_sys_clk(ulong dummy)
+unsigned long
+get_board_sys_clk(ulong dummy)
 {
 	u8 i, go_bit, rd_clks;
 	ulong val = 0;
@@ -422,4 +424,3 @@
 
 	return val;
 }
-
diff --git a/board/mpc8641hpcn/pixis.c b/board/mpc8641hpcn/pixis.c
index f226b3e..964a17c 100644
--- a/board/mpc8641hpcn/pixis.c
+++ b/board/mpc8641hpcn/pixis.c
@@ -92,13 +92,13 @@
 		return 0;
 	}
 
-	vclkh = (sysclk_s << 5) | sysclk_r ;
+	vclkh = (sysclk_s << 5) | sysclk_r;
 	vclkl = sysclk_v;
 
 	out8(PIXIS_BASE + PIXIS_VCLKH, vclkh);
 	out8(PIXIS_BASE + PIXIS_VCLKL, vclkl);
 
-	out8(PIXIS_BASE + PIXIS_AUX,sysclk_aux);
+	out8(PIXIS_BASE + PIXIS_AUX, sysclk_aux);
 
 	return 1;
 }
@@ -118,7 +118,7 @@
 	case 12:
 	case 14:
 	case 16:
-		val = (u8)mpxpll;
+		val = (u8) mpxpll;
 		break;
 	default:
 		printf("Unsupported MPXPLL ratio.\n");
@@ -245,19 +245,16 @@
 
 	/* setting VCTL[WDEN] to 0 to disable watch dog */
 	tmp = in8(PIXIS_BASE + PIXIS_VCTL);
-	tmp &= ~ 0x08;
+	tmp &= ~0x08;
 	out8(PIXIS_BASE + PIXIS_VCTL, tmp);
 
 	return 0;
 }
 
-
 U_BOOT_CMD(
-	diswd, 1, 0, disable_watchdog,
-	"diswd	- Disable watchdog timer \n",
-	NULL
-);
-
+	   diswd, 1, 0, disable_watchdog,
+	   "diswd	- Disable watchdog timer \n",
+	   NULL);
 
 /*
  * This function takes the non-integral cpu:mpx pll ratio
@@ -295,11 +292,11 @@
 
 	if (no_dec) {
 		/* Currently needed only for single digit corepll ratios */
-		mulconst=10;
+		mulconst = 10;
 		decval = 0;
 	} else {
 		j = 0;
-		i++; /* Skipping the decimal point */
+		i++;		/* Skipping the decimal point */
 		while ((strptr[i] > 47) && (strptr[i] < 58)) {
 			decarr[j] = strptr[i];
 			i++;
diff --git a/board/mpc8641hpcn/sys_eeprom.c b/board/mpc8641hpcn/sys_eeprom.c
index 733a57f..74e2a3d 100644
--- a/board/mpc8641hpcn/sys_eeprom.c
+++ b/board/mpc8641hpcn/sys_eeprom.c
@@ -29,16 +29,16 @@
 
 #ifdef CFG_ID_EEPROM
 typedef struct {
-	unsigned char id[4];    /* 0x0000 - 0x0003 */
-	unsigned char sn[12];   /* 0x0004 - 0x000F */
-	unsigned char errata[5];/* 0x0010 - 0x0014 */
-	unsigned char date[7];  /* 0x0015 - 0x001a */
-	unsigned char res_1[37];/* 0x001b - 0x003f */
-	unsigned char tab_size; /* 0x0040 */
-	unsigned char tab_flag; /* 0x0041 */
-	unsigned char mac[8][6];/* 0x0042 - 0x0071 */
-	unsigned char res_2[126];/* 0x0072 - 0x00ef */
-	unsigned int  crc;      /* 0x00f0 - 0x00f3 crc32 checksum */
+	unsigned char id[4];		/* 0x0000 - 0x0003 */
+	unsigned char sn[12];		/* 0x0004 - 0x000F */
+	unsigned char errata[5];	/* 0x0010 - 0x0014 */
+	unsigned char date[7];		/* 0x0015 - 0x001a */
+	unsigned char res_1[37];	/* 0x001b - 0x003f */
+	unsigned char tab_size;		/* 0x0040 */
+	unsigned char tab_flag;		/* 0x0041 */
+	unsigned char mac[8][6];	/* 0x0042 - 0x0071 */
+	unsigned char res_2[126];	/* 0x0072 - 0x00ef */
+	unsigned int crc;		/* 0x00f0 - 0x00f3 crc32 checksum */
 } EEPROM_data;
 
 static EEPROM_data mac_data;
@@ -48,30 +48,34 @@
 	int i;
 	unsigned char ethaddr[8][18];
 
-	printf("ID %c%c%c%c\n", mac_data.id[0],\
-				mac_data.id[1],\
-				mac_data.id[2],\
-				mac_data.id[3]);
-	printf("Errata %c%c%c%c%c\n",   mac_data.errata[0],\
-				mac_data.errata[1],\
-				mac_data.errata[2],\
-				mac_data.errata[3],\
-				mac_data.errata[4]);
-	printf("Date %c%c%c%c%c%c%c\n", mac_data.date[0],\
-				mac_data.date[1],\
-				mac_data.date[2],\
-				mac_data.date[3],\
-				mac_data.date[4],\
-				mac_data.date[5],\
-				mac_data.date[6]);
+	printf("ID %c%c%c%c\n",
+	       mac_data.id[0],
+	       mac_data.id[1],
+	       mac_data.id[2],
+	       mac_data.id[3]);
+	printf("Errata %c%c%c%c%c\n",
+	       mac_data.errata[0],
+	       mac_data.errata[1],
+	       mac_data.errata[2],
+	       mac_data.errata[3],
+	       mac_data.errata[4]);
+	printf("Date %c%c%c%c%c%c%c\n",
+	       mac_data.date[0],
+	       mac_data.date[1],
+	       mac_data.date[2],
+	       mac_data.date[3],
+	       mac_data.date[4],
+	       mac_data.date[5],
+	       mac_data.date[6]);
 	for (i = 0; i < 8; i++) {
-		sprintf(ethaddr[i],"%02x:%02x:%02x:%02x:%02x:%02x",\
-					mac_data.mac[i][0],\
-					mac_data.mac[i][1],\
-					mac_data.mac[i][2],\
-					mac_data.mac[i][3],\
-					mac_data.mac[i][4],\
-					mac_data.mac[i][5]);
+		sprintf(ethaddr[i],
+			"%02x:%02x:%02x:%02x:%02x:%02x",
+			mac_data.mac[i][0],
+			mac_data.mac[i][1],
+			mac_data.mac[i][2],
+			mac_data.mac[i][3],
+			mac_data.mac[i][4],
+			mac_data.mac[i][5]);
 		printf("MAC %d %s\n", i, ethaddr[i]);
 	}
 
@@ -85,7 +89,7 @@
 
 int mac_read(void)
 {
-	int ret,length;
+	int ret, length;
 	unsigned int crc = 0;
 	unsigned char dev = ID_EEPROM_ADDR, *data;
 
@@ -98,12 +102,12 @@
 
 	data = (unsigned char *)(&mac_data);
 	printf("Check CRC on reading ...");
-	crc = crc32(crc, data, length-4);
+	crc = crc32(crc, data, length - 4);
 	if (crc != mac_data.crc) {
-		printf("CRC checksum is invalid, in EEPROM CRC is %x, calculated CRC is %x\n",mac_data.crc,crc);
+		printf("CRC checksum is invalid, in EEPROM CRC is %x, calculated CRC is %x\n",
+		     mac_data.crc, crc);
 		return -1;
-	}
-	else {
+	} else {
 		printf("CRC OK\n");
 		mac_show();
 	}
@@ -114,94 +118,97 @@
 {
 	int ret, i, length;
 	unsigned int crc = 0;
-	unsigned char dev = ID_EEPROM_ADDR,*ptr;
-	unsigned char * eeprom_data = (unsigned char *)(&mac_data);
+	unsigned char dev = ID_EEPROM_ADDR, *ptr;
+	unsigned char *eeprom_data = (unsigned char *)(&mac_data);
 
 	for (i = 0; i < sizeof(mac_data.res_1); i++)
 		mac_data.res_1[i] = 0;
-	for (i = 0;i < sizeof(mac_data.res_2); i++)
+	for (i = 0; i < sizeof(mac_data.res_2); i++)
 		mac_data.res_2[i] = 0;
 	length = sizeof(EEPROM_data);
-	crc = crc32 (crc, eeprom_data, length-4);
+	crc = crc32(crc, eeprom_data, length - 4);
 	mac_data.crc = crc;
 	for (i = 0, ptr = eeprom_data; i < length; i += 8, ptr += 8) {
-		ret = i2c_write(dev, i, 1, ptr, (length-i) <8 ? (length-i) : 8);
-		udelay(5000);           /* 5ms write cycle timing */
+		ret =
+		    i2c_write(dev, i, 1, ptr,
+			      (length - i) < 8 ? (length - i) : 8);
+		udelay(5000);	/* 5ms write cycle timing */
 		if (ret)
 			break;
 	}
 	if (ret) {
 		printf("Programming failed.\n");
 		return -1;
-	}
-	else {
-		printf("Programming %d bytes. Reading back ...\n",length);
+	} else {
+		printf("Programming %d bytes. Reading back ...\n", length);
 		mac_read();
 	}
 	return 0;
 }
 
-int do_mac (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mac(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
 	int i;
 	char cmd = 's';
 	unsigned long long mac_val;
 
-	if(i2c_probe(ID_EEPROM_ADDR) != 0)
+	if (i2c_probe(ID_EEPROM_ADDR) != 0)
 		return -1;
 
-	if(argc>1) {
+	if (argc > 1) {
 		cmd = argv[1][0];
 		switch (cmd) {
-			case 'r':       /* display */
-				mac_read();
-				break;
-			case 's':       /* save */
-				mac_prog();
-				break;
-			case 'i':       /* id */
-				for (i=0; i<4; i++) {
-					mac_data.id[i] = argv[2][i];
-				}
-				break;
-			case 'n':       /* serial number */
-				for (i=0; i<12; i++) {
-					mac_data.sn[i] = argv[2][i];
-				}
-				break;
-			case 'e':       /* errata */
-				for (i=0; i<5; i++) {
-					mac_data.errata[i] = argv[2][i];
-				}
-				break;
-			case 'd':       /* date */
-				for (i=0; i<7; i++) {
-					mac_data.date[i] = argv[2][i];
-				}
-				break;
-			case 'p':       /* number of ports */
-				mac_data.tab_size = (unsigned char)simple_strtoul(argv[2],NULL,16);
-				break;
-			case '0':       /* mac 0 */
-			case '1':       /* mac 1 */
-			case '2':       /* mac 2 */
-			case '3':       /* mac 3 */
-			case '4':       /* mac 4 */
-			case '5':       /* mac 5 */
-			case '6':       /* mac 6 */
-			case '7':       /* mac 7 */
-				mac_val = simple_strtoull(argv[2],NULL,16);
-				for (i=0; i<6; i++) {
-					mac_data.mac[cmd-'0'][i] = *((unsigned char *)(((unsigned int)(&mac_val))+i+2));
-				}
-				break;
-			case 'h':       /* help */
-			default:
-				printf ("Usage:\n%s\n", cmdtp->usage);
-				break;
+		case 'r':	/* display */
+			mac_read();
+			break;
+		case 's':	/* save */
+			mac_prog();
+			break;
+		case 'i':	/* id */
+			for (i = 0; i < 4; i++) {
+				mac_data.id[i] = argv[2][i];
+			}
+			break;
+		case 'n':	/* serial number */
+			for (i = 0; i < 12; i++) {
+				mac_data.sn[i] = argv[2][i];
+			}
+			break;
+		case 'e':	/* errata */
+			for (i = 0; i < 5; i++) {
+				mac_data.errata[i] = argv[2][i];
+			}
+			break;
+		case 'd':	/* date */
+			for (i = 0; i < 7; i++) {
+				mac_data.date[i] = argv[2][i];
+			}
+			break;
+		case 'p':	/* number of ports */
+			mac_data.tab_size =
+			    (unsigned char)simple_strtoul(argv[2], NULL, 16);
+			break;
+		case '0':	/* mac 0 */
+		case '1':	/* mac 1 */
+		case '2':	/* mac 2 */
+		case '3':	/* mac 3 */
+		case '4':	/* mac 4 */
+		case '5':	/* mac 5 */
+		case '6':	/* mac 6 */
+		case '7':	/* mac 7 */
+			mac_val = simple_strtoull(argv[2], NULL, 16);
+			for (i = 0; i < 6; i++) {
+				mac_data.mac[cmd - '0'][i] =
+				    *((unsigned char *)
+				      (((unsigned int)(&mac_val)) + i + 2));
+			}
+			break;
+		case 'h':	/* help */
+		default:
+			printf("Usage:\n%s\n", cmdtp->usage);
+			break;
 		}
-	}
-	else {
+	} else {
 		mac_show();
 	}
 	return 0;
@@ -209,36 +216,41 @@
 
 int mac_read_from_eeprom(void)
 {
-	int length,i;
-	unsigned char dev = ID_EEPROM_ADDR, *data, ethaddr[4][18], enetvar[32];
+	int length, i;
+	unsigned char dev = ID_EEPROM_ADDR;
+	unsigned char *data;
+	unsigned char ethaddr[4][18];
+	unsigned char enetvar[32];
 	unsigned int crc = 0;
 
 	length = sizeof(EEPROM_data);
-	if(i2c_read (dev, 0, 1, (unsigned char *)(&mac_data), length)) {
+	if (i2c_read(dev, 0, 1, (unsigned char *)(&mac_data), length)) {
 		printf("Read failed.\n");
 		return -1;
 	}
 
 	data = (unsigned char *)(&mac_data);
-	crc = crc32(crc, data, length-4);
+	crc = crc32(crc, data, length - 4);
 	if (crc != mac_data.crc) {
 		return -1;
-	}
-	else {
-		for(i=0; i<4; i++) {
-			if(memcmp(&mac_data.mac[i], "\0\0\0\0\0\0", 6)) {
-				sprintf(ethaddr[i], "%02x:%02x:%02x:%02x:%02x:%02x", \
-					mac_data.mac[i][0], \
-					mac_data.mac[i][1], \
-					mac_data.mac[i][2], \
-					mac_data.mac[i][3], \
-					mac_data.mac[i][4], \
+	} else {
+		for (i = 0; i < 4; i++) {
+			if (memcmp(&mac_data.mac[i], "\0\0\0\0\0\0", 6)) {
+				sprintf(ethaddr[i],
+					"%02x:%02x:%02x:%02x:%02x:%02x",
+					mac_data.mac[i][0],
+					mac_data.mac[i][1],
+					mac_data.mac[i][2],
+					mac_data.mac[i][3],
+					mac_data.mac[i][4],
 					mac_data.mac[i][5]);
-				sprintf(enetvar, i ? "eth%daddr" : "ethaddr", i);
+				sprintf(enetvar,
+					i ? "eth%daddr" : "ethaddr",
+					i);
 				setenv(enetvar, ethaddr[i]);
 			}
 		}
 	}
 	return 0;
 }
-#endif  /* CFG_ID_EEPROM */
+#endif /* CFG_ID_EEPROM */
