blob: 02c74731feab84bd0b14375c30538bb7963e8d51 [file] [log] [blame]
Lokesh Vutlac1e60e82018-11-02 19:51:03 +05301/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * K3: Architecture common definitions
4 *
Manorit Chawdhry53dde1a2024-05-21 16:26:45 +05305 * Copyright (C) 2018-2024 Texas Instruments Incorporated - https://www.ti.com/
Lokesh Vutlac1e60e82018-11-02 19:51:03 +05306 * Lokesh Vutla <lokeshvutla@ti.com>
7 */
8
9#include <asm/armv7_mpu.h>
Lokesh Vutla8be6bbf2020-08-05 22:44:23 +053010#include <asm/hardware.h>
Manorit Chawdhry53dde1a2024-05-21 16:26:45 +053011#include <mach/security.h>
Lokesh Vutlac1e60e82018-11-02 19:51:03 +053012
Bryan Brattlofeb3f3572025-04-25 12:02:06 -050013/* keep ram_top in the 32-bit address space */
14#define CFG_MAX_MEM_MAPPED 0x100000000
15
Manorit Chawdhrya2cfec42023-07-14 11:22:27 +053016#define K3_FIREWALL_BACKGROUND_BIT (8)
Manorit Chawdhry33f75ee2023-05-05 15:54:00 +053017
Andrew F. Davisf0bcb662020-01-10 14:35:21 -050018struct fwl_data {
19 const char *name;
20 u16 fwl_id;
21 u16 regions;
22};
23
Manorit Chawdhry33f75ee2023-05-05 15:54:00 +053024enum k3_firewall_region_type {
25 K3_FIREWALL_REGION_FOREGROUND,
26 K3_FIREWALL_REGION_BACKGROUND
27};
28
Andrew Davisf8c98362022-07-15 11:34:32 -050029enum k3_device_type {
30 K3_DEVICE_TYPE_BAD,
31 K3_DEVICE_TYPE_GP,
32 K3_DEVICE_TYPE_TEST,
33 K3_DEVICE_TYPE_EMU,
34 K3_DEVICE_TYPE_HS_FS,
35 K3_DEVICE_TYPE_HS_SE,
36};
37
Lokesh Vutlac1e60e82018-11-02 19:51:03 +053038void setup_k3_mpu_regions(void);
Andreas Dannenbergd13ec8c2019-08-15 15:55:28 -050039int early_console_init(void);
Lokesh Vutla5fbd6fe2019-12-31 15:49:55 +053040void disable_linefill_optimization(void);
Bryan Brattlof1b19b262025-04-14 15:20:02 -050041int remove_fwl_region(struct fwl_data *fwl);
Andrew F. Davisf0bcb662020-01-10 14:35:21 -050042void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size);
Keerthy7007adc2020-02-12 13:55:04 +053043int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
Lokesh Vutla5fafe442020-03-10 16:50:58 +053044void k3_sysfw_print_ver(void);
Joao Paulo Goncalvesfc3557f2023-11-13 16:07:21 -030045void spl_enable_cache(void);
Matthias Schiffer0262dcd2023-09-27 15:43:14 +020046void mmr_unlock(uintptr_t base, u32 partition);
Lokesh Vutla8be6bbf2020-08-05 22:44:23 +053047bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);
Andrew Davisf8c98362022-07-15 11:34:32 -050048enum k3_device_type get_device_type(void);
Andrew Davis2dde9a72023-04-06 11:38:17 -050049struct ti_sci_handle *get_ti_sci_handle(void);
50void do_board_detect(void);
Manorit Chawdhrydb01bcc2023-05-18 12:44:17 +053051void ti_secure_image_check_binary(void **p_image, size_t *p_size);
Aradhya Bhatia5b095382024-02-12 15:36:35 +053052
53#if (IS_ENABLED(CONFIG_K3_QOS))
54void setup_qos(void);
55#else
56static inline void setup_qos(void)
57{
58}
59#endif