Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DEL 1ns 4cha - Software
Commits
01a8765d
Commit
01a8765d
authored
Apr 22, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP watch SPI registers
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
ac61b222
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
pll.c
kernel/pll.c
+7
-0
No files found.
kernel/pll.c
View file @
01a8765d
...
@@ -56,19 +56,26 @@ int fd_pll_init(struct fd_dev *fd)
...
@@ -56,19 +56,26 @@ int fd_pll_init(struct fd_dev *fd)
/* Write the magic config */
/* Write the magic config */
for
(
i
=
0
,
r
=
__9516_regs
;
i
<
ARRAY_SIZE
(
__9516_regs
);
i
++
,
r
++
)
{
for
(
i
=
0
,
r
=
__9516_regs
;
i
<
ARRAY_SIZE
(
__9516_regs
);
i
++
,
r
++
)
{
i
=
pll_readl
(
fd
,
0x1f
);
// printk("0x%x Write PLL reg: reg %x val %x\n", i, r->val, r->reg);
if
(
pll_writel
(
fd
,
r
->
val
,
r
->
reg
)
<
0
)
{
if
(
pll_writel
(
fd
,
r
->
val
,
r
->
reg
)
<
0
)
{
dev_err
(
dev
,
"Error in configuring PLL (step %i)
\n
"
,
i
);
dev_err
(
dev
,
"Error in configuring PLL (step %i)
\n
"
,
i
);
return
-
EIO
;
return
-
EIO
;
}
}
}
}
// i = pll_readl(fd, 0x003);
// printk("Before commit regs: ID %x\n", i);
if
(
pll_writel
(
fd
,
0x01
,
0x232
)
<
0
)
if
(
pll_writel
(
fd
,
0x01
,
0x232
)
<
0
)
goto
out
;
goto
out
;
i
=
pll_readl
(
fd
,
0x003
);
printk
(
"After commit regs: ID %x
\n
"
,
i
);
/* Wait for it to lock */
/* Wait for it to lock */
j
=
jiffies
+
HZ
/
2
;
j
=
jiffies
+
HZ
/
2
;
while
(
jiffies
<
j
)
{
while
(
jiffies
<
j
)
{
i
=
pll_readl
(
fd
,
0x1f
);
i
=
pll_readl
(
fd
,
0x1f
);
pr_info
(
"0x%x"
,
i
);
if
(
i
<
0
)
if
(
i
<
0
)
return
-
EIO
;
return
-
EIO
;
if
(
i
&
1
)
if
(
i
&
1
)
...
...
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