summaryrefslogtreecommitdiff
path: root/board/ti
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-03-26 15:53:12 -0400
committerTom Rini <trini@ti.com>2014-03-28 15:15:10 -0400
commit68996b84b6060e186c617dadefd3037f5f8b7420 (patch)
tree2fe59e4c78e45be15ff40d65092b93de7affe0dc /board/ti
parent6bd04bb48715dc8e8f6d1a3389f886698bba0dc0 (diff)
downloadu-boot-imx-68996b84b6060e186c617dadefd3037f5f8b7420.zip
u-boot-imx-68996b84b6060e186c617dadefd3037f5f8b7420.tar.gz
u-boot-imx-68996b84b6060e186c617dadefd3037f5f8b7420.tar.bz2
am335x_evm: Clarify when we build board_eth_init
If we build this function in cases where we would be discarding it anyhow we still end up with maybe unused warnings. Rather than litter the function with __maybe_unused, just spell out when to build it. Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'board/ti')
-rw-r--r--board/ti/am335x/board.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 7609a18..554398f 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -573,8 +573,22 @@ static struct cpsw_platform_data cpsw_data = {
};
#endif
-#if defined(CONFIG_DRIVER_TI_CPSW) || \
- (defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET))
+/*
+ * This function will:
+ * Read the eFuse for MAC addresses, and set ethaddr/eth1addr/usbnet_devaddr
+ * in the environment
+ * Perform fixups to the PHY present on certain boards. We only need this
+ * function in:
+ * - SPL with either CPSW or USB ethernet support
+ * - Full U-Boot, with either CPSW or USB ethernet
+ * Build in only these cases to avoid warnings about unused variables
+ * when we build an SPL that has neither option but full U-Boot will.
+ */
+#if ((defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USBETH_SUPPORT)) \
+ && defined(CONFIG_SPL_BUILD)) || \
+ ((defined(CONFIG_DRIVER_TI_CPSW) || \
+ defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET)) && \
+ !defined(CONFIG_SPL_BUILD))
int board_eth_init(bd_t *bis)
{
int rv, n = 0;