From patchwork Fri Nov 16 01:43:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 998690 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; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42x1QQ3F9kz9s47 for ; Fri, 16 Nov 2018 12:50:22 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 27859C22251; Fri, 16 Nov 2018 01:46:22 +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_MSPIKE_H2 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 7E802C221A1; Fri, 16 Nov 2018 01:45:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 80FB0C2224A; Fri, 16 Nov 2018 01:44:32 +0000 (UTC) Received: from mail-vk1-f201.google.com (mail-vk1-f201.google.com [209.85.221.201]) by lists.denx.de (Postfix) with ESMTPS id BE711C2225C for ; Fri, 16 Nov 2018 01:44:28 +0000 (UTC) Received: by mail-vk1-f201.google.com with SMTP id c1so3690497vkf.19 for ; Thu, 15 Nov 2018 17:44:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ZrrqKnjpLdqG7zYAfLeWze/i256GIJEYUEAjlTRSJu8=; b=LxYZ1IsAyZ4oJAG4et8P+nTKZGaC4J1LWC3wr1Htjz21soXArG87wv36Z1i03eQCIC JjEZHQpXpwyuxQiiU9S3RqKKDpsQmqX7nQCgkCT7FJlFmMhXl/Cr2oDqBdAYl7LIslnl gxxz7SvvGrySavtduNvNfAKx2YrF0vspc7Q0YX/tv1Pd41fPJTO+12V0WP+4/8SWKY3+ JlIbf+2W5+cKe6uPM8G/Epv+E4xTmFnGPS5tWm4SPk/GLpQ6sy4CBOwFf4o0iaVaZtEC WkTVdUsBFKSAQ7vwitvBa3b0HIMRBHKWOk31tYgJzKtyf4TC4+pg9+JhFUUHvfx3w11n qeKg== X-Gm-Message-State: AGRZ1gKXLJzUqv77SJHvI+hUmwiRvTV2xExTBIYq31PMa8zy5uEye+EV ShBsZE6jUME8Y8MfDj/HJ0n33C8= X-Google-Smtp-Source: AJdET5d9xC0MhgrTvi4D3xxLEkqUimGETNrStNtDUSqFNo1HoSkfO3QEO8c7xP8xnS8YirpxHLQJsV4= X-Received: by 2002:ab0:25c2:: with SMTP id y2mr2456474uan.22.1542332667646; Thu, 15 Nov 2018 17:44:27 -0800 (PST) Date: Thu, 15 Nov 2018 18:43:52 -0700 In-Reply-To: <20181116014409.147279-1-sjg@chromium.org> Message-Id: <20181116014409.147279-5-sjg@chromium.org> Mime-Version: 1.0 References: <20181116014409.147279-1-sjg@chromium.org> X-Mailer: git-send-email 2.19.1.1215.g8438c0b245-goog From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini Subject: [U-Boot] [PATCH v3 04/21] bloblist: Locate bloblist in U-Boot 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add support for locating a bloblist in U-Boot that has been set up by SPL. It is copied into RAM during relocation. Reviewed-by: Tom Rini Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None common/board_f.c | 34 +++++++++++++++++++++++++++++++ include/asm-generic/global_data.h | 4 ++++ 2 files changed, 38 insertions(+) diff --git a/common/board_f.c b/common/board_f.c index 96503ff8d3c..42378537c8d 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -560,6 +561,16 @@ static int reserve_stacks(void) return arch_reserve_stacks(); } +static int reserve_bloblist(void) +{ +#ifdef CONFIG_BLOBLIST + gd->start_addr_sp -= CONFIG_BLOBLIST_SIZE; + gd->new_bloblist = map_sysmem(gd->start_addr_sp, CONFIG_BLOBLIST_SIZE); +#endif + + return 0; +} + static int display_new_sp(void) { debug("New Stack Pointer is: %08lx\n", gd->start_addr_sp); @@ -666,6 +677,24 @@ static int reloc_bootstage(void) return 0; } +static int reloc_bloblist(void) +{ +#ifdef CONFIG_BLOBLIST + if (gd->flags & GD_FLG_SKIP_RELOC) + return 0; + if (gd->new_bloblist) { + int size = CONFIG_BLOBLIST_SIZE; + + debug("Copying bloblist from %p to %p, size %x\n", + gd->bloblist, gd->new_bloblist, size); + memcpy(gd->new_bloblist, gd->bloblist, size); + gd->bloblist = gd->new_bloblist; + } +#endif + + return 0; +} + static int setup_reloc(void) { if (gd->flags & GD_FLG_SKIP_RELOC) { @@ -813,6 +842,9 @@ static const init_fnc_t init_sequence_f[] = { initf_malloc, log_init, initf_bootstage, /* uses its own timer, so does not need DM */ +#ifdef CONFIG_BLOBLIST + bloblist_init, +#endif initf_console_record, #if defined(CONFIG_HAVE_FSP) arch_fsp_init, @@ -913,6 +945,7 @@ static const init_fnc_t init_sequence_f[] = { reserve_global_data, reserve_fdt, reserve_bootstage, + reserve_bloblist, reserve_arch, reserve_stacks, dram_init_banksize, @@ -932,6 +965,7 @@ static const init_fnc_t init_sequence_f[] = { INIT_FUNC_WATCHDOG_RESET reloc_fdt, reloc_bootstage, + reloc_bloblist, setup_reloc, #if defined(CONFIG_X86) || defined(CONFIG_ARC) copy_uboot_to_ram, diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index c83fc01b764..ccf361ed88a 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -122,6 +122,10 @@ typedef struct global_data { struct list_head log_head; /* List of struct log_device */ int log_fmt; /* Mask containing log format info */ #endif +#if CONFIG_IS_ENABLED(BLOBLIST) + struct bloblist_hdr *bloblist; /* Bloblist information */ + struct bloblist_hdr *new_bloblist; /* Relocated blolist info */ +#endif } gd_t; #endif