]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
treewide: Simply conditions with the new OF_REAL
authorSimon Glass <sjg@chromium.org>
Sat, 7 Aug 2021 13:24:03 +0000 (07:24 -0600)
committerSimon Glass <sjg@chromium.org>
Sat, 25 Sep 2021 15:46:15 +0000 (09:46 -0600)
Use this new Kconfig to simplify the compilation conditions where
appropriate.

Signed-off-by: Simon Glass <sjg@chromium.org>
38 files changed:
arch/x86/lib/lpc-uclass.c
common/spl/spl.c
common/spl/spl_spi.c
drivers/clk/clk-uclass.c
drivers/clk/rockchip/clk_px30.c
drivers/clk/rockchip/clk_rk3288.c
drivers/clk/rockchip/clk_rk3308.c
drivers/clk/rockchip/clk_rk3368.c
drivers/clk/rockchip/clk_rk3399.c
drivers/core/device.c
drivers/core/fdtaddr.c
drivers/core/lists.c
drivers/core/root.c
drivers/core/uclass.c
drivers/firmware/firmware-uclass.c
drivers/gpio/mxs_gpio.c
drivers/gpio/omap_gpio.c
drivers/i2c/i2c-uclass.c
drivers/i2c/omap24xx_i2c.c
drivers/misc/misc-uclass.c
drivers/mmc/mxsmmc.c
drivers/mmc/omap_hsmmc.c
drivers/pch/pch-uclass.c
drivers/pinctrl/pinctrl-qe-io.c
drivers/power/domain/power-domain-uclass.c
drivers/serial/ns16550.c
drivers/serial/serial_omap.c
drivers/spi/cf_spi.c
drivers/spi/davinci_spi.c
drivers/spi/fsl_espi.c
drivers/spi/mxs_spi.c
drivers/spi/omap3_spi.c
drivers/spi/spi-uclass.c
drivers/tpm/tpm-uclass.c
dts/Kconfig
include/clk.h
include/dm/device.h
include/power-domain.h

index 1302a6e34a144a9f3441ae92d7ecce9768b00666..67b931d3b28966ae6301a64fa0241f66181f630b 100644 (file)
@@ -10,7 +10,7 @@
 UCLASS_DRIVER(lpc) = {
        .id             = UCLASS_LPC,
        .name           = "lpc",
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .post_bind      = dm_scan_fdt_dev,
 #endif
 };
index 31516e1eeda71000c1a14c7b00b1b6c718875218..ed94d5146cca9c0d13b8d3859b5865cd73eb3375 100644 (file)
@@ -489,7 +489,7 @@ static int spl_common_init(bool setup_malloc)
                return ret;
        }
 #endif
-       if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
+       if (CONFIG_IS_ENABLED(OF_REAL)) {
                ret = fdtdec_setup();
                if (ret) {
                        debug("fdtdec_setup() returned error %d\n", ret);
index f92ce37384cc49767ccf9e8aec83fb6b9ff08ca7..46ee4058e76616f717368713dc6768617fe4752b 100644 (file)
@@ -102,10 +102,10 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
 
        header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
-       payload_offs = ofnode_conf_read_int("u-boot,spl-payload-offset",
-                                           payload_offs);
-#endif
+       if (CONFIG_IS_ENABLED(OF_REAL)) {
+               payload_offs = ofnode_conf_read_int("u-boot,spl-payload-offset",
+                                                   payload_offs);
+       }
 
 #ifdef CONFIG_SPL_OS_BOOT
        if (spl_start_uboot() || spi_load_image_os(spl_image, flash, header))
index cea38a4c6e522a196a8cc23b903a0823adcd05af..7b1ea076afd5e222f2679e3fe8b1e8899b0627e7 100644 (file)
@@ -35,8 +35,7 @@ struct clk *dev_get_clk_ptr(struct udevice *dev)
        return (struct clk *)dev_get_uclass_priv(dev);
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL)
-# if CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
 int clk_get_by_driver_info(struct udevice *dev, struct phandle_1_arg *cells,
                           struct clk *clk)
 {
@@ -49,7 +48,9 @@ int clk_get_by_driver_info(struct udevice *dev, struct phandle_1_arg *cells,
 
        return 0;
 }
-# else
+#endif
+
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int clk_of_xlate_default(struct clk *clk,
                                struct ofnode_phandle_args *args)
 {
@@ -412,7 +413,6 @@ int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk)
 
        return clk_get_by_index(dev, index, clk);
 }
-# endif /* OF_PLATDATA */
 
 int clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk)
 {
@@ -465,7 +465,7 @@ int clk_release_all(struct clk *clk, int count)
        return 0;
 }
 
-#endif /* OF_CONTROL */
+#endif /* OF_REAL */
 
 int clk_request(struct udevice *dev, struct clk *clk)
 {
index a49b6f19f4f6685b8eae367971d167a8ea5f0903..617ce0dce5ace541f775464f81321b6ac8e4bcaf 100644 (file)
@@ -1367,7 +1367,7 @@ static ulong px30_clk_set_rate(struct clk *clk, ulong rate)
        return ret;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int px30_gmac_set_parent(struct clk *clk, struct clk *parent)
 {
        struct px30_clk_priv *priv = dev_get_priv(clk->dev);
@@ -1418,7 +1418,7 @@ static int px30_clk_enable(struct clk *clk)
 static struct clk_ops px30_clk_ops = {
        .get_rate = px30_clk_get_rate,
        .set_rate = px30_clk_set_rate,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .set_parent = px30_clk_set_parent,
 #endif
        .enable = px30_clk_enable,
index 221a5bd400f68be3052448a79d66abb538fb2bd7..e61bd6f1bf655fb8cf141087201bf537ff9beaa5 100644 (file)
@@ -950,7 +950,7 @@ static int __maybe_unused rk3288_clk_set_parent(struct clk *clk, struct clk *par
 static struct clk_ops rk3288_clk_ops = {
        .get_rate       = rk3288_clk_get_rate,
        .set_rate       = rk3288_clk_set_rate,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .set_parent     = rk3288_clk_set_parent,
 #endif
 };
index 5248e596853e9559120ccd30d2bee598b77b03b2..2876643e6be791f887742c258c13b1f623e6578d 100644 (file)
@@ -939,7 +939,7 @@ static ulong rk3308_clk_set_rate(struct clk *clk, ulong rate)
        return ret;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int __maybe_unused rk3308_mac_set_parent(struct clk *clk, struct clk *parent)
 {
        struct rk3308_clk_priv *priv = dev_get_priv(clk->dev);
@@ -976,7 +976,7 @@ static int __maybe_unused rk3308_clk_set_parent(struct clk *clk, struct clk *par
 static struct clk_ops rk3308_clk_ops = {
        .get_rate = rk3308_clk_get_rate,
        .set_rate = rk3308_clk_set_rate,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .set_parent = rk3308_clk_set_parent,
 #endif
 };
index 698fc3f13f5a3b61b33dec9a12937cf224429161..a0887b50a13b2f6c4d35862c326492e39d5961d7 100644 (file)
@@ -574,7 +574,7 @@ static int __maybe_unused rk3368_clk_set_parent(struct clk *clk, struct clk *par
 static struct clk_ops rk3368_clk_ops = {
        .get_rate = rk3368_clk_get_rate,
        .set_rate = rk3368_clk_set_rate,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .set_parent = rk3368_clk_set_parent,
 #endif
 };
index f8cbda44551e0bbecdb6a886b0e3a4b5d32b88a6..75b6fbfc1b1eaf021ac02596dcf476653e125071 100644 (file)
@@ -1289,7 +1289,7 @@ static int rk3399_clk_disable(struct clk *clk)
 static struct clk_ops rk3399_clk_ops = {
        .get_rate = rk3399_clk_get_rate,
        .set_rate = rk3399_clk_set_rate,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .set_parent = rk3399_clk_set_parent,
 #endif
        .enable = rk3399_clk_enable,
index 29668f6fb30e4eecd10308264e362bf5ef47c037..42ba2dce46584ac52bce79487ebc5ad33c616b56 100644 (file)
@@ -670,7 +670,7 @@ static int device_get_device_tail(struct udevice *dev, int ret,
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 /**
  * device_find_by_ofnode() - Return device associated with given ofnode
  *
@@ -1074,7 +1074,7 @@ void dev_set_uclass_plat(struct udevice *dev, void *uclass_plat)
        dev->uclass_plat_ = uclass_plat;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 bool device_is_compatible(const struct udevice *dev, const char *compat)
 {
        return ofnode_device_is_compatible(dev_ofnode(dev), compat);
index 4ffbd6b2ebc1ec0e7235a2cc4f1c69ba09b6d78d..6dfda20772636ffa56c31037a73a5e5afeeef3e8 100644 (file)
@@ -20,7 +20,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index)
 {
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        fdt_addr_t addr;
 
        if (CONFIG_IS_ENABLED(OF_TRANSLATE)) {
index e214306b904bc0032f333d7ad15a6ff74bde7ba3..350b9d32687c189bd596326943b14d9b94cd9f92 100644 (file)
@@ -154,7 +154,7 @@ int device_bind_driver_to_node(struct udevice *parent, const char *drv_name,
        return ret;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 /**
  * driver_check_compatible() - Check if a driver matches a compatible string
  *
index 78eee082c95433243466d1bc776b22dbfce6a8cc..fecdcb5b308fb35f11cf2e17f0b680aea97d9d07 100644 (file)
@@ -245,7 +245,7 @@ int dm_scan_plat(bool pre_reloc_only)
        return ret;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 /**
  * dm_scan_fdt_node() - Scan the device tree and bind drivers for a node
  *
@@ -372,7 +372,7 @@ static int dm_scan(bool pre_reloc_only)
                return ret;
        }
 
-       if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
+       if (CONFIG_IS_ENABLED(OF_REAL)) {
                ret = dm_extended_scan(pre_reloc_only);
                if (ret) {
                        debug("dm_extended_scan() failed: %d\n", ret);
index 3146dfd0320d75be404cda41819e6d5933f32331..c5a50952fd0d29729aafe7355cd5b2bd1e115e6f 100644 (file)
@@ -397,7 +397,7 @@ done:
        return ret;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent,
                                  const char *name, struct udevice **devp)
 {
index bfaf283eed5f85ba97ca79025ba47a12c4ff227b..e83a147a000b6d919cd10d530e4b4b1ac209efe7 100644 (file)
@@ -9,7 +9,7 @@
 UCLASS_DRIVER(firmware) = {
        .id             = UCLASS_FIRMWARE,
        .name           = "firmware",
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .post_bind      = dm_scan_fdt_dev,
 #endif
 };
index 7b9d88a8a75dc03409119c1c814ded7f9c97bbee..1356f89ac2f080e3c5a8adc94bcac4d5e3ad1d52 100644 (file)
@@ -262,7 +262,7 @@ static int mxs_gpio_probe(struct udevice *dev)
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int mxs_of_to_plat(struct udevice *dev)
 {
        struct mxs_gpio_plat *plat = dev_get_plat(dev);
@@ -301,7 +301,7 @@ U_BOOT_DRIVER(fsl_imx23_gpio) = {
        .probe  = mxs_gpio_probe,
        .priv_auto      = sizeof(struct mxs_gpio_priv),
        .plat_auto      = sizeof(struct mxs_gpio_plat),
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = mxs_gpio_ids,
        .of_to_plat = mxs_of_to_plat,
 #endif
index 316a28efa6bb5bfef3f143d9889ddbe5b73dcc2d..eee36458d5a034ac74f17c85a8b2d9b26a78ed14 100644 (file)
@@ -336,7 +336,7 @@ static int omap_gpio_bind(struct udevice *dev)
 }
 #endif
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static const struct udevice_id omap_gpio_ids[] = {
        { .compatible = "ti,omap3-gpio" },
        { .compatible = "ti,omap4-gpio" },
index db1c9d94624408675d90ae3fe51bb5a7951b4aee..71bc2b5b8a6db420e2077e14fcc49434e1132efd 100644 (file)
@@ -633,7 +633,7 @@ int i2c_deblock(struct udevice *bus)
        return ops->deblock(bus);
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 int i2c_chip_of_to_plat(struct udevice *dev, struct dm_i2c_chip *chip)
 {
        int addr;
@@ -655,7 +655,7 @@ int i2c_chip_of_to_plat(struct udevice *dev, struct dm_i2c_chip *chip)
 
 static int i2c_pre_probe(struct udevice *dev)
 {
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        struct dm_i2c_bus *i2c = dev_get_uclass_priv(dev);
        unsigned int max = 0;
        ofnode node;
@@ -678,7 +678,7 @@ static int i2c_pre_probe(struct udevice *dev)
 
 static int i2c_post_probe(struct udevice *dev)
 {
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        struct dm_i2c_bus *i2c = dev_get_uclass_priv(dev);
 
        i2c->speed_hz = dev_read_u32_default(dev, "clock-frequency",
@@ -692,7 +692,7 @@ static int i2c_post_probe(struct udevice *dev)
 
 static int i2c_child_post_bind(struct udevice *dev)
 {
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        struct dm_i2c_chip *plat = dev_get_parent_plat(dev);
 
        if (!dev_has_ofnode(dev))
@@ -709,7 +709,7 @@ static int i2c_post_bind(struct udevice *dev)
 
        debug("%s: %s, seq=%d\n", __func__, dev->name, dev_seq(dev));
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        ret = dm_scan_fdt_dev(dev);
 #endif
        return ret;
index e2c8c005d92dc10d5f5c5f09d04b32aae8ed2f7c..a767dee9866c8258114ee8df0377bccacec4e2df 100644 (file)
@@ -1034,7 +1034,7 @@ static int omap_i2c_probe(struct udevice *bus)
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int omap_i2c_of_to_plat(struct udevice *bus)
 {
        struct omap_i2c_plat *plat = dev_get_plat(bus);
@@ -1063,7 +1063,7 @@ static const struct dm_i2c_ops omap_i2c_ops = {
 U_BOOT_DRIVER(i2c_omap) = {
        .name   = "i2c_omap",
        .id     = UCLASS_I2C,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = omap_i2c_ids,
        .of_to_plat = omap_i2c_of_to_plat,
        .plat_auto      = sizeof(struct omap_i2c_plat),
index 72720b0e590cdd50dfffb6c06b74c696be058269..cbfacc3801a39c5ecfc810666fece37f46f8a765 100644 (file)
@@ -70,7 +70,7 @@ int misc_set_enabled(struct udevice *dev, bool val)
 UCLASS_DRIVER(misc) = {
        .id             = UCLASS_MISC,
        .name           = "misc",
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .post_bind      = dm_scan_fdt_dev,
 #endif
 };
index 8fd41764152fa291e6908057a097e008f139aa6a..35a8e21058edaf607e6dd54fa43bd2a1d4789c88 100644 (file)
@@ -665,7 +665,7 @@ static const struct dm_mmc_ops mxsmmc_ops = {
        .set_ios        = mxsmmc_set_ios,
 };
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int mxsmmc_of_to_plat(struct udevice *bus)
 {
        struct mxsmmc_plat *plat = dev_get_plat(bus);
@@ -709,7 +709,7 @@ static const struct udevice_id mxsmmc_ids[] = {
 U_BOOT_DRIVER(fsl_imx23_mmc) = {
        .name = "fsl_imx23_mmc",
        .id     = UCLASS_MMC,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = mxsmmc_ids,
        .of_to_plat = mxsmmc_of_to_plat,
 #endif
index 306ce0fe1e2b2db10c67981fddc3110bb5b75ed0..d267dc6436626a23239e7552628c71edac6106b9 100644 (file)
@@ -1891,7 +1891,7 @@ static int omap_hsmmc_get_pinctrl_state(struct mmc *mmc)
 }
 #endif
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 #ifdef CONFIG_OMAP54XX
 __weak const struct mmc_platform_fixups *platform_fixups_mmc(uint32_t addr)
 {
@@ -2009,7 +2009,7 @@ static int omap_hsmmc_probe(struct udevice *dev)
        return omap_hsmmc_init_setup(mmc);
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 
 static const struct omap_mmc_of_data dra7_mmc_of_data = {
        .controller_flags = OMAP_HSMMC_REQUIRE_IODELAY,
@@ -2027,7 +2027,7 @@ static const struct udevice_id omap_hsmmc_ids[] = {
 U_BOOT_DRIVER(omap_hsmmc) = {
        .name   = "omap_hsmmc",
        .id     = UCLASS_MMC,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = omap_hsmmc_ids,
        .of_to_plat = omap_hsmmc_of_to_plat,
        .plat_auto      = sizeof(struct omap_hsmmc_plat),
index 7bc2372e96d2d4350bc211b761c6a944af9902a4..af028f9cecad7ab6310ed585da209df03af0095d 100644 (file)
@@ -66,7 +66,7 @@ int pch_ioctl(struct udevice *dev, ulong req, void *data, int size)
 UCLASS_DRIVER(pch) = {
        .id             = UCLASS_PCH,
        .name           = "pch",
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .post_bind      = dm_scan_fdt_dev,
 #endif
 };
index e129ab2f8311639cfda4cdd3f4f159a858aa72fd..dc0be7ce3bd6d1a39b48cbdbff307a9fde8d7190 100644 (file)
@@ -248,7 +248,7 @@ U_BOOT_DRIVER(par_io_pinctrl) = {
        .of_to_plat = qe_io_of_to_plat,
        .plat_auto      = sizeof(struct qe_io_plat),
        .ops = &par_io_pinctrl_ops,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .flags  = DM_FLAG_PRE_RELOC,
 #endif
 };
index 00d1489ea20543b8522cc22a04faf427eb4b1315..33f9206bd09db5f93a516e03ddc0c1168265e2c9 100644 (file)
@@ -112,7 +112,7 @@ int power_domain_off(struct power_domain *power_domain)
        return ops->off(power_domain);
 }
 
-#if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA))
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int dev_power_domain_ctrl(struct udevice *dev, bool on)
 {
        struct power_domain pd;
@@ -162,7 +162,7 @@ int dev_power_domain_off(struct udevice *dev)
 {
        return dev_power_domain_ctrl(dev, false);
 }
-#endif
+#endif  /* OF_REAL */
 
 UCLASS_DRIVER(power_domain) = {
        .id             = UCLASS_POWER_DOMAIN,
index cc121eee277d8696c800542f6b9f8592fcb55323..953c2fbe5c1a5c4231a46071fd2ee8d414246422 100644 (file)
@@ -533,7 +533,7 @@ enum {
 };
 #endif
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 int ns16550_serial_of_to_plat(struct udevice *dev)
 {
        struct ns16550_plat *plat = dev_get_plat(dev);
@@ -588,7 +588,7 @@ const struct dm_serial_ops ns16550_serial_ops = {
        .getinfo = ns16550_serial_getinfo,
 };
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 /*
  * Please consider existing compatible strings before adding a new
  * one to keep this table compact. Or you may add a generic "ns16550"
@@ -602,7 +602,7 @@ static const struct udevice_id ns16550_serial_ids[] = {
        { .compatible = "snps,dw-apb-uart",     .data = PORT_NS16550 },
        {}
 };
-#endif /* OF_CONTROL && !OF_PLATDATA */
+#endif /* OF_REAL */
 
 #if CONFIG_IS_ENABLED(SERIAL_PRESENT)
 
@@ -611,7 +611,7 @@ static const struct udevice_id ns16550_serial_ids[] = {
 U_BOOT_DRIVER(ns16550_serial) = {
        .name   = "ns16550_serial",
        .id     = UCLASS_SERIAL,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = ns16550_serial_ids,
        .of_to_plat = ns16550_serial_of_to_plat,
        .plat_auto      = sizeof(struct ns16550_plat),
index 2b23ece442e5e6c4ded4fa168548622c207c9a34..ee938f67632b5f3e41b93361fd3ee0133f0f26d2 100644 (file)
@@ -98,7 +98,7 @@ DEBUG_UART_FUNCS
 
 #if CONFIG_IS_ENABLED(DM_SERIAL)
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int omap_serial_of_to_plat(struct udevice *dev)
 {
        struct ns16550_plat *plat = dev_get_plat(dev);
@@ -149,13 +149,13 @@ static const struct udevice_id omap_serial_ids[] = {
        { .compatible = "ti,am654-uart", },
        {}
 };
-#endif /* OF_CONTROL && !OF_PLATDATA */
+#endif /* OF_REAL */
 
 #if CONFIG_IS_ENABLED(SERIAL_PRESENT)
 U_BOOT_DRIVER(omap_serial) = {
        .name   = "omap_serial",
        .id     = UCLASS_SERIAL,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = omap_serial_ids,
        .of_to_plat = omap_serial_of_to_plat,
        .plat_auto      = sizeof(struct ns16550_plat),
index 6511c0e0e541707bb853072f38fdc9d68e77c9e3..ea23357090fefbd9f2460a0b9c03631c96d343fa 100644 (file)
@@ -384,7 +384,7 @@ static int coldfire_spi_probe(struct udevice *bus)
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int coldfire_dspi_of_to_plat(struct udevice *bus)
 {
        fdt_addr_t addr;
@@ -450,7 +450,7 @@ static const struct dm_spi_ops coldfire_spi_ops = {
 U_BOOT_DRIVER(coldfire_spi) = {
        .name = "spi_coldfire",
        .id = UCLASS_SPI,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = coldfire_spi_ids,
        .of_to_plat = coldfire_dspi_of_to_plat,
        .plat_auto      = sizeof(struct coldfire_spi_plat),
index 15557a62306a30c0e86120a11c829ab236e33880..0ee6171108a8772bbe4060f13c3ef3a09f05031b 100644 (file)
@@ -391,7 +391,7 @@ static int davinci_spi_probe(struct udevice *bus)
        return 0;
 }
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int davinci_ofdata_to_platadata(struct udevice *bus)
 {
        struct davinci_spi_plat *plat = dev_get_plat(bus);
@@ -418,7 +418,7 @@ static const struct udevice_id davinci_spi_ids[] = {
 U_BOOT_DRIVER(davinci_spi) = {
        .name = "davinci_spi",
        .id = UCLASS_SPI,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = davinci_spi_ids,
        .of_to_plat = davinci_ofdata_to_platadata,
        .plat_auto      = sizeof(struct davinci_spi_plat),
index 387b5471598ccce93d0f9445e4a730fbce0be819..c7a692623fb9d5a0d2ba1df68ee4f796dd9ee987 100644 (file)
@@ -541,7 +541,7 @@ static const struct dm_spi_ops fsl_espi_ops = {
        .set_mode       = fsl_espi_set_mode,
 };
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int fsl_espi_of_to_plat(struct udevice *bus)
 {
        fdt_addr_t addr;
@@ -572,7 +572,7 @@ static const struct udevice_id fsl_espi_ids[] = {
 U_BOOT_DRIVER(fsl_espi) = {
        .name   = "fsl_espi",
        .id     = UCLASS_SPI,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = fsl_espi_ids,
        .of_to_plat = fsl_espi_of_to_plat,
 #endif
index d41352a0bb8ce29d377dbe4dfa1a5ef14150e892..773e26bbed74ca3804986a3f960dd5fea2e57964 100644 (file)
@@ -440,7 +440,7 @@ static const struct dm_spi_ops mxs_spi_ops = {
         */
 };
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static int mxs_of_to_plat(struct udevice *bus)
 {
        struct mxs_spi_plat *plat = dev_get_plat(bus);
@@ -483,7 +483,7 @@ static const struct udevice_id mxs_spi_ids[] = {
 U_BOOT_DRIVER(fsl_imx23_spi) = {
        .name = "fsl_imx23_spi",
        .id     = UCLASS_SPI,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = mxs_spi_ids,
        .of_to_plat = mxs_of_to_plat,
 #endif
index c69f8fee6e5734f6162bb0f168450db18c9b844d..ea38a0ffbaf53eb33bffbe27cbcedd77f5477ca6 100644 (file)
@@ -481,7 +481,7 @@ static const struct dm_spi_ops omap3_spi_ops = {
         */
 };
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 static struct omap2_mcspi_platform_config omap2_pdata = {
        .regs_offset = 0,
 };
@@ -516,7 +516,7 @@ U_BOOT_DRIVER(omap3_spi) = {
        .name   = "omap3_spi",
        .id     = UCLASS_SPI,
        .flags  = DM_FLAG_PRE_RELOC,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .of_match = omap3_spi_ids,
        .of_to_plat = omap3_spi_of_to_plat,
        .plat_auto      = sizeof(struct omap3_spi_plat),
index d867b278064f3f0dbaca04fd77cd8f0ab69016a2..5a2a74367877f6b65c1511d9238fd02d7aef0060 100644 (file)
@@ -531,7 +531,7 @@ UCLASS_DRIVER(spi) = {
        .id             = UCLASS_SPI,
        .name           = "spi",
        .flags          = DM_UC_FLAG_SEQ_ALIAS,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .post_bind      = dm_scan_fdt_dev,
 #endif
        .post_probe     = spi_post_probe,
index 35774a6289e986f38ed90c38b57ab233d41adc1e..f67fe1019b2ec63670958dde66f2cba6659c36eb 100644 (file)
@@ -140,7 +140,7 @@ UCLASS_DRIVER(tpm) = {
        .id             = UCLASS_TPM,
        .name           = "tpm",
        .flags          = DM_UC_FLAG_SEQ_ALIAS,
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
        .post_bind      = dm_scan_fdt_dev,
 #endif
        .per_device_auto        = sizeof(struct tpm_chip_priv),
index d853aaafbc185d2a6d2d6431ba1f6bb6e5e67369..0cc562c626e0304c4215be5b4eec6a3cc5fa2ca1 100644 (file)
@@ -44,12 +44,13 @@ config OF_CONTROL
        bool "Run-time configuration via Device Tree"
        select DTC
        select OF_LIBFDT if !OF_PLATDATA
+       select OF_REAL if !OF_PLATDATA
        help
          This feature provides for run-time configuration of U-Boot
          via a flattened device tree.
 
 config OF_REAL
-       def_bool y
+       bool
        help
          Indicates that a real devicetree is available which can be accessed
          at runtime. This means that dev_read_...() functions can be used to
index f3c88fe68aa8303985a49ea1f95d026d37bb6b2f..f34401f48ee46d8d6e98ca993c0e030676cd9970 100644 (file)
@@ -300,9 +300,7 @@ enum clk_defaults_stage {
        CLK_DEFAULTS_POST_FORCE,
 };
 
-#if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) && \
-       CONFIG_IS_ENABLED(CLK)
-
+#if CONFIG_IS_ENABLED(OF_REAL) && CONFIG_IS_ENABLED(CLK)
 /**
  * clk_set_defaults - Process 'assigned-{clocks/clock-parents/clock-rates}'
  *                    properties to configure clocks
index ef6241bca8ba4aadd0d7f2e702b2aebb03803345..68986dd11e28eb2211764df5ee1045f769189865 100644 (file)
@@ -300,7 +300,7 @@ struct udevice_id {
        ulong data;
 };
 
-#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_REAL)
 #define of_match_ptr(_ptr)     (_ptr)
 #else
 #define of_match_ptr(_ptr)     NULL
index 72ff2ff25ba2b0d747d9f29d2c35e450b4d555a5..62ff19948f9abeb41505e45465fd835e8f02f6f5 100644 (file)
@@ -162,8 +162,7 @@ static inline int power_domain_off(struct power_domain *power_domain)
  *
  * @return 0 if OK, or a negative error code.
  */
-#if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) && \
-       CONFIG_IS_ENABLED(POWER_DOMAIN)
+#if CONFIG_IS_ENABLED(OF_REAL) && CONFIG_IS_ENABLED(POWER_DOMAIN)
 int dev_power_domain_on(struct udevice *dev);
 #else
 static inline int dev_power_domain_on(struct udevice *dev)
@@ -179,8 +178,7 @@ static inline int dev_power_domain_on(struct udevice *dev)
  *
  * @return 0 if OK, or a negative error code.
  */
-#if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) && \
-       CONFIG_IS_ENABLED(POWER_DOMAIN)
+#if CONFIG_IS_ENABLED(OF_REAL) && CONFIG_IS_ENABLED(POWER_DOMAIN)
 int dev_power_domain_off(struct udevice *dev);
 #else
 static inline int dev_power_domain_off(struct udevice *dev)