Software APIs
rom_ext_manifest.c
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #include "sw/device/silicon_creator/rom_ext/rom_ext_manifest.h"
6 
7 #include "sw/device/silicon_creator/lib/manifest.h"
8 
9 #include "hw/top_earlgrey/sw/autogen/top_earlgrey.h" // Generated.
10 
11 enum {
13 };
14 
15 const manifest_t *rom_ext_manifest(void) {
16  uintptr_t pc = 0;
17  asm("auipc %[pc], 0;" : [pc] "=r"(pc));
18 
19  // Align the PC to the current flash side. The ROM_EXT must be the first
20  // entity in each flash side, so this alignment is the manifest address.
21  pc &= ~((uintptr_t)kFlashHalf - 1);
22  return (const manifest_t *)pc;
23 }