summaryrefslogtreecommitdiff
path: root/common/init_rom.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /common/init_rom.c
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-firmware-cherry-14454.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'common/init_rom.c')
-rw-r--r--common/init_rom.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/common/init_rom.c b/common/init_rom.c
deleted file mode 100644
index 320849c008..0000000000
--- a/common/init_rom.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Init ROM module for Chrome EC */
-
-#include "builtin/assert.h"
-#include "common.h"
-#include "init_rom.h"
-#include "flash.h"
-#include "stdbool.h"
-#include "stddef.h"
-
-const void *init_rom_map(const void *addr, int size)
-{
- const char *src;
- uintptr_t offset;
-
- /*
- * When CONFIG_CHIP_INIT_ROM_REGION isn't enabled, .init_rom objects
- * are linked into the .rodata section and directly addressable.
- * Return the caller's pointer.
- */
- if (!IS_ENABLED(CONFIG_CHIP_INIT_ROM_REGION))
- return addr;
-
- /*
- * When flash isn't memory mapped, caller's must use init_rom_copy()
- * to copy .init_rom data into RAM.
- */
- if (!IS_ENABLED(CONFIG_MAPPED_STORAGE))
- return NULL;
-
- /*
- * Safe pointer conversion - needed for host tests which can have
- * 64-bit pointers.
- */
- offset = (uintptr_t)addr;
-
- ASSERT(offset <= __INT_MAX__);
-
- /*
- * Convert flash offset to memory mapped address
- */
- if (crec_flash_dataptr((int)offset, size, 1, &src) < 0)
- return NULL;
-
- /* Once the flash offset is validated, lock the flash for the caller */
- crec_flash_lock_mapped_storage(1);
-
- return src;
-}
-
-/*
- * The addr and size parameters are provided for forward compatibility if
- * the flash API is extended to support locking less than the entire flash.
- */
-void init_rom_unmap(const void *addr, int size)
-{
- if (IS_ENABLED(CONFIG_CHIP_INIT_ROM_REGION))
- crec_flash_lock_mapped_storage(0);
-}
-
-int init_rom_copy(int offset, int size, char *data)
-{
- return crec_flash_read(offset, size, data);
-}
-