Root/atrf/fw/include/atspi/ep0.h

Source at commit c2dd23840ce5875deca09673fcb8abb8dc3a8e7a created 9 years 1 month ago.
By Werner Almesberger, Moved fw/ and tools/ into atrf/ as well.
1/*
2 * include/atspi/ep0.h - EP0 extension protocol
3 *
4 * Written 2008-2010 by Werner Almesberger
5 * Copyright 2008-2010 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13
14#ifndef EP0_H
15#define EP0_H
16
17/*
18 * Direction bRequest wValue wIndex wLength
19 *
20 * ->host ATSPI_ID - - 3
21 * ->host ATSPI_BUILD - - #bytes
22 * host-> ATSPI_RESET - - 0
23 *
24 * host-> ATSPI_RF_RESET - -
25 *
26 * host-> ATSPI_REG_WRITE value addr 0
27 * ->host ATSPI_REG_READ - addr 1
28 * host-> ATSPI_BUF_WRITE - - #bytes
29 * ->host ATSPI_BUF_READ - - #bytes
30 * host-> ATSPI_SRAM_WRITE - addr #bytes
31 * ->host ATSPI_SRAM_READ - addr #bytes
32 */
33
34/*
35 * EP0 protocol:
36 *
37 * 0.0 initial release
38 */
39
40#define EP0ATSPI_MAJOR 0 /* EP0 protocol, major revision */
41#define EP0ATSPI_MINOR 0 /* EP0 protocol, minor revision */
42
43#define HW_TYPE_100813 0 /* 100813 */
44
45
46/*
47 * bmRequestType:
48 *
49 * D7 D6..5 D4...0
50 * | | |
51 * direction (0 = host->dev)
52 * type (2 = vendor)
53 * recipient (0 = device)
54 */
55
56
57#define ATSPI_TO_DEV(req) (0x40 | (req) << 8)
58#define ATSPI_FROM_DEV(req) (0xc0 | (req) << 8)
59
60
61enum atspi_requests {
62    ATSPI_ID = 0x00,
63    ATSPI_BUILD,
64    ATSPI_RESET,
65    ATSPI_RF_RESET = 0x10,
66    ATSPI_REG_WRITE = 0x20,
67    ATSPI_REG_READ,
68    ATSPI_BUF_WRITE,
69    ATSPI_BUF_READ,
70    ATSPI_SRAM_WRITE,
71    ATSPI_SRAM_READ,
72};
73
74
75void ep0_init(void);
76
77#endif /* !EP0_H */
78

Archive Download this file



interactive