diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-04-08 07:25:08 (GMT) |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-04-08 07:25:08 (GMT) |
commit | 519fdde9e6a6ebce7dc743b4f5621503d25b7a45 (patch) | |
tree | 29649f48b92b92342183f71565c34afeca0b1735 /include | |
parent | c71645ad2bd5179ad21e2501c26f574e9688f02a (diff) | |
parent | 04d2f0a9f33112bd70ce4d9c451fdca1682e3a59 (diff) | |
download | u-boot-fsl-qoriq-519fdde9e6a6ebce7dc743b4f5621503d25b7a45.tar.xz |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts:
arch/arm/cpu/arm926ejs/mxs/Makefile
include/configs/trats.h
include/configs/trats2.h
include/mmc.h
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 7 | ||||
-rw-r--r-- | include/config_fallbacks.h | 16 | ||||
-rw-r--r-- | include/configs/MERGERBOX.h | 1 | ||||
-rw-r--r-- | include/configs/MVBC_P.h | 1 | ||||
-rw-r--r-- | include/configs/MVBLM7.h | 1 | ||||
-rw-r--r-- | include/configs/MVSMR.h | 1 | ||||
-rw-r--r-- | include/configs/a3m071.h | 1 | ||||
-rw-r--r-- | include/configs/am335x_evm.h | 3 | ||||
-rw-r--r-- | include/configs/bfin_adi_common.h | 1 | ||||
-rw-r--r-- | include/configs/lsxl.h | 1 | ||||
-rw-r--r-- | include/configs/sacsng.h | 1 | ||||
-rw-r--r-- | include/configs/sandbox.h | 2 | ||||
-rw-r--r-- | include/configs/siemens-am33x-common.h | 1 | ||||
-rw-r--r-- | include/configs/trats.h | 7 | ||||
-rw-r--r-- | include/configs/trats2.h | 7 | ||||
-rw-r--r-- | include/dfu.h | 4 | ||||
-rw-r--r-- | include/dwmmc.h | 2 | ||||
-rw-r--r-- | include/fsl_esdhc.h | 4 | ||||
-rw-r--r-- | include/mmc.h | 51 | ||||
-rw-r--r-- | include/sdhci.h | 2 | ||||
-rw-r--r-- | include/uuid.h | 41 |
21 files changed, 133 insertions, 22 deletions
diff --git a/include/common.h b/include/common.h index 5c9bd08..cbd3c9e 100644 --- a/include/common.h +++ b/include/common.h @@ -822,8 +822,7 @@ void udelay (unsigned long); void mdelay(unsigned long); /* lib/uuid.c */ -void uuid_str_to_bin(const char *uuid, unsigned char *out); -int uuid_str_valid(const char *uuid); +#include <uuid.h> /* lib/vsprintf.c */ #include <vsprintf.h> @@ -835,9 +834,7 @@ char * strmhz(char *buf, unsigned long hz); #include <u-boot/crc.h> /* lib/rand.c */ -#if defined(CONFIG_RANDOM_MACADDR) || \ - defined(CONFIG_BOOTP_RANDOM_DELAY) || \ - defined(CONFIG_CMD_LINK_LOCAL) +#if defined(CONFIG_LIB_RAND) || defined(CONFIG_LIB_HW_RAND) #define RAND_MAX -1U void srand(unsigned int seed); unsigned int rand(void); diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h index d8339b2..e6fb47b 100644 --- a/include/config_fallbacks.h +++ b/include/config_fallbacks.h @@ -55,6 +55,22 @@ #define HAVE_BLOCK_DEVICE #endif +#if (defined(CONFIG_PARTITION_UUIDS) || \ + defined(CONFIG_EFI_PARTITION) || \ + defined(CONFIG_RANDOM_UUID) || \ + defined(CONFIG_CMD_UUID) || \ + defined(CONFIG_BOOTP_PXE)) && \ + !defined(CONFIG_LIB_UUID) +#define CONFIG_LIB_UUID +#endif + +#if (defined(CONFIG_RANDOM_UUID) || \ + defined(CONFIG_CMD_UUID)) && \ + (!defined(CONFIG_LIB_RAND) && \ + !defined(CONFIG_LIB_HW_RAND)) +#define CONFIG_LIB_RAND +#endif + #ifndef CONFIG_SYS_PROMPT #define CONFIG_SYS_PROMPT "=> " #endif diff --git a/include/configs/MERGERBOX.h b/include/configs/MERGERBOX.h index 930699b..19ea316 100644 --- a/include/configs/MERGERBOX.h +++ b/include/configs/MERGERBOX.h @@ -312,6 +312,7 @@ #define CONFIG_BOOTP_NTPSERVER #define CONFIG_BOOTP_RANDOM_DELAY #define CONFIG_BOOTP_SEND_HOSTNAME +#define CONFIG_LIB_RAND /* * Command line configuration. diff --git a/include/configs/MVBC_P.h b/include/configs/MVBC_P.h index 99e4e90..036396c 100644 --- a/include/configs/MVBC_P.h +++ b/include/configs/MVBC_P.h @@ -104,6 +104,7 @@ #define CONFIG_BOOTP_NTPSERVER #define CONFIG_BOOTP_RANDOM_DELAY #define CONFIG_BOOTP_SEND_HOSTNAME +#define CONFIG_LIB_RAND /* * Autoboot diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h index 30af691..27c2fa0 100644 --- a/include/configs/MVBLM7.h +++ b/include/configs/MVBLM7.h @@ -227,6 +227,7 @@ #define CONFIG_BOOTP_NTPSERVER #define CONFIG_BOOTP_RANDOM_DELAY #define CONFIG_BOOTP_SEND_HOSTNAME +#define CONFIG_LIB_RAND /* USB */ #define CONFIG_SYS_USB_HOST diff --git a/include/configs/MVSMR.h b/include/configs/MVSMR.h index bb565b6..ad15506 100644 --- a/include/configs/MVSMR.h +++ b/include/configs/MVSMR.h @@ -92,6 +92,7 @@ #define CONFIG_BOOTP_SEND_HOSTNAME #define CONFIG_BOOTP_SUBNETMASK #define CONFIG_BOOTP_VENDOREX +#define CONFIG_LIB_RAND /* * Autoboot diff --git a/include/configs/a3m071.h b/include/configs/a3m071.h index 1e65cd1..205adfd 100644 --- a/include/configs/a3m071.h +++ b/include/configs/a3m071.h @@ -58,6 +58,7 @@ #define CONFIG_BOOTP_SERVERIP #define CONFIG_NET_RETRY_COUNT 3 #define CONFIG_CMD_LINK_LOCAL +#define CONFIG_LIB_RAND #define CONFIG_NETCONSOLE #define CONFIG_SYS_CONSOLE_IS_IN_ENV #define CONFIG_CMD_PING diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index fd6f52c..ea9e758 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -208,9 +208,6 @@ #define CONFIG_BOOTCOUNT_LIMIT #define CONFIG_BOOTCOUNT_AM33XX -/* CPSW support */ -#define CONFIG_SPL_ETH_SUPPORT - /* USB gadget RNDIS */ #define CONFIG_SPL_MUSB_NEW_SUPPORT diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index 08ccce0..ea9acf6 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -17,6 +17,7 @@ # define CONFIG_BOOTP_DNS # define CONFIG_BOOTP_NTPSERVER # define CONFIG_BOOTP_RANDOM_DELAY +# define CONFIG_LIB_RAND # define CONFIG_KEEP_SERVERADDR # define CONFIG_CMD_DNS # define CONFIG_CMD_PING diff --git a/include/configs/lsxl.h b/include/configs/lsxl.h index 2ae8a27..96a889f 100644 --- a/include/configs/lsxl.h +++ b/include/configs/lsxl.h @@ -37,6 +37,7 @@ #define CONFIG_SHOW_BOOT_PROGRESS #define CONFIG_RANDOM_MACADDR +#define CONFIG_LIB_RAND #define CONFIG_KIRKWOOD_GPIO #define CONFIG_OF_LIBFDT diff --git a/include/configs/sacsng.h b/include/configs/sacsng.h index 0a694fb..b5064ab 100644 --- a/include/configs/sacsng.h +++ b/include/configs/sacsng.h @@ -457,6 +457,7 @@ #endif /* CONFIG_BOOT_ROOT_NFS */ #define CONFIG_BOOTP_RANDOM_DELAY /* Randomize the BOOTP retry delay */ +#define CONFIG_LIB_RAND /* * BOOTP options diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 04171bd..fa62cb6 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -169,4 +169,6 @@ #define CONFIG_TPM_TIS_SANDBOX +#define CONFIG_CMD_LZMADEC + #endif diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h index 98b6e72..721c4e6 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h @@ -265,6 +265,7 @@ #define CONFIG_DFU_NAND #define CONFIG_CMD_DFU #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 << 20) +#define DFU_MANIFEST_POLL_TIMEOUT 25000 #endif /* CONFIG_SPL_BUILD */ diff --git a/include/configs/trats.h b/include/configs/trats.h index 84c71ce..5d8bd60 100644 --- a/include/configs/trats.h +++ b/include/configs/trats.h @@ -187,6 +187,9 @@ #define CONFIG_CMD_SPL #define CONFIG_SYS_SPL_ARGS_ADDR CONFIG_SYS_SDRAM_BASE + 0x100 +/* GPT */ +#define CONFIG_RANDOM_UUID + /* I2C */ #include <asm/arch/gpio.h> @@ -219,6 +222,10 @@ #define CONFIG_POWER_BATTERY #define CONFIG_POWER_BATTERY_TRATS +/* Security subsystem - enable hw_rand() */ +#define CONFIG_EXYNOS_ACE_SHA +#define CONFIG_LIB_HW_RAND + /* Common misc for Samsung */ #define CONFIG_MISC_COMMON diff --git a/include/configs/trats2.h b/include/configs/trats2.h index 85cf4aa..53d449c 100644 --- a/include/configs/trats2.h +++ b/include/configs/trats2.h @@ -166,6 +166,9 @@ "setenv spl_addr_tmp;\0" \ "fdtaddr=40800000\0" \ +/* GPT */ +#define CONFIG_RANDOM_UUID + /* I2C */ #include <asm/arch/gpio.h> @@ -201,6 +204,10 @@ int get_soft_i2c_sda_pin(void); #define CONFIG_POWER_FG_MAX77693 #define CONFIG_POWER_BATTERY_TRATS2 +/* Security subsystem - enable hw_rand() */ +#define CONFIG_EXYNOS_ACE_SHA +#define CONFIG_LIB_HW_RAND + /* Common misc for Samsung */ #define CONFIG_MISC_COMMON diff --git a/include/dfu.h b/include/dfu.h index f973426..6c71ecb 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -80,6 +80,9 @@ static inline unsigned int get_mmc_blk_size(int dev) #ifndef DFU_DEFAULT_POLL_TIMEOUT #define DFU_DEFAULT_POLL_TIMEOUT 0 #endif +#ifndef DFU_MANIFEST_POLL_TIMEOUT +#define DFU_MANIFEST_POLL_TIMEOUT DFU_DEFAULT_POLL_TIMEOUT +#endif struct dfu_entity { char name[DFU_NAME_SIZE]; @@ -138,6 +141,7 @@ unsigned long dfu_get_buf_size(void); int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num); int dfu_write(struct dfu_entity *de, void *buf, int size, int blk_seq_num); +int dfu_flush(struct dfu_entity *de, void *buf, int size, int blk_seq_num); /* Device specific */ #ifdef CONFIG_DFU_MMC extern int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s); diff --git a/include/dwmmc.h b/include/dwmmc.h index b641558..c9bdf51 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -143,6 +143,8 @@ struct dwmci_host { void (*clksel)(struct dwmci_host *host); void (*board_init)(struct dwmci_host *host); unsigned int (*get_mmc_clk)(struct dwmci_host *host); + + struct mmc_config cfg; }; struct dwmci_idmac { diff --git a/include/fsl_esdhc.h b/include/fsl_esdhc.h index 89bcbd1..a6e3a5d 100644 --- a/include/fsl_esdhc.h +++ b/include/fsl_esdhc.h @@ -13,6 +13,9 @@ #include <asm/errno.h> #include <asm/byteorder.h> +/* needed for the mmc_cfg definition */ +#include <mmc.h> + /* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c #define SYSCTL_INITA 0x08000000 @@ -155,6 +158,7 @@ struct fsl_esdhc_cfg { u32 esdhc_base; u32 sdhc_clk; u8 max_bus_width; + struct mmc_config cfg; }; /* Select the correct accessors depending on endianess */ diff --git a/include/mmc.h b/include/mmc.h index b65ad9e..42d0125 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -150,6 +150,7 @@ #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ #define EXT_CSD_PARTITIONS_ATTRIBUTE 156 /* R/W */ #define EXT_CSD_PARTITIONING_SUPPORT 160 /* RO */ +#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ #define EXT_CSD_RPMB_MULT 168 /* RO */ #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ #define EXT_CSD_BOOT_BUS_WIDTH 177 @@ -250,20 +251,40 @@ struct mmc_data { uint blocksize; }; +/* forward decl. */ +struct mmc; + +struct mmc_ops { + int (*send_cmd)(struct mmc *mmc, + struct mmc_cmd *cmd, struct mmc_data *data); + void (*set_ios)(struct mmc *mmc); + int (*init)(struct mmc *mmc); + int (*getcd)(struct mmc *mmc); + int (*getwp)(struct mmc *mmc); +}; + +struct mmc_config { + const char *name; + const struct mmc_ops *ops; + uint host_caps; + uint voltages; + uint f_min; + uint f_max; + uint b_max; + unsigned char part_type; +}; + +/* TODO struct mmc should be in mmc_private but it's hard to fix right now */ struct mmc { struct list_head link; - char name[32]; - void *priv; - uint voltages; + const struct mmc_config *cfg; /* provided configuration */ uint version; + void *priv; uint has_init; - uint f_min; - uint f_max; int high_capacity; uint bus_width; uint clock; uint card_caps; - uint host_caps; uint ocr; uint dsr; uint dsr_imp; @@ -283,13 +304,6 @@ struct mmc { u64 capacity_rpmb; u64 capacity_gp[4]; block_dev_desc_t block_dev; - int (*send_cmd)(struct mmc *mmc, - struct mmc_cmd *cmd, struct mmc_data *data); - void (*set_ios)(struct mmc *mmc); - int (*init)(struct mmc *mmc); - int (*getcd)(struct mmc *mmc); - int (*getwp)(struct mmc *mmc); - uint b_max; char op_cond_pending; /* 1 if we are waiting on an op_cond command */ char init_in_progress; /* 1 if we have done mmc_start_init() */ char preinit; /* start init as early as possible */ @@ -297,6 +311,8 @@ struct mmc { }; int mmc_register(struct mmc *mmc); +struct mmc *mmc_create(const struct mmc_config *cfg, void *priv); +void mmc_destroy(struct mmc *mmc); int mmc_initialize(bd_t *bis); int mmc_init(struct mmc *mmc); int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size); @@ -317,6 +333,8 @@ int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize, int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access); /* Function to modify the BOOT_BUS_WIDTH field of EXT_CSD */ int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode); +/* Function to modify the RST_n_FUNCTION field of EXT_CSD */ +int mmc_set_rst_n_function(struct mmc *mmc, u8 enable); /** * Start device initialization and return immediately; it does not block on @@ -345,7 +363,7 @@ void mmc_set_preinit(struct mmc *mmc, int preinit); #ifdef CONFIG_GENERIC_MMC #ifdef CONFIG_MMC_SPI -#define mmc_host_is_spi(mmc) ((mmc)->host_caps & MMC_MODE_SPI) +#define mmc_host_is_spi(mmc) ((mmc)->cfg->host_caps & MMC_MODE_SPI) #else #define mmc_host_is_spi(mmc) 0 #endif @@ -356,4 +374,9 @@ int mmc_legacy_init(int verbose); int board_mmc_init(bd_t *bis); +/* Set block count limit because of 16 bit register limit on some hardware*/ +#ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT +#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535 +#endif + #endif /* _MMC_H_ */ diff --git a/include/sdhci.h b/include/sdhci.h index 32e04f5..aa4a0e9 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -252,6 +252,8 @@ struct sdhci_host { void (*set_control_reg)(struct sdhci_host *host); void (*set_clock)(int dev_index, unsigned int div); uint voltages; + + struct mmc_config cfg; }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS diff --git a/include/uuid.h b/include/uuid.h new file mode 100644 index 0000000..93027c1 --- /dev/null +++ b/include/uuid.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2014 Samsung Electronics + * Przemyslaw Marczak <p.marczak@samsung.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#ifndef __UUID_H__ +#define __UUID_H__ + +/* This is structure is in big-endian */ +struct uuid { + unsigned int time_low; + unsigned short time_mid; + unsigned short time_hi_and_version; + unsigned char clock_seq_hi_and_reserved; + unsigned char clock_seq_low; + unsigned char node[6]; +} __packed; + +enum { + UUID_STR_FORMAT_STD, + UUID_STR_FORMAT_GUID +}; + +#define UUID_STR_LEN 36 +#define UUID_BIN_LEN sizeof(struct uuid) + +#define UUID_VERSION_MASK 0xf000 +#define UUID_VERSION_SHIFT 12 +#define UUID_VERSION 0x4 + +#define UUID_VARIANT_MASK 0xc0 +#define UUID_VARIANT_SHIFT 7 +#define UUID_VARIANT 0x1 + +int uuid_str_valid(const char *uuid); +int uuid_str_to_bin(char *uuid_str, unsigned char *uuid_bin, int str_format); +void uuid_bin_to_str(unsigned char *uuid_bin, char *uuid_str, int str_format); +void gen_rand_uuid(unsigned char *uuid_bin); +void gen_rand_uuid_str(char *uuid_str, int str_format); +#endif |