summaryrefslogtreecommitdiff
path: root/board/mpc8568mds/mpc8568mds.c
diff options
context:
space:
mode:
authorHaiying Wang <Haiying.Wang@freescale.com>2007-06-19 14:18:34 -0400
committerAndrew Fleming-AFLEMING <afleming@freescale.com>2007-08-14 01:46:08 -0500
commitc59e4091ffe0148398b9e9ff14a019ea038b7432 (patch)
tree6d741c960be02243bff591c1ef1d98ad112e94a7 /board/mpc8568mds/mpc8568mds.c
parentd111d6382c99fdea08c2312eeeae8786945e189a (diff)
downloadu-boot-imx-c59e4091ffe0148398b9e9ff14a019ea038b7432.zip
u-boot-imx-c59e4091ffe0148398b9e9ff14a019ea038b7432.tar.gz
u-boot-imx-c59e4091ffe0148398b9e9ff14a019ea038b7432.tar.bz2
Add PCI support for MPC8568MDS board
This patch is against u-boot-mpc85xx.git of www.denx.com Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com> Signed-off-by: Ebony Zhu <ebony.zhu@freescale.com>
Diffstat (limited to 'board/mpc8568mds/mpc8568mds.c')
-rw-r--r--board/mpc8568mds/mpc8568mds.c60
1 files changed, 56 insertions, 4 deletions
diff --git a/board/mpc8568mds/mpc8568mds.c b/board/mpc8568mds/mpc8568mds.c
index 9c7960d..23caaec 100644
--- a/board/mpc8568mds/mpc8568mds.c
+++ b/board/mpc8568mds/mpc8568mds.c
@@ -27,6 +27,7 @@
#include <asm/processor.h>
#include <asm/immap_85xx.h>
#include <spd.h>
+#include <i2c.h>
#include "bcsr.h"
@@ -50,6 +51,15 @@ int board_early_init_f (void)
enable_8568mds_duart();
enable_8568mds_flash_write();
+#ifdef CFG_I2C2_OFFSET
+ /* Enable I2C2_SCL and I2C2_SDA */
+ volatile struct par_io *port_c;
+ port_c = (struct par_io*)(CFG_IMMR + 0xe0140);
+ port_c->cpdir2 |= 0x0f000000;
+ port_c->cppar2 &= ~0x0f000000;
+ port_c->cppar2 |= 0x0a000000;
+#endif
+
return 0;
}
@@ -269,20 +279,62 @@ static struct pci_config_table pci_mpc8568mds_config_table[] = {
#endif
static struct pci_controller hose[] = {
+ {
#ifndef CONFIG_PCI_PNP
- { config_table: pci_mpc8568mds_config_table,},
-#endif
-#ifdef CONFIG_MPC85XX_PCI2
- {},
+ config_table: pci_mpc8568mds_config_table,
#endif
+ }
};
#endif /* CONFIG_PCI */
+/*
+ * pib_init() -- Initialize the PCA9555 IO expander on the PIB board
+ */
+void
+pib_init(void)
+{
+ u8 val8, orig_i2c_bus;
+ /*
+ * Assign PIB PMC2/3 to PCI bus
+ */
+
+ /*switch temporarily to I2C bus #2 */
+ orig_i2c_bus = i2c_get_bus_num();
+ i2c_set_bus_num(1);
+
+ val8 = 0x00;
+ i2c_write(0x23, 0x6, 1, &val8, 1);
+ i2c_write(0x23, 0x7, 1, &val8, 1);
+ val8 = 0xff;
+ i2c_write(0x23, 0x2, 1, &val8, 1);
+ i2c_write(0x23, 0x3, 1, &val8, 1);
+
+ val8 = 0x00;
+ i2c_write(0x26, 0x6, 1, &val8, 1);
+ val8 = 0x34;
+ i2c_write(0x26, 0x7, 1, &val8, 1);
+ val8 = 0xf9;
+ i2c_write(0x26, 0x2, 1, &val8, 1);
+ val8 = 0xff;
+ i2c_write(0x26, 0x3, 1, &val8, 1);
+
+ val8 = 0x00;
+ i2c_write(0x27, 0x6, 1, &val8, 1);
+ i2c_write(0x27, 0x7, 1, &val8, 1);
+ val8 = 0xff;
+ i2c_write(0x27, 0x2, 1, &val8, 1);
+ val8 = 0xef;
+ i2c_write(0x27, 0x3, 1, &val8, 1);
+
+ asm("eieio");
+}
+
void
pci_init_board(void)
{
#ifdef CONFIG_PCI
+ pib_init();
pci_mpc85xx_init(&hose);
#endif
}