From patchwork Thu May 16 10:28:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsin-Yi Wang X-Patchwork-Id: 10946299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0D93924 for ; Thu, 16 May 2019 10:28:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE516288F8 for ; Thu, 16 May 2019 10:28:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1D3E28978; Thu, 16 May 2019 10:28:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0ED94288F8 for ; Thu, 16 May 2019 10:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6uKkUNUsqam9w05gA8n41TjUoguLGdjFkeQQK+9BC4k=; b=cembi6hEfg9WYo Nol+wAWbdAIW9sBc+hejuKXzxzVlpFqyLxlgyEU6Csz0Tr4+SGwny5kBrtMBU9wcxGZX/pzAVe0FV P0zRZRDJFQWLz+rV3Sgn0v3kpjKF3tWCduh/d8zmNYtQZfX4islEcpF7/F/Swdpq0k3eNWLKWbgoy arcBxLoOhzyh74ubbktjs61lHluf3hkhBunTgVeCHiA1M12sYHzG6vr92XUd5PWYP8aEENfGHNnMo QywAGOVjaqQvXlWoDEQVH+91/OctItfCc8w+Qe4nFExUD3i+ZgGn3jvRpe3bdM51CT0C+A5W54YaV XXZ8e5+krmPiBnC5iVew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRDcu-0001gm-DS; Thu, 16 May 2019 10:28:40 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hRDcr-0001fy-76 for linux-arm-kernel@lists.infradead.org; Thu, 16 May 2019 10:28:38 +0000 Received: by mail-pf1-x444.google.com with SMTP id u17so1621959pfn.7 for ; Thu, 16 May 2019 03:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zdJ9wOciRCFBg5OhP24ccEPW98TzZ5e0I9CMtzhtP7k=; b=j6TjZjdTvdf6CjCSc4yUwh0w3lHoZrsZkToyITUvilzaKO5fJ0vqwlISOAS2BDbhb6 2VbC5h3lCINUHea8eLr5qB7bqHliBCV26+cZHkuc6/kN9BvyoxdDK0mVitXKri3MUivK IbYPCZMbdWKCRDRF9dlx5fQMu94ziC7y43FQI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zdJ9wOciRCFBg5OhP24ccEPW98TzZ5e0I9CMtzhtP7k=; b=HNzH/YzdwsqUZhEtXl9yrye8DPxFKWE7fngxy16VKhSz+E0mPu7bazRRhvU/aNSuGT LflrrlITdf9xJydrTn0fC+uMBRl2zYLxHb5wr4REeLnrWT8x08iQGyFaLAR9j8SfJ/Pz IDZX1K6KSlMYx2BPFLa38RRVkurr7/OjrNLnoQ29M+RoXqd3Z+ovlQzR68mi2p875QiG ttoj/u8YmJJcwvVXDTzkGk/A7+Yu2x60FBdOOyterUzYFSZlmW/3CKGrCLWx1XWyC0Ui 6BPrr8GIXj6TAoGZhtHEisStcsr3nCqKJo6+1U63FfnzaQKW7HuOplZor8ETW4tFqn+a IlUg== X-Gm-Message-State: APjAAAUjJjjc5rvjwJuNGN+OvIF5VcLyYsLXbhNRavVGzo/toMNi0GYX eG2kPx4DsKqgwyVmmjWCBwLGVgY0H4U= X-Google-Smtp-Source: APXvYqzPTskZH8eYovOCQmHUvgMMgQkqepD4OYCnKFG7nHyDLIhQaMeOn+J/Ld+Xt/Ggq8IM/7Zmkg== X-Received: by 2002:a62:e00e:: with SMTP id f14mr52831963pfh.257.1558002515484; Thu, 16 May 2019 03:28:35 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id h123sm9338048pfe.80.2019.05.16.03.28.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 May 2019 03:28:34 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 1/3] include/of_fdt.h: add a weak arch hook to update fdt pgprot Date: Thu, 16 May 2019 18:28:15 +0800 Message-Id: <20190516102817.188519-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190516_032837_281703_E9048A90 X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Yu Zhao , Kees Cook , Ard Biesheuvel , Catalin Marinas , Stephen Boyd , Chintan Pandya , Will Deacon , linux-kernel@vger.kernel.org, Mike Rapoport , Jun Yao , Miles Chen , Rob Herring , James Morse , Hsin-Yi Wang , Andrew Murray , Andrew Morton , Laura Abbott , Frank Rowand , Robin Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Does nothing as default, arch can implement their function to map fdt to RO/RW. This is convenient if arch map fdt to RO during init but needs to write fdt in some special cases after that. Signed-off-by: Hsin-Yi Wang --- drivers/of/fdt.c | 13 +++++++++++++ include/linux/of_fdt.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index de893c9616a1..e84971d1e9ea 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -30,6 +30,19 @@ #include "of_private.h" +/* + * update_fdt_pgprot - Arch hook for changing fdt pgprot + * + * @prot: page protection flags for fdt + * + * Architecture can implement this function if they want to chagne + * fdt page protection flags before or after doing modification and + * fixups to fdt. + * + * Default does nothing. + */ +__weak void update_fdt_pgprot(pgprot_t prot) {} + /* * of_fdt_limit_memory - limit the number of regions in the /memory node * @limit: maximum entries diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index a713e5d156d8..406c3e7b2b75 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -109,5 +109,7 @@ static inline void unflatten_device_tree(void) {} static inline void unflatten_and_copy_device_tree(void) {} #endif /* CONFIG_OF_EARLY_FLATTREE */ +extern void update_fdt_pgprot(pgprot_t prot); + #endif /* __ASSEMBLY__ */ #endif /* _LINUX_OF_FDT_H */