aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-06-08 09:10:31 -0400
committerTom Rini <trini@konsulko.com>2019-06-08 09:10:31 -0400
commit5973901826c73462306fbe4051bc3643dca6b88f (patch)
tree0135545945d4eabd2e2ba873a79f1f57a8e13c33 /include
parent6d277fb0ed145f82dd50cc6e99d2fa553a588c3b (diff)
parent879a3bc1c2f3e2aadd6f05e6427cf4d97a272f9a (diff)
downloadu-boot-5973901826c73462306fbe4051bc3643dca6b88f.zip
u-boot-5973901826c73462306fbe4051bc3643dca6b88f.tar.gz
u-boot-5973901826c73462306fbe4051bc3643dca6b88f.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-tegra
The bulk of these changes are an effort to unify Tegra186 builds with builds of prior 64-bit Tegra generations. On top of that there are various improvements that allow data (such as the MAC address and boot arguments) to be passed through from early firmware to the kernel on boot.
Diffstat (limited to 'include')
-rw-r--r--include/configs/tegra-common-post.h2
-rw-r--r--include/fdtdec.h24
-rw-r--r--include/linux/string.h1
3 files changed, 27 insertions, 0 deletions
diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h
index e54428b..9685ee5 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -21,12 +21,14 @@
#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
#ifndef CONFIG_SPL_BUILD
+#ifndef BOOT_TARGET_DEVICES
#define BOOT_TARGET_DEVICES(func) \
func(MMC, mmc, 1) \
func(MMC, mmc, 0) \
func(USB, usb, 0) \
func(PXE, pxe, na) \
func(DHCP, dhcp, na)
+#endif
#include <config_distro_bootcmd.h>
#else
#define BOOTENV
diff --git a/include/fdtdec.h b/include/fdtdec.h
index fa8e34f..e6c22dd 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -997,6 +997,30 @@ int fdtdec_setup_memory_banksize_fdt(const void *blob);
int fdtdec_setup_memory_banksize(void);
/**
+ * fdtdec_set_ethernet_mac_address() - set MAC address for default interface
+ *
+ * Looks up the default interface via the "ethernet" alias (in the /aliases
+ * node) and stores the given MAC in its "local-mac-address" property. This
+ * is useful on platforms that store the MAC address in a custom location.
+ * Board code can call this in the late init stage to make sure that the
+ * interface device tree node has the right MAC address configured for the
+ * Ethernet uclass to pick it up.
+ *
+ * Typically the FDT passed into this function will be U-Boot's control DTB.
+ * Given that a lot of code may be holding offsets to various nodes in that
+ * tree, this code will only set the "local-mac-address" property in-place,
+ * which means that it needs to exist and have space for the 6-byte address.
+ * This ensures that the operation is non-destructive and does not invalidate
+ * offsets that other drivers may be using.
+ *
+ * @param fdt FDT blob
+ * @param mac buffer containing the MAC address to set
+ * @param size size of MAC address
+ * @return 0 on success or a negative error code on failure
+ */
+int fdtdec_set_ethernet_mac_address(void *fdt, const u8 *mac, size_t size);
+
+/**
* fdtdec_set_phandle() - sets the phandle of a given node
*
* @param blob FDT blob
diff --git a/include/linux/string.h b/include/linux/string.h
index 3606620..5d63be4 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -94,6 +94,7 @@ size_t strcspn(const char *s, const char *reject);
#ifndef __HAVE_ARCH_STRDUP
extern char * strdup(const char *);
#endif
+extern char * strndup(const char *, size_t);
#ifndef __HAVE_ARCH_STRSWAB
extern char * strswab(const char *);
#endif