From e4d7abc0d448c7e805f2b48ed1251708d1f84c67 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Sun, 16 Apr 2017 22:05:36 -0500 Subject: lib: provide clearer devicetree semantics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The devicetree data structures have been available in more than just ramstage and romstage. In order to provide clearer and consistent semantics two new macros are provided: 1. DEVTREE_EARLY which is true when !ENV_RAMSTAGE 2. DEVTREE_CONST as a replacment for ROMSTAGE_CONST The ROMSTAGE_CONST attribute is used in the source code to mark the devicetree data structures as const in early stages even though it's not just romstage. Therefore, rename the attribute to DEVTREE_CONST as that's the actual usage. The only place where the usage was not devicetree related is console_loglevel, but the same name was used for consistency. Any stage that is not ramstage has the const C attribute applied when DEVTREE_CONST is used. Change-Id: Ibd51c2628dc8f68e0896974f7e4e7c8588d333ed Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/19333 Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Furquan Shaikh --- src/soc/intel/apollolake/i2c_early.c | 4 ++-- src/soc/intel/apollolake/pmutil.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/soc/intel/apollolake') diff --git a/src/soc/intel/apollolake/i2c_early.c b/src/soc/intel/apollolake/i2c_early.c index 4eb2b86042..871c7621a9 100644 --- a/src/soc/intel/apollolake/i2c_early.c +++ b/src/soc/intel/apollolake/i2c_early.c @@ -28,8 +28,8 @@ static int i2c_early_init_bus(unsigned int bus) { - ROMSTAGE_CONST struct soc_intel_apollolake_config *config; - ROMSTAGE_CONST struct device *tree_dev; + DEVTREE_CONST struct soc_intel_apollolake_config *config; + DEVTREE_CONST struct device *tree_dev; pci_devfn_t dev; int devfn; uintptr_t base; diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c index 9e57b28abe..9999913bb3 100644 --- a/src/soc/intel/apollolake/pmutil.c +++ b/src/soc/intel/apollolake/pmutil.c @@ -502,10 +502,10 @@ void pmc_gpe_init(void) uint32_t gpio_cfg = 0; uint32_t gpio_cfg_reg; uint8_t dw1, dw2, dw3; - ROMSTAGE_CONST struct soc_intel_apollolake_config *config; + DEVTREE_CONST struct soc_intel_apollolake_config *config; /* Look up the device in devicetree */ - ROMSTAGE_CONST struct device *dev = dev_find_slot(0, SA_DEVFN_ROOT); + DEVTREE_CONST struct device *dev = dev_find_slot(0, SA_DEVFN_ROOT); if (!dev || !dev->chip_info) { printk(BIOS_ERR, "BUG! Could not find SOC devicetree config\n"); return; -- cgit v1.2.3