Prepare v2024.10
[platform/kernel/u-boot.git] / arch / arm / mach-k3 / common.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * K3: Architecture common definitions
4  *
5  * Copyright (C) 2018-2024 Texas Instruments Incorporated - https://www.ti.com/
6  *      Lokesh Vutla <lokeshvutla@ti.com>
7  */
8
9 #include <asm/armv7_mpu.h>
10 #include <asm/hardware.h>
11 #include <mach/security.h>
12
13 #define K3_FIREWALL_BACKGROUND_BIT (8)
14
15 struct fwl_data {
16         const char *name;
17         u16 fwl_id;
18         u16 regions;
19 };
20
21 enum k3_firewall_region_type {
22         K3_FIREWALL_REGION_FOREGROUND,
23         K3_FIREWALL_REGION_BACKGROUND
24 };
25
26 enum k3_device_type {
27         K3_DEVICE_TYPE_BAD,
28         K3_DEVICE_TYPE_GP,
29         K3_DEVICE_TYPE_TEST,
30         K3_DEVICE_TYPE_EMU,
31         K3_DEVICE_TYPE_HS_FS,
32         K3_DEVICE_TYPE_HS_SE,
33 };
34
35 void setup_k3_mpu_regions(void);
36 int early_console_init(void);
37 void disable_linefill_optimization(void);
38 void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size);
39 int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
40 void k3_sysfw_print_ver(void);
41 void spl_enable_cache(void);
42 void mmr_unlock(uintptr_t base, u32 partition);
43 bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);
44 enum k3_device_type get_device_type(void);
45 struct ti_sci_handle *get_ti_sci_handle(void);
46 void do_board_detect(void);
47 void ti_secure_image_check_binary(void **p_image, size_t *p_size);
48
49 #if (IS_ENABLED(CONFIG_K3_QOS))
50 void setup_qos(void);
51 #else
52 static inline void setup_qos(void)
53 {
54 }
55 #endif