File: xlnx-cfi-if.h

package info (click to toggle)
qemu 1%3A10.0.3%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 413,680 kB
  • sloc: ansic: 4,733,433; pascal: 114,769; python: 105,506; asm: 68,431; sh: 52,881; makefile: 27,469; perl: 18,778; cpp: 11,435; xml: 3,404; objc: 2,877; yacc: 2,505; php: 1,299; tcl: 1,296; lex: 1,110; sql: 71; awk: 43; sed: 35; javascript: 7
file content (58 lines) | stat: -rw-r--r-- 1,313 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Xilinx CFI interface
 *
 * Copyright (C) 2023, Advanced Micro Devices, Inc.
 *
 * Written by Francisco Iglesias <francisco.iglesias@amd.com>
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */
#ifndef XLNX_CFI_IF_H
#define XLNX_CFI_IF_H 1

#include "qemu/help-texts.h"
#include "qom/object.h"

#define TYPE_XLNX_CFI_IF "xlnx-cfi-if"
typedef struct XlnxCfiIfClass XlnxCfiIfClass;
DECLARE_CLASS_CHECKERS(XlnxCfiIfClass, XLNX_CFI_IF, TYPE_XLNX_CFI_IF)

#define XLNX_CFI_IF(obj) \
     INTERFACE_CHECK(XlnxCfiIf, (obj), TYPE_XLNX_CFI_IF)

typedef enum {
    PACKET_TYPE_CFU = 0x52,
    PACKET_TYPE_CFRAME = 0xA1,
} xlnx_cfi_packet_type;

typedef enum {
    CFRAME_FAR = 1,
    CFRAME_SFR = 2,
    CFRAME_FDRI = 4,
    CFRAME_CMD = 6,
} xlnx_cfi_reg_addr;

typedef struct XlnxCfiPacket {
    uint8_t reg_addr;
    uint32_t data[4];
} XlnxCfiPacket;

typedef struct XlnxCfiIf {
    Object Parent;
} XlnxCfiIf;

typedef struct XlnxCfiIfClass {
    InterfaceClass parent;

    void (*cfi_transfer_packet)(XlnxCfiIf *cfi_if, XlnxCfiPacket *pkt);
} XlnxCfiIfClass;

/**
 * Transfer a XlnxCfiPacket.
 *
 * @cfi_if: the object implementing this interface
 * @XlnxCfiPacket: a pointer to the XlnxCfiPacket to transfer
 */
void xlnx_cfi_transfer_packet(XlnxCfiIf *cfi_if, XlnxCfiPacket *pkt);

#endif /* XLNX_CFI_IF_H */