18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2020 Loongson Technology Co., Ltd.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef _LOONGARCH_SETUP_H
78c2ecf20Sopenharmony_ci#define _LOONGARCH_SETUP_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/types.h>
108c2ecf20Sopenharmony_ci#include <uapi/asm/setup.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define VECSIZE 0x200
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciextern unsigned long eentry;
158c2ecf20Sopenharmony_ciextern unsigned long tlbrentry;
168c2ecf20Sopenharmony_ciextern void tlb_init(int cpu);
178c2ecf20Sopenharmony_ciextern void cpu_cache_init(void);
188c2ecf20Sopenharmony_ciextern void cache_error_setup(void);
198c2ecf20Sopenharmony_ciextern void per_cpu_trap_init(int cpu);
208c2ecf20Sopenharmony_ciextern void set_handler(unsigned long offset, void *addr, unsigned long len);
218c2ecf20Sopenharmony_ciextern void set_merr_handler(unsigned long offset, void *addr, unsigned long len);
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#ifdef CONFIG_USE_OF
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_cistruct boot_param_header;
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciextern void device_tree_init(void);
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#else /* CONFIG_OF */
308c2ecf20Sopenharmony_cistatic inline void device_tree_init(void) { }
318c2ecf20Sopenharmony_ci#endif /* CONFIG_OF */
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#endif /* __SETUP_H */
34