2 * Copyright (C) 2007 Freescale Semiconductor, Inc.
4 * Tony Li <tony.li@freescale.com>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
15 #ifdef CONFIG_PQ_MDS_PIB
17 #include "pq-mds-pib.h"
24 /* Switch temporarily to I2C bus #2 */
25 orig_i2c_bus = i2c_get_bus_num();
29 #if defined(CONFIG_PCI) && !defined(CONFIG_PCISLAVE)
30 /* Assign PIB PMC slot to desired PCI bus */
31 i2c_write(0x23, 0x6, 1, &val8, 1);
32 i2c_write(0x23, 0x7, 1, &val8, 1);
34 i2c_write(0x23, 0x2, 1, &val8, 1);
35 i2c_write(0x23, 0x3, 1, &val8, 1);
38 i2c_write(0x26, 0x6, 1, &val8, 1);
40 i2c_write(0x26, 0x7, 1, &val8, 1);
41 #if defined(CONFIG_MPC832XEMDS)
42 val8 = 0xf9; /* PMC2, PMC3 slot to PCI bus */
44 val8 = 0xf3; /* PMC1, PMC2, PMC3 slot to PCI bus */
46 i2c_write(0x26, 0x2, 1, &val8, 1);
48 i2c_write(0x26, 0x3, 1, &val8, 1);
51 i2c_write(0x27, 0x6, 1, &val8, 1);
52 i2c_write(0x27, 0x7, 1, &val8, 1);
54 i2c_write(0x27, 0x2, 1, &val8, 1);
56 i2c_write(0x27, 0x3, 1, &val8, 1);
60 #if defined(CONFIG_MPC832XEMDS)
61 printf("PCI 32bit bus on PMC2 &PMC3\n");
63 printf("PCI 32bit bus on PMC1 & PMC2 &PMC3\n");
67 #if defined(CONFIG_PQ_MDS_PIB_ATM)
68 #if defined(CONFIG_MPC8360EMDS)
70 i2c_write(0x20, 0x6, 1, &val8, 1);
71 i2c_write(0x20, 0x7, 1, &val8, 1);
74 i2c_write(0x20, 0x2, 1, &val8, 1);
76 i2c_write(0x20, 0x3, 1, &val8, 1);
80 printf("QOC3 ATM card on PMC0\n");
81 #elif defined(CONFIG_MPC832XEMDS)
83 i2c_write(0x26, 0x7, 1, &val8, 1);
85 i2c_write(0x26, 0x3, 1, &val8, 1);
88 i2c_write(0x21, 0x6, 1, &val8, 1);
89 i2c_write(0x21, 0x7, 1, &val8, 1);
92 i2c_write(0x21, 0x2, 1, &val8, 1);
94 i2c_write(0x21, 0x3, 1, &val8, 1);
98 printf("QOC3 ATM card on PMC1\n");
101 /* Reset to original I2C bus */
102 i2c_set_bus_num(orig_i2c_bus);
105 #endif /* CONFIG_PQ_MDS_PIB */