From patchwork Mon Nov 20 22:33:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 839807 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="VbBWRmFc"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ygkFm6Kvzz9sRW for ; Tue, 21 Nov 2017 09:40:44 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 773ADC21EFF; Mon, 20 Nov 2017 22:37:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 920C5C220FD; Mon, 20 Nov 2017 22:34:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C2CC2C2211C; Mon, 20 Nov 2017 22:34:05 +0000 (UTC) Received: from mail-it0-f68.google.com (mail-it0-f68.google.com [209.85.214.68]) by lists.denx.de (Postfix) with ESMTPS id 04E6DC220C6 for ; Mon, 20 Nov 2017 22:34:01 +0000 (UTC) Received: by mail-it0-f68.google.com with SMTP id x28so13915572ita.0 for ; Mon, 20 Nov 2017 14:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=A+aFM8zqm1HcjVAdy4SgQAjAsxKtPr0sqX9o8bKTKRc=; b=VbBWRmFco//NWaTeUyc417vlm18lswzV6kp3gcinoGGcg5cEe1bAjXACwu/Dl5ntq0 JNhldd5FraShnG9S122bBO1Nf+MqbTX9ZtT9thjtLn/+0r2pv/y9EYXDJ3twuaI6/m12 D87mJLOLTqSn4Qi+vL5zQvPec2ZI3IIrc3JKE/0R7aN6Jzird9R1OOwLm0RrQXZ1oVJ8 pfq7GKDqC/kU+vrOaH21nWRQNoDwVNwd1C6RUL9XFyitmSy7D+t08uUQkn+2+nE1j3g3 r6i4YZJTnuFSW+a9o3UPfOoD8ZGy9TkWZuy04xqALi7PpzTLIWAp+RuKalTXwG7KK900 q8vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=A+aFM8zqm1HcjVAdy4SgQAjAsxKtPr0sqX9o8bKTKRc=; b=HkKGAhy2FPKxgVj9rqDk3cnJYoiQi5srQMJ7FCCLtQ7shT05sqZfAhT8R//00SawfI BC2RH//B4ShS2WAbrMoHGEKFzCyZ9kmPp7SNQYWQKEm6R8UXU87BN7yWijldY/hvMncb hQEY0D2L7jZpiv548bp/y0h5svhvj0JtXbSfQ1Z8gPaekjiJJCDE2eJCCb7BR5iv0/B9 GFjZK2WWPsLmAMdnMKsObCKm71v1tVB0EK1N3NsIiSWUXFvvyBkV3fgUHhWOjz2ni6HL SiHCgOjQSDJxOMHqXzZnwgsiu4nyq+J8Eo2z5gndiqUSCEkUuAobecil2hH0+9QSdjhb 5PCw== X-Gm-Message-State: AJaThX6E/OuDwvcFUxeVs1VC/QiUOXs6DjXJHjD8c4ecpwKrmjLwv9FB 3BHoHa2TrnKhWVpOcH8d/upKXA== X-Google-Smtp-Source: AGs4zMZGbwcr/bqn3dZ+V8oe/1rjp5KZNuSxPO2WjUDnZ6bV1ZW+RZuCSnD1nmI2RDcmhoAV8wiNrA== X-Received: by 10.36.120.11 with SMTP id p11mr20673084itc.10.1511217239245; Mon, 20 Nov 2017 14:33:59 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:0:10f2:0:e90f:b435:bce5:43fe]) by smtp.gmail.com with ESMTPSA id 202sm3300132iou.72.2017.11.20.14.33.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 14:33:58 -0800 (PST) Received: by kiwi.bld.corp.google.com (Postfix, from userid 121222) id D6B2D14001C; Mon, 20 Nov 2017 15:33:54 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Mon, 20 Nov 2017 15:33:32 -0700 Message-Id: <20171120223335.45852-12-sjg@chromium.org> X-Mailer: git-send-email 2.15.0.448.gf294e3d99a-goog In-Reply-To: <20171120223335.45852-1-sjg@chromium.org> References: <20171120223335.45852-1-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 11/14] log: Plumb logging into the init sequence X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Set up logging both before and after relocation. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Reviewed-by: Lukasz Majewski --- Changes in v3: None Changes in v2: None common/board_f.c | 5 ++++- common/board_r.c | 2 ++ common/log.c | 1 + include/asm-generic/global_data.h | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/board_f.c b/common/board_f.c index 1e8bf63ec10..e46eceda7d0 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -751,6 +751,7 @@ static const init_fnc_t init_sequence_f[] = { trace_early_init, #endif initf_malloc, + log_init, initf_bootstage, /* uses its own timer, so does not need DM */ initf_console_record, #if defined(CONFIG_HAVE_FSP) @@ -932,8 +933,10 @@ void board_init_f_r(void) * The pre-relocation drivers may be using memory that has now gone * away. Mark serial as unavailable - this will fall back to the debug * UART if available. + * + * Do the same with log drivers since the memory may not be available. */ - gd->flags &= ~GD_FLG_SERIAL_READY; + gd->flags &= ~(GD_FLG_SERIAL_READY | GD_FLG_LOG_READY); #ifdef CONFIG_TIMER gd->timer = NULL; #endif diff --git a/common/board_r.c b/common/board_r.c index 89729d77360..09167c13cc8 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -691,6 +691,7 @@ static init_fnc_t init_sequence_r[] = { #endif initr_barrier, initr_malloc, + log_init, initr_bootstage, /* Needs malloc() but has its own timer */ initr_console_record, #ifdef CONFIG_SYS_NONCACHED_MEMORY @@ -884,6 +885,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) #if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_ARM64) gd = new_gd; #endif + gd->flags &= ~GD_FLG_LOG_READY; #ifdef CONFIG_NEEDS_MANUAL_RELOC for (i = 0; i < ARRAY_SIZE(init_sequence_r); i++) diff --git a/common/log.c b/common/log.c index a7d9a548f2a..c94a3c17592 100644 --- a/common/log.c +++ b/common/log.c @@ -238,6 +238,7 @@ int log_init(void) (struct list_head *)&gd->log_head); drv++; } + gd->flags |= GD_FLG_LOG_READY; gd->default_log_level = LOGL_INFO; return 0; diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 77755dbb068..73e036d6fd4 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -146,5 +146,6 @@ typedef struct global_data { #define GD_FLG_RECORD 0x01000 /* Record console */ #define GD_FLG_ENV_DEFAULT 0x02000 /* Default variable flag */ #define GD_FLG_SPL_EARLY_INIT 0x04000 /* Early SPL init is done */ +#define GD_FLG_LOG_READY 0x08000 /* Log system is ready for use */ #endif /* __ASM_GENERIC_GBL_DATA_H */