162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2020 Synopsys, Inc. (www.synopsys.com)
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci#ifndef __ASM_ARC_ASSERTS_H
862306a36Sopenharmony_ci#define __ASM_ARC_ASSERTS_H
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci/* Helpers to sanitize config options. */
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_civoid chk_opt_strict(char *opt_name, bool hw_exists, bool opt_ena);
1362306a36Sopenharmony_civoid chk_opt_weak(char *opt_name, bool hw_exists, bool opt_ena);
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/*
1662306a36Sopenharmony_ci * Check required config option:
1762306a36Sopenharmony_ci *  - panic in case of OPT enabled but corresponding HW absent.
1862306a36Sopenharmony_ci *  - warn in case of OPT disabled but corresponding HW exists.
1962306a36Sopenharmony_ci*/
2062306a36Sopenharmony_ci#define CHK_OPT_STRICT(opt_name, hw_exists)				\
2162306a36Sopenharmony_ci({									\
2262306a36Sopenharmony_ci	chk_opt_strict(#opt_name, hw_exists, IS_ENABLED(opt_name));	\
2362306a36Sopenharmony_ci})
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci/*
2662306a36Sopenharmony_ci * Check optional config option:
2762306a36Sopenharmony_ci *  - panic in case of OPT enabled but corresponding HW absent.
2862306a36Sopenharmony_ci*/
2962306a36Sopenharmony_ci#define CHK_OPT_WEAK(opt_name, hw_exists)				\
3062306a36Sopenharmony_ci({									\
3162306a36Sopenharmony_ci	chk_opt_weak(#opt_name, hw_exists, IS_ENABLED(opt_name));	\
3262306a36Sopenharmony_ci})
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#endif /* __ASM_ARC_ASSERTS_H */
35