From patchwork Sun Jun 28 04:38:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Kushwaha X-Patchwork-Id: 489103 X-Patchwork-Delegate: yorksun@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9BCE9140759 for ; Sun, 28 Jun 2015 14:40:15 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F8614B663; Sun, 28 Jun 2015 06:40:10 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qNOPNROSuinP; Sun, 28 Jun 2015 06:40:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9A0414B662; Sun, 28 Jun 2015 06:39:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 405114A03A for ; Sun, 28 Jun 2015 06:39:51 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3u1AhFO2So2D for ; Sun, 28 Jun 2015 06:39:51 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0148.outbound.protection.outlook.com [157.56.110.148]) by theia.denx.de (Postfix) with ESMTPS id 88C0F4A039 for ; Sun, 28 Jun 2015 06:39:46 +0200 (CEST) Received: from BY2PR03CA069.namprd03.prod.outlook.com (10.141.249.42) by BLUPR03MB150.namprd03.prod.outlook.com (10.255.212.18) with Microsoft SMTP Server (TLS) id 15.1.195.15; Sun, 28 Jun 2015 04:39:44 +0000 Received: from BN1AFFO11FD007.protection.gbl (2a01:111:f400:7c10::108) by BY2PR03CA069.outlook.office365.com (2a01:111:e400:2c5d::42) with Microsoft SMTP Server (TLS) id 15.1.201.16 via Frontend Transport; Sun, 28 Jun 2015 04:39:38 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD007.mail.protection.outlook.com (10.58.52.67) with Microsoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport; Sun, 28 Jun 2015 04:39:35 +0000 Received: from b32579-VirtualBox.ap.freescale.net ([10.232.40.37]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t5S4d4Ur016612; Sat, 27 Jun 2015 21:39:32 -0700 From: Prabhakar Kushwaha To: Date: Sun, 28 Jun 2015 10:08:50 +0530 Message-ID: <1435466341-22901-1-git-send-email-prabhakar@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD007; 1:8EL/ckk3AWexenfdjZ7On4Qn7HjajhLx7ByckuHZt0gYq03PTBaKPOVU5+a2BGl6oIcW+KJ4GlL104lKBRUKZMXILrGzGrOpd/MpTui5SM3OXrweVzVhnMNHGBPFFYKAvU/uBXuJdMpkjeJ8yuPqKwoUmN95UdZ2leepLQ0CkxkVqBnrFcftnCnKtAWCi7xanPsXV3yCStNGC0/+hUlAakec3u6niU0pBMnWe2EWRHto0LX31JSc/8dC2yNWvQDb10Q1aLHbcGRgjmkwiYe8jJQaT4nB2leZIZAtlG2gUdlXR4Ls9cWnqOuU5hkVoIz85iVXKdF2BO6Y2AdTDe4JLg== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(85426001)(62966003)(77156002)(5001960100002)(107886002)(110136002)(36756003)(46102003)(189998001)(92566002)(450100001)(50986999)(87936001)(105606002)(106466001)(77096005)(2351001)(50466002)(47776003)(50226001)(104016003)(86362001)(19580395003)(19580405001)(6806004)(229853001)(33646002)(48376002)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB150; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB150; 2:1elhMOGeZvJ+hGogCIFtWsjI7vrh9FAaXOf0EAyPsmfybP+KTvO3v91+/tIPLxUf; 3:npDleYyQS4POMAnnYUnErw8Ap4/Ij7tJ8U2vOTXjX2dXa1yufr8SXAS0l4f2nb7tlqqd1jUOT5dJL2Rcd6KDxFd1WzbNBFcpw3BtxvTL0ZQU0mC0VEROb0ZuiiFJCw1rVmrbBKgztZdrb94ORyRfVVQB82TDjyeIyZ3366n/vkKlE4uP7HNYDJHa0sSE4LPYc3Uc5+ejgptMOek2somOH+r5wU77Q2O9Qv0BiPkXIp4=; 20:ODEzGGzNjpr9kykJjWLdw9u/uAdyezw1Go7p6VsCXp0uQk93EVpWGmaCyHvrXSBMKiAUbn46v3IK2ntznJ91k3a0csQ4jwY1xpXIGUbt2E9EKRZ66bYhfvYQ8YVssKCgC/yO0JqVPIvCLSCdi8Dj/VvAFWNvi1kRhnGhkSpfK9BGuGHJoF/dYXdnv+rZX9G+s5SfitMVovgt+bB6zm+tEVG2mUBJDHn5YL/xsUHMt4he/JGd4ZsYaV8CTRqqX1NOkx122JGHGDipFdMGLeCeQFfEXuuzTM0zNnuW1X1ENh5icPv+ocv0UQwJCZdX14Ys+DCYaM3jCgpithm1bP8OpwcVLeR/AZh0l92TzSPKiL4=; 4:F/PemFgMlBs4LVFaZgUgpfRxPhYj2OMctkSVQ2HScDtUYK8Dctq54WDbVRwlDT+oNZY+4jch8iMh0yFG2gBUvXfl1j55E4OGVwveqnr9o3PN4CzMJQH08dIBheHDWraGdTQOtOfvLA/6HHzjQJQkYixhmd73pN1nRIaBR43ogLOx6XgMts3Z3H524KQDI0EzeuOtnB3rYzZCcRNlyokM9sMG33kE8PgCIaWl34l8dhniywpkqXth/dINGnf8Mtr1XGiieGOYcf/GfOJVSWwCzzy75m+lA5uPmZCqIsQTRi0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB150; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR03MB150; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB150; X-Forefront-PRVS: 0621E7E436 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB150; 23:aWe97izdg2gWwSKA8kYuLYaZ8e7aXW7Bow/joapzGpouv1frs/QuQL1K1oh5g8zjq7Ah4QxkLZQ42ALzytD4ysK0RMzlh6O5fdlt+a2BwwRMy6mErzgCZnvmEf0v5/GHyYzmnLu8MubpMeljCbmIO3n90uN7NsanFU9OB9zRGqG6+0zE+/5s0NZlpHZiVKBA5DTuLjaoYGwCoGV+95t+kaK94NUE2hZq87G4MX+K+JjFMuu8Gb+kPVmaEaKbHBVhH4oygIU1OYEmrH6VlM4rMoQTMhahbDjAf83qiQL8jF80Oda5p7hv8DwZGfqHnH40EVz3XqpeLM96X3XUQ6QltZ6cW46yVd0rR10m9qZNYnOw9HLczaPkrCnhoio/e4/9V/aJhvs5sHwH2Yk68nW0EsjbQJNzCnqYGlYUg3auSR2AReAewy/0rdE34mMYwwd+YawkJdMW9Kxx5Pnk1WIQjNn8XrrhJ7KrHLgtTZN+kq7SQZLnfj4jR9oIcsxGgiDEa69Vuf/Uolop9cu1UXZrFfUbVproObLeT8HA17gVDHpS6b1MKTA1328ltMNJMQLNO7CwPcSUubhNTcI8l6KdozMWKlKiy9lGjzvOWkW3OWNMn+fIcvcIwZYJgpBJN/NlvpXGoLclljjJ8RfyBn/cvNq3XiEEj7mmH7cN2FSIJuWL2lL2d4OzYhvOGINymIGswtoum0xV/KAS3ki2hw9fhU9wcoAW7amtvXFCQQJy+OjjYlhxk2pUjss8Wieu633oi6H7hJUrENIQhBNOf3tqNjg7618E7c3TyStwse4+1g7cyMWv7MCZ4LCUbYryhHyYg43AHRqwi+AbWoUARKY+pBGmIUFU+EXA7glHIFHhKlfAvCkIerU4SamHXU3TZJQt X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB150; 5:tYJC/wxeuSXyQPKY4JIy4YQ7/ECSVQASzXwLnQhZjhTCaKsdR/MJgC6YJm7ouZtKttpzeQuP+JoliGtxnsBoOPN28v4B3GnflcON1HvySLD4uH5nKbVmvdH0H4HYXwwtkyUkwOdfKz5VH9PGXk54bw==; 24:PqY+61Ue0tzyT7PnXEfqP6yZp0vNm+wSCC+kMD7jliNueorijO+YSzpPRE/rrHXHGopmKl3iBEqCLM+vRoAEYBzb4RpMQ36tp4DtnWq2icI=; 20:7YF3VaH5xEvdcn9kBfKBSJ8a1CMRrhLMopHCg0R4M6P+eKHh0L5YS6Ac1+keo/9kIg+t7cH1Rt2OklNodtMkaQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2015 04:39:35.5853 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB150 Cc: "J. German Rivera" , yorksun@freescale.com Subject: [U-Boot] [PATCH 01/12][v3] drivers/fsl-mc: Make MC boot error messages more readable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: "J. German Rivera" Make it easier for the user to notice when the MC firmware had problems booting. Signed-off-by: J. German Rivera Signed-off-by: Prabhakar Kushwaha --- Changes for v2: Sending as it is for patchset Changes for v3: Sending as it is for patchset drivers/net/fsl-mc/mc.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index f4a050a..d02da9d 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -224,13 +224,13 @@ static int load_mc_dpc(u64 mc_ram_addr, size_t mc_ram_size) * Don't return with error here, since the MC firmware can * still boot without a DPC */ - printf("fsl-mc: WARNING: No DPC image found\n"); + printf("\nfsl-mc: WARNING: No DPC image found"); return 0; } dpc_size = fdt_totalsize(dpc_fdt_hdr); if (dpc_size > CONFIG_SYS_LS_MC_DPC_MAX_LENGTH) { - printf("fsl-mc: ERROR: Bad DPC image (too large: %d)\n", + printf("\nfsl-mc: ERROR: Bad DPC image (too large: %d)\n", dpc_size); return -EINVAL; } @@ -278,13 +278,13 @@ static int load_mc_dpl(u64 mc_ram_addr, size_t mc_ram_size) error = fdt_check_header(dpl_fdt_hdr); if (error != 0) { - printf("fsl-mc: ERROR: Bad DPL image (bad header)\n"); + printf("\nfsl-mc: ERROR: Bad DPL image (bad header)\n"); return error; } dpl_size = fdt_totalsize(dpl_fdt_hdr); if (dpl_size > CONFIG_SYS_LS_MC_DPL_MAX_LENGTH) { - printf("fsl-mc: ERROR: Bad DPL image (too large: %d)\n", + printf("\nfsl-mc: ERROR: Bad DPL image (too large: %d)\n", dpl_size); return -EINVAL; } @@ -329,7 +329,6 @@ static int wait_for_mc(bool booting_mc, u32 *final_reg_gsr) struct mc_ccsr_registers __iomem *mc_ccsr_regs = MC_CCSR_BASE_ADDR; dmb(); - debug("Polling mc_ccsr_regs->reg_gsr ...\n"); assert(timeout_ms > 0); for (;;) { udelay(1000); /* throttle polling */ @@ -344,10 +343,7 @@ static int wait_for_mc(bool booting_mc, u32 *final_reg_gsr) } if (timeout_ms == 0) { - if (booting_mc) - printf("fsl-mc: timeout booting management complex firmware\n"); - else - printf("fsl-mc: timeout deploying data path layout\n"); + printf("ERROR: timeout\n"); /* TODO: Get an error status from an MC CCSR register */ return -ETIMEDOUT; @@ -360,15 +356,13 @@ static int wait_for_mc(bool booting_mc, u32 *final_reg_gsr) * appropriate errno, so that the status property is set to * failure in the fsl,dprc device tree node. */ - if (booting_mc) { - printf("fsl-mc: WARNING: Firmware booted with error (GSR: %#x)\n", - reg_gsr); - } else { - printf("fsl-mc: WARNING: Data path layout deployed with error (GSR: %#x)\n", - reg_gsr); - } + printf("WARNING: Firmware returned an error (GSR: %#x)\n", + reg_gsr); + } else { + printf("SUCCESS\n"); } + *final_reg_gsr = reg_gsr; return 0; } @@ -464,7 +458,7 @@ int mc_init(void) */ out_le32(&mc_ccsr_regs->reg_gsr, 0xDD00); - printf("\nfsl-mc: Booting Management Complex ...\n"); + printf("\nfsl-mc: Booting Management Complex ... "); /* * Deassert reset and release MC core 0 to run @@ -517,10 +511,11 @@ int mc_init(void) * Tell the MC to deploy the DPL: */ out_le32(&mc_ccsr_regs->reg_gsr, 0x0); - printf("\nfsl-mc: Deploying data path layout ...\n"); + printf("fsl-mc: Deploying data path layout ... "); error = wait_for_mc(false, ®_gsr); if (error != 0) goto out; + out: if (error != 0) mc_boot_status = -error;