Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47830 )
Change subject: util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS ......................................................................
util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS
This change renames the macro `IS_TOP_ALIGNED_ADDRESS` to `IS_HOST_SPACE_ADDRESS` to make it clear that the macro checks if given address is an address in the host space as opposed to the SPI flash space.
Change-Id: I84bb505df62ac41f1d364a662be145603c0bd5fa Signed-off-by: Furquan Shaikh furquan@google.com --- M util/cbfstool/cbfs_image.c M util/cbfstool/cbfstool.c M util/cbfstool/common.h 3 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/47830/1
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index 3f1bf43..da65960 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -731,7 +731,7 @@ assert(image); assert(buffer); assert(buffer->data); - assert(!IS_TOP_ALIGNED_ADDRESS(content_offset)); + assert(!IS_HOST_SPACE_ADDRESS(content_offset));
const char *name = header->filename;
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index c719b8f..061ff82 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -563,7 +563,7 @@ return -1; }
- if (IS_TOP_ALIGNED_ADDRESS(offset)) + if (IS_HOST_SPACE_ADDRESS(offset)) offset = convert_to_from_absolute_top_aligned(param.image_region, -offset); if (cbfs_add_entry(&image, &buffer, offset, header, len_align) != 0) { @@ -646,7 +646,7 @@ * passed in by the caller. */ if (param.stage_xip) { - if (!IS_TOP_ALIGNED_ADDRESS(address)) + if (!IS_HOST_SPACE_ADDRESS(address)) address = -convert_to_from_absolute_top_aligned( param.image_region, address); } else { diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h index 7dbc1f5..9f62e77 100644 --- a/util/cbfstool/common.h +++ b/util/cbfstool/common.h @@ -15,7 +15,12 @@ /* Endianness */ #include "swab.h"
-#define IS_TOP_ALIGNED_ADDRESS(x) ((uint32_t)(x) > 0x80000000) +/* + * There are two address spaces that this tool deals with - SPI flash address space and host + * address space. This macros checks if the address is greater than 2GiB under the assumption + * that the low MMIO lives in the top half of the 4G address space of the host. + */ +#define IS_HOST_SPACE_ADDRESS(addr) ((uint32_t)(addr) > 0x80000000)
#define unused __attribute__((unused))
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47830
to look at the new patch set (#2).
Change subject: util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS ......................................................................
util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS
This change renames the macro `IS_TOP_ALIGNED_ADDRESS` to `IS_HOST_SPACE_ADDRESS` to make it clear that the macro checks if given address is an address in the host space as opposed to the SPI flash space.
Change-Id: I84bb505df62ac41f1d364a662be145603c0bd5fa Signed-off-by: Furquan Shaikh furquan@google.com --- M util/cbfstool/cbfs_image.c M util/cbfstool/cbfstool.c M util/cbfstool/common.h 3 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/47830/2
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/47830
to look at the new patch set (#3).
Change subject: util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS ......................................................................
util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS
This change renames the macro `IS_TOP_ALIGNED_ADDRESS` to `IS_HOST_SPACE_ADDRESS` to make it clear that the macro checks if given address is an address in the host space as opposed to the SPI flash space.
BUG=b:171534504
Change-Id: I84bb505df62ac41f1d364a662be145603c0bd5fa Signed-off-by: Furquan Shaikh furquan@google.com --- M util/cbfstool/cbfs_image.c M util/cbfstool/cbfstool.c M util/cbfstool/common.h 3 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/47830/3
Srinidhi N Kaushik has uploaded a new patch set (#7) to the change originally created by Furquan Shaikh. ( https://review.coreboot.org/c/coreboot/+/47830 )
Change subject: util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS ......................................................................
util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS
This change renames the macro `IS_TOP_ALIGNED_ADDRESS` to `IS_HOST_SPACE_ADDRESS` to make it clear that the macro checks if given address is an address in the host space as opposed to the SPI flash space.
BUG=b:171534504
Change-Id: I84bb505df62ac41f1d364a662be145603c0bd5fa Signed-off-by: Furquan Shaikh furquan@google.com --- M util/cbfstool/cbfs_image.c M util/cbfstool/cbfstool.c M util/cbfstool/common.h 3 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/47830/7
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47830 )
Change subject: util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS ......................................................................
Patch Set 9: Code-Review+2
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47830 )
Change subject: util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS ......................................................................
Patch Set 10: Code-Review+2
Furquan Shaikh has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47830 )
Change subject: util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS ......................................................................
util/cbfstool: Rename IS_TOP_ALIGNED_ADDRESS to IS_HOST_SPACE_ADDRESS
This change renames the macro `IS_TOP_ALIGNED_ADDRESS` to `IS_HOST_SPACE_ADDRESS` to make it clear that the macro checks if given address is an address in the host space as opposed to the SPI flash space.
BUG=b:171534504
Change-Id: I84bb505df62ac41f1d364a662be145603c0bd5fa Signed-off-by: Furquan Shaikh furquan@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/47830 Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org Reviewed-by: Duncan Laurie dlaurie@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M util/cbfstool/cbfs_image.c M util/cbfstool/cbfstool.c M util/cbfstool/common.h 3 files changed, 9 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved Tim Wawrzynczak: Looks good to me, approved
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index 7b8da42..4249015 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -721,7 +721,7 @@ assert(image); assert(buffer); assert(buffer->data); - assert(!IS_TOP_ALIGNED_ADDRESS(content_offset)); + assert(!IS_HOST_SPACE_ADDRESS(content_offset));
const char *name = header->filename;
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index d6f4e98..f9f4e53 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -571,7 +571,7 @@ return -1; }
- if (IS_TOP_ALIGNED_ADDRESS(offset)) + if (IS_HOST_SPACE_ADDRESS(offset)) offset = convert_to_from_absolute_top_aligned(param.image_region, -offset); if (cbfs_add_entry(&image, &buffer, offset, header, len_align) != 0) { ERROR("Failed to add '%s' into ROM image.\n", filename); @@ -657,7 +657,7 @@ * passed in by the caller. */ if (param.stage_xip) { - if (!IS_TOP_ALIGNED_ADDRESS(address)) + if (!IS_HOST_SPACE_ADDRESS(address)) address = -convert_to_from_absolute_top_aligned( param.image_region, address); } else { diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h index f1287e2..1c83045 100644 --- a/util/cbfstool/common.h +++ b/util/cbfstool/common.h @@ -15,7 +15,12 @@
#include "swab.h"
-#define IS_TOP_ALIGNED_ADDRESS(x) ((uint32_t)(x) > 0x80000000) +/* + * There are two address spaces that this tool deals with - SPI flash address space and host + * address space. This macros checks if the address is greater than 2GiB under the assumption + * that the low MMIO lives in the top half of the 4G address space of the host. + */ +#define IS_HOST_SPACE_ADDRESS(addr) ((uint32_t)(addr) > 0x80000000)
#define unused __attribute__((unused))