ulpireg.h revision 1.1 1 1.1 bsh /* $NetBSD: ulpireg.h,v 1.1 2010/11/27 13:41:49 bsh Exp $ */
2 1.1 bsh /*
3 1.1 bsh * Copyright (c) 2009, 2010 Genetec Corporation. All rights reserved.
4 1.1 bsh * Written by Hashimoto Kenichi for Genetec Corporation.
5 1.1 bsh *
6 1.1 bsh * Redistribution and use in source and binary forms, with or without
7 1.1 bsh * modification, are permitted provided that the following conditions
8 1.1 bsh * are met:
9 1.1 bsh * 1. Redistributions of source code must retain the above copyright
10 1.1 bsh * notice, this list of conditions and the following disclaimer.
11 1.1 bsh * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 bsh * notice, this list of conditions and the following disclaimer in the
13 1.1 bsh * documentation and/or other materials provided with the distribution.
14 1.1 bsh *
15 1.1 bsh * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
16 1.1 bsh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 1.1 bsh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 1.1 bsh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
19 1.1 bsh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 1.1 bsh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 1.1 bsh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 1.1 bsh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 1.1 bsh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 1.1 bsh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 1.1 bsh * POSSIBILITY OF SUCH DAMAGE.
26 1.1 bsh */
27 1.1 bsh #ifndef _DEV_USB_ULPI_ULPIREG_H
28 1.1 bsh #define _DEV_USB_ULPI_ULPIREG_H
29 1.1 bsh
30 1.1 bsh /* commands */
31 1.1 bsh #define ULPI_CMD_SPECIAL (0x0 << 6)
32 1.1 bsh #define ULPI_CMD_NOOP (ULPI_CMD_SPECIAL | 0x00)
33 1.1 bsh #define ULPI_CMD_TRANSMIT (0x1 << 6)
34 1.1 bsh #define ULPI_CMD_PID(n) (ULPI_CMD_TRANSMIT | (n))
35 1.1 bsh #define ULPI_CMD_REGWRITE (0x2 << 6)
36 1.1 bsh #define ULPI_CMD_EXTW (ULPI_CMD_REGWRITE | 0x2f)
37 1.1 bsh #define ULPI_CMD_REGREAD (0x3 << 6)
38 1.1 bsh #define ULPI_CMD_EXTR (ULPI_CMD_REGREAD | 0x2f)
39 1.1 bsh
40 1.1 bsh /* registers */
41 1.1 bsh #define ULPI_VENDOR_ID_LOW 0x00
42 1.1 bsh #define ULPI_VENDOR_ID_HIGH 0x01
43 1.1 bsh #define ULPI_PRODUCT_ID_LOW 0x02
44 1.1 bsh #define ULPI_PRODUCT_ID_HIGH 0x03
45 1.1 bsh #define ULPI_FUNCTION_CONTROL 0x04
46 1.1 bsh #define FUNCTION_CONTROL_XCVRSELECT __BITS(0,1)
47 1.1 bsh #define XCVRSELECT_HS 0x0
48 1.1 bsh #define XCVRSELECT_FS 0x1
49 1.1 bsh #define XCVRSELECT_LS 0x2
50 1.1 bsh #define XCVRSELECT_FSLS 0x3 /* FS Xceiver for LS packets */
51 1.1 bsh #define FUNCTION_CONTROL_TERMSELECT __BIT(2)
52 1.1 bsh #define FUNCTION_CONTROL_OPMODE __BITS(3,4)
53 1.1 bsh #define FUNCTION_CONTROL_RESET __BIT(5)
54 1.1 bsh #define FUNCTION_CONTROL_SUSPENDM __BIT(6)
55 1.1 bsh #define ULPI_INTERFACE_CONTROL 0x07
56 1.1 bsh #define ULPI_OTG_CONTROL 0x0a
57 1.1 bsh #define OTG_CONTROL_IDPULLUP __BIT(0) /* ID pull up */
58 1.1 bsh #define OTG_CONTROL_DPPULLDOWN __BIT(1) /* D+ pull down */
59 1.1 bsh #define OTG_CONTROL_DMPULLDOWN __BIT(2) /* D- pull down */
60 1.1 bsh #define OTG_CONTROL_DISCHRGVBUS __BIT(3) /* discharge Vbus */
61 1.1 bsh #define OTG_CONTROL_CHRGVBUS __BIT(4) /* charge Vbus */
62 1.1 bsh #define OTG_CONTROL_DRVVBUS __BIT(5) /* drive 5V on Vbus */
63 1.1 bsh #define OTG_CONTROL_DRVVBUSEXT __BIT(6) /* drive Vbus external */
64 1.1 bsh #define OTG_CONTROL_USEEXTVBUSIND __BIT(7) /* use external Vbus over-current
65 1.1 bsh indecator */
66 1.1 bsh #define ULPI_USB_INT_RISING_EDGE 0x0d
67 1.1 bsh #define ULPI_USB_INT_FALLING_EDGE 0x10
68 1.1 bsh #define ULPI_USB_INT_STATUS 0x13
69 1.1 bsh #define ULPI_USB_INTERRUPT_LATCH 0x14
70 1.1 bsh #define ULPI_DEBUG 0x15
71 1.1 bsh #define ULPI_SCRATCH 0x16
72 1.1 bsh #define ULPI_CARKIT_CONTROL 0x19
73 1.1 bsh #define ULPI_CARKIT_INTERRUPT_DELAY 0x1c
74 1.1 bsh #define ULPI_CARKIT_INTERRUPT_ENABLE 0x1d
75 1.1 bsh #define ULPI_CARKIT_INTERRUPT_STATUS 0x20
76 1.1 bsh #define ULPI_CARKIT_INTERRUPT_LATCH 0x21
77 1.1 bsh #define ULPI_CARKIT_PULSE_CONTROL 0x22
78 1.1 bsh #define ULPI_TRANSMIT_POSITIVE_WIDTH 0x25
79 1.1 bsh #define ULPI_TRANSMIT_NEGATIVE_WIDTH 0x26
80 1.1 bsh #define ULPI_RECEIVE_POLARITY_RECOVERY 0x27
81 1.1 bsh
82 1.1 bsh #define ULPI_VENDOR_SPECIFIC 0x30
83 1.1 bsh
84 1.1 bsh #define ULPI_REG_WRITE 0
85 1.1 bsh #define ULPI_REG_SET 1
86 1.1 bsh #define ULPI_REG_CLEAR 2
87 1.1 bsh
88 1.1 bsh #endif /* _DEV_USB_ULPI_ULPIREG_H */
89