From patchwork Mon Jan 27 05:06:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1229558 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.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 Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Iluk2krS; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 485dMf0tHZz9sR1 for ; Mon, 27 Jan 2020 16:19:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EC06E817D3; Mon, 27 Jan 2020 06:12:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Iluk2krS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 73653817BC; Mon, 27 Jan 2020 06:09:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 54D9581813 for ; Mon, 27 Jan 2020 06:09:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd42.google.com with SMTP id h8so8566029iob.2 for ; Sun, 26 Jan 2020 21:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9nuhhkS9xsb29wkuZvNzcINY1kioi1mudAgVt2g+Jxg=; b=Iluk2krSD9Y1bppWJZ5ohJ5fgzKIIYAgCt03/qHX4pWYp6krl+chN8303jdjuowmR/ 9eBI+C4r3errsjoKTrLYZ5Igs5DCJ65uWmw4XzywiKUCzDvjs+Uw4CuQb+1vrJhrYb+g 3QMkQvJM+gzvaTwz7/uXPk+CmDF9t7WMdYHJo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9nuhhkS9xsb29wkuZvNzcINY1kioi1mudAgVt2g+Jxg=; b=FJMfUZV2h00TN9ViSPuQaDNie79eCY7pAy9p9Fn1qwoHNNRBVq1XGY2JgZKTgvmcJA nTw4x6ExZ2dbwUo+vUTOVvmjYEDwv6nJIBbQ1uEymP0tX2UXOxkxpr4rfDtfJQ7Dl+5g OWxyz3q2AvLoduJ02X4/RmvX4zWKW3ERo55jADomBoJZmUCBY0413cmRza8tNIk9hxzR 5Td67fipswDzOGnlRpWfL+neik4ru37k8yzJnvOS7YK3fh/0r/iPWZkBcM6x4xMkVdUs SQq2/+QSWLYt9HQ/pIoRGPOLsMbo+//1OLz01YuVsmHk2rtfXsTcS1VHpcYFRlzfeJLa GwKg== X-Gm-Message-State: APjAAAU4wg5BjKO1ORQl6XabIKXJcoSSxc9ZKpF5s2e9jkKUxY7t1EdY bDz4Vvuc+CXHvsR9bUnNxXNBZyNcOWQnug== X-Google-Smtp-Source: APXvYqx3mO1XQICFykBXX3PZjONFaU13T7/oWeAYypXmdDMlUSz9XybwTSmHAxJX8U+9E2ECBaQXbQ== X-Received: by 2002:a5d:824c:: with SMTP id n12mr11122518ioo.234.1580101753006; Sun, 26 Jan 2020 21:09:13 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id h23sm4313195ilf.57.2020.01.26.21.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jan 2020 21:09:12 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 062/108] x86: Add debugging to table writing Date: Sun, 26 Jan 2020 22:06:09 -0700 Message-Id: <20200126220508.62.I7759eca88ecdfe2cab1769ab2c28828f5b026012@changeid> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200127050655.170614-1-sjg@chromium.org> References: <20200127050655.170614-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 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" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean Writing tables is currently pretty opaque. Add a bit of debugging to the process so we can see what tables are written and where they start/end in memory. Signed-off-by: Simon Glass --- arch/x86/lib/tables.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c index e359828c8e..80abe1584a 100644 --- a/arch/x86/lib/tables.c +++ b/arch/x86/lib/tables.c @@ -19,21 +19,32 @@ */ typedef ulong (*table_write)(ulong addr); -static table_write table_write_funcs[] = { +/** + * struct table_info - Information about each table to write + * + * @name: Name of table (for debugging) + * @write: Function to call to write this table + */ +struct table_info { + const char *name; + table_write write; +}; + +static struct table_info table_list[] = { #ifdef CONFIG_GENERATE_PIRQ_TABLE - write_pirq_routing_table, + { "pirq", write_pirq_routing_table }, #endif #ifdef CONFIG_GENERATE_SFI_TABLE - write_sfi_table, + { "sfi", write_sfi_table, }, #endif #ifdef CONFIG_GENERATE_MP_TABLE - write_mp_table, + { "mp", write_mp_table, }, #endif #ifdef CONFIG_GENERATE_ACPI_TABLE - write_acpi_tables, + { "acpi", write_acpi_tables, }, #endif #ifdef CONFIG_GENERATE_SMBIOS_TABLE - write_smbios_table, + { "smbios", write_smbios_table, }, #endif }; @@ -61,15 +72,18 @@ void write_tables(void) #endif int i; - for (i = 0; i < ARRAY_SIZE(table_write_funcs); i++) { - rom_table_end = table_write_funcs[i](rom_table_start); + debug("Writing tables to %x:\n", rom_table_start); + for (i = 0; i < ARRAY_SIZE(table_list); i++) { + const struct table_info *table = &table_list[i]; + + rom_table_end = table->write(rom_table_start); rom_table_end = ALIGN(rom_table_end, ROM_TABLE_ALIGN); #ifdef CONFIG_SEABIOS table_size = rom_table_end - rom_table_start; high_table = (u32)high_table_malloc(table_size); if (high_table) { - table_write_funcs[i](high_table); + table->write(high_table); cfg_tables[i].start = high_table; cfg_tables[i].size = table_size; @@ -78,6 +92,8 @@ void write_tables(void) } #endif + debug("- wrote '%s' to %x, end %x\n", table->name, + rom_table_start, rom_table_end); rom_table_start = rom_table_end; } @@ -86,4 +102,5 @@ void write_tables(void) cfg_tables[i].size = 0; write_coreboot_table(CB_TABLE_ADDR, cfg_tables); #endif + debug("- done writing tables\n"); }