From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/7] dfu: Make DFU support more SPL friendly
Date: Thu, 17 Jan 2019 13:43:03 -0600 [thread overview]
Message-ID: <20190117194308.29644-3-afd@ti.com> (raw)
In-Reply-To: <20190117194308.29644-1-afd@ti.com>
Do this by using $(SPL_) in Makefiles and CONFIG_IS_ENABLED in C code.
This ensures the files and features are only built into the right build
for which they are enabled. Using the macros to simplify this patch was
made possible by the config symbol rename done in the last patch.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
drivers/Makefile | 3 +--
drivers/dfu/Makefile | 12 ++++++------
include/dfu.h | 10 +++++-----
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/Makefile b/drivers/Makefile
index 14543c7d6c..eca023ac04 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -2,6 +2,7 @@
obj-$(CONFIG_$(SPL_TPL_)CLK) += clk/
obj-$(CONFIG_$(SPL_TPL_)DM) += core/
+obj-$(CONFIG_$(SPL_TPL_)DFU) += dfu/
obj-$(CONFIG_$(SPL_TPL_)GPIO_SUPPORT) += gpio/
obj-$(CONFIG_$(SPL_TPL_)DRIVERS_MISC_SUPPORT) += misc/ sysreset/ firmware/
obj-$(CONFIG_$(SPL_TPL_)I2C_SUPPORT) += i2c/
@@ -50,7 +51,6 @@ obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/
obj-$(CONFIG_SPL_USB_GADGET) += usb/common/
obj-$(CONFIG_SPL_USB_GADGET) += usb/gadget/udc/
-obj-$(CONFIG_SPL_DFU) += dfu/
obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/
obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
@@ -86,7 +86,6 @@ obj-y += misc/
obj-$(CONFIG_MMC) += mmc/
obj-$(CONFIG_NVME) += nvme/
obj-y += pcmcia/
-obj-y += dfu/
obj-$(CONFIG_X86) += pch/
obj-y += phy/allwinner/
obj-y += phy/marvell/
diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile
index 56f9b0c5f4..4164f342ac 100644
--- a/drivers/dfu/Makefile
+++ b/drivers/dfu/Makefile
@@ -3,9 +3,9 @@
# Copyright (C) 2012 Samsung Electronics
# Lukasz Majewski <l.majewski@samsung.com>
-obj-$(CONFIG_DFU) += dfu.o
-obj-$(CONFIG_DFU_MMC) += dfu_mmc.o
-obj-$(CONFIG_DFU_NAND) += dfu_nand.o
-obj-$(CONFIG_DFU_RAM) += dfu_ram.o
-obj-$(CONFIG_DFU_SF) += dfu_sf.o
-obj-$(CONFIG_DFU_TFTP) += dfu_tftp.o
+obj-$(CONFIG_$(SPL_)DFU) += dfu.o
+obj-$(CONFIG_$(SPL_)DFU_MMC) += dfu_mmc.o
+obj-$(CONFIG_$(SPL_)DFU_NAND) += dfu_nand.o
+obj-$(CONFIG_$(SPL_)DFU_RAM) += dfu_ram.o
+obj-$(CONFIG_$(SPL_)DFU_SF) += dfu_sf.o
+obj-$(CONFIG_$(SPL_)DFU_TFTP) += dfu_tftp.o
diff --git a/include/dfu.h b/include/dfu.h
index fbe978abdc..9340a900a2 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -202,7 +202,7 @@ static inline void dfu_set_defer_flush(struct dfu_entity *dfu)
int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size);
/* Device specific */
-#ifdef CONFIG_DFU_MMC
+#if CONFIG_IS_ENABLED(DFU_MMC)
extern int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s);
#else
static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr,
@@ -213,7 +213,7 @@ static inline int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr,
}
#endif
-#ifdef CONFIG_DFU_NAND
+#if CONFIG_IS_ENABLED(DFU_NAND)
extern int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr, char *s);
#else
static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr,
@@ -224,7 +224,7 @@ static inline int dfu_fill_entity_nand(struct dfu_entity *dfu, char *devstr,
}
#endif
-#ifdef CONFIG_DFU_RAM
+#if CONFIG_IS_ENABLED(DFU_RAM)
extern int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, char *s);
#else
static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr,
@@ -235,7 +235,7 @@ static inline int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr,
}
#endif
-#ifdef CONFIG_DFU_SF
+#if CONFIG_IS_ENABLED(DFU_SF)
extern int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr, char *s);
#else
static inline int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr,
@@ -259,7 +259,7 @@ static inline int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr,
*
* @return 0 on success, otherwise error code
*/
-#ifdef CONFIG_DFU_TFTP
+#if CONFIG_IS_ENABLED(DFU_TFTP)
int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len,
char *interface, char *devstring);
#else
--
2.19.1
next prev parent reply other threads:[~2019-01-17 19:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-17 19:43 [U-Boot] [PATCH v3 0/7] Add USB boot to HS DRA7xx/AM57xx Andrew F. Davis
2019-01-17 19:43 ` [U-Boot] [PATCH v3 1/7] spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU Andrew F. Davis
2019-01-22 22:40 ` Lukasz Majewski
2019-01-27 3:52 ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-17 19:43 ` Andrew F. Davis [this message]
2019-01-22 22:41 ` [U-Boot] [PATCH v3 2/7] dfu: Make DFU support more SPL friendly Lukasz Majewski
2019-01-27 3:52 ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-17 19:43 ` [U-Boot] [PATCH v3 3/7] dfu: Remove dependency on HUSH parser in SPL Andrew F. Davis
2019-01-22 22:43 ` Lukasz Majewski
2019-01-22 23:41 ` Tom Rini
2019-01-23 6:54 ` Lukasz Majewski
2019-01-23 14:13 ` Andrew F. Davis
2019-01-27 3:52 ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-17 19:43 ` [U-Boot] [PATCH v3 4/7] ARM: mach-omap2: Kconfig: Allow OMAP5 devices to set entry point Andrew F. Davis
2019-01-27 3:52 ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-17 19:43 ` [U-Boot] [PATCH v3 5/7] defconfigs: Add config for DRA7xx High Security EVM with USB Boot support Andrew F. Davis
2019-01-27 3:51 ` [U-Boot] [U-Boot, v3, " Tom Rini
2019-01-28 17:43 ` Andrew F. Davis
2019-01-17 19:43 ` [U-Boot] [PATCH v3 6/7] defconfigs: Add config for AM57xx High Security EVM with USB/UART " Andrew F. Davis
2019-01-17 19:43 ` [U-Boot] [PATCH v3 7/7] doc: ti-secure: Add ULO info for AM57xx/DRA7xx secure devices from TI Andrew F. Davis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190117194308.29644-3-afd@ti.com \
--to=afd@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox