From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B927C433EF for ; Sat, 12 Feb 2022 12:12:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C1A6183095; Sat, 12 Feb 2022 13:12:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GPCNWgRP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 739EF83504; Sat, 12 Feb 2022 13:12:52 +0100 (CET) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (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 B336680FE2 for ; Sat, 12 Feb 2022 13:12:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=aford173@gmail.com Received: by mail-io1-xd29.google.com with SMTP id q204so14491819iod.8 for ; Sat, 12 Feb 2022 04:12:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/v16j0et4lJB9CnK/kPk0UdTZZrTxz1z11cQKudL1QU=; b=GPCNWgRP+nS5rTw33x61x6oj9XtKArfmuYjQEp5GIULqvDu0nouIkIHeZbqynV28Av rrD1BQewvGFjhyhJNC5sI/BZa8RRSmKfOlVLyMGaEP86q4E6/pnsOoHg4z014cjqdIs2 WqHsOy6T1WZAvOQLeJkXq1WgfqcObAQsrWGzRHwcOL2GB4Yyl/upig0Zl6sUykYpHZ8c S51pvCo2KY0U+3AmsxboLP5vm0WdQ50liyBcnyaM4N48FG4z1S8WLCNuf790hRldjhqE ooPaRlWSBFksJ5z3KbB0DjTOU7r7KCmvT9Na7LwXD8IHfD+EDWG2fo57B1qZTFgFHJA/ MMAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/v16j0et4lJB9CnK/kPk0UdTZZrTxz1z11cQKudL1QU=; b=A2FpXrx0z4oMzryxcCCd0/IHhHAd5jNYr4maICMbfGnPpycl7vTxjuZAzg7hlMJe6H L3T+AUSksPEwJRgh1MRFitB1+Zowt6QG5RFjBiwSEAErzPEyhIFwok/gUceEYYfLHiHU 7Avp6i7wyuL6YqOHWE41k6sbYmIouZX51oSl3+s20PxfT/RRNPdaekW9WqdG6SFDnSDp EpZIdNs+uONnsEMGVXKAhQwsTDUED9PeqqFmSL66vVkg4IE/0RHDYFpRLK/sSmcOYBqs Mewta0iUGGEO9lYXRVSM9Qc5x7t/1befCBAiOrmbWUy6/mNurvkIT+A0yL5ie3GtPbdq GJzQ== X-Gm-Message-State: AOAM531ecVow/RIUimIp0nwYn44jqE0whXtUdeRyxtYoq4t3h3ljK6Su qA3mkzuA6E3FVfaLj6P5JJKCuzxiB+G9zg== X-Google-Smtp-Source: ABdhPJymQ5Pa3q38N5pcILdA0KOkyygwhDA/6ABZadSgBm+ybj2iQ6TqSUkFxwcdSzK2/ZCsM18SXg== X-Received: by 2002:a05:6638:10e6:: with SMTP id g6mr3184094jae.135.1644667966625; Sat, 12 Feb 2022 04:12:46 -0800 (PST) Received: from aford-IdeaCentre-A730.lan ([2601:448:8400:9e8:adc0:251:7f96:c2ca]) by smtp.gmail.com with ESMTPSA id x11sm15009540iow.8.2022.02.12.04.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Feb 2022 04:12:45 -0800 (PST) From: Adam Ford To: u-boot@lists.denx.de Cc: trini@konsulko.com, aford@beaconembedded.com, Adam Ford Subject: [PATCH 1/2] arm: omap3: Cleanup sys_info to fit OMAP3 booting with LTO Date: Sat, 12 Feb 2022 06:12:40 -0600 Message-Id: <20220212121241.1655425-1-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean With LTO enabled, some functions appear to be optimized in a way that causes hanging on some OMAP3 boards after some unrelated patches were applied. The solution appears to make several functions __used. There also appears be to be some dead code, so remove it while cleaning this up. This has been tested on a general purpose OMAP3530, DM3730, and AM3517. Signed-off-by: Adam Ford diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h index a6e9ff84aa..e7078a32db 100644 --- a/arch/arm/include/asm/arch-omap3/sys_proto.h +++ b/arch/arm/include/asm/arch-omap3/sys_proto.h @@ -45,16 +45,12 @@ void gpmc_init(void); void enable_gpmc_cs_config(const u32 *gpmc_config, const struct gpmc_cs *cs, u32 base, u32 size); void set_gpmc_cs0(int flash_type); - void watchdog_init(void); void set_muxconf_regs(void); - u32 get_cpu_family(void); u32 get_cpu_rev(void); -u32 get_sku_id(void); u32 is_gpmc_muxed(void); u32 get_gpmc0_type(void); -u32 get_gpmc0_width(void); u32 is_running_in_sdram(void); u32 is_running_in_sram(void); u32 is_running_in_flash(void); diff --git a/arch/arm/mach-omap2/omap3/sys_info.c b/arch/arm/mach-omap2/omap3/sys_info.c index ac72633c20..5f535e2782 100644 --- a/arch/arm/mach-omap2/omap3/sys_info.c +++ b/arch/arm/mach-omap2/omap3/sys_info.c @@ -55,7 +55,7 @@ void omap_die_id(unsigned int *die_id) /****************************************** * get_cpu_type(void) - extract cpu info ******************************************/ -u32 get_cpu_type(void) +static u32 get_cpu_type(void) { return readl(&ctrl_base->ctrl_omap_stat); } @@ -64,7 +64,7 @@ u32 get_cpu_type(void) * get_cpu_id(void) - extract cpu id * returns 0 for ES1.0, cpuid otherwise ******************************************/ -u32 get_cpu_id(void) +static u32 get_cpu_id(void) { struct ctrl_id *id_base; u32 cpuid = 0; @@ -89,7 +89,7 @@ u32 get_cpu_id(void) /****************************************** * get_cpu_family(void) - extract cpu info ******************************************/ -u32 get_cpu_family(void) +__used u32 get_cpu_family(void) { u16 hawkeye; u32 cpu_family; @@ -119,7 +119,7 @@ u32 get_cpu_family(void) /****************************************** * get_cpu_rev(void) - extract version info ******************************************/ -u32 get_cpu_rev(void) +__used u32 get_cpu_rev(void) { u32 cpuid = get_cpu_id(); @@ -132,41 +132,12 @@ u32 get_cpu_rev(void) /***************************************************************** * get_sku_id(void) - read sku_id to get info on max clock rate *****************************************************************/ -u32 get_sku_id(void) +static u32 get_sku_id(void) { struct ctrl_id *id_base = (struct ctrl_id *)OMAP34XX_ID_L4_IO_BASE; return readl(&id_base->sku_id) & SKUID_CLK_MASK; } -/*************************************************************************** - * get_gpmc0_base() - Return current address hardware will be - * fetching from. The below effectively gives what is correct, its a bit - * mis-leading compared to the TRM. For the most general case the mask - * needs to be also taken into account this does work in practice. - * - for u-boot we currently map: - * -- 0 to nothing, - * -- 4 to flash - * -- 8 to enent - * -- c to wifi - ****************************************************************************/ -u32 get_gpmc0_base(void) -{ - u32 b; - - b = readl(&gpmc_cfg->cs[0].config7); - b &= 0x1F; /* keep base [5:0] */ - b = b << 24; /* ret 0x0b000000 */ - return b; -} - -/******************************************************************* - * get_gpmc0_width() - See if bus is in x8 or x16 (mainly for nand) - *******************************************************************/ -u32 get_gpmc0_width(void) -{ - return WIDTH_16BIT; -} - /************************************************************************* * get_board_rev() - setup to pass kernel board revision information * returns:(bit[0-3] sub version, higher bit[7-4] is higher version) -- 2.32.0