| // Copyright 2022 Google LLC. |
| // Copyright lowRISC contributors. |
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| // SPDX-License-Identifier: Apache-2.0 |
| |
| #include "sw/device/lib/arch/device.h" |
| #include "sw/device/lib/dif/dif_isp_wrapper.h" |
| #include "sw/device/lib/dif/dif_uart.h" |
| #include "sw/device/lib/runtime/hart.h" |
| #include "sw/device/lib/runtime/log.h" |
| #include "sw/device/lib/runtime/print.h" |
| #include "sw/device/lib/testing/test_framework/check.h" |
| #include "sw/device/lib/testing/test_framework/ottf_test_config.h" |
| #include "sw/device/lib/testing/test_framework/status.h" |
| |
| #include "hw/top_matcha/sw/autogen/top_matcha.h" |
| |
| OTTF_DEFINE_TEST_CONFIG(); |
| |
| static dif_uart_t uart; |
| static dif_isp_wrapper_t isp_wrapper; |
| |
| void _ottf_main(void) { |
| |
| uint32_t en_result, regwen_result; |
| |
| CHECK_DIF_OK(dif_uart_init( |
| mmio_region_from_addr(TOP_MATCHA_UART0_BASE_ADDR), &uart)); |
| CHECK_DIF_OK( |
| dif_uart_configure(&uart, (dif_uart_config_t){ |
| .baudrate = kUartBaudrate, |
| .clk_freq_hz = kClockFreqPeripheralHz, |
| .parity_enable = kDifToggleDisabled, |
| .parity = kDifUartParityEven, |
| })); |
| base_uart_stdout(&uart); |
| |
| LOG_INFO("Hello Shodan!"); |
| |
| // Start testing |
| test_status_set(kTestStatusInTest); |
| |
| CHECK_DIF_OK(dif_isp_wrapper_init(mmio_region_from_addr(TOP_MATCHA_CAM_CTRL_BASE_ADDR ), &isp_wrapper)); |
| |
| test_status_set(kTestStatusPassed); |
| } |