2 * arch/ubicom32/mach-common/usb_tio.h
3 * Definitions for usb_tio.c
5 * (C) Copyright 2009, Ubicom, Inc.
7 * This file is part of the Ubicom32 Linux Kernel Port.
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
23 * Ubicom32 implementation derived from (with many thanks):
29 #include <linux/version.h>
30 #include <linux/kernel.h>
31 #include <linux/types.h>
32 #include <linux/errno.h>
33 #include <linux/err.h>
34 #include <asm/devtree.h>
35 #include <asm/ip5000.h>
42 #define USB_TIO_REQUEST_MAGIC1 0x2307
43 #define USB_TIO_REQUEST_MAGIC2 0x0789
44 #if defined(USB_TIO_DEBUG)
45 #define USB_TIO_REQUEST_VERIFY_MAGIC(req) usb_tio_request_verify_magic(req)
46 #define USB_TIO_REQUEST_SET_MAGIC(req) usb_tio_request_set_magic(req)
47 #define USB_TIO_REQUEST_CLEAR_MAGIC(req) usb_tio_request_clear_magic(req)
49 #define USB_TIO_REQUEST_VERIFY_MAGIC(req)
50 #define USB_TIO_REQUEST_SET_MAGIC(req) usb_tio_request_set_magic(req)
51 #define USB_TIO_REQUEST_CLEAR_MAGIC(req)
63 USB_TIO_READ_FIFO_SYNC
,
65 USB_TIO_WRITE16_ASYNC
,
67 USB_TIO_WRITE_FIFO_ASYNC
,
71 USB_TIO_WRITE_FIFO_SYNC
,
80 struct usb_tio_request
{
81 volatile u32_t address
;
84 volatile u32_t buffer
;
87 const volatile u16_t status
;
88 volatile u32_t transfer_length
;
89 volatile u32_t thread_mask
;
94 struct devtree_node dn
;
95 volatile struct usb_tio_request
* volatile pdesc
;
96 struct usb_tio_request request
;
97 volatile u32_t usb_vp_config
;
98 volatile u32_t usb_vp_control
;
99 const volatile u32_t usb_vp_status
;
100 volatile u16_t usb_vp_hw_int_tx
;
101 volatile u16_t usb_vp_hw_int_rx
;
102 volatile u8_t usb_vp_hw_int_usb
;
103 volatile u8_t usb_vp_hw_int_mask_usb
;
104 volatile u16_t usb_vp_hw_int_mask_tx
;
105 volatile u16_t usb_vp_hw_int_mask_rx
;
109 extern struct usbtio_node
*usb_node
;
110 extern void ubi32_usb_init(void);