summaryrefslogtreecommitdiffstats
path: root/include/hw/usb/imx-usb-phy.h
blob: f7f92fc4621b81c89611f1f794c6f34dee62222e (plain) (blame)
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
#ifndef IMX_USB_PHY_H
#define IMX_USB_PHY_H

#include "hw/sysbus.h"
#include "qemu/bitops.h"
#include "qom/object.h"

enum IMXUsbPhyRegisters {
    USBPHY_PWD,
    USBPHY_PWD_SET,
    USBPHY_PWD_CLR,
    USBPHY_PWD_TOG,
    USBPHY_TX,
    USBPHY_TX_SET,
    USBPHY_TX_CLR,
    USBPHY_TX_TOG,
    USBPHY_RX,
    USBPHY_RX_SET,
    USBPHY_RX_CLR,
    USBPHY_RX_TOG,
    USBPHY_CTRL,
    USBPHY_CTRL_SET,
    USBPHY_CTRL_CLR,
    USBPHY_CTRL_TOG,
    USBPHY_STATUS,
    USBPHY_DEBUG = 0x14,
    USBPHY_DEBUG_SET,
    USBPHY_DEBUG_CLR,
    USBPHY_DEBUG_TOG,
    USBPHY_DEBUG0_STATUS,
    USBPHY_DEBUG1 = 0x1c,
    USBPHY_DEBUG1_SET,
    USBPHY_DEBUG1_CLR,
    USBPHY_DEBUG1_TOG,
    USBPHY_VERSION,
    USBPHY_MAX
};

#define USBPHY_CTRL_SFTRST BIT(31)

#define TYPE_IMX_USBPHY "imx.usbphy"
typedef struct IMXUSBPHYState IMXUSBPHYState;
DECLARE_INSTANCE_CHECKER(IMXUSBPHYState, IMX_USBPHY,
                         TYPE_IMX_USBPHY)

struct IMXUSBPHYState {
    /* <private> */
    SysBusDevice parent_obj;

    /* <public> */
    MemoryRegion iomem;

    uint32_t usbphy[USBPHY_MAX];
};

#endif /* IMX_USB_PHY_H */