|  | # Copyright 2023 Google LLC. | 
|  | # Copyright lowRISC contributors. | 
|  | # Licensed under the Apache License, Version 2.0, see LICENSE for details. | 
|  | # SPDX-License-Identifier: Apache-2.0 | 
|  |  | 
|  | package(default_visibility = ["//visibility:public"]) | 
|  |  | 
|  | load("@lowrisc_opentitan//rules:opentitan.bzl", "OPENTITAN_CPU") | 
|  |  | 
|  | cc_library( | 
|  | name = "util", | 
|  | hdrs = [ | 
|  | "util.h", | 
|  | ], | 
|  | target_compatible_with = [OPENTITAN_CPU], | 
|  | ) | 
|  |  | 
|  | cc_library( | 
|  | name = "tar_header", | 
|  | hdrs = [ | 
|  | "tar.h", | 
|  | ], | 
|  | target_compatible_with = [OPENTITAN_CPU], | 
|  | ) | 
|  |  | 
|  | cc_library( | 
|  | name = "virtual_memory", | 
|  | srcs = [ | 
|  | "virtual_memory.c", | 
|  | ], | 
|  | hdrs = [ | 
|  | "virtual_memory.h", | 
|  | ], | 
|  | target_compatible_with = [OPENTITAN_CPU], | 
|  | deps = [ | 
|  | "@lowrisc_opentitan//sw/device/lib/testing/test_framework:check", | 
|  | ], | 
|  | ) | 
|  |  | 
|  | # TODO(atv): Merge SPI codes under @lowrisc_opentitan//sw/device/lib/testing:spi_device_testutils | 
|  | # and @lowrisc_opentitan//sw/device/lib/testing:spi_flash_testutils with the SPI codes in matcha. | 
|  | cc_library( | 
|  | name = "spi_flash", | 
|  | srcs = [ | 
|  | "spi_flash.c", | 
|  | ], | 
|  | hdrs = [ | 
|  | "spi_flash.h", | 
|  | ], | 
|  | target_compatible_with = [OPENTITAN_CPU], | 
|  | deps = [ | 
|  | ":eflash", | 
|  | ":tar_header", | 
|  | "//hw/top_matcha/sw:top_matcha", | 
|  | "//sw/device/lib/arch:device", | 
|  | "@lowrisc_opentitan//sw/device/lib/dif:spi_host", | 
|  | "@lowrisc_opentitan//sw/device/lib/testing/test_framework:check", | 
|  | ], | 
|  | ) | 
|  |  | 
|  | cc_library( | 
|  | name = "eflash", | 
|  | srcs = [ | 
|  | "eflash.c", | 
|  | ], | 
|  | hdrs = [ | 
|  | "eflash.h", | 
|  | ], | 
|  | target_compatible_with = [OPENTITAN_CPU], | 
|  | deps = [ | 
|  | "//hw/top_matcha/sw:top_matcha", | 
|  | "@lowrisc_opentitan//sw/device/lib/dif:flash_ctrl", | 
|  | "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
|  | "@lowrisc_opentitan//sw/device/silicon_creator/lib/drivers:flash_ctrl", | 
|  | ], | 
|  | ) | 
|  |  | 
|  | cc_library( | 
|  | name = "camera_hm01b0", | 
|  | srcs = [ | 
|  | "camera_hm01b0.c", | 
|  | ], | 
|  | hdrs = [ | 
|  | "camera_hm01b0.h", | 
|  | "camera_hm01b0_regs.h", | 
|  | ], | 
|  | target_compatible_with = [OPENTITAN_CPU], | 
|  | deps = [ | 
|  | "//hw/top_matcha/sw:top_matcha", | 
|  | "//sw/device/lib/dif:rv_plic_smc", | 
|  | "@lowrisc_opentitan//sw/device/lib/dif:i2c", | 
|  | "@lowrisc_opentitan//sw/device/lib/testing/test_framework:check", | 
|  | ], | 
|  | ) |