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