blob: 385c8825f2f6e735c86fedf0658d94ae86553a8b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Michal Simek04b7e622015-01-15 10:01:51 +01002/*
3 * (C) Copyright 2014 - 2015 Xilinx, Inc.
4 * Michal Simek <michal.simek@xilinx.com>
Michal Simek04b7e622015-01-15 10:01:51 +01005 */
6
7#ifndef _ASM_ARCH_SYS_PROTO_H
8#define _ASM_ARCH_SYS_PROTO_H
9
Siva Durga Prasad Paladugu0e39bd72017-02-02 01:10:46 +053010#define PAYLOAD_ARG_CNT 5
11
Siva Durga Prasad Paladugu9f0a8e92017-07-25 11:51:36 +053012#define ZYNQMP_CSU_SILICON_VER_MASK 0xF
Siva Durga Prasad Paladugub1acb652018-02-28 13:26:53 +053013#define ZYNQMP_SIP_SVC_PM_SECURE_IMG_LOAD 0xC200002D
14#define KEY_PTR_LEN 32
Siva Durga Prasad Paladugu9f0a8e92017-07-25 11:51:36 +053015
Siva Durga Prasad Paladugu6809e812018-05-31 15:10:23 +053016#define ZYNQMP_FPGA_BIT_AUTH_DDR 1
17#define ZYNQMP_FPGA_BIT_AUTH_OCM 2
18#define ZYNQMP_FPGA_BIT_ENC_USR_KEY 3
19#define ZYNQMP_FPGA_BIT_ENC_DEV_KEY 4
Siva Durga Prasad Paladugu91c315d2018-03-01 17:44:47 +053020#define ZYNQMP_FPGA_BIT_NS 5
21
Siva Durga Prasad Paladugu6809e812018-05-31 15:10:23 +053022#define ZYNQMP_FPGA_AUTH_DDR 1
23
Siva Durga Prasad Paladugu5d9f8ec2018-08-21 15:44:48 +053024#define ZYNQMP_SIP_SVC_GET_API_VERSION 0xC2000001
25
26#define ZYNQMP_PM_VERSION_MAJOR 1
27#define ZYNQMP_PM_VERSION_MINOR 0
28#define ZYNQMP_PM_VERSION_MAJOR_SHIFT 16
29#define ZYNQMP_PM_VERSION_MINOR_MASK 0xFFFF
30
31#define ZYNQMP_PM_VERSION \
32 ((ZYNQMP_PM_VERSION_MAJOR << ZYNQMP_PM_VERSION_MAJOR_SHIFT) | \
33 ZYNQMP_PM_VERSION_MINOR)
34
Siva Durga Prasad Paladugu8406d472018-08-21 15:44:49 +053035#define ZYNQMP_PM_VERSION_INVALID ~0
36
Siva Durga Prasad Paladugu62fe3132018-08-21 15:44:50 +053037#define PMUFW_V1_0 ((1 << ZYNQMP_PM_VERSION_MAJOR_SHIFT) | 0)
38
Siva Durga Prasad Paladugu9f0a8e92017-07-25 11:51:36 +053039enum {
40 IDCODE,
41 VERSION,
Michal Simek50d8cef2017-08-22 14:58:53 +020042 IDCODE2,
Siva Durga Prasad Paladugu9f0a8e92017-07-25 11:51:36 +053043};
44
45enum {
46 ZYNQMP_SILICON_V1,
47 ZYNQMP_SILICON_V2,
48 ZYNQMP_SILICON_V3,
49 ZYNQMP_SILICON_V4,
50};
51
Siva Durga Prasad Paladugu5e2a9072017-07-13 19:01:09 +053052enum {
53 TCM_LOCK,
54 TCM_SPLIT,
55};
56
Michal Simek44dd5202017-07-31 10:37:09 +020057int zynq_board_read_rom_ethaddr(unsigned char *ethaddr);
Michal Simek04b7e622015-01-15 10:01:51 +010058unsigned int zynqmp_get_silicon_version(void);
59
Michal Simek456e4542017-01-09 10:05:16 +010060void handoff_setup(void);
61
Siva Durga Prasad Paladugu8406d472018-08-21 15:44:49 +053062unsigned int zynqmp_pmufw_version(void);
Siva Durga Prasad Paladugu0e39bd72017-02-02 01:10:46 +053063int zynqmp_mmio_write(const u32 address, const u32 mask, const u32 value);
64int zynqmp_mmio_read(const u32 address, u32 *value);
65int invoke_smc(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3,
66 u32 *ret_payload);
67
Siva Durga Prasad Paladugu5e2a9072017-07-13 19:01:09 +053068void initialize_tcm(bool mode);
Nitin Jain9bcc76f2018-04-20 12:30:40 +053069void mem_map_fill(void);
Siva Durga Prasad Paladugucd35d522017-07-25 11:51:38 +053070int chip_id(unsigned char id);
Siva Durga Prasad Paladugu48eaa0c2018-10-05 15:09:05 +053071#if defined(CONFIG_SYS_MEM_RSVD_FOR_MMU) || defined(CONFIG_DEFINE_TCM_OCM_MMAP)
72void tcm_init(u8 mode);
73#endif
Siva Durga Prasad Paladugucd35d522017-07-25 11:51:38 +053074
Michal Simek04b7e622015-01-15 10:01:51 +010075#endif /* _ASM_ARCH_SYS_PROTO_H */