Skip to content

Commit e6a7036

Browse files
tomchycarlescufi
authored andcommitted
[nrf noup] uuid: Use relative addresses
Switch back to relative address, since the addition of "ranges" property is being reverted. Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
1 parent d535c15 commit e6a7036

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

boot/zephyr/uuid/uuid.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,11 @@ fih_ret boot_uuid_vid_match(const struct flash_area *fap, const struct image_uui
2727
{
2828
const struct uuid_map_entry *map = NULL;
2929
size_t n_uuids = boot_uuid_vid_map_get(&map);
30-
int fa_ret;
31-
uintptr_t base;
3230

3331
assert(fap != NULL);
3432

35-
/* The memory map contains absolute addresses - fetch the base address for the area
36-
* in question.
37-
*/
38-
fa_ret = flash_device_base(flash_area_get_device_id(fap), &base);
39-
if (fa_ret != 0) {
40-
FIH_RET(FIH_FAILURE);
41-
}
42-
4333
for (size_t i = 0; i < n_uuids; i++) {
44-
if ((map[i].dev == fap->fa_dev) && (fap->fa_off + base == map[i].off) &&
34+
if ((map[i].dev == fap->fa_dev) && (fap->fa_off == map[i].off) &&
4535
(fap->fa_size == map[i].size)) {
4636
if (boot_uuid_compare(uuid_vid, &map[i].uuid)) {
4737
FIH_RET(FIH_SUCCESS);
@@ -58,21 +48,11 @@ fih_ret boot_uuid_cid_match(const struct flash_area *fap, const struct image_uui
5848
{
5949
const struct uuid_map_entry *map = NULL;
6050
size_t n_uuids = boot_uuid_cid_map_get(&map);
61-
int fa_ret;
62-
uintptr_t base;
6351

6452
assert(fap != NULL);
6553

66-
/* The memory map contains absolute addresses - fetch the base address for the area
67-
* in question.
68-
*/
69-
fa_ret = flash_device_base(flash_area_get_device_id(fap), &base);
70-
if (fa_ret != 0) {
71-
FIH_RET(FIH_FAILURE);
72-
}
73-
7454
for (size_t i = 0; i < n_uuids; i++) {
75-
if ((map[i].dev == fap->fa_dev) && (fap->fa_off + base == map[i].off) &&
55+
if ((map[i].dev == fap->fa_dev) && (fap->fa_off == map[i].off) &&
7656
(fap->fa_size == map[i].size)) {
7757
if (boot_uuid_compare(uuid_cid, &map[i].uuid)) {
7858
FIH_RET(FIH_SUCCESS);

0 commit comments

Comments
 (0)