From 651d96f7e4c84adcdb98ef07ec878c20326e3359 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Wed, 14 Nov 2007 18:54:53 +0300 Subject: MPC8360E-MDS: configure and enable second UART Despite user manual, BCSR9.7 is negated (high) on HRST, so UART2 is disabled. Fix that and configure QE pins properly. Signed-off-by: Anton Vorontsov --- board/freescale/mpc8360emds/mpc8360emds.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'board/freescale/mpc8360emds/mpc8360emds.c') diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index e050cd4..538a556 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -87,6 +87,11 @@ const qe_iop_conf_t qe_iop_conf_tab[] = { {0, 1, 3, 0, 2}, /* MDIO */ {0, 2, 1, 0, 1}, /* MDC */ + {5, 0, 1, 0, 2}, /* UART2_SOUT */ + {5, 1, 2, 0, 3}, /* UART2_CTS */ + {5, 2, 1, 0, 1}, /* UART2_RTS */ + {5, 3, 2, 0, 2}, /* UART2_SIN */ + {0, 0, 0, 0, QE_IOP_TAB_END}, /* END of table */ }; @@ -106,6 +111,9 @@ int board_early_init_f(void) immr->sysconf.spridr == SPR_8360E_REV21) bcsr[0xe] = 0x30; + /* Enable second UART */ + bcsr[0x9] &= ~0x01; + return 0; } -- cgit v1.1 From 24f868433b50ecbaa88e118aadc7bd254013c6ae Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Fri, 9 Nov 2007 14:28:08 -0600 Subject: mpc83xx: mpc8360 rev.2.1 erratum 2: replace rgmii-id with rgmii-rxid u-boot itself uses GMII mode on the 8360. Fix up UCC phy-connection-type properties in the device tree so the PHY gets configured for internal delay on RX only by the OS, as prescribed by mpc8360 rev. 2.1 pb mds erratum #2. Signed-off-by: Kim Phillips --- board/freescale/mpc8360emds/mpc8360emds.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'board/freescale/mpc8360emds/mpc8360emds.c') diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index 538a556..ff9a85c 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -303,6 +303,7 @@ void sdram_init(void) #if defined(CONFIG_OF_BOARD_SETUP) void ft_board_setup(void *blob, bd_t *bd) { + const immap_t *immr = (immap_t *)CFG_IMMR; #if defined(CONFIG_OF_FLAT_TREE) u32 *p; int len; @@ -317,5 +318,35 @@ void ft_board_setup(void *blob, bd_t *bd) #ifdef CONFIG_PCI ft_pci_setup(blob, bd); #endif + /* + * mpc8360ea pb mds errata 2: RGMII timing + * if on mpc8360ea rev. 2.1, + * change both ucc phy-connection-types from rgmii-id to rgmii-rxid + */ + if (immr->sysconf.spridr == SPR_8360_REV21 || + immr->sysconf.spridr == SPR_8360E_REV21) { + int nodeoffset; + void *prop; + + /* fixup UCC 1 if using rgmii-id mode */ + nodeoffset = fdt_find_node_by_path(blob, "/" OF_QE "/ucc@2000"); + if (nodeoffset >= 0) { + prop = fdt_getprop(blob, nodeoffset, + "phy-connection-type", 0); + if (prop && (strcmp(prop, "rgmii-id") == 0)) + fdt_setprop(blob, nodeoffset, "phy-connection-type", + "rgmii-rxid", sizeof("rgmii-rxid")); + } + + /* fixup UCC 2 if using rgmii-id mode */ + nodeoffset = fdt_find_node_by_path(blob, "/" OF_QE "/ucc@3000"); + if (nodeoffset >= 0) { + prop = fdt_getprop(blob, nodeoffset, + "phy-connection-type", 0); + if (prop && (strcmp(prop, "rgmii-id") == 0)) + fdt_setprop(blob, nodeoffset, "phy-connection-type", + "rgmii-rxid", sizeof("rgmii-rxid")); + } + } } #endif -- cgit v1.1 From c16e44fa835fb9eec982d919863a04e2f78e5ce7 Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Tue, 27 Nov 2007 14:17:29 -0600 Subject: mpc83xx: fix remaining fdt_find_node_by_path references rename to fdt_path_offset Signed-off-by: Kim Phillips --- board/freescale/mpc8360emds/mpc8360emds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board/freescale/mpc8360emds/mpc8360emds.c') diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index ff9a85c..4a368b0 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -329,7 +329,7 @@ void ft_board_setup(void *blob, bd_t *bd) void *prop; /* fixup UCC 1 if using rgmii-id mode */ - nodeoffset = fdt_find_node_by_path(blob, "/" OF_QE "/ucc@2000"); + nodeoffset = fdt_path_offset(blob, "/" OF_QE "/ucc@2000"); if (nodeoffset >= 0) { prop = fdt_getprop(blob, nodeoffset, "phy-connection-type", 0); @@ -339,7 +339,7 @@ void ft_board_setup(void *blob, bd_t *bd) } /* fixup UCC 2 if using rgmii-id mode */ - nodeoffset = fdt_find_node_by_path(blob, "/" OF_QE "/ucc@3000"); + nodeoffset = fdt_path_offset(blob, "/" OF_QE "/ucc@3000"); if (nodeoffset >= 0) { prop = fdt_getprop(blob, nodeoffset, "phy-connection-type", 0); -- cgit v1.1 From f602082b4b7ed4ee16432067cc67a0a24fedc715 Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Mon, 10 Dec 2007 14:16:22 -0600 Subject: mpc83xx: supress compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mpc8360emds.c: In function ‘ft_board_setup’: mpc8360emds.c:335: warning: assignment discards qualifiers from pointer target type mpc8360emds.c:345: warning: assignment discards qualifiers from pointer target type Signed-off-by: Kim Phillips --- board/freescale/mpc8360emds/mpc8360emds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/freescale/mpc8360emds/mpc8360emds.c') diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index 4a368b0..e673840 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -326,7 +326,7 @@ void ft_board_setup(void *blob, bd_t *bd) if (immr->sysconf.spridr == SPR_8360_REV21 || immr->sysconf.spridr == SPR_8360E_REV21) { int nodeoffset; - void *prop; + const char *prop; /* fixup UCC 1 if using rgmii-id mode */ nodeoffset = fdt_path_offset(blob, "/" OF_QE "/ucc@2000"); -- cgit v1.1 From 5b8bc606c61456566af6912f818a153b6b06f242 Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Thu, 20 Dec 2007 14:09:22 -0600 Subject: mpc83xx: convert to using do_fixup_*() convert to using simpler mpc85xx style fdt update code; streamline by eliminating macros OF_SOC, OF_CPU, etc. which allows us to rm the old school FLAT_TREE code from 83xx (since the sbc8349 was just converted over to using libfdt). Signed-off-by: Kim Phillips --- board/freescale/mpc8360emds/mpc8360emds.c | 41 ++++++++++++++++++------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'board/freescale/mpc8360emds/mpc8360emds.c') diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index e673840..a899800 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -327,25 +327,32 @@ void ft_board_setup(void *blob, bd_t *bd) immr->sysconf.spridr == SPR_8360E_REV21) { int nodeoffset; const char *prop; + const char *path; - /* fixup UCC 1 if using rgmii-id mode */ - nodeoffset = fdt_path_offset(blob, "/" OF_QE "/ucc@2000"); + nodeoffset = fdt_path_offset(fdt, "/aliases"); if (nodeoffset >= 0) { - prop = fdt_getprop(blob, nodeoffset, - "phy-connection-type", 0); - if (prop && (strcmp(prop, "rgmii-id") == 0)) - fdt_setprop(blob, nodeoffset, "phy-connection-type", - "rgmii-rxid", sizeof("rgmii-rxid")); - } - - /* fixup UCC 2 if using rgmii-id mode */ - nodeoffset = fdt_path_offset(blob, "/" OF_QE "/ucc@3000"); - if (nodeoffset >= 0) { - prop = fdt_getprop(blob, nodeoffset, - "phy-connection-type", 0); - if (prop && (strcmp(prop, "rgmii-id") == 0)) - fdt_setprop(blob, nodeoffset, "phy-connection-type", - "rgmii-rxid", sizeof("rgmii-rxid")); +#if defined(CONFIG_HAS_ETH0) + /* fixup UCC 1 if using rgmii-id mode */ + path = fdt_getprop(blob, nodeoffset, "ethernet0", NULL); + if (path) { + prop = fdt_getprop(blob, nodeoffset, + "phy-connection-type", 0); + if (prop && (strcmp(prop, "rgmii-id") == 0)) + fdt_setprop(blob, nodeoffset, "phy-connection-type", + "rgmii-rxid", sizeof("rgmii-rxid")); + } +#endif +#if defined(CONFIG_HAS_ETH1) + /* fixup UCC 2 if using rgmii-id mode */ + path = fdt_getprop(blob, nodeoffset, "ethernet1", NULL); + if (path) { + prop = fdt_getprop(blob, nodeoffset, + "phy-connection-type", 0); + if (prop && (strcmp(prop, "rgmii-id") == 0)) + fdt_setprop(blob, nodeoffset, "phy-connection-type", + "rgmii-rxid", sizeof("rgmii-rxid")); + } +#endif } } } -- cgit v1.1 From b3458d2cd55d01732e30a76d898afd99e871cd67 Mon Sep 17 00:00:00 2001 From: Kim Phillips Date: Thu, 20 Dec 2007 15:57:28 -0600 Subject: mpc83xx: remove FLAT_TREE code need to rm it from pci code, too! Signed-off-by: Kim Phillips --- board/freescale/mpc8360emds/mpc8360emds.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'board/freescale/mpc8360emds/mpc8360emds.c') diff --git a/board/freescale/mpc8360emds/mpc8360emds.c b/board/freescale/mpc8360emds/mpc8360emds.c index a899800..2fcef8b 100644 --- a/board/freescale/mpc8360emds/mpc8360emds.c +++ b/board/freescale/mpc8360emds/mpc8360emds.c @@ -25,9 +25,7 @@ #else #include #endif -#if defined(CONFIG_OF_FLAT_TREE) -#include -#elif defined(CONFIG_OF_LIBFDT) +#if defined(CONFIG_OF_LIBFDT) #include #endif #if defined(CONFIG_PQ_MDS_PIB) @@ -304,16 +302,7 @@ void sdram_init(void) void ft_board_setup(void *blob, bd_t *bd) { const immap_t *immr = (immap_t *)CFG_IMMR; -#if defined(CONFIG_OF_FLAT_TREE) - u32 *p; - int len; - - p = ft_get_prop(blob, "/memory/reg", &len); - if (p != NULL) { - *p++ = cpu_to_be32(bd->bi_memstart); - *p = cpu_to_be32(bd->bi_memsize); - } -#endif + ft_cpu_setup(blob, bd); #ifdef CONFIG_PCI ft_pci_setup(blob, bd); -- cgit v1.1