Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
36a8eb4e
Commit
36a8eb4e
authored
Apr 14, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
writel/readl work now
parent
8511552a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
elphel393-init.c
src/drivers/elphel/elphel393-init.c
+21
-8
No files found.
src/drivers/elphel/elphel393-init.c
View file @
36a8eb4e
...
@@ -412,18 +412,31 @@ static int get_factory_info(void){
...
@@ -412,18 +412,31 @@ static int get_factory_info(void){
static
int
setup_mio_pin_and_reset_usb
(
void
){
static
int
setup_mio_pin_and_reset_usb
(
void
){
u32
reg_value
;
u32
reg_value
;
void
__iomem
*
emio_ptr
=
ioremap
(
0xe000a000
,
0x00000300
);
if
(
!
emio_ptr
)
{
pr_err
(
"Failed to get a pointer to the EMIO registers"
);
return
-
1
;
}
const
u32
newvalue
=
0x1
<<
17
;
const
u32
newvalue
=
0x1
<<
17
;
reg_value
=
readl
(
0xe000a244
);
reg_value
=
readl
(
emio_ptr
+
0x244
);
writel
(
reg_value
|
newvalue
,
0xe000a244
);
pr_debug
(
"read DIR reg: 0x%08x
\n
"
,
reg_value
);
writel
(
reg_value
|
newvalue
,
emio_ptr
+
0x244
);
udelay
(
10
);
udelay
(
10
);
reg_value
=
readl
(
0xe000a248
);
reg_value
=
readl
(
emio_ptr
+
0x248
);
writel
(
reg_value
|
newvalue
,
0xe000a248
);
pr_debug
(
"read EN reg: 0x%08x
\n
"
,
reg_value
);
writel
(
reg_value
|
newvalue
,
emio_ptr
+
0x248
);
udelay
(
10
);
udelay
(
10
);
reg_value
=
readl
(
0xe000a044
);
reg_value
=
readl
(
emio_ptr
+
0x44
);
writel
(
reg_value
&
(
~
newvalue
),
0xe000a044
);
pr_debug
(
"read OUT reg: 0x%08x
\n
"
,
reg_value
);
writel
(
reg_value
&
(
~
newvalue
),
emio_ptr
+
0x44
);
udelay
(
10
);
udelay
(
10
);
writel
(
reg_value
|
newvalue
,
0xe000a044
);
writel
(
reg_value
|
newvalue
,
emio_ptr
+
0x44
);
reg_value
=
readl
(
0xe000a064
);
reg_value
=
readl
(
emio_ptr
+
0x64
);
pr_debug
(
"read IN reg (correct value: 0x00020000): 0x%08x
\n
"
,
reg_value
);
iounmap
(
emio_ptr
);
return
0
;
return
0
;
}
}
...
...
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