summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Warren <bwarren@qstreams.com>2006-09-12 10:15:53 -0400
committerKim Phillips <kim.phillips@freescale.com>2006-11-03 19:42:19 -0600
commit183da6d9b446cc12123455844ad1187e2375626f (patch)
tree7417ed2b751e792fb046d0aefde120a7f07dcf3c
parentb24f119d672b709d153ff2ac091d4aa63ec6877d (diff)
Additional MPC8349 support for multibus i2c
Hello, Here is a patch for a file that was accidentally left out of a previous attempt. It accompanies the patch with ticket DNX#2006090742000024 CHANGELOG: Change PCI initialization to use new multi-bus I2C API. regards, Ben
-rw-r--r--board/mpc8349emds/pci.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/board/mpc8349emds/pci.c b/board/mpc8349emds/pci.c
index 63e4405578..a4d6508bb0 100644
--- a/board/mpc8349emds/pci.c
+++ b/board/mpc8349emds/pci.c
@@ -68,11 +68,16 @@ static struct pci_controller pci_hose[] = {
void
pib_init(void)
{
- u8 val8;
+ u8 val8, orig_i2c_bus;
/*
* Assign PIB PMC slot to desired PCI bus
*/
- mpc8349_i2c = (i2c_t*)(CFG_IMMRBAR + CFG_I2C2_OFFSET);
+ /* Switch temporarily to I2C bus #2 */
+ orig_i2c_bus = i2c_get_bus_num();
+
+ if(orig_i2c_bus != I2C_BUS_2)
+ i2c_set_bus_num(I2C_BUS_2);
+
i2c_init(CFG_I2C_SPEED, CFG_I2C_SLAVE);
val8 = 0;
@@ -118,6 +123,9 @@ pib_init(void)
printf("PCI1: 32-bit on PMC1, PMC2\n");
printf("PCI2: 32-bit on PMC3\n");
#endif
+ /* Reset to original I2C bus */
+ if(orig_i2c_bus != I2C_BUS_2)
+ i2c_set_bus_num(orig_i2c_bus);
}
/**************************************************************************