Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp441950yba; Thu, 16 May 2019 03:31:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqySVqlgAcnh3oweSF2zeObYNpYe8FjS9OEXfkTBGZyqCpZHOwaYd4nR3r9YPfuOywADEiu7 X-Received: by 2002:a63:e417:: with SMTP id a23mr48117385pgi.224.1558002663475; Thu, 16 May 2019 03:31:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558002663; cv=none; d=google.com; s=arc-20160816; b=eN2IhslZcuvEehm8kLmPRcqjkYc/jOoZlHjt4EWeedoftjb13fp7kHjPWp6qTXzxgt YXBu7RGHL7C78ochdDoN2eLYVawnk4hax0iVXKUP18uSdPnTKCzR/vykFAQrwrw8zRAX tTwT02oJAUznJIkLlrjdXauRVZCuVrJKZaZQ2fZYF0yT+7fUd9JeqElxP8DWZX4Pi2re LwDNvREU85lf52Goj157pNd3Vi8jv8TOFAsznlS6k+UaEw7SneHba0C3vjby7EaeG5cB qnTCcr3PC/37wIUaL3QHzGdozKuJS/hL34XOuRBCPxvCyxsHKL9qD8taCG6S6+PtVsFd LtUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zdJ9wOciRCFBg5OhP24ccEPW98TzZ5e0I9CMtzhtP7k=; b=XzA/6KpzfFt5G2bqCaXRQBgfrojBVxNsatracQxYMp9FOgjoOlcmj8ZCx6CWvaSRQn VyjQOjdTHLrCKLTG9OafUwArVv/euifi2om1N1QyUeTyZr+RIvMpMaAFESC2i+cqdM2p xJLscxvoKsNUEHt10WTtpv+yLgKi+SLaoWsyASi7Rj+/6heJ64S7FUeSjLYeqaMngNnn l4S7yvGl5o2p3yoHEwtG1DsY4rRYD4D1e7LYF1DULrH9snl17QSFDjLjG92rMXIcPbYM vMzw9l6Xp+LO1RQFuTm86pxcmDtGZXkx4tkpiXbonBq5LLSDhQGLz0HtyF6wm/srT3NC +IvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j6TjZjdT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23si4399164plr.149.2019.05.16.03.30.48; Thu, 16 May 2019 03:31:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j6TjZjdT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727035AbfEPK2g (ORCPT + 99 others); Thu, 16 May 2019 06:28:36 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33733 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbfEPK2g (ORCPT ); Thu, 16 May 2019 06:28:36 -0400 Received: by mail-pf1-f196.google.com with SMTP id z28so1641295pfk.0 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=P/MuIIfSE7jF50r719BJifFRyUrQdZOZplzZxcswoWRN/CPhVdhs16Ps984OwDbgSr yYIGtYPnmhvn6+mEMVQdhcGuRrNxzQLSY8ooFAuyZDvOLeBhbyuuSX5u9c0EG3facmIi sp121RaRppzFPWlvGapwaP56ztUw/fvkACRlduwTNCGvTRyjFc0fy/eAllzS/jy32dsi evA2QcVMjaDS6lj3VgpLErD7kCwtuppR4fhRT8QPCjovVzg2o5lytNT6ePWyrT6/0wpa k8VsDSJxEzn1aZWLoOEYucNKHdBVa1chHsM99YyLta64K00WurMq1cVsRS8FMKp2SFJE 8xng== X-Gm-Message-State: APjAAAUj04UQos4Yjmzo1ZE6qRoVHUL/HY27us4NNiWnSnoYp7sEPpPS 2+dNw/iADuaCQDWiCVGjJGs1Kg== 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 Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Frank Rowand , Catalin Marinas , Will Deacon , Andrew Morton , Mike Rapoport , Ard Biesheuvel , Miles Chen , Hsin-Yi Wang , James Morse , Andrew Murray , Mark Rutland , Chintan Pandya , Jun Yao , Yu Zhao , Robin Murphy , Laura Abbott , Stephen Boyd , Kees Cook 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ -- 2.20.1