diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/configs/legoev3.h | 1 | ||||
-rw-r--r-- | include/configs/microchip_mpfs_icicle.h | 63 | ||||
-rw-r--r-- | include/configs/qemu-riscv.h | 2 | ||||
-rw-r--r-- | include/configs/tegra-common-post.h | 2 | ||||
-rw-r--r-- | include/fdtdec.h | 24 | ||||
-rw-r--r-- | include/linux/string.h | 1 | ||||
-rw-r--r-- | include/time.h | 9 | ||||
-rw-r--r-- | include/uuid.h | 10 |
8 files changed, 107 insertions, 5 deletions
diff --git a/include/configs/legoev3.h b/include/configs/legoev3.h index 1e239ecadd0..36ca3b201ed 100644 --- a/include/configs/legoev3.h +++ b/include/configs/legoev3.h @@ -22,6 +22,7 @@ #define CONFIG_SYS_OSCIN_FREQ 24000000 #define CONFIG_SYS_TIMERBASE DAVINCI_TIMER0_BASE #define CONFIG_SYS_HZ_CLOCK clk_get(DAVINCI_AUXCLK_CLKID) +#define CONFIG_SKIP_LOWLEVEL_INIT /* * Memory Info diff --git a/include/configs/microchip_mpfs_icicle.h b/include/configs/microchip_mpfs_icicle.h new file mode 100644 index 00000000000..82c7fbbdf22 --- /dev/null +++ b/include/configs/microchip_mpfs_icicle.h @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2019 Microchip Technology Inc. + * Padmarao Begari <padmarao.begari@microchip.com> + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +/* + * CPU and Board Configuration Options + */ +#define CONFIG_BOOTP_SEND_HOSTNAME + +/* + * Miscellaneous configurable options + */ +#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ + +/* + * Print Buffer Size + */ +#define CONFIG_SYS_PBSIZE \ + (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) + +/* + * max number of command args + */ +#define CONFIG_SYS_MAXARGS 16 + +/* + * Boot Argument Buffer Size + */ +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE + +/* + * Size of malloc() pool + * 512kB is suggested, (CONFIG_ENV_SIZE + 128 * 1024) was not enough + */ +#define CONFIG_SYS_MALLOC_LEN (512 << 10) + +/* + * Physical Memory Map + */ +#define PHYS_SDRAM_0 0x80000000 /* SDRAM Bank #1 */ +#define PHYS_SDRAM_0_SIZE 0x40000000 /* 1 GB */ +#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_0 + +/* Init Stack Pointer */ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x200000) + +#define CONFIG_SYS_LOAD_ADDR 0x80000000 /* SDRAM */ + +/* + * memtest works on DRAM + */ +#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_0 +#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE) + +/* When we use RAM as ENV */ +#define CONFIG_ENV_SIZE 0x2000 + +#endif /* __CONFIG_H */ diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h index b7110edebcb..df22f780b09 100644 --- a/include/configs/qemu-riscv.h +++ b/include/configs/qemu-riscv.h @@ -20,7 +20,7 @@ #define CONFIG_STANDALONE_LOAD_ADDR 0x80200000 /* Environment options */ -#define CONFIG_ENV_SIZE SZ_4K +#define CONFIG_ENV_SIZE SZ_128K #define BOOT_TARGET_DEVICES(func) \ func(QEMU, qemu, na) \ diff --git a/include/configs/tegra-common-post.h b/include/configs/tegra-common-post.h index e54428ba43e..9685ee5059a 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 fa8e34f6f96..e6c22dd5cd5 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 36066207392..5d63be4ce5b 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 diff --git a/include/time.h b/include/time.h index 9fd0d73fb4e..1e9b369be7c 100644 --- a/include/time.h +++ b/include/time.h @@ -4,6 +4,7 @@ #define _TIME_H #include <linux/typecheck.h> +#include <linux/types.h> unsigned long get_timer(unsigned long base); @@ -21,6 +22,14 @@ unsigned long timer_get_us(void); */ void timer_test_add_offset(unsigned long offset); +/** + * usec_to_tick() - convert microseconds to clock ticks + * + * @usec: duration in microseconds + * Return: duration in clock ticks + */ +uint64_t usec_to_tick(unsigned long usec); + /* * These inlines deal with timer wrapping correctly. You are * strongly encouraged to use them diff --git a/include/uuid.h b/include/uuid.h index 124bbce8a2c..abcc325eae9 100644 --- a/include/uuid.h +++ b/include/uuid.h @@ -6,6 +6,8 @@ #ifndef __UUID_H__ #define __UUID_H__ +#include <linux/bitops.h> + /* This is structure is in big-endian */ struct uuid { unsigned int time_low; @@ -16,10 +18,10 @@ struct uuid { unsigned char node[6]; } __packed; -enum { - UUID_STR_FORMAT_STD, - UUID_STR_FORMAT_GUID -}; +/* Bits of a bitmask specifying the output format for GUIDs */ +#define UUID_STR_FORMAT_STD 0 +#define UUID_STR_FORMAT_GUID BIT(0) +#define UUID_STR_UPPER_CASE BIT(1) #define UUID_STR_LEN 36 #define UUID_BIN_LEN sizeof(struct uuid) |