| /* |
| * Copyright 2023 Google LLC |
| * |
| * 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. |
| */ |
| |
| |
| #include "hw/top_matcha/sw/autogen/top_matcha.h" |
| #include "sw/device/examples/hello_world_multicore/hello_world_multicore_sc_loaders.h" |
| #include "sw/device/lib/spi_flash.h" |
| #include "sw/device/lib/testing/test_framework/check.h" |
| |
| void load_smc(void) { |
| CHECK_DIF_OK(load_file_from_tar( |
| "smc.bin", (void*)TOP_MATCHA_RAM_SMC_BASE_ADDR, |
| (TOP_MATCHA_RAM_SMC_BASE_ADDR + TOP_MATCHA_RAM_SMC_SIZE_BYTES))); |
| } |
| |
| void load_kelvin(void) { |
| CHECK_DIF_OK(load_file_from_tar( |
| "kelvin.bin", (void*)TOP_MATCHA_ML_TOP_DMEM_BASE_ADDR, |
| (TOP_MATCHA_ML_TOP_DMEM_BASE_ADDR + TOP_MATCHA_RAM_ML_DMEM_SIZE_BYTES))); |
| } |
| |
| void load_init(void) { spi_flash_init(); } |