#include <i2c.h>
#include "i2c_common.h"
-#ifdef CONFIG_DM_I2C
+#if CONFIG_IS_ENABLED(DM_I2C)
/* If DM is in use, retrieve the chip for the specified bus number */
int fsl_i2c_get_device(int address, int bus, DEVICE_HANDLE_T *dev)
#define __NXP_I2C_COMMON_H__
/* Common functionality shared by the I2C drivers for VID and the mux. */
-#ifdef CONFIG_DM_I2C
+#if CONFIG_IS_ENABLED(DM_I2C)
#define DEVICE_HANDLE_T struct udevice *
#define I2C_READ(dev, register, data, length) \
GSC_SC_RST_CAUSE_MAX = 10,
};
-#if (IS_ENABLED(CONFIG_DM_I2C))
+#if CONFIG_IS_ENABLED(DM_I2C)
struct gsc_priv {
int gscver;
# (C) Copyright 2006-2009
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-ifdef CONFIG_SPL_BUILD
-
-ifeq ($(CONFIG_$(SPL_TPL_)BUILD)$(CONFIG_$(SPL_TPL_)DM_SERIAL),yy)
-obj-y += serial-uclass.o
-else
-obj-y += serial.o
-endif
-
-else
-
-ifdef CONFIG_DM_SERIAL
+ifeq ($(CONFIG_$(SPL_TPL_)DM_SERIAL),y)
obj-y += serial-uclass.o
else
obj-y += serial.o
endif
-endif
-
-ifdef CONFIG_DM_SERIAL
obj-$(CONFIG_PL01X_SERIAL) += serial_pl01x.o
-else
obj-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
obj-$(CONFIG_$(SPL_)SYS_NS16550_SERIAL) += serial_ns16550.o
-endif
obj-$(CONFIG_ALTERA_UART) += altera_uart.o
obj-$(CONFIG_ALTERA_JTAG_UART) += altera_jtag_uart.o
#include <linux/delay.h>
#include <asm/io.h>
-#ifdef CONFIG_DM_SERIAL
+#if CONFIG_IS_ENABLED(DM_SERIAL)
#include <asm/arch/atmel_serial.h>
#endif
#include <asm/arch/clk.h>
DECLARE_GLOBAL_DATA_PTR;
-#ifndef CONFIG_DM_SERIAL
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
static void atmel_serial_setbrg_internal(atmel_usart3_t *usart, int id,
int baudrate)
{
{
return &atmel_serial_drv;
}
-#endif
-
-#ifdef CONFIG_DM_SERIAL
+#else
enum serial_clk_type {
CLK_TYPE_NORMAL = 0,
CLK_TYPE_DBGU,
{
}
-#if defined(CONFIG_DM_STDIO)
+#if CONFIG_IS_ENABLED(DM_STDIO)
#if CONFIG_IS_ENABLED(SERIAL_PRESENT)
static void serial_stub_putc(struct stdio_dev *sdev, const char ch)
static int serial_post_probe(struct udevice *dev)
{
struct dm_serial_ops *ops = serial_get_ops(dev);
-#ifdef CONFIG_DM_STDIO
+#if CONFIG_IS_ENABLED(DM_STDIO)
struct serial_dev_priv *upriv = dev_get_uclass_priv(dev);
struct stdio_dev sdev;
#endif
return ret;
}
-#ifdef CONFIG_DM_STDIO
+#if CONFIG_IS_ENABLED(DM_STDIO)
if (!(gd->flags & GD_FLG_RELOC))
return 0;
memset(&sdev, '\0', sizeof(sdev));
return (readl(&priv->regs->lsr) & UART_LSR_THRE) ? 0 : 1;
}
-#if defined(CONFIG_DM_SERIAL) && \
- (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_DM))
+#if CONFIG_IS_ENABLED(DM_SERIAL)
static int mtk_serial_setbrg(struct udevice *dev, int baudrate)
{
struct mtk_serial_priv *priv = dev_get_priv(dev);
DECLARE_GLOBAL_DATA_PTR;
-#ifndef CONFIG_DM_SERIAL
-
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
static volatile unsigned char *const port[] = CFG_PL01x_PORTS;
static enum pl01x_type pl01x_type __section(".data");
static struct pl01x_regs *base_regs __section(".data");
return 0;
}
-#ifndef CONFIG_DM_SERIAL
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
static void pl01x_serial_init_baud(int baudrate)
{
int clock = 0;
{
return &pl01x_serial_drv;
}
-
-#endif /* nCONFIG_DM_SERIAL */
-
-#ifdef CONFIG_DM_SERIAL
-
+#else
int pl01x_serial_setbrg(struct udevice *dev, int baudrate)
{
struct pl01x_serial_plat *plat = dev_get_plat(dev);
u32 pl011_cr; /* 0x30 Control register */
};
-#ifdef CONFIG_DM_SERIAL
+#if CONFIG_IS_ENABLED(DM_SERIAL)
int pl01x_serial_of_to_plat(struct udevice *dev);
int pl01x_serial_probe(struct udevice *dev);
+++ /dev/null
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2012
- * Ilya Yanok, ilya.yanok@gmail.com
- */
-
-#ifndef __CONFIG_UNCMD_SPL_H__
-#define __CONFIG_UNCMD_SPL_H__
-
-#ifdef CONFIG_SPL_BUILD
-/* SPL needs only BOOTP + TFTP so undefine other stuff to save space */
-
-#ifndef CONFIG_SPL_DM
-#undef CONFIG_DM_SERIAL
-#undef CONFIG_DM_I2C
-#endif
-
-#undef CONFIG_DM_STDIO
-
-#endif /* CONFIG_SPL_BUILD */
-#endif /* __CONFIG_UNCMD_SPL_H__ */
* shorted - index 1
* Retain non-DM serial port for debug purposes.
*/
-#if !defined(CONFIG_DM_SERIAL)
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
#define CFG_SYS_NS16550_CLK (get_bus_freq(0) / 2)
#define CFG_SYS_NS16550_COM1 (CFG_SYS_CCSRBAR + 0x11C500)
#endif
* NS16550 Configuration
*/
#define CFG_SYS_NS16550_CLK CFG_SYS_TCLK
-#if !defined(CONFIG_DM_SERIAL)
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
#define CFG_SYS_NS16550_COM1 MV_UART_CONSOLE_BASE
#endif
#else
#define CFG_SYS_NS16550_CLK 24000000
#endif
-#ifndef CONFIG_DM_SERIAL
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
# define CFG_SYS_NS16550_COM1 SUNXI_UART0_BASE
# define CFG_SYS_NS16550_COM2 SUNXI_UART1_BASE
# define CFG_SYS_NS16550_COM3 SUNXI_UART2_BASE
* Hardware drivers
*/
#define CFG_SYS_NS16550_CLK 48000000
-#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_SERIAL)
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
#define CFG_SYS_NS16550_COM3 UART3_BASE
#endif
* NS16550 Configuration
*/
#define CFG_SYS_NS16550_CLK CFG_SYS_TCLK
-#if !defined(CONFIG_DM_SERIAL)
+#if !CONFIG_IS_ENABLED(DM_SERIAL)
#define CFG_SYS_NS16550_COM1 MV_UART_CONSOLE_BASE
#endif
#include <linux/types.h>
-#if defined(CONFIG_DM_SERIAL) && !defined(CONFIG_SYS_NS16550_REG_SIZE)
+#if CONFIG_IS_ENABLED(DM_SERIAL) && !defined(CONFIG_SYS_NS16550_REG_SIZE)
/*
* For driver model we always use one byte per register, and sort out the
* differences in the driver
#ifdef CONFIG_NS16550_DYNAMIC
#define UART_REG(x) unsigned char x
#else
-#if !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0)
-#error "Please define NS16550 registers size."
-#elif defined(CONFIG_SYS_NS16550_MEM32) && !defined(CONFIG_DM_SERIAL)
+#if defined(CONFIG_SYS_NS16550_MEM32) && !CONFIG_IS_ENABLED(DM_SERIAL)
#define UART_REG(x) u32 x
+#elif !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0)
+#error "Please define NS16550 registers size."
#elif (CONFIG_SYS_NS16550_REG_SIZE > 0)
#define UART_REG(x) \
unsigned char prepad_##x[CONFIG_SYS_NS16550_REG_SIZE - 1]; \
UART_REG(scr); /* 10*/
UART_REG(ssr); /* 11*/
#endif
-#ifdef CONFIG_DM_SERIAL
+#if CONFIG_IS_ENABLED(DM_SERIAL)
struct ns16550_plat *plat;
#endif
};
define filechk_config_h
(echo "/* Automatically generated - do not edit */"; \
echo \#define CFG_BOARDDIR board/$(if $(VENDOR),$(VENDOR)/)$(BOARD);\
- echo \#include \<config_uncmd_spl.h\>; \
echo \#include \<configs/$(CONFIG_SYS_CONFIG_NAME).h\>; \
echo \#include \<asm/config.h\>; \
echo \#include \<linux/kconfig.h\>; \
# Modified for U-Boot
-include include/config/auto.conf
-include $(prefix)/include/autoconf.mk
-include scripts/Makefile.uncmd_spl
include scripts/Kbuild.include
+++ /dev/null
-# SPDX-License-Identifier: GPL-2.0+
-# Makefile version of include/config_uncmd_spl.h
-# TODO: Invent a better way
-
-ifdef CONFIG_SPL_BUILD
-
-ifndef CONFIG_SPL_DM
-CONFIG_DM_SERIAL=
-CONFIG_DM_I2C=
-CONFIG_DM_SPI=
-CONFIG_DM_SPI_FLASH=
-endif
-
-endif