]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
of: clean up OF_CONTROL ifdef conditionals
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 11 Aug 2015 22:31:55 +0000 (07:31 +0900)
committerTom Rini <trini@konsulko.com>
Tue, 18 Aug 2015 17:46:05 +0000 (13:46 -0400)
We have flipped CONFIG_SPL_DISABLE_OF_CONTROL.  We have cleansing
devices, $(SPL_) and CONFIG_IS_ENABLED(), so we are ready to clear
away the ugly logic in include/fdtdec.h:

 #ifdef CONFIG_OF_CONTROL
 # if defined(CONFIG_SPL_BUILD) && !defined(SPL_OF_CONTROL)
 #  define OF_CONTROL 0
 # else
 #  define OF_CONTROL 1
 # endif
 #else
 # define OF_CONTROL 0
 #endif

Now CONFIG_IS_ENABLED(OF_CONTROL) is the substitute.  It refers to
CONFIG_OF_CONTROL for U-boot proper and CONFIG_SPL_OF_CONTROL for
SPL.

Also, we no longer have to cancel CONFIG_OF_CONTROL in
include/config_uncmd_spl.h and scripts/Makefile.spl.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
55 files changed:
arch/arm/mach-exynos/include/mach/dwmmc.h
arch/arm/mach-exynos/include/mach/mipi_dsim.h
arch/arm/mach-exynos/include/mach/mmc.h
arch/arm/mach-exynos/pinmux.c
arch/arm/mach-tegra/clock.c
arch/arm/mach-tegra/tegra114/clock.c
arch/arm/mach-tegra/tegra124/clock.c
arch/arm/mach-tegra/tegra20/clock.c
arch/arm/mach-tegra/tegra30/clock.c
board/xilinx/microblaze-generic/microblaze-generic.c
board/xilinx/zynq/board.c
common/cli.c
common/spl/spl.c
drivers/core/Makefile
drivers/core/device.c
drivers/core/lists.c
drivers/core/root.c
drivers/gpio/mxc_gpio.c
drivers/gpio/vybrid_gpio.c
drivers/i2c/s3c24x0_i2c.c
drivers/input/Makefile
drivers/input/tegra-kbc.c
drivers/mmc/exynos_dw_mmc.c
drivers/mmc/s5p_sdhci.c
drivers/mmc/tegra_mmc.c
drivers/mmc/zynq_sdhci.c
drivers/mtd/spi/sf_probe.c
drivers/net/xilinx_emaclite.c
drivers/net/zynq_gem.c
drivers/power/exynos-tmu.c
drivers/power/pmic/pmic_max77686.c
drivers/serial/ns16550.c
drivers/serial/serial-uclass.c
drivers/serial/serial_omap.c
drivers/serial/serial_pl01x.c
drivers/serial/serial_tegra.c
drivers/serial/serial_uniphier.c
drivers/serial/serial_zynq.c
drivers/sound/max98095.c
drivers/sound/wm8994.c
drivers/tpm/tpm_tis_i2c.c
drivers/video/exynos_dp_lowlevel.c
drivers/video/exynos_fb.c
drivers/video/exynos_fimd.c
drivers/video/exynos_mipi_dsi.c
drivers/video/tegra.c
include/cli.h
include/config_uncmd_spl.h
include/configs/microblaze-generic.h
include/configs/socfpga_common.h
include/dm/device.h
include/fdtdec.h
lib/Makefile
lib/fdtdec.c
scripts/Makefile.uncmd_spl

index a7ca12c477e2689e361085286f6d20f581f4358f..bd997ad47e31f82cf96df1d15dceb327bd8b2849 100644 (file)
@@ -27,7 +27,5 @@
 #define DWMCI_DIVRATIO_BIT             24
 #define DWMCI_DIVRATIO_MASK            0x7
 
-#ifdef CONFIG_OF_CONTROL
 int exynos_dwmmc_init(const void *blob);
-#endif
 int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32 clksel);
index 50e5c258a930997d9a975238bbeb1cfb49f6d392..c9e8e067d741dc7fc9203d77cac3139f189f449e 100644 (file)
@@ -374,7 +374,5 @@ void exynos_init_dsim_platform_data(vidinfo_t *vid);
 /* panel driver init based on mipi dsi interface */
 void s6e8ax0_init(void);
 
-#ifdef CONFIG_OF_CONTROL
 extern int mipi_power(void);
-#endif
 #endif /* _DSIM_H */
index 0fb6461c08bcdefcbf513cf5a43361be768f7a41..48b8c4d882e72e9ef493d7059eba0b7d65327417 100644 (file)
@@ -65,8 +65,6 @@ static inline int s5p_mmc_init(int index, int bus_width)
        return s5p_sdhci_init(base, index, bus_width);
 }
 
-#ifdef CONFIG_OF_CONTROL
 int exynos_mmc_init(const void *blob);
-#endif
 
 #endif
index e97cb376ffc7ca8ba4806755d7ba241325fc15f3..179b29449e6f520a31f37c474d30e4d8d528c0ba 100644 (file)
@@ -874,7 +874,7 @@ int exynos_pinmux_config(int peripheral, int flags)
        return -1;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static int exynos4_pinmux_decode_periph_id(const void *blob, int node)
 {
        int err;
index f014434d8cc3f8ac28f7a5aef3117a3c9ee586c3..f9dfcd04115a1267ac39080fddc2feea255ad5b2 100644 (file)
@@ -573,7 +573,7 @@ void clock_ll_start_uart(enum periph_id periph_id)
        reset_set_enable(periph_id, 0);
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int clock_decode_periph_id(const void *blob, int node)
 {
        enum periph_id id;
@@ -588,7 +588,7 @@ int clock_decode_periph_id(const void *blob, int node)
        assert(clock_periph_id_isvalid(id));
        return id;
 }
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 int clock_verify(void)
 {
index f1831d385d02f1e23699029ce8f361a0e334a6a6..5e805a7baf032b5749df17601c377af653f42d8a 100644 (file)
@@ -582,7 +582,7 @@ void reset_set_enable(enum periph_id periph_id, int enable)
        writel(reg, reset);
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 /*
  * Convert a device tree clock ID to our peripheral ID. They are mostly
  * the same but we are very cautious so we check that a valid clock ID is
@@ -618,7 +618,7 @@ enum periph_id clk_id_to_periph_id(int clk_id)
                return clk_id;
        }
 }
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 void clock_early_init(void)
 {
index 291b75276c5e845a636008f65b7ac774389f3332..61e8ab7053fd493f07e9a606ac74084fcf0d08ef 100644 (file)
@@ -732,7 +732,7 @@ void reset_set_enable(enum periph_id periph_id, int enable)
        writel(reg, reset);
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 /*
  * Convert a device tree clock ID to our peripheral ID. They are mostly
  * the same but we are very cautious so we check that a valid clock ID is
@@ -798,7 +798,7 @@ enum periph_id clk_id_to_periph_id(int clk_id)
                return clk_id;
        }
 }
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 void clock_early_init(void)
 {
index dea459b164be4c3ada7f7d4caa742cb1fb1261ad..cd9fb9a55340ffa5b29a0633a2b248243fa1b08a 100644 (file)
@@ -507,7 +507,7 @@ void reset_set_enable(enum periph_id periph_id, int enable)
        writel(reg, reset);
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 /*
  * Convert a device tree clock ID to our peripheral ID. They are mostly
  * the same but we are very cautious so we check that a valid clock ID is
@@ -542,7 +542,7 @@ enum periph_id clk_id_to_periph_id(int clk_id)
                return clk_id;
        }
 }
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 void clock_early_init(void)
 {
index 3ce508b0b25b56011168dbc2d1f9a15beba5c557..1f104f288e5756351ec612d52b1831fb891e152d 100644 (file)
@@ -562,7 +562,7 @@ void reset_set_enable(enum periph_id periph_id, int enable)
        writel(reg, reset);
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 /*
  * Convert a device tree clock ID to our peripheral ID. They are mostly
  * the same but we are very cautious so we check that a valid clock ID is
@@ -600,7 +600,7 @@ enum periph_id clk_id_to_periph_id(int clk_id)
                return clk_id;
        }
 }
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 void clock_early_init(void)
 {
index 375cd0b6feb9fc68641463f490d18c9c5603cf17..0c8bd7d1511eb6213e96fac6dcb91201b81d49a6 100644 (file)
@@ -24,7 +24,7 @@ DECLARE_GLOBAL_DATA_PTR;
 static int reset_pin = -1;
 #endif
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 ulong ram_base;
 
 void dram_init_banksize(void)
index 738c31c6ee1f568cc95a6dd47ce34579f2853b64..237f2c2a2bf6d1fd095eb42e5403b09b54d20c80 100644 (file)
@@ -154,7 +154,7 @@ int board_mmc_init(bd_t *bd)
 
 int dram_init(void)
 {
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        int node;
        fdt_addr_t addr;
        fdt_size_t size;
index 075ae9dc4aec5971b327651c7b8117211adb04e1..b6ae80a5fe9d2cb79c7b6571c3e91714ba830f06 100644 (file)
@@ -135,7 +135,7 @@ int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 }
 #endif
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 bool cli_process_fdt(const char **cmdp)
 {
        /* Allow the fdt to override the boot command */
@@ -196,7 +196,7 @@ err:
         */
        hang();
 }
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 void cli_loop(void)
 {
index 45cf92526c12f6812c904c0a8d604d2965178ea7..a5892d7988747505c7022abcc8ba55bd276127d4 100644 (file)
@@ -157,8 +157,7 @@ int spl_init(void)
        gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
        gd->malloc_ptr = 0;
 #endif
-       if (IS_ENABLED(CONFIG_OF_CONTROL) &&
-                       IS_ENABLED(CONFIG_SPL_OF_CONTROL)) {
+       if (CONFIG_IS_ENABLED(OF_CONTROL)) {
                ret = fdtdec_setup();
                if (ret) {
                        debug("fdtdec_setup() returned error %d\n", ret);
index 1dd25a366074910b9a77cca2b74fcee8f491e21a..11e0276e56b289114a28cfe13a321079dbef8541 100644 (file)
@@ -7,7 +7,7 @@
 obj-y  += device.o lists.o root.o uclass.o util.o
 obj-$(CONFIG_DEVRES) += devres.o
 ifndef CONFIG_SPL_BUILD
-obj-$(CONFIG_OF_CONTROL) += simple-bus.o
+obj-$(CONFIG_$(SPL_)OF_CONTROL) += simple-bus.o
 endif
 obj-$(CONFIG_$(SPL_)DM_DEVICE_REMOVE)  += device-remove.o
 obj-$(CONFIG_DM)       += dump.o
index 56b90817de0b444e653c9749fe1163e2348725ec..e23a8725e7ab06d96fbf617a083dcefaa16e980a 100644 (file)
@@ -59,7 +59,7 @@ int device_bind(struct udevice *parent, const struct driver *drv,
 
        dev->seq = -1;
        dev->req_seq = -1;
-       if (IS_ENABLED(CONFIG_OF_CONTROL) && IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) {
+       if (CONFIG_IS_ENABLED(OF_CONTROL) && IS_ENABLED(CONFIG_DM_SEQ_ALIAS)) {
                /*
                * Some devices, such as a SPI bus, I2C bus and serial ports
                * are numbered using aliases.
@@ -561,7 +561,7 @@ const char *dev_get_uclass_name(struct udevice *dev)
 
 fdt_addr_t dev_get_addr(struct udevice *dev)
 {
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        fdt_addr_t addr;
 
        addr = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg");
index 2e52500ef25c7ee145c22240cae67356b212bf99..a1c94780dd31d977c1823958a0539d5af261f25b 100644 (file)
@@ -99,7 +99,7 @@ int device_bind_driver_to_node(struct udevice *parent, const char *drv_name,
        return 0;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 /**
  * driver_check_compatible() - Check if a driver is compatible with this node
  *
index 12d046051fdb3af8065adcd18d5bc017d6dc25b9..78ab00c7bfbf9e4d46cdf2c9e83e3cf2011d23e8 100644 (file)
@@ -114,7 +114,7 @@ int dm_init(void)
        ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
        if (ret)
                return ret;
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        DM_ROOT_NON_CONST->of_offset = 0;
 #endif
        ret = device_probe(DM_ROOT_NON_CONST);
@@ -145,7 +145,7 @@ int dm_scan_platdata(bool pre_reloc_only)
        return ret;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int dm_scan_fdt_node(struct udevice *parent, const void *blob, int offset,
                     bool pre_reloc_only)
 {
@@ -198,7 +198,7 @@ int dm_init_and_scan(bool pre_reloc_only)
                return ret;
        }
 
-       if (OF_CONTROL) {
+       if (CONFIG_IS_ENABLED(OF_CONTROL)) {
                ret = dm_scan_fdt(gd->fdt_blob, pre_reloc_only);
                if (ret) {
                        debug("dm_scan_fdt() failed: %d\n", ret);
index 57a650f75074af3a575ecbfe61e33b221ee0b955..0c48320966b56f7f66d061d21bb9c440bfdbf545 100644 (file)
@@ -336,7 +336,7 @@ U_BOOT_DRIVER(gpio_mxc) = {
        .bind   = mxc_gpio_bind,
 };
 
-#ifndef CONFIG_OF_CONTROL
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct mxc_gpio_plat mxc_plat[] = {
        { 0, (struct gpio_regs *)GPIO1_BASE_ADDR },
        { 1, (struct gpio_regs *)GPIO2_BASE_ADDR },
index 6eaf0a9ad4ca9c8fb290ec90173f75fb0e5bfd3d..4d25f9af4e0f63866fa3f209e1e17792c0521a77 100644 (file)
@@ -135,7 +135,7 @@ static int vybrid_gpio_bind(struct udevice *dev)
        return 0;
 }
 
-#ifndef CONFIG_OF_CONTROL
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct vybrid_gpio_platdata vybrid_gpio[] = {
        {0, GPIO0_BASE_ADDR, "GPIO0 "},
        {1, GPIO1_BASE_ADDR, "GPIO1 "},
index c11a6be7b76e8c3c50a6e829bc79f467a8ed9ff6..ae6f436385a616479db3096256613657c3d14665 100644 (file)
@@ -1002,7 +1002,7 @@ static int s3c24x0_i2c_write(struct i2c_adapter *adap, uchar chip, uint addr,
        }
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static void process_nodes(const void *blob, int node_list[], int count,
                         int is_highspeed)
 {
@@ -1101,7 +1101,7 @@ int i2c_reset_port_fdt(const void *blob, int node)
 
        return 0;
 }
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 #ifdef CONFIG_EXYNOS5
 static void exynos_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
index 24fec9b83ef1e6ea6d8a773775c31b7d7949c098..b1161c5e1b4e9f9f686f53e9db7f7d7d35f18922 100644 (file)
@@ -14,4 +14,4 @@ obj-y += keyboard.o pc_keyb.o
 obj-$(CONFIG_PS2MULT) += ps2mult.o ps2ser.o
 endif
 obj-y += input.o
-obj-$(CONFIG_OF_CONTROL) += key_matrix.o
+obj-$(CONFIG_$(SPL_)OF_CONTROL) += key_matrix.o
index 0ef94f7a00bb26c72bfb2d07b60f63dc9030d77b..c9c9fac5ada63400d0630b9330f664877a0ae9dc 100644 (file)
@@ -295,7 +295,7 @@ static int init_tegra_keyboard(struct stdio_dev *dev)
        if (config.created)
                return 0;
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        int     node;
 
        node = fdtdec_next_compatible(gd->fdt_blob, 0,
index e0837452351ffdd60a5549a698969c3ff05afa22..cde2ba7118f16adbae2262bdadc9f4929f298c89 100644 (file)
@@ -158,7 +158,7 @@ int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32 clksel)
        return exynos_dwmci_core_init(host, index);
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static struct dwmci_host dwmci_host[DWMMC_MAX_CH_NUM];
 
 static int do_dwmci_init(struct dwmci_host *host)
index 522eab9bbfc4ac0d5edbf0d45a84209a43693128..4db51d6488aa319335c8ebfb395528ab85ae24e3 100644 (file)
@@ -96,7 +96,7 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width)
        return s5p_sdhci_core_init(host);
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
 
 static int do_sdhci_init(struct sdhci_host *host)
index 6f8b4d00a2cf0cd9375c45b40a2d22c0e1fc2046..15848658e1197de620afc64c09cd211ecd59a2b5 100644 (file)
@@ -21,7 +21,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 struct mmc_host mmc_host[CONFIG_SYS_MMC_MAX_DEVICE];
 
-#ifndef CONFIG_OF_CONTROL
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
 #error "Please enable device tree support to use this driver"
 #endif
 
index 971acbb6dffaf4716b70d742a526f760cd858ab3..c69f5d4e2d44ac52f90ca24251593f95ed660f55 100644 (file)
@@ -33,7 +33,7 @@ int zynq_sdhci_init(phys_addr_t regbase)
        return 0;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int zynq_sdhci_of_init(const void *blob)
 {
        int offset = 0;
index e0283dc82cd87a07dbd0707fa21c593eaad4c71c..954376de15365f10fac0e378225e103e59a0ceec 100644 (file)
@@ -266,7 +266,7 @@ static int spi_flash_validate_params(struct spi_slave *spi, u8 *idcode,
        return 0;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
 {
        fdt_addr_t addr;
@@ -292,7 +292,7 @@ int spi_flash_decode_fdt(const void *blob, struct spi_flash *flash)
 
        return 0;
 }
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 /**
  * spi_flash_probe_slave() - Probe for a SPI flash device on a bus
@@ -347,7 +347,7 @@ int spi_flash_probe_slave(struct spi_slave *spi, struct spi_flash *flash)
                }
        }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        if (spi_flash_decode_fdt(gd->fdt_blob, flash)) {
                debug("SF: FDT decode error\n");
                ret = -EINVAL;
index c9afa99690867c11407d9e983cc294d960f0790b..564205df83d39532f378bd0d5f32ad4e2c632b04 100644 (file)
@@ -361,7 +361,7 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
        return 1;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int xilinx_emaclite_of_init(const void *blob)
 {
        int offset = 0;
index b2006dfa0775152e2dbbb2eafce4263e766d0981..9175d2cae8f75676009ea0b0a3d9bfe74c704dae 100644 (file)
@@ -553,7 +553,7 @@ int zynq_gem_initialize(bd_t *bis, phys_addr_t base_addr,
        return 1;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int zynq_gem_of_init(const void *blob)
 {
        int offset = 0;
index 9a093a5bddd63d6bf15917377896edd1afe32144..b9968c25eb2115934f20b085671cc1bd09cddb75 100644 (file)
@@ -180,7 +180,7 @@ enum tmu_status_t tmu_monitor(int *temp)
  */
 static int get_tmu_fdt_values(struct tmu_info *info, const void *blob)
 {
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        fdt_addr_t addr;
        int node;
        int error = 0;
index 1ad810acc266cb41cfbc5071c633c464d6418865..93c8d2b155dbbe0ad129bc3d30246b0ebf645549 100644 (file)
@@ -256,7 +256,7 @@ int pmic_init(unsigned char bus)
 {
        static const char name[] = "MAX77686_PMIC";
        struct pmic *p = pmic_alloc();
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        const void *blob = gd->fdt_blob;
        int node, parent, tmp;
 #endif
@@ -266,7 +266,7 @@ int pmic_init(unsigned char bus)
                return -ENOMEM;
        }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        node = fdtdec_next_compatible(blob, 0, COMPAT_MAXIM_MAX77686_PMIC);
        if (node < 0) {
                debug("PMIC: No node for PMIC Chip in device tree\n");
index c8a77e295e9ee9d3c2f1108d1b86014bb6d46bd2..2b6d1e46386b0ee895ef10f77b14e550cb50e4c2 100644 (file)
@@ -357,7 +357,7 @@ int ns16550_serial_probe(struct udevice *dev)
        return 0;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
 {
        struct ns16550_platdata *plat = dev->platdata;
index 2a496979bcdf7f93c40c91064eba7a34004eb414..55011cc4b9a7e6a36dd5039e5a501c6afc85d86e 100644 (file)
@@ -32,7 +32,7 @@ static void serial_find_console_or_panic(void)
        struct udevice *dev;
        int node;
 
-       if (OF_CONTROL && gd->fdt_blob) {
+       if (CONFIG_IS_ENABLED(OF_CONTROL) && gd->fdt_blob) {
                /* Check for a chosen console */
                node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
                if (node < 0)
@@ -55,7 +55,7 @@ static void serial_find_console_or_panic(void)
                        }
                }
        }
-       if (!SPL_BUILD || !OF_CONTROL || !gd->fdt_blob) {
+       if (!SPL_BUILD || !CONFIG_IS_ENABLED(OF_CONTROL) || !gd->fdt_blob) {
                /*
                * Try to use CONFIG_CONS_INDEX if available (it is numbered
                * from 1!).
index 325fe427fd854211bbb6288a2d7075e892f708d4..e8d544f0da4f5aff81cd083f6b31ad0118fc5ed6 100644 (file)
@@ -12,7 +12,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id omap_serial_ids[] = {
        { .compatible = "ti,omap3-uart" },
        { .compatible = "ti,omap4-uart" },
index ad503afcad540c3b7901e462ba024d1a382ad71d..917b6034d360e824bdfa6fd95e8ae82224f08fa8 100644 (file)
@@ -353,7 +353,7 @@ static const struct dm_serial_ops pl01x_serial_ops = {
        .setbrg = pl01x_serial_setbrg,
 };
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id pl01x_serial_id[] ={
        {.compatible = "arm,pl011", .data = TYPE_PL011},
        {.compatible = "arm,pl010", .data = TYPE_PL010},
index b9227f05633c358a5c3918bec488a277d803601f..0c84f0bc91463956c0fadd66f2809b83e91c9a7f 100644 (file)
@@ -9,7 +9,7 @@
 #include <ns16550.h>
 #include <serial.h>
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id tegra_serial_ids[] = {
        { .compatible = "nvidia,tegra20-uart" },
        { }
@@ -42,7 +42,7 @@ U_BOOT_DEVICE(ns16550_serial) = {
 U_BOOT_DRIVER(serial_ns16550) = {
        .name   = "serial_tegra20",
        .id     = UCLASS_SERIAL,
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        .of_match = tegra_serial_ids,
        .ofdata_to_platdata = tegra_serial_ofdata_to_platdata,
        .platdata_auto_alloc_size = sizeof(struct ns16550_platdata),
index f21098607862062782bc61fc1fb9f234747ef582..abf362a8458512e4c627d929dd0af79fe5032ded 100644 (file)
@@ -113,7 +113,7 @@ static int uniphier_serial_remove(struct udevice *dev)
        return 0;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id uniphier_uart_of_match[] = {
        { .compatible = "socionext,uniphier-uart" },
        { /* sentinel */ }
index 9278763164fae607791d5d4dabd0fe35a9d7e920..9d842901966587f57f40d22c631486f771de3b52 100644 (file)
@@ -175,7 +175,7 @@ DECLARE_PSSERIAL_FUNCTIONS(1);
 static struct serial_device uart_zynq_serial1_device =
        INIT_PSSERIAL_STRUCTURE(1, "ttyPS1");
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 __weak struct serial_device *default_serial_console(void)
 {
        const void *blob = gd->fdt_blob;
index febf4195ba9b8870183d409f3ca4743e18118bc0..35829f88c9d99c132175c21f04b204d0f928cfba 100644 (file)
@@ -520,7 +520,7 @@ static int get_max98095_codec_values(struct sound_codec_info *pcodec_info,
                                const void *blob)
 {
        int error = 0;
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        enum fdt_compat_id compat;
        int node;
        int parent;
index f8e9a6eadd62c6f9e5cf14189eec4cfcd1ec8069..d378442c5035d2e9e53b23e622085eabcc55156c 100644 (file)
@@ -814,7 +814,7 @@ static int get_codec_values(struct sound_codec_info *pcodec_info,
                        const void *blob)
 {
        int error = 0;
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        enum fdt_compat_id compat;
        int node;
        int parent;
index ee4dfeae445bd7d9b398ce59086e54ead4ec20ff..cc740e9c21beb16510c73897416f998993a9573f 100644 (file)
@@ -585,7 +585,7 @@ static struct tpm_vendor_specific tpm_tis_i2c = {
 
 static enum i2c_chip_type tpm_vendor_chip_type(void)
 {
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        const void *blob = gd->fdt_blob;
 
        if (fdtdec_next_compatible(blob, 0, COMPAT_INFINEON_SLB9645_TPM) >= 0)
index 05118f801b33403b235cdf6df843529c7edf3df0..e9b461a99a935775c8b59e19e8f4a63c49d1e3e5 100644 (file)
@@ -22,7 +22,7 @@ struct exynos_dp *dp_regs;
 
 void exynos_dp_set_base_addr(void)
 {
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        unsigned int node = fdtdec_next_compatible(gd->fdt_blob,
                                        0, COMPAT_SAMSUNG_EXYNOS5_DP);
        if (node <= 0)
index 8f3b8263dab6e8a328e3056b413620ef7e3e241c..69edc3a3a4a382512167ae3660f49f953c419be5 100644 (file)
@@ -28,7 +28,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static unsigned int panel_width, panel_height;
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 vidinfo_t panel_info  = {
        /*
         * Insert a value here so that we don't end up in the BSS
@@ -126,7 +126,7 @@ static void lcd_panel_on(vidinfo_t *vid)
 
        exynos_backlight_on(1);
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        node = fdtdec_next_compatible(gd->fdt_blob, 0,
                                                COMPAT_SAMSUNG_EXYNOS_FIMD);
        if (node <= 0) {
@@ -150,7 +150,7 @@ static void lcd_panel_on(vidinfo_t *vid)
                exynos_mipi_dsi_init();
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int exynos_lcd_early_init(const void *blob)
 {
        unsigned int node;
@@ -295,7 +295,7 @@ void lcd_ctrl_init(void *lcdbase)
        set_system_display_ctrl();
        set_lcd_clk();
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 #ifdef CONFIG_EXYNOS_MIPI_DSIM
        exynos_init_dsim_platform_data(&panel_info);
 #endif
index f67fa817ed13938a1965046b24dfe0c7364ef389..ac001a801e0917b9f56ecef86aa01c545793f557 100644 (file)
@@ -251,7 +251,7 @@ void exynos_fimd_window_off(unsigned int win_id)
        writel(cfg, &fimd_ctrl->winshmap);
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 /*
 * The reset value for FIMD SYSMMU register MMU_CTRL is 3
 * on Exynos5420 and newer versions.
@@ -295,7 +295,7 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
 {
        unsigned int cfg = 0, rgb_mode;
        unsigned int offset;
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        unsigned int node;
 
        node = fdtdec_next_compatible(gd->fdt_blob,
index c68ebd6f7baef81d5bc49da0c6e5949607d0b950..b597accf3d81f9380fb303e11ec2f8832676244f 100644 (file)
@@ -28,7 +28,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 static struct exynos_platform_mipi_dsim *dsim_pd;
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static struct mipi_dsim_config dsim_config_dt;
 static struct exynos_platform_mipi_dsim dsim_platform_data_dt;
 static struct mipi_dsim_lcd_device mipi_lcd_device_dt;
@@ -249,7 +249,7 @@ void exynos_set_dsim_platform_data(struct exynos_platform_mipi_dsim *pd)
        dsim_pd = pd;
 }
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 int exynos_dsim_config_parse_dt(const void *blob)
 {
        int node;
index 33c61039943bb21012b240e890389795fb78da29..8e8134614e395154634266462aa668c944140599 100644 (file)
@@ -49,7 +49,7 @@ vidinfo_t panel_info = {
        .vl_col = -1,
 };
 
-#ifndef CONFIG_OF_CONTROL
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
 #error "You must enable CONFIG_OF_CONTROL to get Tegra LCD support"
 #endif
 
index 6da7a4afdb1199dee24be9aa343c5a4a94b14c44..4c39b9e2b1f17420fb9129907eb4cd319a5349e1 100644 (file)
@@ -108,7 +108,7 @@ int cli_readline_into_buffer(const char *const prompt, char *buffer,
  */
 int cli_simple_parse_line(char *line, char *argv[]);
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 /**
  * cli_process_fdt() - process the boot command from the FDT
  *
index 2741fc8a8e10f990f6abaae0fe4bee9daa7b24f4..6e299f69ae48a82ea770c077597ada36397476c0 100644 (file)
@@ -20,9 +20,6 @@
 #undef CONFIG_CMD_SNTP
 #undef CONFIG_CMD_TFTPPUT
 #undef CONFIG_CMD_TFTPSRV
-#ifndef CONFIG_SPL_OF_CONTROL
-#undef CONFIG_OF_CONTROL
-#endif
 
 #ifndef CONFIG_SPL_DM
 #undef CONFIG_DM_SERIAL
index 626fa44927111d19003b611d8079474d95955aea..8ce1c497077032f8aaae487b7bdd941c8b49a8f8 100644 (file)
 # define CONFIG_XILINX_TB_WATCHDOG
 #endif
 
-#ifndef CONFIG_OF_CONTROL
+#if !defined(CONFIG_OF_CONTROL) || \
+       (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_OF_CONTROL))
 /* ddr sdram - main memory */
 # define CONFIG_SYS_SDRAM_BASE XILINX_RAM_START
 # define CONFIG_SYS_SDRAM_SIZE XILINX_RAM_SIZE
index 5ca45a90c7902e6d50af9ae202d829c56ab6fddf..c64c7ed42075a20179c43c2648d652968ad93548 100644 (file)
@@ -214,7 +214,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SPI_FLASH_BAR
 #endif
 
-#ifdef CONFIG_OF_CONTROL       /* DW SPI is controlled via DT */
+#if CONFIG_IS_ENABLED(OF_CONTROL)      /* DW SPI is controlled via DT */
 #define CONFIG_DESIGNWARE_SPI
 #define CONFIG_CMD_SPI
 #endif
index 1f78963803d85d45a32f532c5d7851a3a269fbfa..a239be64691ad774ce380782a08eea6e73e10ad4 100644 (file)
@@ -122,11 +122,11 @@ struct udevice_id {
        ulong data;
 };
 
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 #define of_match_ptr(_ptr)     (_ptr)
 #else
 #define of_match_ptr(_ptr)     NULL
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_IS_ENABLED(OF_CONTROL) */
 
 /**
  * struct driver - A driver for a feature or peripheral
index 5796e272b29c71cc27be4a36e7503a489dfbf33d..0cb6fa0075028ecc08f44c7e0d9a463a9c7ae0ce 100644 (file)
@@ -45,16 +45,6 @@ struct fdt_memory {
 #define SPL_BUILD      0
 #endif
 
-#ifdef CONFIG_OF_CONTROL
-# if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_OF_CONTROL)
-#  define OF_CONTROL 0
-# else
-#  define OF_CONTROL 1
-# endif
-#else
-# define OF_CONTROL 0
-#endif
-
 /*
  * Information about a resource. start is the first address of the resource
  * and end is the last address (inclusive). The length of the resource will
index 3b6a74bae72cb622bfa6485568fbed90765e5132..96f832edd2daa0ff6f19054125bd53a1fe1de722 100644 (file)
@@ -26,8 +26,8 @@ obj-y += crc8.o
 obj-y += crc16.o
 obj-$(CONFIG_ERRNO_STR) += errno_str.o
 obj-$(CONFIG_FIT) += fdtdec_common.o
-obj-$(CONFIG_OF_CONTROL) += fdtdec_common.o
-obj-$(CONFIG_OF_CONTROL) += fdtdec.o
+obj-$(CONFIG_$(SPL_)OF_CONTROL) += fdtdec_common.o
+obj-$(CONFIG_$(SPL_)OF_CONTROL) += fdtdec.o
 obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
 obj-$(CONFIG_GZIP) += gunzip.o
 obj-$(CONFIG_GZIP_COMPRESSED) += gzip.o
@@ -51,15 +51,12 @@ endif
 
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_OF_LIBFDT) += libfdt/
-obj-$(CONFIG_OF_CONTROL) += fdtdec_common.o
-obj-$(CONFIG_OF_CONTROL) += fdtdec.o
 endif
-
 ifdef CONFIG_SPL_OF_CONTROL
 obj-$(CONFIG_OF_LIBFDT) += libfdt/
-obj-$(CONFIG_OF_CONTROL) += fdtdec_common.o
-obj-$(CONFIG_OF_CONTROL) += fdtdec.o
 endif
+obj-$(CONFIG_$(SPL_)OF_CONTROL) += fdtdec_common.o
+obj-$(CONFIG_$(SPL_)OF_CONTROL) += fdtdec.o
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
index d21fb74c22de6e3501982a5288097b103fe6584f..b65e1e6185550e4651ebce5ecb46d50cecccf791 100644 (file)
@@ -1140,7 +1140,7 @@ int fdtdec_decode_display_timing(const void *blob, int parent, int index,
 
 int fdtdec_setup(void)
 {
-#ifdef CONFIG_OF_CONTROL
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 # ifdef CONFIG_OF_EMBED
        /* Get a pointer to the FDT */
        gd->fdt_blob = __dtb_dt_begin;
index b90fcb8186716fff17f7f15ab02038d0635c045f..40035468e76e9c627de1a9eb2281baf0ab789fc4 100644 (file)
@@ -3,9 +3,6 @@
 # TODO: Invent a better way
 
 ifdef CONFIG_SPL_BUILD
-ifndef CONFIG_SPL_OF_CONTROL
-CONFIG_OF_CONTROL=
-endif
 
 ifndef CONFIG_SPL_DM
 CONFIG_DM_SERIAL=