From patchwork Tue Aug 10 07:30:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1515289 X-Patchwork-Delegate: sjg@chromium.org 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=RUELdfs2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GkPkP2rGtz9sT6 for ; Tue, 10 Aug 2021 17:30:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B5F4D81D6C; Tue, 10 Aug 2021 09:30:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com 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" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="RUELdfs2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E444B82B4E; Tue, 10 Aug 2021 09:30:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 77BB581D6C for ; Tue, 10 Aug 2021 09:30:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-wr1-x429.google.com with SMTP id l18so24934885wrv.5 for ; Tue, 10 Aug 2021 00:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WznRlNVyPJt7+2z1/nRfzFSESKXRNgR8x/5DDYifCwU=; b=RUELdfs2QzfTX34Nl2AqFIGZ5gdrTX49v7VdLyP+laFM/MB0ItRE9XG/KuI3Az3EAk 8BjlG+27IQ775yf7GzrggVZPBZegY+lMhUWQ3HVc2Npz4rsccBur5WY3JpU73jWtZK1Y xFh+6WIAwuAXunJB6jQZcZAVGS3L+T2qs6Tx0eJW649wGgbAqO0l3+gZsRpn7DkjYc3/ mRXKN0pbnGep3haoEof4bbnRBslrjZkb5pFIYxts+1Hdl8bV/aW8JRLan6AB1VerL0Wx 0o/mPGoYkYK4TU4u0vqqeZZoC/AeSqnIMJJzWJJTMrbrak9x3dRS2YLVFdB2NCFpSuVp +Pzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=WznRlNVyPJt7+2z1/nRfzFSESKXRNgR8x/5DDYifCwU=; b=t/JnbGHUfUj8+JDTyp0z88T8ArnVrOTEKTUsyGnOidSNsAFgx9zZKO1aS6KS4GPrkP jVaz976USvTw9urE9vAQWrt5AsypPgcpPHyMY0F/vb9zMyEt32zpNKRcntdCmnoxqiTC uqLOX8YZSn/M1rpuhdCykjOWAznPrcLycSELJ7VV3M+K9uJvA7Bi9NSqVqw6eu0OKQIi tc3qfivRo6+gAqkAkV1Dfgsi5o+VR28vuFcksyw19qDoY65e1tbvtVgTF0/BkQzL5EON PtkmcBTkTzZR9RHT9/hgxk4NUpOA7ldPoW2u67IevaCoJk0dnmnyGCJOLPhCJUhZuaSB k26Q== X-Gm-Message-State: AOAM533+uyEaV4SfybNH4SS9a03hVs2yOgXRYvN2p9TCVPjWbckhfQGv sbtuWpSdjxZTRfD5hxAEQhIwAUkGqRPDlby2 X-Google-Smtp-Source: ABdhPJyfoyna7Wt0aepZpbfBeJYLprZOARAG72Dq/iikZZEd2r0hUjJirw/2eGlRHRI0jZRjlJ4CeA== X-Received: by 2002:a05:6000:25a:: with SMTP id m26mr15995745wrz.262.1628580621670; Tue, 10 Aug 2021 00:30:21 -0700 (PDT) Received: from localhost ([2a02:768:2307:40d6::648]) by smtp.gmail.com with ESMTPSA id d8sm22354207wrv.20.2021.08.10.00.30.20 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Aug 2021 00:30:21 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com, Tom Rini Cc: Simon Glass Subject: [PATCH] fdt_support: Add kernel-doc for fdt_fixup_memory_banks() Date: Tue, 10 Aug 2021 09:30:16 +0200 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Add kernel-doc description for fdt_fixup_memory_banks() because it is implemented in one specific way and this information should be available for others to decide if their SoC conforms to it. If you don't want U-Boot to update your memory DT layout please disable CONFIG_ARCH_FIXUP_FDT_MEMORY. Signed-off-by: Michal Simek Reviewed-by: Simon Glass --- common/fdt_support.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/fdt_support.c b/common/fdt_support.c index 4341d84bd5ec..8992ac5d3fca 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -420,6 +420,24 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size, #else #define MEMORY_BANKS_MAX 4 #endif + +/** + * fdt_fixup_memory_banks - Update DT memory node + * @blob: Pointer to DT blob + * @start: Pointer to memory start addresses array + * @size: Pointer to memory sizes array + * @banks: Number of memory banks + * + * Return: 0 on success, negative value on failure + * + * Based on the passed number of banks and arrays, the function is able to + * update existing DT memory nodes to match run time detected/changed memory + * configuration. Implementation is handling one specific case with only one + * memory node where multiple tuples could be added/updated. + * The case where multiple memory nodes with a single tuple (base, size) are + * used, this function is only updating the first memory node without removing + * others. + */ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks) { int err, nodeoffset;