commit ced0ecfd0f55a6a6b1c9b382b1f79f72a8da6ce6
Author: Sam Song <samsongshu@yahoo.com.cn>
Date:   Thu Apr 5 15:21:14 2007 +0800

    Fix 86xx compile warnings with ELDK4.0/4.1.
    
    Signed-off-by: Sam Song <samsongshu@yahoo.com.cn>

diff --git a/board/mpc8641hpcn/mpc8641hpcn.c b/board/mpc8641hpcn/mpc8641hpcn.c
index b2cf4a9..632b91a 100644
--- a/board/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/mpc8641hpcn/mpc8641hpcn.c
@@ -67,8 +67,10 @@ int checkboard(void)
 
 	uint devdisr = gur->devdisr;
 	uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
+#ifdef DEBUG
 	uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
 	uint pex1_agent = (host1_agent == 0) || (host1_agent == 1);
+#endif	/* DEBUG */
 
 	if ((io_sel == 2 || io_sel == 3 || io_sel == 5
 	     || io_sel == 6 || io_sel == 7 || io_sel == 0xF)
@@ -282,7 +284,7 @@ mpc8641_reset_board(cmd_tbl_t * cmdtp, i
 
 		val = set_px_sysclk(simple_strtoul(argv[2], NULL, 10));
 
-		corepll = strfractoint(argv[3]);
+		corepll = strfractoint((unsigned char *)argv[3]);
 		val = val + set_px_corepll(corepll);
 		val = val + set_px_mpxpll(simple_strtoul(argv[4], NULL, 10));
 		if (val == 3) {
@@ -302,7 +304,7 @@ mpc8641_reset_board(cmd_tbl_t * cmdtp, i
 			/* reset with frequency changed */
 			val = set_px_sysclk(simple_strtoul(argv[3], NULL, 10));
 
-			corepll = strfractoint(argv[4]);
+			corepll = strfractoint((unsigned char *)argv[4]);
 			val = val + set_px_corepll(corepll);
 			val = val + set_px_mpxpll(simple_strtoul(argv[5],
 								 NULL, 10));
diff --git a/board/mpc8641hpcn/pixis.c b/board/mpc8641hpcn/pixis.c
index 964a17c..777af6e 100644
--- a/board/mpc8641hpcn/pixis.c
+++ b/board/mpc8641hpcn/pixis.c
@@ -309,10 +309,10 @@ ulong strfractoint(uchar *strptr)
 		mulconst = 1;
 		for (i = 0; i < decarr_len; i++)
 			mulconst *= 10;
-		decval = simple_strtoul(decarr, NULL, 10);
+		decval = simple_strtoul((char *)decarr, NULL, 10);
 	}
 
-	intval = simple_strtoul(intarr, NULL, 10);
+	intval = simple_strtoul((char *)intarr, NULL, 10);
 	intval = intval * mulconst;
 
 	retval = intval + decval;
diff --git a/board/mpc8641hpcn/sys_eeprom.c b/board/mpc8641hpcn/sys_eeprom.c
index 74e2a3d..7bc663b 100644
--- a/board/mpc8641hpcn/sys_eeprom.c
+++ b/board/mpc8641hpcn/sys_eeprom.c
@@ -68,7 +68,7 @@ int mac_show(void)
 	       mac_data.date[5],
 	       mac_data.date[6]);
 	for (i = 0; i < 8; i++) {
-		sprintf(ethaddr[i],
+		sprintf((char *)ethaddr[i],
 			"%02x:%02x:%02x:%02x:%02x:%02x",
 			mac_data.mac[i][0],
 			mac_data.mac[i][1],
@@ -79,10 +79,10 @@ int mac_show(void)
 		printf("MAC %d %s\n", i, ethaddr[i]);
 	}
 
-	setenv("ethaddr", ethaddr[0]);
-	setenv("eth1addr", ethaddr[1]);
-	setenv("eth2addr", ethaddr[2]);
-	setenv("eth3addr", ethaddr[3]);
+	setenv("ethaddr",  (char *)ethaddr[0]);
+	setenv("eth1addr", (char *)ethaddr[1]);
+	setenv("eth2addr", (char *)ethaddr[2]);
+	setenv("eth3addr", (char *)ethaddr[3]);
 
 	return 0;
 }
@@ -236,7 +236,7 @@ int mac_read_from_eeprom(void)
 	} else {
 		for (i = 0; i < 4; i++) {
 			if (memcmp(&mac_data.mac[i], "\0\0\0\0\0\0", 6)) {
-				sprintf(ethaddr[i],
+				sprintf((char *)ethaddr[i],
 					"%02x:%02x:%02x:%02x:%02x:%02x",
 					mac_data.mac[i][0],
 					mac_data.mac[i][1],
@@ -244,10 +244,10 @@ int mac_read_from_eeprom(void)
 					mac_data.mac[i][3],
 					mac_data.mac[i][4],
 					mac_data.mac[i][5]);
-				sprintf(enetvar,
+				sprintf((char *)enetvar,
 					i ? "eth%daddr" : "ethaddr",
 					i);
-				setenv(enetvar, ethaddr[i]);
+				setenv((char *)enetvar, (char *)ethaddr[i]);
 			}
 		}
 	}
diff --git a/cpu/mpc86xx/interrupts.c b/cpu/mpc86xx/interrupts.c
index 49820bb..2ba82e6 100644
--- a/cpu/mpc86xx/interrupts.c
+++ b/cpu/mpc86xx/interrupts.c
@@ -71,7 +71,7 @@ static __inline__ void set_dec(unsigned
 }
 
 /* interrupt is not supported yet */
-int interrupt_init_cpu(unsigned *decrementer_count)
+int interrupt_init_cpu(unsigned long *decrementer_count)
 {
 	return 0;
 }
@@ -158,7 +158,7 @@ void timer_interrupt(struct pt_regs *reg
 
 	timestamp++;
 
-	ppcDcbf(&timestamp);
+	ppcDcbf(timestamp);
 
 	/* Restore Decrementer Count */
 	set_dec(decrementer_count);
diff --git a/cpu/mpc86xx/pci.c b/cpu/mpc86xx/pci.c
index b86548d..3922d4d 100644
--- a/cpu/mpc86xx/pci.c
+++ b/cpu/mpc86xx/pci.c
@@ -30,6 +30,8 @@
 #include <common.h>
 #include <pci.h>
 
+extern void pcie_setup_indirect(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data);
+
 #if defined(CONFIG_PCI)
 void
 pci_mpc86xx_init(struct pci_controller *hose)
@@ -41,7 +43,7 @@ pci_mpc86xx_init(struct pci_controller *
 
 	volatile ccsr_gur_t *gur = &immap->im_gur;
 	uint host1_agent = (gur->porbmsr & MPC86xx_PORBMSR_HA) >> 17;
-	uint pcie1_host = (host1_agent == 2) || (host1_agent == 3);
+	/* uint pcie1_host = (host1_agent == 2) || (host1_agent == 3); */
 	uint pcie1_agent = (host1_agent == 0) || (host1_agent == 1);
 	uint devdisr = gur->devdisr;
 	uint io_sel = (gur->pordevsr & MPC86xx_PORDEVSR_IO_SEL) >> 16;
diff --git a/cpu/mpc86xx/spd_sdram.c b/cpu/mpc86xx/spd_sdram.c
index ac9ff81..6add783 100644
--- a/cpu/mpc86xx/spd_sdram.c
+++ b/cpu/mpc86xx/spd_sdram.c
@@ -1092,16 +1092,18 @@ long int
 spd_sdram(void)
 {
 	int memsize_ddr1_dimm1 = 0;
-	int memsize_ddr1_dimm2 = 0;
 	int memsize_ddr2_dimm1 = 0;
-	int memsize_ddr2_dimm2 = 0;
 	int memsize_total = 0;
-	int memsize_ddr1 = 0;
-	int memsize_ddr2 = 0;
 	unsigned int ddr1_enabled = 0;
 	unsigned int ddr2_enabled = 0;
+#ifndef CONFIG_DDR_INTERLEAVE
+	int memsize_ddr1_dimm2 = 0;
+	int memsize_ddr2_dimm2 = 0;
+	int memsize_ddr1 = 0;
+	int memsize_ddr2 = 0;
 	unsigned int law_size_ddr1;
 	unsigned int law_size_ddr2;
+#endif	/* CONFIG_DDR_INTERLEAVE */
 	volatile immap_t *immap = (immap_t *)CFG_IMMR;
 	volatile ccsr_local_mcm_t *mcm = &immap->im_local_mcm;
 
diff --git a/drivers/ahci.c b/drivers/ahci.c
index 8ceff00..ccd4d71 100644
--- a/drivers/ahci.c
+++ b/drivers/ahci.c
@@ -253,7 +253,8 @@ static void ahci_print_info(struct ahci_
 
 static int ahci_init_one(pci_dev_t pdev)
 {
-	u32 iobase, vendor;
+	u32 iobase;
+	u16 vendor;
 	int rc;
 
 	memset((void *)ataid, 0, sizeof(hd_driveid_t *) * AHCI_MAX_PORTS);
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index bbe3505..c955252 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -58,8 +58,8 @@
 #define CONFIG_DDR_ECC			/* only for ECC DDR module */
 #define CONFIG_ECC_INIT_VIA_DDRCONTROLLER	/* DDR controller or DMA? */
 #define CONFIG_MEM_INIT_VALUE		0xDeadBeef
-#define CONFIG_NUM_DDR_CONTROLLERS     2
-/* #define CONFIG_DDR_INTERLEAVE               1 */
+#define CONFIG_NUM_DDR_CONTROLLERS	2  	 
+/* #define CONFIG_DDR_INTERLEAVE          	1 */
 #define CACHE_LINE_INTERLEAVING		0x20000000
 #define PAGE_INTERLEAVING		0x21000000
 #define BANK_INTERLEAVING		0x22000000
@@ -68,6 +68,10 @@
 
 #define CONFIG_ALTIVEC          1
 
+#ifndef __ASSEMBLY__
+extern unsigned long get_board_sys_clk(unsigned long dummy);
+#endif
+
 /*
  * L2CR setup -- make sure this is right for your board!
  */
