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 87A75C433FE for ; Tue, 11 Oct 2022 11:52:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 73E5384F23; Tue, 11 Oct 2022 13:51:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="MFci9WXZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A722584F04; Tue, 11 Oct 2022 13:50:52 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 211DD84F00 for ; Tue, 11 Oct 2022 13:50:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rogerq@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F0E7C61172; Tue, 11 Oct 2022 11:50:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54575C433D7; Tue, 11 Oct 2022 11:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665489043; bh=c0+JAfCoXZr9BrTwwYrFBMlHyM5QjWdKPhaUBw3eAAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MFci9WXZkGPUn2wftWt5WQrLXMA9ShyVadZyKwNMUSuB9FT1Fci/8qgZllUgvgxt6 hOrdXmOB6D9DdUv1rwLv5ofbils/T65b+MOEoK4ipKyoBbCqmg+iiB8Q4L2kLKHZ4D LN05RfoU9ezbWtPo4AWJTWXyzQI+PXTlkRGYysKI2HBaarKwAQe9+Nadhs2PFIJt0K 26KgUigQvq4m5a2BCRWyRhbRqJQEwgkUR4Cd++m/Frw+vBP2nWWcZ0x47EDqQXBNBS p39Dv/GF11u3HLctFFH8mv685HxX4PRk2eotntzNRs8b1cTgBXFOnaynqVJMR191bO /945YiIBHyx1w== From: Roger Quadros To: dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, trini@konsulko.com Cc: u-boot@lists.denx.de, Roger Quadros Subject: [u-boot][PATCH 08/14] mtd: rawnand: omap_gpmc: Reduce .bss usage Date: Tue, 11 Oct 2022 14:50:06 +0300 Message-Id: <20221011115012.6181-9-rogerq@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011115012.6181-1-rogerq@kernel.org> References: <20221011115012.6181-1-rogerq@kernel.org> 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.6 at phobos.denx.de X-Virus-Status: Clean Allocate omap_ecclayout on the heap as we have limited .bss space on AM64 R5 SPL configuration. Reduces .bss usage by 2984 bytes. Signed-off-by: Roger Quadros --- drivers/mtd/nand/raw/omap_gpmc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/omap_gpmc.c b/drivers/mtd/nand/raw/omap_gpmc.c index b5ad66ad49..e772a914c8 100644 --- a/drivers/mtd/nand/raw/omap_gpmc.c +++ b/drivers/mtd/nand/raw/omap_gpmc.c @@ -40,7 +40,6 @@ static u8 bch8_polynomial[] = {0xef, 0x51, 0x2e, 0x09, 0xed, 0x93, 0x9a, 0xc2, 0x97, 0x79, 0xe5, 0x24, 0xb5}; #endif static uint8_t cs_next; -static __maybe_unused struct nand_ecclayout omap_ecclayout; #if defined(CONFIG_NAND_OMAP_GPMC_WSCFG) static const int8_t wscfg[CONFIG_SYS_MAX_NAND_DEVICE] = @@ -874,7 +873,7 @@ static void __maybe_unused omap_free_bch(struct mtd_info *mtd) static int omap_select_ecc_scheme(struct nand_chip *nand, enum omap_ecc ecc_scheme, unsigned int pagesize, unsigned int oobsize) { struct omap_nand_info *info = nand_get_controller_data(nand); - struct nand_ecclayout *ecclayout = &omap_ecclayout; + struct nand_ecclayout *ecclayout = nand->ecc.layout; int eccsteps = pagesize / SECTOR_BYTES; int i; @@ -1167,7 +1166,9 @@ int board_nand_init(struct nand_chip *nand) nand->cmd_ctrl = omap_nand_hwcontrol; nand->options |= NAND_NO_PADDING | NAND_CACHEPRG; nand->chip_delay = 100; - nand->ecc.layout = &omap_ecclayout; + nand->ecc.layout = kzalloc(sizeof(*nand->ecc.layout), GFP_KERNEL); + if (!nand->ecc.layout) + return -ENOMEM; /* configure driver and controller based on NAND device bus-width */ gpmc_config = readl(&gpmc_cfg->cs[cs].config1); -- 2.17.1