blob: 899be64a50cb3147283a6ba97ebf359ac9bd3cef [file] [log] [blame]
Lokesh Vutla23f7b1a2018-11-02 19:51:03 +05301/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * K3: Architecture common definitions
4 *
5 * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
6 * Lokesh Vutla <lokeshvutla@ti.com>
7 */
8
9#include <asm/armv7_mpu.h>
Lokesh Vutla01dbe362020-08-05 22:44:23 +053010#include <asm/hardware.h>
Lokesh Vutla23f7b1a2018-11-02 19:51:03 +053011
Manorit Chawdhryb8ebf242023-04-20 17:16:24 +053012#define J721E 0xbb64
13#define J7200 0xbb6d
14#define K3_BACKGROUND_FIREWALL_BIT BIT(8)
15
Andrew F. Davisea70da12020-01-10 14:35:21 -050016struct fwl_data {
17 const char *name;
18 u16 fwl_id;
19 u16 regions;
20};
21
Andrew Davisd1c07952022-07-15 11:34:32 -050022enum k3_device_type {
23 K3_DEVICE_TYPE_BAD,
24 K3_DEVICE_TYPE_GP,
25 K3_DEVICE_TYPE_TEST,
26 K3_DEVICE_TYPE_EMU,
27 K3_DEVICE_TYPE_HS_FS,
28 K3_DEVICE_TYPE_HS_SE,
29};
30
Lokesh Vutla23f7b1a2018-11-02 19:51:03 +053031void setup_k3_mpu_regions(void);
Andreas Dannenberge630afe12019-08-15 15:55:28 -050032int early_console_init(void);
Lokesh Vutla40109f42019-12-31 15:49:55 +053033void disable_linefill_optimization(void);
Andrew F. Davisea70da12020-01-10 14:35:21 -050034void remove_fwl_configs(struct fwl_data *fwl_data, size_t fwl_data_size);
Keerthy3ab34bc2020-02-12 13:55:04 +053035int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr);
Lokesh Vutla6e44aeb2020-03-10 16:50:58 +053036void k3_sysfw_print_ver(void);
Jan Kiszkac02712a2020-05-18 07:57:22 +020037void spl_enable_dcache(void);
Lokesh Vutla58ccd612020-08-05 22:44:17 +053038void mmr_unlock(phys_addr_t base, u32 partition);
Lokesh Vutla01dbe362020-08-05 22:44:23 +053039bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);
Andrew Davisd1c07952022-07-15 11:34:32 -050040enum k3_device_type get_device_type(void);
Tero Kristo547b2772021-06-11 11:45:19 +030041void ti_secure_image_post_process(void **p_image, size_t *p_size);
Andrew Davise25fe5b2023-04-06 11:38:17 -050042struct ti_sci_handle *get_ti_sci_handle(void);
43void do_board_detect(void);
Manorit Chawdhrybd6a2472023-05-18 12:44:17 +053044void ti_secure_image_check_binary(void **p_image, size_t *p_size);