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 1B5ECC7EE25 for ; Fri, 9 Jun 2023 20:26:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 161B984791; Fri, 9 Jun 2023 22:26:28 +0200 (CEST) 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="Y5fWnSP4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A983A85893; Fri, 9 Jun 2023 22:26:25 +0200 (CEST) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 0CDDD84768 for ; Fri, 9 Jun 2023 22:26:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jernej.skrabec@gmail.com Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-307d20548adso1583909f8f.0 for ; Fri, 09 Jun 2023 13:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686342382; x=1688934382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EZvA/3fbhD0ZlZP2eZsPZEPlg+aDPhGDa3Vr2v+kNLw=; b=Y5fWnSP4/lzEi2Pvl7jUd8iq0SzWVhCiuv41xtc+6bY2KuJzHzubdFYB/sXNzgiWKg 55zo/jY4nc0EEA9Co48v2T6WiWSXyxnOjdUhVe0PHHxkXU1hRdyJeyFMqmVCPFAnuYXp NOJyRB+LZQapNZ2dvGSYPimailSGiet+ct8QtHmjilQODBqhlsGhUp5wEC5pwz/48BK/ 1rlGEuLh8vL6S4aHWWP4mVBRyoCjR0MfFIokpN+zUWaIdkInfIY1T1pSvtjhLh0IqtUs J2qVECRYBfUEb+W4SrDiFFK/CjN/TOkTsNacoskfqsI0ceKzb1LkGHy3QWhvSLKub2lM b1LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686342382; x=1688934382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EZvA/3fbhD0ZlZP2eZsPZEPlg+aDPhGDa3Vr2v+kNLw=; b=a/LrG13Y6VSAnveKkuCKK9A/veQjI2hy/7dU5Yrxy2D2OxcToekK7FFZZcNIySg90m qlch93VeuOauMl3yw5yz4/W7imqjMWXuPRLoxvado48wbH9HrqYbY9GQnTirU2Rw8C90 H2RzVE5NlGAx6nORRteGY72v0+DUGEhTk1hpI7DzUohdBrKhbIdNppEZs5NkYfO8tNvF wLmiVtZVzDsvAsTOrQIug0jwFlV+p5KiBfQXbfVWZ3HoXwLMLkSOgO8SJI2Cev0W+yjA OklHFjJvs6sHcH52bthaXQBKACHPPXQfVZGObh6j1cTIA8qlzov8VBavF/wVPlymgHDe Pr7g== X-Gm-Message-State: AC+VfDzQORLQ5+IXbWJqFRUGcSmoPsi0aa7dkBXXIm5mUNEVfbKOW0To mkevddj358MicLRHWt5c3OBGWGKAP9UIZg== X-Google-Smtp-Source: ACHHUZ53TC4YnpMn6/PYjOs/A4zgdRb9nuqxbGor7Pus7ebc0Z/s9VGheL2EiyyJAIuhZ/T40M+heg== X-Received: by 2002:adf:f6cd:0:b0:30e:3eaa:19e with SMTP id y13-20020adff6cd000000b0030e3eaa019emr1513304wrp.16.1686342382316; Fri, 09 Jun 2023 13:26:22 -0700 (PDT) Received: from jernej-laptop.localnet (89-212-118-115.static.t-2.net. [89.212.118.115]) by smtp.gmail.com with ESMTPSA id v18-20020a5d43d2000000b0030ae93bd196sm5289477wrr.21.2023.06.09.13.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 13:26:22 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Jagan Teki , Mikhail Kalashnikov , Andre Przywara Cc: Samuel Holland , Icenowy Zheng , Piotr Oniszczuk , u-boot@lists.denx.de, linux-sunxi@lists.linux.dev Subject: Re: [PATCH 3/5] sunxi: H616: dram: split struct dram_para Date: Fri, 09 Jun 2023 22:26:21 +0200 Message-ID: <4810216.GXAFRqVoOG@jernej-laptop> In-Reply-To: <20230607000745.10245-4-andre.przywara@arm.com> References: <20230607000745.10245-1-andre.przywara@arm.com> <20230607000745.10245-4-andre.przywara@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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.8 at phobos.denx.de X-Virus-Status: Clean Dne sreda, 07. junij 2023 ob 02:07:43 CEST je Andre Przywara napisal(a): > Currently there is one DRAM parameter struct for the Allwinner H616 DRAM > "driver". It contains many fields that are compile time constants > (set by Kconfig variables), though there are also some fields that are > probed and changed over the runtime of the DRAM initialisation. > > Because of this mixture, the compiler cannot properly optimise the code > for size, as it does not consider constant propagation in its full > potential. > > Help the compiler out by splitting that structure into two: one that only > contains values known at compile time, and another one where the values > will actually change. The former can then be declared "const", which will > let the compiler fold its values directly into the code using it. > > We also add "const" tags for some new "struct dram_config" pointers, to > further increase code optimisation. > To help the compiler optimise the code further, the definition of the > now "const struct dram_para" has to happen at a file-global level, so > move that part out of sunxi_dram_init(). > > That results in quite some code savings (almost 2KB), and helps to keep > the code small with the LPDDR3 support added later. > > Signed-off-by: Andre Przywara Nice trick. It could be used also in other DRAM drivers. Reviewed-by: Jernej Skrabec Best regards, Jernej