xref: /openbmc/u-boot/board/esd/vme8349/caddy.h (revision 2290fe06)
1 /*
2  * caddy.c -- esd VME8349 support for "missing" access modes in TSI148.
3  * Copyright (c) 2009 esd gmbh.
4  *
5  * Reinhard Arlt <reinhard.arlt@esd-electronics.com>
6  *
7  * SPDX-License-Identifier:	GPL-2.0+
8  */
9 
10 #ifndef __CADDY_H__
11 #define __CADDY_H__
12 
13 #define CMD_SIZE	1024
14 #define ANSWER_SIZE	1024
15 #define CADDY_MAGIC	"esd vme8349 V1.0"
16 
17 enum caddy_cmds {
18 	CADDY_CMD_IO_READ_8,
19 	CADDY_CMD_IO_READ_16,
20 	CADDY_CMD_IO_READ_32,
21 	CADDY_CMD_IO_WRITE_8,
22 	CADDY_CMD_IO_WRITE_16,
23 	CADDY_CMD_IO_WRITE_32,
24 	CADDY_CMD_CONFIG_READ_8,
25 	CADDY_CMD_CONFIG_READ_16,
26 	CADDY_CMD_CONFIG_READ_32,
27 	CADDY_CMD_CONFIG_WRITE_8,
28 	CADDY_CMD_CONFIG_WRITE_16,
29 	CADDY_CMD_CONFIG_WRITE_32,
30 };
31 
32 struct caddy_cmd {
33 	uint32_t cmd;
34 	uint32_t issue;
35 	uint32_t addr;
36 	uint32_t par[5];
37 };
38 
39 struct caddy_answer {
40 	uint32_t answer;
41 	uint32_t issue;
42 	uint32_t status;
43 	uint32_t par[5];
44 };
45 
46 struct caddy_interface {
47 	uint8_t  magic[16];
48 	uint32_t cmd_in;
49 	uint32_t cmd_out;
50 	uint32_t heartbeat;
51 	uint32_t reserved1;
52 	struct caddy_cmd cmd[CMD_SIZE];
53 	uint32_t answer_in;
54 	uint32_t answer_out;
55 	uint32_t reserved2;
56 	uint32_t reserved3;
57 	struct caddy_answer answer[CMD_SIZE];
58 };
59 
60 #endif /* of __CADDY_H__ */
61