Software APIs
english_breakfast_fake_driver_funcs.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 
6 #include "sw/device/silicon_creator/lib/drivers/lifecycle.h"
7 #include "sw/device/silicon_creator/lib/drivers/otp.h"
8 #include "sw/device/silicon_creator/lib/drivers/rstmgr.h"
9 
10 // TODO(#12905): This file includes fake definitions for the functions that are
11 // used by the silicon_creator bootstrap implementation and to set reset_reason
12 // but missing in the english breakfast top level due to hardware limitations.
13 
14 #ifndef OPENTITAN_IS_ENGLISHBREAKFAST
15 #error "This file should be compiled only for the english breakfast top level"
16 #endif
17 
18 void lifecycle_hw_rev_get(lifecycle_hw_rev_t *hw_rev) {
19  *hw_rev = (lifecycle_hw_rev_t){
20  .silicon_creator_id = 0,
21  .product_id = 0,
22  .revision_id = 0,
23  };
24 }
25 
26 uint32_t otp_read32(uint32_t address) { return kHardenedBoolFalse; }
27 
28 dif_result_t dif_rstmgr_init(mmio_region_t base_addr, dif_rstmgr_t *rstmgr) {
29  return kDifOk;
30 }
31 
32 dif_result_t dif_rstmgr_reset_info_get(const dif_rstmgr_t *handle,
34  *info = 1 << kRstmgrReasonPowerOn;
35  return kDifOk;
36 }
37 
38 dif_result_t dif_rstmgr_reset_info_clear(const dif_rstmgr_t *handle) {
39  return kDifOk;
40 }
41 
42 void rstmgr_reset(void) {
43  while (true) {
44  }
45 }