1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 01:02:19 +02:00

Merge branch '2020-05-25-misc-fixes'

- A few minor Kconfig migrations / corrections
- DFU doc fixes/improvements
- Bugfix for ARMv8, env userspace building, more NULL checks in generic
  PHY code
This commit is contained in:
Tom Rini
2020-05-25 11:56:57 -04:00
32 changed files with 254 additions and 60 deletions

View File

@@ -600,13 +600,16 @@ F: cmd/usb_*.c
F: common/dfu.c F: common/dfu.c
F: common/update.c F: common/update.c
F: common/usb_storage.c F: common/usb_storage.c
F: doc/api/dfu.rst
F: drivers/dfu/ F: drivers/dfu/
F: drivers/usb/gadget/ F: drivers/usb/gadget/
F: include/dfu.h
DRIVER MODEL DRIVER MODEL
M: Simon Glass <sjg@chromium.org> M: Simon Glass <sjg@chromium.org>
S: Maintained S: Maintained
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git T: git https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git
F: doc/driver-model/
F: drivers/core/ F: drivers/core/
F: include/dm/ F: include/dm/
F: test/dm/ F: test/dm/

4
README
View File

@@ -2729,10 +2729,6 @@ Configuration Settings:
regular expression. This allows multiple variables to define the same regular expression. This allows multiple variables to define the same
flags without explicitly listing them for each variable. flags without explicitly listing them for each variable.
- CONFIG_ENV_ACCESS_IGNORE_FORCE
If defined, don't allow the -f switch to env set override variable
access flags.
The following definitions that deal with the placement and management The following definitions that deal with the placement and management
of environment data (variable area); in general, we support the of environment data (variable area); in general, we support the
following configurations: following configurations:

View File

@@ -86,6 +86,7 @@ config RISCV
config SANDBOX config SANDBOX
bool "Sandbox" bool "Sandbox"
select BOARD_LATE_INIT select BOARD_LATE_INIT
select BZIP2
select DM select DM
select DM_GPIO select DM_GPIO
select DM_I2C select DM_I2C
@@ -94,6 +95,7 @@ config SANDBOX
select DM_SERIAL select DM_SERIAL
select DM_SPI select DM_SPI
select DM_SPI_FLASH select DM_SPI_FLASH
select GZIP_COMPRESSED
select HAVE_BLOCK_DEVICE select HAVE_BLOCK_DEVICE
select LZO select LZO
select OF_BOARD_SETUP select OF_BOARD_SETUP

View File

@@ -557,7 +557,7 @@ static u64 set_one_region(u64 start, u64 size, u64 attrs, bool flag, int level)
void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size, void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
enum dcache_option option) enum dcache_option option)
{ {
u64 attrs = PMD_ATTRINDX(option); u64 attrs = PMD_ATTRINDX(option >> 2);
u64 real_start = start; u64 real_start = start;
u64 real_size = size; u64 real_size = size;

View File

@@ -810,11 +810,13 @@ config CMD_UNLZ4
config CMD_UNZIP config CMD_UNZIP
bool "unzip" bool "unzip"
default y if CMD_BOOTI default y if CMD_BOOTI
select GZIP
help help
Uncompress a zip-compressed memory region. Uncompress a zip-compressed memory region.
config CMD_ZIP config CMD_ZIP
bool "zip" bool "zip"
select GZIP_COMPRESSED
help help
Compress a memory region with zlib deflate method. Compress a memory region with zlib deflate method.

View File

@@ -7,6 +7,7 @@
#include <common.h> #include <common.h>
#include <command.h> #include <command.h>
#include <env.h> #include <env.h>
#include <gzip.h>
static int do_zip(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) static int do_zip(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{ {

View File

@@ -13,6 +13,7 @@ CONFIG_USE_PREBOOT=y
CONFIG_PREBOOT="fdt addr ${fdtcontroladdr};fdt move ${fdtcontroladdr} ${fdtsaveaddr};fdt addr ${fdtsaveaddr};" CONFIG_PREBOOT="fdt addr ${fdtcontroladdr};fdt move ${fdtcontroladdr} ${fdtsaveaddr};fdt addr ${fdtsaveaddr};"
CONFIG_HUSH_PARSER=y CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="U-Boot>" CONFIG_SYS_PROMPT="U-Boot>"
CONFIG_CMD_MMC=y
CONFIG_EFI_PARTITION=y CONFIG_EFI_PARTITION=y
CONFIG_OF_PRIOR_STAGE=y CONFIG_OF_PRIOR_STAGE=y
CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_IS_IN_MMC=y

View File

@@ -14,6 +14,7 @@ CONFIG_USE_PREBOOT=y
CONFIG_PREBOOT="fdt addr ${fdtcontroladdr};fdt move ${fdtcontroladdr} ${fdtsaveaddr};fdt addr ${fdtsaveaddr};" CONFIG_PREBOOT="fdt addr ${fdtcontroladdr};fdt move ${fdtcontroladdr} ${fdtsaveaddr};fdt addr ${fdtsaveaddr};"
CONFIG_HUSH_PARSER=y CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="U-Boot>" CONFIG_SYS_PROMPT="U-Boot>"
CONFIG_CMD_MMC=y
CONFIG_CMD_SF_TEST=y CONFIG_CMD_SF_TEST=y
CONFIG_CMD_SPI=y CONFIG_CMD_SPI=y
CONFIG_OF_PRIOR_STAGE=y CONFIG_OF_PRIOR_STAGE=y

View File

@@ -16,6 +16,7 @@ CONFIG_HUSH_PARSER=y
# CONFIG_CMD_FLASH is not set # CONFIG_CMD_FLASH is not set
CONFIG_CMD_GPIO=y CONFIG_CMD_GPIO=y
# CONFIG_CMD_LOADS is not set # CONFIG_CMD_LOADS is not set
CONFIG_CMD_MMC=y
CONFIG_CMD_NAND=y CONFIG_CMD_NAND=y
CONFIG_CMD_PART=y CONFIG_CMD_PART=y
CONFIG_CMD_USB=y CONFIG_CMD_USB=y

View File

@@ -19,6 +19,7 @@ CONFIG_HUSH_PARSER=y
# CONFIG_BOOTM_NETBSD is not set # CONFIG_BOOTM_NETBSD is not set
CONFIG_CMD_GPIO=y CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_CACHE=y CONFIG_CMD_CACHE=y
CONFIG_CMD_REGULATOR=y CONFIG_CMD_REGULATOR=y
CONFIG_CMD_EXT2=y CONFIG_CMD_EXT2=y

View File

@@ -21,6 +21,7 @@ CONFIG_HUSH_PARSER=y
# CONFIG_BOOTM_NETBSD is not set # CONFIG_BOOTM_NETBSD is not set
CONFIG_CMD_GPIO=y CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_CACHE=y CONFIG_CMD_CACHE=y
CONFIG_CMD_REGULATOR=y CONFIG_CMD_REGULATOR=y
CONFIG_CMD_EXT2=y CONFIG_CMD_EXT2=y

View File

@@ -12,6 +12,7 @@ CONFIG_MISC_INIT_R=y
CONFIG_BOARD_EARLY_INIT_F=y CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_CMD_BOOTZ=y CONFIG_CMD_BOOTZ=y
CONFIG_CMD_GPT=y CONFIG_CMD_GPT=y
CONFIG_CMD_MMC=y
CONFIG_CMD_DHCP=y CONFIG_CMD_DHCP=y
CONFIG_CMD_PING=y CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y CONFIG_CMD_EXT2=y

View File

@@ -17,6 +17,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0xe8
CONFIG_CMD_BOOTZ=y CONFIG_CMD_BOOTZ=y
CONFIG_CMD_GPT=y CONFIG_CMD_GPT=y
CONFIG_CMD_MMC=y
CONFIG_CMD_DHCP=y CONFIG_CMD_DHCP=y
CONFIG_CMD_PING=y CONFIG_CMD_PING=y
CONFIG_CMD_EXT2=y CONFIG_CMD_EXT2=y

View File

@@ -19,6 +19,7 @@ CONFIG_HUSH_PARSER=y
# CONFIG_BOOTM_NETBSD is not set # CONFIG_BOOTM_NETBSD is not set
CONFIG_CMD_GPIO=y CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
CONFIG_CMD_CACHE=y CONFIG_CMD_CACHE=y
CONFIG_CMD_REGULATOR=y CONFIG_CMD_REGULATOR=y
CONFIG_CMD_EXT2=y CONFIG_CMD_EXT2=y

View File

@@ -13,6 +13,7 @@ CONFIG_CMD_BOOTZ=y
CONFIG_CMD_MEMTEST=y CONFIG_CMD_MEMTEST=y
CONFIG_SYS_MEMTEST_START=0xc0000000 CONFIG_SYS_MEMTEST_START=0xc0000000
CONFIG_SYS_MEMTEST_END=0xc7c00000 CONFIG_SYS_MEMTEST_END=0xc7c00000
CONFIG_CMD_MMC=y
CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_DM=y CONFIG_DM=y

View File

@@ -48,12 +48,12 @@ Configuration Options:
CONFIG_CMD_DFU CONFIG_CMD_DFU
Environment variables: Environment variables:
the dfu command use 3 environments variables: the dfu command uses 3 environments variables:
"dfu_alt_info" : the DFU setting for the USB download gadget with a comma "dfu_alt_info" : the DFU setting for the USB download gadget with a semicolon
separated string of information on each alternate: separated string of information on each alternate:
dfu_alt_info="<alt1>;<alt2>;....;<altN>" dfu_alt_info="<alt1>;<alt2>;....;<altN>"
when only several device are used, the format is: when several devices are used, the format is:
- <interface> <dev>'='alternate list (';' separated) - <interface> <dev>'='alternate list (';' separated)
- each interface is separated by '&' - each interface is separated by '&'
dfu_alt_info=\ dfu_alt_info=\
@@ -63,7 +63,7 @@ Environment variables:
"<interfaceI> <devI>=<altY+1>;....;<altZ>&" "<interfaceI> <devI>=<altY+1>;....;<altZ>&"
"dfu_bufsiz" : size of the DFU buffer, when absent, use "dfu_bufsiz" : size of the DFU buffer, when absent, use
CONFIG_SYS_DFU_DATA_BUF_SIZE (8MiB by default) CONFIG_SYS_DFU_DATA_BUF_SIZE (8 MiB by default)
"dfu_hash_algo" : name of the hash algorithm to use "dfu_hash_algo" : name of the hash algorithm to use
@@ -87,12 +87,21 @@ Commands:
"mmc" (for eMMC and SD card) "mmc" (for eMMC and SD card)
cmd: dfu 0 mmc <dev> cmd: dfu 0 mmc <dev>
each element in "dfu_alt_info" = each element in "dfu_alt_info" =
<name> raw <offset> <size> raw access to mmc device <name> raw <offset> <size> [mmcpart <num>] raw access to mmc device
<name> part <dev> <part_id> raw acces to partition <name> part <dev> <part_id> [mmcpart <num>] raw access to partition
<name> fat <dev> <part_id> file in FAT partition <name> fat <dev> <part_id> [mmcpart <num>] file in FAT partition
<name> ext4 <dev> <part_id> file in EXT4 partition <name> ext4 <dev> <part_id> [mmcpart <num>] file in EXT4 partition
with <partid> is the GPT or DOS partition index with <partid> being the GPT or DOS partition index,
with <num> being the eMMC hardware partition number.
A value of environment variable dfu_alt_info for eMMC could be:
"u-boot raw 0x3e 0x800 mmcpart 1;bl2 raw 0x1e 0x1d mmcpart 1"
A value of environment variable dfu_alt_info for SD card could be:
"u-boot raw 0x80 0x800;uImage ext4 0 2"
"nand" (raw slc nand device) "nand" (raw slc nand device)
cmd: dfu 0 nand <dev> cmd: dfu 0 nand <dev>

7
doc/api/dfu.rst Normal file
View File

@@ -0,0 +1,7 @@
.. SPDX-License-Identifier: GPL-2.0+
Device firmware update
======================
.. kernel-doc:: include/dfu.h
:internal:

View File

@@ -6,6 +6,7 @@ U-Boot API documentation
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
dfu
efi efi
linker_lists linker_lists
serial serial

View File

@@ -118,7 +118,7 @@ int generic_phy_init(struct phy *phy)
{ {
struct phy_ops const *ops; struct phy_ops const *ops;
if (!phy) if (!generic_phy_valid(phy))
return 0; return 0;
ops = phy_dev_ops(phy->dev); ops = phy_dev_ops(phy->dev);
@@ -129,7 +129,7 @@ int generic_phy_reset(struct phy *phy)
{ {
struct phy_ops const *ops; struct phy_ops const *ops;
if (!phy) if (!generic_phy_valid(phy))
return 0; return 0;
ops = phy_dev_ops(phy->dev); ops = phy_dev_ops(phy->dev);
@@ -140,7 +140,7 @@ int generic_phy_exit(struct phy *phy)
{ {
struct phy_ops const *ops; struct phy_ops const *ops;
if (!phy) if (!generic_phy_valid(phy))
return 0; return 0;
ops = phy_dev_ops(phy->dev); ops = phy_dev_ops(phy->dev);
@@ -151,7 +151,7 @@ int generic_phy_power_on(struct phy *phy)
{ {
struct phy_ops const *ops; struct phy_ops const *ops;
if (!phy) if (!generic_phy_valid(phy))
return 0; return 0;
ops = phy_dev_ops(phy->dev); ops = phy_dev_ops(phy->dev);
@@ -162,7 +162,7 @@ int generic_phy_power_off(struct phy *phy)
{ {
struct phy_ops const *ops; struct phy_ops const *ops;
if (!phy) if (!generic_phy_valid(phy))
return 0; return 0;
ops = phy_dev_ops(phy->dev); ops = phy_dev_ops(phy->dev);

7
env/Kconfig vendored
View File

@@ -604,6 +604,13 @@ config DELAY_ENVIRONMENT
later by U-Boot code. With CONFIG_OF_CONTROL this is instead later by U-Boot code. With CONFIG_OF_CONTROL this is instead
controlled by the value of /config/load-environment. controlled by the value of /config/load-environment.
config ENV_ACCESS_IGNORE_FORCE
bool "Block forced environment operations"
default n
help
If defined, don't allow the -f switch to env set override variable
access flags.
if SPL_ENV_SUPPORT if SPL_ENV_SUPPORT
config SPL_ENV_IS_NOWHERE config SPL_ENV_IS_NOWHERE
bool "SPL Environment is not stored" bool "SPL Environment is not stored"

View File

@@ -130,7 +130,6 @@ extern phys_addr_t prior_stage_fdt_address;
#define CONFIG_CMD_ASKENV #define CONFIG_CMD_ASKENV
#define CONFIG_CMD_CACHE #define CONFIG_CMD_CACHE
#define CONFIG_CMD_EXT2 #define CONFIG_CMD_EXT2
#define CONFIG_CMD_MMC
/* /*
* Flash configuration. * Flash configuration.

View File

@@ -202,8 +202,6 @@
#define CONFIG_IMX_BOOTAUX #define CONFIG_IMX_BOOTAUX
#define CONFIG_CMD_MMC
#define CONFIG_SYS_FSL_USDHC_NUM 2 #define CONFIG_SYS_FSL_USDHC_NUM 2
#define CONFIG_SYS_FSL_ESDHC_ADDR 0 #define CONFIG_SYS_FSL_ESDHC_ADDR 0

View File

@@ -193,8 +193,6 @@
#define CONFIG_IMX_BOOTAUX #define CONFIG_IMX_BOOTAUX
#define CONFIG_CMD_MMC
#define CONFIG_SYS_FSL_USDHC_NUM 2 #define CONFIG_SYS_FSL_USDHC_NUM 2
#define CONFIG_SYS_FSL_ESDHC_ADDR 0 #define CONFIG_SYS_FSL_ESDHC_ADDR 0

View File

@@ -120,7 +120,6 @@
/* /*
* MMC * MMC
*/ */
#define CONFIG_CMD_MMC
/* SATA */ /* SATA */
#define CONFIG_SCSI_AHCI_PLAT #define CONFIG_SCSI_AHCI_PLAT

View File

@@ -174,8 +174,6 @@
#define CONFIG_IMX_BOOTAUX #define CONFIG_IMX_BOOTAUX
#define CONFIG_CMD_MMC
#define CONFIG_SYS_FSL_USDHC_NUM 2 #define CONFIG_SYS_FSL_USDHC_NUM 2
#define CONFIG_SYS_FSL_ESDHC_ADDR 0 #define CONFIG_SYS_FSL_ESDHC_ADDR 0

View File

@@ -68,7 +68,6 @@
#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC_BASE_ADDR #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC_BASE_ADDR
#define CONFIG_SYS_FSL_ESDHC_NUM 1 #define CONFIG_SYS_FSL_ESDHC_NUM 1
#define CONFIG_CMD_MMC
/* #define CONFIG_CMD_EXT2 EXT2 Support */ /* #define CONFIG_CMD_EXT2 EXT2 Support */
#if 0 #if 0

View File

@@ -114,9 +114,6 @@
BOOTENV \ BOOTENV \
MEM_LAYOUT_ENV_SETTINGS MEM_LAYOUT_ENV_SETTINGS
#define CONFIG_GZIP_COMPRESSED
#define CONFIG_BZIP2
#ifndef CONFIG_SPL_BUILD #ifndef CONFIG_SPL_BUILD
#define CONFIG_SYS_IDE_MAXBUS 1 #define CONFIG_SYS_IDE_MAXBUS 1
#define CONFIG_SYS_ATA_IDE0_OFFSET 0 #define CONFIG_SYS_ATA_IDE0_OFFSET 0

View File

@@ -101,7 +101,6 @@
/* Command line configuration */ /* Command line configuration */
#define CONFIG_CMD_MII #define CONFIG_CMD_MII
#define CONFIG_CMD_MMC
#define CONFIG_CMD_CACHE #define CONFIG_CMD_CACHE
#endif /* __CONFIG_H */ #endif /* __CONFIG_H */

View File

@@ -159,20 +159,139 @@ struct dfu_entity {
}; };
#ifdef CONFIG_SET_DFU_ALT_INFO #ifdef CONFIG_SET_DFU_ALT_INFO
/**
* set_dfu_alt_info() - set dfu_alt_info environment variable
*
* If CONFIG_SET_DFU_ALT_INFO=y, this board specific function is called to set
* environment variable dfu_alt_info.
*
* @interface: dfu interface, e.g. "mmc" or "nand"
* @devstr: device number as string
*/
void set_dfu_alt_info(char *interface, char *devstr); void set_dfu_alt_info(char *interface, char *devstr);
#endif #endif
/**
* dfu_alt_init() - initialize buffer for dfu entities
*
* @num: number of entities
* @dfu: on return allocated buffer
* Return: 0 on success
*/
int dfu_alt_init(int num, struct dfu_entity **dfu); int dfu_alt_init(int num, struct dfu_entity **dfu);
/**
* dfu_alt_add() - add alternate to dfu entity buffer
*
* @dfu: dfu entity
* @interface: dfu interface, e.g. "mmc" or "nand"
* @devstr: device number as string
* @s: string description of alternate
* Return: 0 on success
*/
int dfu_alt_add(struct dfu_entity *dfu, char *interface, char *devstr, char *s); int dfu_alt_add(struct dfu_entity *dfu, char *interface, char *devstr, char *s);
/**
* dfu_config_entities() - initialize dfu entitities from envirionment
*
* Initialize the list of dfu entities from environment variable dfu_alt_info.
* The list must be freed by calling dfu_free_entities(). This function bypasses
* set_dfu_alt_info(). So typically you should use dfu_init_env_entities()
* instead.
*
* See function :c:func:`dfu_free_entities`
* See function :c:func:`dfu_init_env_entities`
*
* @s: string with alternates
* @interface: interface, e.g. "mmc" or "nand"
* @devstr: device number as string
* Return: 0 on success, a negative error code otherwise
*/
int dfu_config_entities(char *s, char *interface, char *devstr); int dfu_config_entities(char *s, char *interface, char *devstr);
/**
* dfu_free_entities() - free the list of dfu entities
*
* Free the internal list of dfu entities.
*
* See function :c:func:`dfu_init_env_entities`
*/
void dfu_free_entities(void); void dfu_free_entities(void);
/**
* dfu_show_entities() - print DFU alt settings list
*/
void dfu_show_entities(void); void dfu_show_entities(void);
/**
* dfu_get_alt_number() - get number of alternates
*
* Return: number of alternates in the dfu entities list
*/
int dfu_get_alt_number(void); int dfu_get_alt_number(void);
const char *dfu_get_dev_type(enum dfu_device_type t);
const char *dfu_get_layout(enum dfu_layout l); /**
* dfu_get_dev_type() - get string representation for dfu device type
*
* @type: device type
* Return: string representation for device type
*/
const char *dfu_get_dev_type(enum dfu_device_type type);
/**
* dfu_get_layout() - get string describing layout
*
* Internally layouts are represented by enum dfu_device_type values. This
* function translates an enum value to a human readable string, e.g. DFU_FS_FAT
* is translated to "FAT".
*
* @layout: layout
* Result: string representation for the layout
*/
const char *dfu_get_layout(enum dfu_layout layout);
/**
* dfu_get_entity() - get dfu entity for an alternate id
*
* @alt: alternate id
* Return: dfu entity
*/
struct dfu_entity *dfu_get_entity(int alt); struct dfu_entity *dfu_get_entity(int alt);
char *dfu_extract_token(char** e, int *n); char *dfu_extract_token(char** e, int *n);
/**
* dfu_get_alt() - get alternate id for filename
*
* Environment variable dfu_alt_info defines the write destinations (alternates)
* for different filenames. This function get the index of the alternate for
* a filename. If an absolute filename is provided (starting with '/'), the
* directory path is ignored.
*
* @name: filename
* Return: id of the alternate or negative error number (-ENODEV)
*/
int dfu_get_alt(char *name); int dfu_get_alt(char *name);
/**
* dfu_init_env_entities() - initialize dfu entitities from envirionment
*
* Initialize the list of dfu entities from environment variable dfu_alt_info.
* The list must be freed by calling dfu_free_entities().
* @interface and @devstr are used to select the relevant set of alternates
* from environment variable dfu_alt_info.
*
* If environment variable dfu_alt_info specifies the interface and the device,
* use NULL for @interface and @devstr.
*
* See function :c:func:`dfu_free_entities`
*
* @interface: interface, e.g. "mmc" or "nand"
* @devstr: device number as string
* Return: 0 on success, a negative error code otherwise
*/
int dfu_init_env_entities(char *interface, char *devstr); int dfu_init_env_entities(char *interface, char *devstr);
unsigned char *dfu_get_buf(struct dfu_entity *dfu); unsigned char *dfu_get_buf(struct dfu_entity *dfu);
unsigned char *dfu_free_buf(void); unsigned char *dfu_free_buf(void);
unsigned long dfu_get_buf_size(void); unsigned long dfu_get_buf_size(void);
@@ -183,29 +302,79 @@ unsigned long dfu_get_timeout(void);
void dfu_set_timeout(unsigned long); void dfu_set_timeout(unsigned long);
#endif #endif
/**
* dfu_read() - read from dfu entity
*
* The block sequence number @blk_seq_num is a 16 bit counter that must be
* incremented with each call for the same dfu entity @de.
*
* @de: dfu entity
* @buf: buffer
* @size: size of buffer
* @blk_seq_num: block sequence number
* Return: 0 for success, -1 for error
*/
int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num); int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
/**
* dfu_write() - write to dfu entity
*
* Write the contents of a buffer @buf to the dfu entity @de. After writing
* the last block call dfu_flush(). If a file is already loaded completely
* into memory it is preferable to use dfu_write_from_mem_addr() which takes
* care of blockwise transfer and flushing.
*
* The block sequence number @blk_seq_num is a 16 bit counter that must be
* incremented with each call for the same dfu entity @de.
*
* See function :c:func:`dfu_flush`
* See function :c:func:`dfu_write_from_mem_addr`
*
* @de: dfu entity
* @buf: buffer
* @size: size of buffer
* @blk_seq_num: block sequence number
* Return: 0 for success, -1 for error
*/
int dfu_write(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);
/**
* dfu_flush() - flush to dfu entity
*
* This function has to be called after writing the last block to the dfu
* entity @de.
*
* The block sequence number @blk_seq_num is a 16 bit counter that must be
* incremented with each call for the same dfu entity @de.
*
* See function :c:func:`dfu_write`
*
* @de: dfu entity
* @buf: ignored
* @size: ignored
* @blk_seq_num: block sequence number of last write - ignored
* Return: 0 for success, -1 for error
*/
int dfu_flush(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);
/** /**
* dfu_initiated_callback - weak callback called on DFU transaction start * dfu_initiated_callback() - weak callback called on DFU transaction start
* *
* It is a callback function called by DFU stack when a DFU transaction is * It is a callback function called by DFU stack when a DFU transaction is
* initiated. This function allows to manage some board specific behavior on * initiated. This function allows to manage some board specific behavior on
* DFU targets. * DFU targets.
* *
* @param dfu - pointer to the dfu_entity, which should be initialized * @dfu: pointer to the dfu_entity, which should be initialized
*
*/ */
void dfu_initiated_callback(struct dfu_entity *dfu); void dfu_initiated_callback(struct dfu_entity *dfu);
/** /**
* dfu_flush_callback - weak callback called at the end of the DFU write * dfu_flush_callback() - weak callback called at the end of the DFU write
* *
* It is a callback function called by DFU stack after DFU manifestation. * It is a callback function called by DFU stack after DFU manifestation.
* This function allows to manage some board specific behavior on DFU targets * This function allows to manage some board specific behavior on DFU targets
* *
* @param dfu - pointer to the dfu_entity, which should be flushed * @dfu: pointer to the dfu_entity, which should be flushed
*
*/ */
void dfu_flush_callback(struct dfu_entity *dfu); void dfu_flush_callback(struct dfu_entity *dfu);
@@ -217,10 +386,11 @@ void dfu_transaction_cleanup(struct dfu_entity *dfu);
* It should be NULL when not used. * It should be NULL when not used.
*/ */
extern struct dfu_entity *dfu_defer_flush; extern struct dfu_entity *dfu_defer_flush;
/** /**
* dfu_get_defer_flush - get current value of dfu_defer_flush pointer * dfu_get_defer_flush() - get current value of dfu_defer_flush pointer
* *
* @return - value of the dfu_defer_flush pointer * Return: value of the dfu_defer_flush pointer
*/ */
static inline struct dfu_entity *dfu_get_defer_flush(void) static inline struct dfu_entity *dfu_get_defer_flush(void)
{ {
@@ -228,9 +398,9 @@ static inline struct dfu_entity *dfu_get_defer_flush(void)
} }
/** /**
* dfu_set_defer_flush - set the dfu_defer_flush pointer * dfu_set_defer_flush() - set the dfu_defer_flush pointer
* *
* @param dfu - pointer to the dfu_entity, which should be written * @dfu: pointer to the dfu_entity, which should be written
*/ */
static inline void dfu_set_defer_flush(struct dfu_entity *dfu) static inline void dfu_set_defer_flush(struct dfu_entity *dfu)
{ {
@@ -238,16 +408,16 @@ static inline void dfu_set_defer_flush(struct dfu_entity *dfu)
} }
/** /**
* dfu_write_from_mem_addr - write data from memory to DFU managed medium * dfu_write_from_mem_addr() - write data from memory to DFU managed medium
* *
* This function adds support for writing data starting from fixed memory * This function adds support for writing data starting from fixed memory
* address (like $loadaddr) to dfu managed medium (e.g. NAND, MMC, file system) * address (like $loadaddr) to dfu managed medium (e.g. NAND, MMC, file system)
* *
* @param dfu - dfu entity to which we want to store data * @dfu: dfu entity to which we want to store data
* @param buf - fixed memory addres from where data starts * @buf: fixed memory address from where data starts
* @param size - number of bytes to write * @size: number of bytes to write
* *
* @return - 0 on success, other value on failure * Return: 0 on success, other value on failure
*/ */
int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size); int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size);
@@ -324,17 +494,17 @@ static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr,
#endif #endif
/** /**
* dfu_tftp_write - Write TFTP data to DFU medium * dfu_tftp_write() - write TFTP data to DFU medium
* *
* This function is storing data received via TFTP on DFU supported medium. * This function is storing data received via TFTP on DFU supported medium.
* *
* @param dfu_entity_name - name of DFU entity to write * @dfu_entity_name: name of DFU entity to write
* @param addr - address of data buffer to write * @addr: address of data buffer to write
* @param len - number of bytes * @len: number of bytes
* @param interface - destination DFU medium (e.g. "mmc") * @interface: destination DFU medium (e.g. "mmc")
* @param devstring - instance number of destination DFU medium (e.g. "1") * @devstring: instance number of destination DFU medium (e.g. "1")
* *
* @return 0 on success, otherwise error code * Return: 0 on success, otherwise error code
*/ */
#if CONFIG_IS_ENABLED(DFU_TFTP) #if CONFIG_IS_ENABLED(DFU_TFTP)
int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len, int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len,

View File

@@ -424,6 +424,10 @@ config GZIP
help help
This enables support for GZIP compression algorithm. This enables support for GZIP compression algorithm.
config GZIP_COMPRESSED
bool
select ZLIB
config BZIP2 config BZIP2
bool "Enable bzip2 decompression support" bool "Enable bzip2 decompression support"
help help

View File

@@ -415,7 +415,6 @@ CONFIG_ENABLE_36BIT_PHYS
CONFIG_ENABLE_MMU CONFIG_ENABLE_MMU
CONFIG_ENABLE_MUST_CHECK CONFIG_ENABLE_MUST_CHECK
CONFIG_ENABLE_WARN_DEPRECATED CONFIG_ENABLE_WARN_DEPRECATED
CONFIG_ENV_ACCESS_IGNORE_FORCE
CONFIG_ENV_ADDR_FLEX CONFIG_ENV_ADDR_FLEX
CONFIG_ENV_CALLBACK_LIST_DEFAULT CONFIG_ENV_CALLBACK_LIST_DEFAULT
CONFIG_ENV_CALLBACK_LIST_STATIC CONFIG_ENV_CALLBACK_LIST_STATIC
@@ -644,8 +643,6 @@ CONFIG_GPIO_LED_STUBS
CONFIG_GREEN_LED CONFIG_GREEN_LED
CONFIG_GURNARD_FPGA CONFIG_GURNARD_FPGA
CONFIG_GURNARD_SPLASH CONFIG_GURNARD_SPLASH
CONFIG_GZIP_COMPRESSED
CONFIG_GZIP_COMPRESS_DEF_SZ
CONFIG_G_DNL_THOR_PRODUCT_NUM CONFIG_G_DNL_THOR_PRODUCT_NUM
CONFIG_G_DNL_THOR_VENDOR_NUM CONFIG_G_DNL_THOR_VENDOR_NUM
CONFIG_G_DNL_UMS_PRODUCT_NUM CONFIG_G_DNL_UMS_PRODUCT_NUM

1
tools/env/fw_env.h vendored
View File

@@ -4,7 +4,6 @@
* Wolfgang Denk, DENX Software Engineering, wd@denx.de. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*/ */
#include <env.h>
#include <stdint.h> #include <stdint.h>
/* /*