ppc4xx: Fix msg "initialization as root-complex failed" upon PCIe scan
PATCH 1/1 ppc4xx: Fix msg "initialization as root-complex failed" upon PCIe scan
This message is printed upon PCIe bus scan, not only upon error, but also if no PCIe device is detected at all. Since this is not an error, let's remove this message in this case. We already have the message "link is not up." if there is no PCIe device present.
--- board/amcc/canyonlands/canyonlands.c | 3 +++ board/amcc/katmai/katmai.c | 3 +++ board/amcc/kilauea/kilauea.c | 3 +++ board/amcc/makalu/makalu.c | 3 +++ board/amcc/yucca/yucca.c | 3 +++ cpu/ppc4xx/4xx_pcie.c | 3 ++- 6 files changed, 17 insertions(+), 1 deletions(-)
board/amcc/canyonlands/canyonlands.c +3 -0
@@ -28,6 +28,7 @@#include <asm/mmu.h> #include <asm/4xx_pcie.h> #include <asm/gpio.h> +#include <asm/errno.h> extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS ];/* info for FLASH chips */
@@ -414,6 +415,8 @@ void pcie_setup_hoses(int busno) ret =ppc4xx_init_pcie_endport (i); else ret =ppc4xx_init_pcie_rootport (i); +if (ret == -ENODEV ) +continue ;if (ret) {printf ("PCIE%d: initialization as %s failed\n" , i,is_end_point (i) ?"endpoint" :"root-complex" );
board/amcc/katmai/katmai.c +3 -0
@@ -32,6 +32,7 @@#include <asm/io.h> #include <asm/gpio.h> #include <asm/4xx_pcie.h> +#include <asm/errno.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -391,6 +392,8 @@ void pcie_setup_hoses(int busno) ret =ppc4xx_init_pcie_endport (i); else ret =ppc4xx_init_pcie_rootport (i); +if (ret == -ENODEV ) +continue ;if (ret) {printf ("PCIE%d: initialization as %s failed\n" , i,is_end_point (i) ?"endpoint" :"root-complex" );
board/amcc/kilauea/kilauea.c +3 -0
@@ -28,6 +28,7 @@#include <fdt_support.h> #include <asm/processor.h> #include <asm/io.h> +#include <asm/errno.h> #if defined(CONFIG_PCI )#include <pci.h>
@@ -317,6 +318,8 @@ void pcie_setup_hoses(int busno) ret =ppc4xx_init_pcie_endport (i); else ret =ppc4xx_init_pcie_rootport (i); +if (ret == -ENODEV ) +continue ;if (ret) {printf ("PCIE%d: initialization as %s failed\n" , i,is_end_point (i) ?"endpoint" :"root-complex" );
board/amcc/makalu/makalu.c +3 -0
@@ -29,6 +29,7 @@#include <asm/gpio.h> #include <asm/io.h> #include <fdt_support.h> +#include <asm/errno.h> #if defined(CONFIG_PCI )#include <pci.h>
@@ -273,6 +274,8 @@ void pcie_setup_hoses(int busno) ret =ppc4xx_init_pcie_endport (i); else ret =ppc4xx_init_pcie_rootport (i); +if (ret == -ENODEV ) +continue ;if (ret) {printf ("PCIE%d: initialization as %s failed\n" , i,is_end_point (i) ?"endpoint" :"root-complex" );
board/amcc/yucca/yucca.c +3 -0
@@ -32,6 +32,7 @@#include <asm/processor.h> #include <asm/io.h> #include <asm/4xx_pcie.h> +#include <asm/errno.h> #include "yucca.h"
@@ -830,6 +831,8 @@ void pcie_setup_hoses(int busno)yucca_setup_pcie_fpga_rootpoint (i); ret =ppc4xx_init_pcie_rootport (i); } +if (ret == -ENODEV ) +continue ;if (ret) {printf ("PCIE%d: initialization as %s failed\n" , i,is_end_point (i) ?"endpoint" :"root-complex" );
cpu/ppc4xx/4xx_pcie.c +2 -1
@@ -30,6 +30,7 @@#include <ppc4xx.h> #include <asm/processor.h> #include <asm-ppc/io.h> +#include <asm/errno.h> #if (defined(CONFIG_440SPE) || defined(CONFIG_405EX) || \ defined(CONFIG_460EX) || defined(CONFIG_460GT)) && \
@@ -874,7 +875,7 @@ int ppc4xx_init_pcie_port(int port, int rootport) val =SDR_READ (SDRN_PESDR_LOOP (port));if (!(val &0x00001000 )) {printf ("PCIE%d: link is not up.\n" , port); -return -1 ; +return -ENODEV ; }/*
Signature · 1 line
1.6.4.4
PATCH 1/1 ppc4xx: Fix msg "initialization as root-complex failed" upon PCIe scan
Dear Stefan Roese,
Quoted 4 lines · In message <[email protected]> you wrote:
This message is printed upon PCIe bus scan, not only upon error, but also if no PCIe device is detected at all. Since this is not an error, let's remove this message in this case. We already have the message "link is not up." if there is no PCIe device present.
Thanks.
But looking at this patch, it seems that larger parts in this (supposedly) board-specific code are actually more or less identical.
Should we not factor out such common code?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Real programmers don't comment their code. It was hard to write, it should be hard to understand.
PATCH 1/1 ppc4xx: Fix msg "initialization as root-complex failed" upon PCIe scan
Hi Wolfgang,
Quoted 4 lines · On Friday 02 October 2009 14:41:58 Wolfgang Denk wrote:
But looking at this patch, it seems that larger parts in this (supposedly) board-specific code are actually more or less identical.
Should we not factor out such common code?
Yes, this could (should) be done. But there are differences in these board specific functions. This consolidation could introduce new errors/bugs. And I didn't want to do such a thing, now that the merge window is closed. And frankly, I don't have the time for such a cleanup right now. But I'll put this on my to-do list.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
PATCH 1/1 ppc4xx: Fix msg "initialization as root-complex failed" upon PCIe scan
Dear Stefan Roese,
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 5 lines
But looking at this patch, it seems that larger parts in this (supposedly) board-specific code are actually more or less identical.
Should we not factor out such common code?
Yes, this could (should) be done. But there are differences in these board specific functions. This consolidation could introduce new errors/bugs. And I didn't want to do such a thing, now that the merge window is closed. And
I did not intend to ask for this fior the current release.
Quoted 2 lines
frankly, I don't have the time for such a cleanup right now. But I'll put this on my to-do list.
Thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Beware of programmers carrying screwdrivers." - Chip Salzenberg
PATCH 1/1 ppc4xx: Fix msg "initialization as root-complex failed" upon PCIe scan
In reply to Stefan RoeseQuoted 4 lines · On Friday 02 October 2009 14:35:16 Stefan Roese wrote:
This message is printed upon PCIe bus scan, not only upon error, but also if no PCIe device is detected at all. Since this is not an error, let's remove this message in this case. We already have the message "link is not up." if there is no PCIe device present.
Applied to u-boot-ppc4xx. Thanks.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de