From 08b7bc3c3afd20b9fc62dd356c0e961e6dba5f26 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 8 Jul 2019 13:18:21 -0600 Subject: cbfs: Add an enum and comment for the magic number This field is not commented in the original file. Add a comment. Signed-off-by: Simon Glass --- include/cbfs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/cbfs.h b/include/cbfs.h index bd1bf75bbf..f2ede25f51 100644 --- a/include/cbfs.h +++ b/include/cbfs.h @@ -40,6 +40,17 @@ enum cbfs_filetype { CBFS_TYPE_CMOS_LAYOUT = 0x01aa }; +enum { + CBFS_HEADER_MAGIC = 0x4f524243, +}; + +/** + * struct cbfs_header - header at the start of a CBFS region + * + * All fields use big-endian format. + * + * @magic: Magic number (CBFS_HEADER_MAGIC) + */ struct cbfs_header { u32 magic; u32 version; -- cgit v1.2.3 From ababe101d3797cdc6c1c8ab703ce4dc8fd9ac326 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 8 Jul 2019 13:18:22 -0600 Subject: cbfs: Rename checksum to attributes_offset It seems that this field has been renamed in later version of coreboot. Update it. Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 4 ++-- include/cbfs.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c index 7b2513cb24..af4d3c5e56 100644 --- a/fs/cbfs/cbfs.c +++ b/fs/cbfs/cbfs.c @@ -55,7 +55,7 @@ static void swap_file_header(struct cbfs_fileheader *dest, memcpy(&dest->magic, &src->magic, sizeof(dest->magic)); dest->len = be32_to_cpu(src->len); dest->type = be32_to_cpu(src->type); - dest->checksum = be32_to_cpu(src->checksum); + dest->attributes_offset = be32_to_cpu(src->attributes_offset); dest->offset = be32_to_cpu(src->offset); } @@ -108,7 +108,7 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align, newNode->name = (char *)fileHeader + sizeof(struct cbfs_fileheader); newNode->name_length = name_len; - newNode->checksum = header.checksum; + newNode->attributes_offset = header.attributes_offset; step = header.len; if (step % align) diff --git a/include/cbfs.h b/include/cbfs.h index f2ede25f51..b8d1dabbf6 100644 --- a/include/cbfs.h +++ b/include/cbfs.h @@ -65,7 +65,8 @@ struct cbfs_fileheader { u8 magic[8]; u32 len; u32 type; - u32 checksum; + /* offset to struct cbfs_file_attribute or 0 */ + u32 attributes_offset; u32 offset; } __packed; @@ -76,7 +77,7 @@ struct cbfs_cachenode { u32 data_length; char *name; u32 name_length; - u32 checksum; + u32 attributes_offset; } __packed; extern enum cbfs_result file_cbfs_result; -- cgit v1.2.3 From 15d61d04b47806d6dbb91ddf5dc32798c02f4857 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Fri, 5 Jul 2019 09:23:18 -0700 Subject: dm: Fix parameter description of dev_read_name() The comments of dev_read_name() wrongly describe "node" as its parameter. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- include/dm/read.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/dm/read.h b/include/dm/read.h index 62d4be6038..6ecd062e20 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -227,7 +227,7 @@ fdt_addr_t dev_read_addr_size(struct udevice *dev, const char *propname, /** * dev_read_name() - get the name of a device's node * - * @node: valid node to look up + * @dev: Device to read from * @return name of node */ const char *dev_read_name(struct udevice *dev); -- cgit v1.2.3 From c026231e15fa634c6865c2f8d2317d973b4cc4b4 Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Thu, 11 Jul 2019 11:23:44 +0300 Subject: dm: uclass: fix comment copy/paste error The uclass_next_device() routine continues a previously started device iteration. Change the description that is copied from uclass_first_device(). Signed-off-by: Baruch Siach Reviewed-by: Simon Glass --- include/dm/uclass.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/dm/uclass.h b/include/dm/uclass.h index 1bc62d523e..484d166013 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -297,7 +297,7 @@ int uclass_first_device_err(enum uclass_id id, struct udevice **devp); * * The device returned is probed if necessary, and ready for use * - * This function is useful to start iterating through a list of devices which + * This function is useful to iterate through a list of devices which * are functioning correctly and can be probed. * * @devp: On entry, pointer to device to lookup. On exit, returns pointer -- cgit v1.2.3