/*
 * Copyright 2023 Google LLC
 * Copyright lowRISC contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


#ifndef SW_DEVICE_SILICON_CREATOR_ROM_BOOTSTRAP_H_
#define SW_DEVICE_SILICON_CREATOR_ROM_BOOTSTRAP_H_

#include "sw/device/lib/base/hardened.h"
#include "sw/device/lib/base/mmio.h"
#include "sw/device/silicon_creator/lib/error.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Checks whether bootstrap is requested.
 *
 * The return value of this function also depends on the `ROM_BOOTSTRAP_EN` OTP
 * item.
 *
 * @return Whether bootstrap is requested.
 */
hardened_bool_t bootstrap_requested(mmio_region_t otp_addr,
                                    mmio_region_t gpio_addr);

/**
 * Bootstraps the data partition of the embedded flash with data received by the
 * spi_device.
 *
 * OpenTitan bootstrap uses the typical SPI flash EEPROM commands. A typical
 * bootstrap session involves:
 * - Asserting bootstrap pins to enter bootstrap mode,
 * - Erasing the chip (WREN, CHIP_ERASE, busy loop ...),
 * - Programming the chip (WREN, PAGE_PROGRAM, busy loop ...), and
 * - Resetting the chip (RESET).
 *
 * This function only returns on error since a successful bootstrap ends with a
 * chip reset.
 *
 * @return Result of the operation.
 */
rom_error_t bootstrap(mmio_region_t otp_addr, mmio_region_t gpio_addr,
                      mmio_region_t spi_device_addr);

#ifdef __cplusplus
}
#endif

#endif  // SW_DEVICE_SILICON_CREATOR_ROM_BOOTSTRAP_H_
