1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2024, Telechips Inc. 4 */ 5 6 #ifndef __DRIVERS_OPENEDGES_OMC_H 7 #define __DRIVERS_OPENEDGES_OMC_H 8 9 #include <types_ext.h> 10 #include <util.h> 11 12 #define OMC_FLAG_RELATIVE_ADDR BIT(0) 13 14 enum omc_action { 15 OMC_ACTION_NONE = 0, 16 OMC_ACTION_ERR, 17 OMC_ACTION_INT, 18 OMC_ACTION_ERR_INT 19 }; 20 21 struct omc_region_config { 22 uint32_t filters; 23 uint64_t base; 24 uint64_t top; 25 uint32_t ns_device_access; 26 uint32_t flags; 27 }; 28 29 void omc_init(vaddr_t base, uint32_t size, uint8_t num); 30 void omc_configure_region(uint8_t region, const struct omc_region_config *cfg); 31 void omc_set_action(enum omc_action action); 32 33 void omc_fail_dump(uint8_t filter); 34 void omc_int_clear(uint8_t filter); 35 36 #endif /* __DRIVERS_OPENEDGES_OMC_H */ 37