Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linux
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martyn Welch
linux
Commits
37da5b87
Commit
37da5b87
authored
11 years ago
by
Ben Skeggs
Browse files
Options
Downloads
Patches
Plain Diff
drm/nouveau/i2c/anx9805: add debugging to aux transactions
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
9efc583e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/gpu/drm/nouveau/core/subdev/i2c/anx9805.c
+19
-5
19 additions, 5 deletions
drivers/gpu/drm/nouveau/core/subdev/i2c/anx9805.c
drivers/gpu/drm/nouveau/core/subdev/i2c/port.h
+15
-0
15 additions, 0 deletions
drivers/gpu/drm/nouveau/core/subdev/i2c/port.h
with
34 additions
and
5 deletions
drivers/gpu/drm/nouveau/core/subdev/i2c/anx9805.c
+
19
−
5
View file @
37da5b87
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
* Authors: Ben Skeggs <bskeggs@redhat.com>
* Authors: Ben Skeggs <bskeggs@redhat.com>
*/
*/
#include
"p
riv
.h"
#include
"p
ort
.h"
struct
anx9805_i2c_port
{
struct
anx9805_i2c_port
{
struct
nouveau_i2c_port
base
;
struct
nouveau_i2c_port
base
;
...
@@ -37,6 +37,8 @@ anx9805_train(struct nouveau_i2c_port *port, int link_nr, int link_bw, bool enh)
...
@@ -37,6 +37,8 @@ anx9805_train(struct nouveau_i2c_port *port, int link_nr, int link_bw, bool enh)
struct
nouveau_i2c_port
*
mast
=
(
void
*
)
nv_object
(
chan
)
->
parent
;
struct
nouveau_i2c_port
*
mast
=
(
void
*
)
nv_object
(
chan
)
->
parent
;
u8
tmp
,
i
;
u8
tmp
,
i
;
DBG
(
"ANX9805 train %d 0x%02x %d
\n
"
,
link_nr
,
link_bw
,
enh
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xa0
,
link_bw
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xa0
,
link_bw
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xa1
,
link_nr
|
(
enh
?
0x80
:
0x00
));
nv_wri2cr
(
mast
,
chan
->
addr
,
0xa1
,
link_nr
|
(
enh
?
0x80
:
0x00
));
nv_wri2cr
(
mast
,
chan
->
addr
,
0xa2
,
0x01
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xa2
,
0x01
);
...
@@ -66,16 +68,23 @@ anx9805_aux(struct nouveau_i2c_port *port, bool retry,
...
@@ -66,16 +68,23 @@ anx9805_aux(struct nouveau_i2c_port *port, bool retry,
struct
anx9805_i2c_port
*
chan
=
(
void
*
)
port
;
struct
anx9805_i2c_port
*
chan
=
(
void
*
)
port
;
struct
nouveau_i2c_port
*
mast
=
(
void
*
)
nv_object
(
chan
)
->
parent
;
struct
nouveau_i2c_port
*
mast
=
(
void
*
)
nv_object
(
chan
)
->
parent
;
int
i
,
ret
=
-
ETIMEDOUT
;
int
i
,
ret
=
-
ETIMEDOUT
;
u8
buf
[
16
]
=
{};
u8
tmp
;
u8
tmp
;
DBG
(
"%02x %05x %d
\n
"
,
type
,
addr
,
size
);
tmp
=
nv_rdi2cr
(
mast
,
chan
->
ctrl
,
0x07
)
&
~
0x04
;
tmp
=
nv_rdi2cr
(
mast
,
chan
->
ctrl
,
0x07
)
&
~
0x04
;
nv_wri2cr
(
mast
,
chan
->
ctrl
,
0x07
,
tmp
|
0x04
);
nv_wri2cr
(
mast
,
chan
->
ctrl
,
0x07
,
tmp
|
0x04
);
nv_wri2cr
(
mast
,
chan
->
ctrl
,
0x07
,
tmp
);
nv_wri2cr
(
mast
,
chan
->
ctrl
,
0x07
,
tmp
);
nv_wri2cr
(
mast
,
chan
->
ctrl
,
0xf7
,
0x01
);
nv_wri2cr
(
mast
,
chan
->
ctrl
,
0xf7
,
0x01
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xe4
,
0x80
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xe4
,
0x80
);
for
(
i
=
0
;
!
(
type
&
1
)
&&
i
<
size
;
i
++
)
if
(
!
(
type
&
1
))
{
nv_wri2cr
(
mast
,
chan
->
addr
,
0xf0
+
i
,
data
[
i
]);
memcpy
(
buf
,
data
,
size
);
DBG
(
"%16ph"
,
buf
);
for
(
i
=
0
;
i
<
size
;
i
++
)
nv_wri2cr
(
mast
,
chan
->
addr
,
0xf0
+
i
,
buf
[
i
]);
}
nv_wri2cr
(
mast
,
chan
->
addr
,
0xe5
,
((
size
-
1
)
<<
4
)
|
type
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xe5
,
((
size
-
1
)
<<
4
)
|
type
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xe6
,
(
addr
&
0x000ff
)
>>
0
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xe6
,
(
addr
&
0x000ff
)
>>
0
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xe7
,
(
addr
&
0x0ff00
)
>>
8
);
nv_wri2cr
(
mast
,
chan
->
addr
,
0xe7
,
(
addr
&
0x0ff00
)
>>
8
);
...
@@ -94,8 +103,13 @@ anx9805_aux(struct nouveau_i2c_port *port, bool retry,
...
@@ -94,8 +103,13 @@ anx9805_aux(struct nouveau_i2c_port *port, bool retry,
goto
done
;
goto
done
;
}
}
for
(
i
=
0
;
(
type
&
1
)
&&
i
<
size
;
i
++
)
if
(
type
&
1
)
{
data
[
i
]
=
nv_rdi2cr
(
mast
,
chan
->
addr
,
0xf0
+
i
);
for
(
i
=
0
;
i
<
size
;
i
++
)
buf
[
i
]
=
nv_rdi2cr
(
mast
,
chan
->
addr
,
0xf0
+
i
);
DBG
(
"%16ph"
,
buf
);
memcpy
(
data
,
buf
,
size
);
}
ret
=
0
;
ret
=
0
;
done:
done:
nv_wri2cr
(
mast
,
chan
->
ctrl
,
0xf7
,
0x01
);
nv_wri2cr
(
mast
,
chan
->
ctrl
,
0xf7
,
0x01
);
...
...
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/core/subdev/i2c/port.h
0 → 100644
+
15
−
0
View file @
37da5b87
#ifndef __NVKM_I2C_PORT_H__
#define __NVKM_I2C_PORT_H__
#include
"priv.h"
#ifndef MSG
#define MSG(l,f,a...) do { \
struct nouveau_i2c_port *_port = (void *)port; \
nv_##l(nv_object(_port)->engine, "PORT:%02x: "f, _port->index, ##a); \
} while(0)
#define DBG(f,a...) MSG(debug, f, ##a)
#define ERR(f,a...) MSG(error, f, ##a)
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment