Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
f4d3faac
Commit
f4d3faac
authored
Sep 04, 2006
by
David Brownell
Committed by
Tony Lindgren
Sep 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MUSB: tusb updates 1/2 -- host side test support
Preliminary high speed electrical test support for the host side.
parent
b6c43e7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
29 deletions
+67
-29
drivers/usb/musb/g_ep0.c
drivers/usb/musb/g_ep0.c
+2
-28
drivers/usb/musb/musbdefs.h
drivers/usb/musb/musbdefs.h
+2
-0
drivers/usb/musb/plat_uds.c
drivers/usb/musb/plat_uds.c
+31
-0
drivers/usb/musb/virthub.c
drivers/usb/musb/virthub.c
+32
-1
No files found.
drivers/usb/musb/g_ep0.c
View file @
f4d3faac
...
...
@@ -200,27 +200,6 @@ static void musb_g_ep0_giveback(struct musb *pThis, struct usb_request *req)
musb_g_giveback
(
&
pThis
->
aLocalEnd
[
0
].
ep_in
,
req
,
0
);
}
/* for high speed test mode; see USB 2.0 spec 7.1.20 */
static
const
u8
musb_test_packet
[
53
]
=
{
/* implicit SYNC then DATA0 to start */
/* JKJKJKJK x9 */
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
/* JJKKJJKK x8 */
0xaa
,
0xaa
,
0xaa
,
0xaa
,
0xaa
,
0xaa
,
0xaa
,
0xaa
,
/* JJJJKKKK x8 */
0xee
,
0xee
,
0xee
,
0xee
,
0xee
,
0xee
,
0xee
,
0xee
,
/* JJJJJJJKKKKKKK x8 */
0xfe
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
/* JJJJJJJK x8 */
0x7f
,
0xbf
,
0xdf
,
0xef
,
0xf7
,
0xfb
,
0xfd
,
/* JKKKKKKK x10, JK */
0xfc
,
0x7e
,
0xbf
,
0xdf
,
0xef
,
0xf7
,
0xfb
,
0xfd
,
0x7e
/* implicit CRC16 then EOP to end */
};
/*
* Handle all control requests with no DATA stage, including standard
* requests such as:
...
...
@@ -684,13 +663,8 @@ irqreturn_t musb_g_ep0_irq(struct musb *pThis)
else
if
(
pThis
->
bTestMode
)
{
DBG
(
1
,
"entering TESTMODE
\n
"
);
if
(
MGC_M_TEST_PACKET
==
pThis
->
bTestModeValue
)
{
musb_write_fifo
(
&
pThis
->
aLocalEnd
[
0
],
sizeof
(
musb_test_packet
),
musb_test_packet
);
}
musb_writew
(
regs
,
MGC_O_HDRC_CSR0
,
MGC_M_CSR0_TXPKTRDY
);
if
(
MGC_M_TEST_PACKET
==
pThis
->
bTestModeValue
)
musb_load_testpacket
(
pThis
);
musb_writeb
(
pBase
,
MGC_O_HDRC_TESTMODE
,
pThis
->
bTestModeValue
);
...
...
drivers/usb/musb/musbdefs.h
View file @
f4d3faac
...
...
@@ -525,6 +525,8 @@ extern void musb_write_fifo(struct musb_hw_ep *ep,
extern
void
musb_read_fifo
(
struct
musb_hw_ep
*
ep
,
u16
wCount
,
u8
*
pDest
);
extern
void
musb_load_testpacket
(
struct
musb
*
);
extern
irqreturn_t
musb_interrupt
(
struct
musb
*
);
extern
void
musb_platform_enable
(
struct
musb
*
musb
);
...
...
drivers/usb/musb/plat_uds.c
View file @
f4d3faac
...
...
@@ -318,6 +318,37 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 wCount, u8 *pDest)
#endif
/* normal PIO */
/*-------------------------------------------------------------------------*/
/* for high speed test mode; see USB 2.0 spec 7.1.20 */
static
const
u8
musb_test_packet
[
53
]
=
{
/* implicit SYNC then DATA0 to start */
/* JKJKJKJK x9 */
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
/* JJKKJJKK x8 */
0xaa
,
0xaa
,
0xaa
,
0xaa
,
0xaa
,
0xaa
,
0xaa
,
0xaa
,
/* JJJJKKKK x8 */
0xee
,
0xee
,
0xee
,
0xee
,
0xee
,
0xee
,
0xee
,
0xee
,
/* JJJJJJJKKKKKKK x8 */
0xfe
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
/* JJJJJJJK x8 */
0x7f
,
0xbf
,
0xdf
,
0xef
,
0xf7
,
0xfb
,
0xfd
,
/* JKKKKKKK x10, JK */
0xfc
,
0x7e
,
0xbf
,
0xdf
,
0xef
,
0xf7
,
0xfb
,
0xfd
,
0x7e
/* implicit CRC16 then EOP to end */
};
void
musb_load_testpacket
(
struct
musb
*
musb
)
{
MGC_SelectEnd
(
musb
->
pRegs
,
0
);
musb_write_fifo
(
musb
->
control_ep
,
sizeof
(
musb_test_packet
),
musb_test_packet
);
musb_writew
(
musb
->
pRegs
,
MGC_O_HDRC_CSR0
,
MGC_M_CSR0_TXPKTRDY
);
}
/*-------------------------------------------------------------------------*/
/*
...
...
drivers/usb/musb/virthub.c
View file @
f4d3faac
...
...
@@ -257,7 +257,7 @@ int musb_hub_control(
musb
->
port1_status
);
break
;
case
SetPortFeature
:
if
(
wIndex
!=
1
)
if
(
(
wIndex
&
0xff
)
!=
1
)
goto
error
;
switch
(
wValue
)
{
...
...
@@ -282,6 +282,37 @@ int musb_hub_control(
musb_port_suspend
(
musb
,
TRUE
);
break
;
case
USB_PORT_FEAT_TEST
:
wIndex
>>=
8
;
switch
(
wIndex
)
{
case
1
:
pr_debug
(
"TEST_J
\n
"
);
temp
=
MGC_M_TEST_J
;
break
;
case
2
:
pr_debug
(
"TEST_K
\n
"
);
temp
=
MGC_M_TEST_K
;
break
;
case
3
:
pr_debug
(
"TEST_SE0_NAK
\n
"
);
temp
=
MGC_M_TEST_SE0_NAK
;
break
;
case
4
:
pr_debug
(
"TEST_PACKET
\n
"
);
temp
=
MGC_M_TEST_PACKET
;
musb_load_testpacket
(
musb
);
break
;
case
5
:
pr_debug
(
"TEST_FORCE_ENABLE
\n
"
);
temp
=
MGC_M_TEST_FORCE_HOST
|
MGC_M_TEST_FORCE_HS
;
/* FIXME and enable a session too */
break
;
default:
goto
error
;
}
musb_writeb
(
musb
->
pRegs
,
MGC_O_HDRC_TESTMODE
,
temp
);
musb
->
port1_status
|=
USB_PORT_STAT_TEST
;
break
;
default:
goto
error
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment