diff options
author | Tom Rini <trini@konsulko.com> | 2020-04-20 17:22:47 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-04-20 17:22:47 -0400 |
commit | a06375805917a5b48c46724ceef4a1cd04935992 (patch) | |
tree | 45bba4e4fb8332c55324efaf96e46e6cbd8f4d93 /include | |
parent | e4837da7828293ea49abc579f939c0f5c4b127c3 (diff) | |
parent | 48180e15d3eaff51b1da30a90bc64b7acba8fb51 (diff) | |
download | u-boot-a06375805917a5b48c46724ceef4a1cd04935992.zip u-boot-a06375805917a5b48c46724ceef4a1cd04935992.tar.gz u-boot-a06375805917a5b48c46724ceef4a1cd04935992.tar.bz2 |
Merge branch '2020-04-17-master-imports'
- Further cleanups for 'make refcheckdocs'
- Another BTRFS fix.
- Support for automatic decompression of images with booti as well as
unlz4 command for manual decompression.
Diffstat (limited to 'include')
-rw-r--r-- | include/ata.h | 41 | ||||
-rw-r--r-- | include/image.h | 21 | ||||
-rw-r--r-- | include/libata.h | 84 |
3 files changed, 65 insertions, 81 deletions
diff --git a/include/ata.h b/include/ata.h index 3f4e4a0..3d870c9 100644 --- a/include/ata.h +++ b/include/ata.h @@ -6,11 +6,8 @@ /* * Most of the following information was derived from the document - * "Information Technology - AT Attachment-3 Interface (ATA-3)" - * which can be found at: - * http://www.dt.wdc.com/ata/ata-3/ata3r5v.zip - * ftp://poctok.iae.nsk.su/pub/asm/Documents/IDE/ATA3R5V.ZIP - * ftp://ftp.fee.vutbr.cz/pub/doc/io/ata/ata-3/ata3r5v.zip + * "Information Technology - AT Attachment-3 Interface (ATA-3)", + * ANSI X3.298-1997. */ #ifndef _ATA_H @@ -71,42 +68,8 @@ #define ATA_LBA 0xE0 /* - * ATA Commands (only mandatory commands listed here) - */ -#define ATA_CMD_READ 0x20 /* Read Sectors (with retries) */ -#define ATA_CMD_READN 0x21 /* Read Sectors ( no retries) */ -#define ATA_CMD_WRITE 0x30 /* Write Sectores (with retries)*/ -#define ATA_CMD_WRITEN 0x31 /* Write Sectors ( no retries)*/ -#define ATA_CMD_VRFY 0x40 /* Read Verify (with retries) */ -#define ATA_CMD_VRFYN 0x41 /* Read verify ( no retries) */ -#define ATA_CMD_SEEK 0x70 /* Seek */ -#define ATA_CMD_DIAG 0x90 /* Execute Device Diagnostic */ -#define ATA_CMD_INIT 0x91 /* Initialize Device Parameters */ -#define ATA_CMD_RD_MULT 0xC4 /* Read Multiple */ -#define ATA_CMD_WR_MULT 0xC5 /* Write Multiple */ -#define ATA_CMD_SETMULT 0xC6 /* Set Multiple Mode */ -#define ATA_CMD_RD_DMA 0xC8 /* Read DMA (with retries) */ -#define ATA_CMD_RD_DMAN 0xC9 /* Read DMS ( no retries) */ -#define ATA_CMD_WR_DMA 0xCA /* Write DMA (with retries) */ -#define ATA_CMD_WR_DMAN 0xCB /* Write DMA ( no retires) */ -#define ATA_CMD_IDENT 0xEC /* Identify Device */ -#define ATA_CMD_SETF 0xEF /* Set Features */ -#define ATA_CMD_CHK_PWR 0xE5 /* Check Power Mode */ - -#define ATA_CMD_READ_EXT 0x24 /* Read Sectors (with retries) with 48bit addressing */ -#define ATA_CMD_WRITE_EXT 0x34 /* Write Sectores (with retries) with 48bit addressing */ -#define ATA_CMD_VRFY_EXT 0x42 /* Read Verify (with retries) with 48bit addressing */ - -#define ATA_CMD_FLUSH 0xE7 /* Flush drive cache */ -#define ATA_CMD_FLUSH_EXT 0xEA /* Flush drive cache, with 48bit addressing */ - -/* * ATAPI Commands */ -#define ATAPI_CMD_IDENT 0xA1 /* Identify AT Atachment Packed Interface Device */ -#define ATAPI_CMD_PACKET 0xA0 /* Packed Command */ - - #define ATAPI_CMD_INQUIRY 0x12 #define ATAPI_CMD_REQ_SENSE 0x03 #define ATAPI_CMD_READ_CAP 0x25 diff --git a/include/image.h b/include/image.h index 2388c1f..de55b2f 100644 --- a/include/image.h +++ b/include/image.h @@ -453,6 +453,15 @@ typedef struct table_entry { } table_entry_t; /* + * Compression type and magic number mapping table. + */ +struct comp_magic_map { + int comp_id; + const char *name; + unsigned char magic[2]; +}; + +/* * get_table_entry_id() scans the translation table trying to find an * entry that matches the given short name. If a matching entry is * found, it's id is returned to the caller. @@ -869,6 +878,18 @@ static inline int image_check_target_arch(const image_header_t *hdr) #endif /* USE_HOSTCC */ /** + * image_decomp_type() - Find out compression type of an image + * + * @buf: Address in U-Boot memory where image is loaded. + * @len: Length of the compressed image. + * @return compression type or IH_COMP_NONE if not compressed. + * + * Note: Only following compression types are supported now. + * lzo, lzma, gzip, bzip2 + */ +int image_decomp_type(const unsigned char *buf, ulong len); + +/** * image_decomp() - decompress an image * * @comp: Compression algorithm that is used (IH_COMP_...) diff --git a/include/libata.h b/include/libata.h index 25296ac..b03b299 100644 --- a/include/libata.h +++ b/include/libata.h @@ -133,49 +133,49 @@ enum { ATA_REG_IRQ = ATA_REG_NSECT, /* ATA device commands */ - ATA_CMD_DEV_RESET = 0x08, /* ATAPI device reset */ - ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ - ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ - ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ - ATA_CMD_EDD = 0x90, /* execute device diagnostic */ - ATA_CMD_FLUSH = 0xE7, - ATA_CMD_FLUSH_EXT = 0xEA, - ATA_CMD_ID_ATA = 0xEC, - ATA_CMD_ID_ATAPI = 0xA1, - ATA_CMD_READ = 0xC8, - ATA_CMD_READ_EXT = 0x25, - ATA_CMD_WRITE = 0xCA, - ATA_CMD_WRITE_EXT = 0x35, - ATA_CMD_WRITE_FUA_EXT = 0x3D, - ATA_CMD_FPDMA_READ = 0x60, - ATA_CMD_FPDMA_WRITE = 0x61, - ATA_CMD_PIO_READ = 0x20, - ATA_CMD_PIO_READ_EXT = 0x24, - ATA_CMD_PIO_WRITE = 0x30, - ATA_CMD_PIO_WRITE_EXT = 0x34, - ATA_CMD_READ_MULTI = 0xC4, - ATA_CMD_READ_MULTI_EXT = 0x29, - ATA_CMD_WRITE_MULTI = 0xC5, - ATA_CMD_WRITE_MULTI_EXT = 0x39, - ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE, - ATA_CMD_SET_FEATURES = 0xEF, - ATA_CMD_SET_MULTI = 0xC6, - ATA_CMD_PACKET = 0xA0, - ATA_CMD_VERIFY = 0x40, - ATA_CMD_VERIFY_EXT = 0x42, - ATA_CMD_STANDBYNOW1 = 0xE0, - ATA_CMD_IDLEIMMEDIATE = 0xE1, - ATA_CMD_SLEEP = 0xE6, - ATA_CMD_INIT_DEV_PARAMS = 0x91, - ATA_CMD_READ_NATIVE_MAX = 0xF8, + ATA_CMD_DEV_RESET = 0x08, /* ATAPI device reset */ + ATA_CMD_PIO_READ = 0x20, /* Read sectors with retry */ + ATA_CMD_PIO_READ_EXT = 0x24, + ATA_CMD_READ_EXT = 0x25, ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, - ATA_CMD_SET_MAX = 0xF9, - ATA_CMD_SET_MAX_EXT = 0x37, - ATA_CMD_READ_LOG_EXT = 0x2f, - ATA_CMD_PMP_READ = 0xE4, - ATA_CMD_PMP_WRITE = 0xE8, - ATA_CMD_CONF_OVERLAY = 0xB1, - ATA_CMD_SEC_FREEZE_LOCK = 0xF5, + ATA_CMD_READ_MULTI_EXT = 0x29, + ATA_CMD_READ_LOG_EXT = 0x2f, + ATA_CMD_PIO_WRITE = 0x30, /* write sectors with retry */ + ATA_CMD_PIO_WRITE_EXT = 0x34, + ATA_CMD_WRITE_EXT = 0x35, + ATA_CMD_SET_MAX_EXT = 0x37, + ATA_CMD_WRITE_MULTI_EXT = 0x39, + ATA_CMD_WRITE_FUA_EXT = 0x3D, + ATA_CMD_VERIFY = 0x40, /* read verify sectors with retry */ + ATA_CMD_VERIFY_EXT = 0x42, + ATA_CMD_FPDMA_READ = 0x60, + ATA_CMD_FPDMA_WRITE = 0x61, + ATA_CMD_EDD = 0x90, /* execute device diagnostic */ + ATA_CMD_INIT_DEV_PARAMS = 0x91, /* initialize device parameters */ + ATA_CMD_PACKET = 0xA0, /* ATAPI packet */ + ATA_CMD_ID_ATAPI = 0xA1, /* ATAPI identify device */ + ATA_CMD_CONF_OVERLAY = 0xB1, + ATA_CMD_READ_MULTI = 0xC4, /* read multiple */ + ATA_CMD_WRITE_MULTI = 0xC5, /* write multiple */ + ATA_CMD_SET_MULTI = 0xC6, /* set multiple mode */ + ATA_CMD_READ = 0xC8, /* read DMA with retry */ + ATA_CMD_WRITE = 0xCA, /* write DMA with retry */ + ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE, + ATA_CMD_STANDBYNOW1 = 0xE0, /* standby immediate */ + ATA_CMD_IDLEIMMEDIATE = 0xE1, /* idle immediate */ + ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ + ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ + ATA_CMD_PMP_READ = 0xE4, /* read buffer */ + ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ + ATA_CMD_SLEEP = 0xE6, /* sleep */ + ATA_CMD_FLUSH = 0xE7, + ATA_CMD_PMP_WRITE = 0xE8, /* write buffer */ + ATA_CMD_FLUSH_EXT = 0xEA, + ATA_CMD_ID_ATA = 0xEC, /* identify device */ + ATA_CMD_SET_FEATURES = 0xEF, /* set features */ + ATA_CMD_SEC_FREEZE_LOCK = 0xF5, /* security freeze */ + ATA_CMD_READ_NATIVE_MAX = 0xF8, + ATA_CMD_SET_MAX = 0xF9, /* READ_LOG_EXT pages */ ATA_LOG_SATA_NCQ = 0x10, |