From 183da6d9b446cc12123455844ad1187e2375626f Mon Sep 17 00:00:00 2001 From: Ben Warren Date: Tue, 12 Sep 2006 10:15:53 -0400 Subject: 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 --- board/mpc8349emds/pci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'board/mpc8349emds/pci.c') diff --git a/board/mpc8349emds/pci.c b/board/mpc8349emds/pci.c index 63e4405..a4d6508 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); } /************************************************************************** -- cgit v1.1 From 2ad6b513b31070bd0c003792ed1c3e7f5d740357 Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Tue, 31 Oct 2006 18:44:42 -0600 Subject: mpc83xx: Add support for the MPC8349E-mITX PREREQUISITE PATCHES: * This patch can only be applied after the following patches have been applied: 1) DNX#2006090742000024 "Add support for multiple I2C buses" 2) DNX#2006090742000033 "Multi-bus I2C implementation of MPC834x" 3) DNX#2006091242000041 "Additional MPC8349 support for multibus i2c" 4) DNX#2006091242000078 "Add support for variable flash memory sizes on 83xx systems" 5) DNX#2006091242000069 "Add support for Errata DDR6 on MPC 834x systems" CHANGELOG: * Add support for the Freescale MPC8349E-mITX reference design platform. The second TSEC (Vitesse 7385 switch) is not supported at this time. Signed-off-by: Timur Tabi --- board/mpc8349emds/pci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'board/mpc8349emds/pci.c') diff --git a/board/mpc8349emds/pci.c b/board/mpc8349emds/pci.c index a4d6508..a916245 100644 --- a/board/mpc8349emds/pci.c +++ b/board/mpc8349emds/pci.c @@ -138,18 +138,18 @@ void pci_init_board(void) { volatile immap_t * immr; - volatile clk8349_t * clk; - volatile law8349_t * pci_law; - volatile pot8349_t * pci_pot; - volatile pcictrl8349_t * pci_ctrl; - volatile pciconf8349_t * pci_conf; + volatile clk83xx_t * clk; + volatile law83xx_t * pci_law; + volatile pot83xx_t * pci_pot; + volatile pcictrl83xx_t * pci_ctrl; + volatile pciconf83xx_t * pci_conf; u16 reg16; u32 reg32; u32 dev; struct pci_controller * hose; immr = (immap_t *)CFG_IMMRBAR; - clk = (clk8349_t *)&immr->clk; + clk = (clk83xx_t *)&immr->clk; pci_law = immr->sysconf.pcilaw; pci_pot = immr->ios.pot; pci_ctrl = immr->pci_ctrl; -- cgit v1.1 From 9ca880a250870a7d55754291b5591d2b5fe89b54 Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Tue, 31 Oct 2006 21:23:16 -0600 Subject: mpc83xx: Fix dual I2C support for the MPC8349ITX, MPC8349EMDS, TQM834x, and MPC8360EMDS This patch also adds an improved I2C set_speed(), which handles all clock frequencies. Signed-off-by: Timur Tabi --- board/mpc8349emds/pci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'board/mpc8349emds/pci.c') diff --git a/board/mpc8349emds/pci.c b/board/mpc8349emds/pci.c index a916245..93827f1 100644 --- a/board/mpc8349emds/pci.c +++ b/board/mpc8349emds/pci.c @@ -75,10 +75,8 @@ pib_init(void) /* 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); + if(orig_i2c_bus != 2) + i2c_set_bus_num(2); val8 = 0; i2c_write(0x23, 0x6, 1, &val8, 1); @@ -124,7 +122,7 @@ pib_init(void) printf("PCI2: 32-bit on PMC3\n"); #endif /* Reset to original I2C bus */ - if(orig_i2c_bus != I2C_BUS_2) + if(orig_i2c_bus != 2) i2c_set_bus_num(orig_i2c_bus); } -- cgit v1.1 From bf0b542d6773a5a1cbce77691f009b06d9aeb57d Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Wed, 1 Nov 2006 00:10:40 -0600 Subject: mpc83xx: add OF_FLAT_TREE bits to 83xx boards add ft_pci_setup, OF_CPU, OF_SOC, OF_TBCLK, and STDOUT_PATH configuration bits to mpc8349emds, mpc8349itx, and mpc8360emds board code. redo environment to use bootm with the fdtaddr for booting ARCH=powerpc kernels by default, and provide default fdtaddr values. --- board/mpc8349emds/pci.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'board/mpc8349emds/pci.c') diff --git a/board/mpc8349emds/pci.c b/board/mpc8349emds/pci.c index 93827f1..908be57 100644 --- a/board/mpc8349emds/pci.c +++ b/board/mpc8349emds/pci.c @@ -385,4 +385,26 @@ pci_init_board(void) } +#ifdef CONFIG_OF_FLAT_TREE +void +ft_pci_setup(void *blob, bd_t *bd) +{ + u32 *p; + int len; + + p = (u32 *)ft_get_prop(blob, "/" OF_SOC "/pci@8500/bus-range", &len); + if (p != NULL) { + p[0] = pci_hose[0].first_busno; + p[1] = pci_hose[0].last_busno; + } + +#ifdef CONFIG_MPC83XX_PCI2 + p = (u32 *)ft_get_prop(blob, "/" OF_SOC "/pci@8600/bus-range", &len); + if (p != NULL) { + p[0] = pci_hose[1].first_busno; + p[1] = pci_hose[1].last_busno; + } +#endif +} +#endif /* CONFIG_OF_FLAT_TREE */ #endif /* CONFIG_PCI */ -- cgit v1.1 From d239d74b1c937984bc519083a8e7de373a390f06 Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Fri, 3 Nov 2006 12:00:28 -0600 Subject: mpc83xx: Replace CFG_IMMRBAR with CFG_IMMR Replace all instances of CFG_IMMRBAR with CFG_IMMR, so that the 83xx tree matches the other 8xxx trees. Signed-off-by: Timur Tabi --- board/mpc8349emds/pci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'board/mpc8349emds/pci.c') diff --git a/board/mpc8349emds/pci.c b/board/mpc8349emds/pci.c index 908be57..da49a5d 100644 --- a/board/mpc8349emds/pci.c +++ b/board/mpc8349emds/pci.c @@ -146,7 +146,7 @@ pci_init_board(void) u32 dev; struct pci_controller * hose; - immr = (immap_t *)CFG_IMMRBAR; + immr = (immap_t *)CFG_IMMR; clk = (clk83xx_t *)&immr->clk; pci_law = immr->sysconf.pcilaw; pci_pot = immr->ios.pot; @@ -260,8 +260,8 @@ pci_init_board(void) hose->region_count = 4; pci_setup_indirect(hose, - (CFG_IMMRBAR+0x8300), - (CFG_IMMRBAR+0x8304)); + (CFG_IMMR+0x8300), + (CFG_IMMR+0x8304)); pci_register_hose(hose); @@ -356,8 +356,8 @@ pci_init_board(void) hose->region_count = 4; pci_setup_indirect(hose, - (CFG_IMMRBAR+0x8380), - (CFG_IMMRBAR+0x8384)); + (CFG_IMMR+0x8380), + (CFG_IMMR+0x8384)); pci_register_hose(hose); -- cgit v1.1 From be5e61815d5a1fac290ce9c0ef09cb6a8e4288fa Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Fri, 3 Nov 2006 19:15:00 -0600 Subject: mpc83xx: Update 83xx to use fsl_i2c.c Update the 83xx tree to use I2C support in drivers/fsl_i2c.c. Delete cpu/mpc83xx/i2c.c, include/asm-ppc/i2c.h, and all references to those files. Added multiple I2C bus support to fsl_i2c.c. Signed-off-by: Timur Tabi --- board/mpc8349emds/pci.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'board/mpc8349emds/pci.c') diff --git a/board/mpc8349emds/pci.c b/board/mpc8349emds/pci.c index da49a5d..bb60e73 100644 --- a/board/mpc8349emds/pci.c +++ b/board/mpc8349emds/pci.c @@ -74,9 +74,7 @@ pib_init(void) */ /* Switch temporarily to I2C bus #2 */ orig_i2c_bus = i2c_get_bus_num(); - - if(orig_i2c_bus != 2) - i2c_set_bus_num(2); + i2c_set_bus_num(1); val8 = 0; i2c_write(0x23, 0x6, 1, &val8, 1); @@ -122,8 +120,7 @@ pib_init(void) printf("PCI2: 32-bit on PMC3\n"); #endif /* Reset to original I2C bus */ - if(orig_i2c_bus != 2) - i2c_set_bus_num(orig_i2c_bus); + i2c_set_bus_num(orig_i2c_bus); } /************************************************************************** -- cgit v1.1 From dd520bf314c7add4183c5191692180f576f96b60 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 30 Nov 2006 18:02:20 +0100 Subject: Code cleanup. --- board/mpc8349emds/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/mpc8349emds/pci.c') diff --git a/board/mpc8349emds/pci.c b/board/mpc8349emds/pci.c index bb60e73..d6a12b8 100644 --- a/board/mpc8349emds/pci.c +++ b/board/mpc8349emds/pci.c @@ -74,7 +74,7 @@ pib_init(void) */ /* Switch temporarily to I2C bus #2 */ orig_i2c_bus = i2c_get_bus_num(); - i2c_set_bus_num(1); + i2c_set_bus_num(1); val8 = 0; i2c_write(0x23, 0x6, 1, &val8, 1); -- cgit v1.1