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 F257AC433F5 for ; Sat, 12 Feb 2022 12:13:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 734118368F; Sat, 12 Feb 2022 13:12:57 +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="E0n6MpIm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B17868321B; Sat, 12 Feb 2022 13:12:54 +0100 (CET) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 154338321B for ; Sat, 12 Feb 2022 13:12:51 +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-xd34.google.com with SMTP id d188so14507661iof.7 for ; Sat, 12 Feb 2022 04:12:51 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=zBfNYS9LUhCIs/bpocHLY0WznCAg//WNpp4mOOSNMxk=; b=E0n6MpImeyHb/470a7n0svkIatye9RW4i1HmhPsS6r2nAydHsFtYL7SEirhh6kc9O1 iuiYk78hGiakSCphYO5Ep7RT0TnqFuAkYeZVbyxqYz4B7KUsB1kRxl/QnisHPcTfvwQ+ RxB7WDwoRrN3J/WmSkx4TPP4HO0qOt0LLV/renbo4LKhFjB6e9aquxEaxMyKxfRolicJ 5DTP/9ULkl2372PgAeUcw1ZUPQP/vmkK/7f6tPQK3XT2c1Z/WGzV6RU27HfWkjAZJ6CL 5FBuyp0/CzdHUOXzgWT5KxjxQq3IplbRd+KFWhyE+RkC4Lr2VFfeZmdsTtC6ARoYPnw5 rUag== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=zBfNYS9LUhCIs/bpocHLY0WznCAg//WNpp4mOOSNMxk=; b=ygfIsRAcYxCQRysQFu8FMgzgKi6z4gpkfAuaEDIv2uTLSVEl+fJsxSQYahEKfsiSUa MnfXyVhkJknaIbO38FuO9b9+3LUH4NBree4VcVqDa+Wplnb3leiQVERLf5VoczfjEeM1 L4NaM9+PILA/p6VxD4YBHjw/OBvxMzISIoX0O3F52pbjTBcnJW+5FGAt5xq9nxccGb/b 9HM16ZwbeIP5sb9geOSTxmpQbb+9cdRpg2RTzRCUctnTDGVVr/511o+46F9b2Oyc5jIP VQKslgY/Ffp95H5C5fe5q9Rgpm3c4aVERGxjspJPH0Eu6m+PRGPIuwRuaLtpn5pqAK0z l1aQ== X-Gm-Message-State: AOAM532TfYcj/TnyICJd+Yt7kSzcoKpM5z2MSQFz/ikkLY3VtLIXGoUE FfZQvjZZ5kVRPMXJ/08Q4A0Ie5hSuBHn4A== X-Google-Smtp-Source: ABdhPJxnZzNPom0uzTFn0AyrJzWD+Ogy8655E0sN5l7YDBWaZkGquwHcy8oN2/GROdOKJOfmtYIW5A== X-Received: by 2002:a05:6638:3007:: with SMTP id r7mr3318932jak.280.1644667967870; Sat, 12 Feb 2022 04:12:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Feb 2022 04:12:47 -0800 (PST) From: Adam Ford To: u-boot@lists.denx.de Cc: trini@konsulko.com, aford@beaconembedded.com, Adam Ford Subject: [PATCH 2/2] arm: omap3: Make some memory functions static and clean headers Date: Sat, 12 Feb 2022 06:12:41 -0600 Message-Id: <20220212121241.1655425-2-aford173@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220212121241.1655425-1-aford173@gmail.com> References: <20220212121241.1655425-1-aford173@gmail.com> 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 There are a few memory functions for both the emif4 (AM3517) and sdrc (OMAP35/DM37) code that can be defined as static, because those functions are not used externally. Make them static and clean up some of the corresponding headers. Signed-off-by: Adam Ford diff --git a/arch/arm/include/asm/arch-omap3/mem.h b/arch/arm/include/asm/arch-omap3/mem.h index 7adc134a75..569779c55e 100644 --- a/arch/arm/include/asm/arch-omap3/mem.h +++ b/arch/arm/include/asm/arch-omap3/mem.h @@ -480,7 +480,6 @@ void mem_init(void); u32 is_mem_sdr(void); u32 mem_ok(u32 cs); -u32 get_sdr_cs_size(u32); u32 get_sdr_cs_offset(u32); #endif /* __ASSEMBLY__ */ diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h index e7078a32db..3e6335c5fa 100644 --- a/arch/arm/include/asm/arch-omap3/sys_proto.h +++ b/arch/arm/include/asm/arch-omap3/sys_proto.h @@ -33,11 +33,8 @@ struct board_sdrc_timings { void prcm_init(void); void per_clocks_enable(void); void ehci_clocks_enable(void); - void memif_init(void); void sdrc_init(void); -void do_sdrc_init(u32, u32); - void get_board_mem_timings(struct board_sdrc_timings *timings); int identify_nand_chip(int *mfr, int *id); void emif4_init(void); @@ -60,12 +57,10 @@ void invalidate_dcache(u32); u32 wait_on_value(u32, u32, void *, u32); void cancel_out(u32 *num, u32 *den, u32 den_limit); void sdelay(unsigned long); -void make_cs1_contiguous(void); int omap_nand_switch_ecc(uint32_t, uint32_t); void power_init_r(void); void do_omap3_emu_romcode_call(u32 service_id, u32 parameters); void omap3_set_aux_cr_secure(u32 acr); u32 warm_reset(void); - void save_omap_boot_params(void); #endif diff --git a/arch/arm/mach-omap2/omap3/emif4.c b/arch/arm/mach-omap2/omap3/emif4.c index df6e9ce1d6..d7d779819b 100644 --- a/arch/arm/mach-omap2/omap3/emif4.c +++ b/arch/arm/mach-omap2/omap3/emif4.c @@ -35,7 +35,7 @@ u32 is_mem_sdr(void) * get_sdr_cs_size - * - Get size of chip select 0/1 */ -u32 get_sdr_cs_size(u32 cs) +static u32 get_sdr_cs_size(u32 cs) { u32 size = 0; diff --git a/arch/arm/mach-omap2/omap3/sdrc.c b/arch/arm/mach-omap2/omap3/sdrc.c index 4d85b1dee9..07f534a60b 100644 --- a/arch/arm/mach-omap2/omap3/sdrc.c +++ b/arch/arm/mach-omap2/omap3/sdrc.c @@ -44,13 +44,28 @@ u32 is_mem_sdr(void) return 0; } +/* + * get_sdr_cs_size - + * - Get size of chip select 0/1 + */ +static u32 get_sdr_cs_size(u32 cs) +{ + u32 size; + + /* get ram size field */ + size = readl(&sdrc_base->cs[cs].mcfg) >> 8; + size &= 0x3FF; /* remove unwanted bits */ + size <<= 21; /* multiply by 2 MiB to find size in MB */ + return size; +} + /* * make_cs1_contiguous - * - When we have CS1 populated we want to have it mapped after cs0 to allow * command line mem=xyz use all memory with out discontinuous support * compiled in. We could do it in the ATAG, but there really is two banks... */ -void make_cs1_contiguous(void) +static void make_cs1_contiguous(void) { u32 size, a_add_low, a_add_high; @@ -62,22 +77,6 @@ void make_cs1_contiguous(void) } - -/* - * get_sdr_cs_size - - * - Get size of chip select 0/1 - */ -u32 get_sdr_cs_size(u32 cs) -{ - u32 size; - - /* get ram size field */ - size = readl(&sdrc_base->cs[cs].mcfg) >> 8; - size &= 0x3FF; /* remove unwanted bits */ - size <<= 21; /* multiply by 2 MiB to find size in MB */ - return size; -} - /* * get_sdr_cs_offset - * - Get offset of cs from cs0 start @@ -128,7 +127,7 @@ static void write_sdrc_timings(u32 cs, struct sdrc_actim *sdrc_actim_base, * true and a possible 2nd time depending on memory configuration from * stack+global context. */ -void do_sdrc_init(u32 cs, u32 early) +static void do_sdrc_init(u32 cs, u32 early) { struct sdrc_actim *sdrc_actim_base0, *sdrc_actim_base1; struct board_sdrc_timings timings; -- 2.32.0