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
6ea28cb0
Commit
6ea28cb0
authored
Nov 26, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Plain Diff
merged with master
parents
ab3b8962
5abbb5ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
ahci_elphel.c
src/drivers/ata/ahci_elphel.c
+18
-13
No files found.
src/drivers/ata/ahci_elphel.c
View file @
6ea28cb0
...
@@ -96,19 +96,28 @@ static int bitstream_loaded(u32 *ptr)
...
@@ -96,19 +96,28 @@ static int bitstream_loaded(u32 *ptr)
return
0
;
return
0
;
}
}
static
int
elphel_check
_load
(
struct
device
*
dev
)
static
void
elphel_defer
_load
(
struct
device
*
dev
)
{
{
int
ret
=
0
;
bool
check_flag
=
true
;
u32
*
ctrl_ptr
=
ioremap_nocache
(
BITSTREAM_CTRL_ADDR
,
4
);
u32
*
ctrl_ptr
=
ioremap_nocache
(
BITSTREAM_CTRL_ADDR
,
4
);
if
(
!
bitstream_loaded
(
ctrl_ptr
))
{
dev_info
(
dev
,
"AHCI driver loading is deferred. Load bitstream and write 1 into "
ret
=
-
1
;
"/sys/devices/soc0/amba@0/80000000.elphel-ahci/load_module to continue
\n
"
);
while
(
check_flag
)
{
if
(
load_driver
)
{
if
(
bitstream_loaded
(
ctrl_ptr
))
{
check_flag
=
false
;
}
else
{
dev_err
(
dev
,
"FPGA bitstream is not loaded or bitstream "
dev_err
(
dev
,
"FPGA bitstream is not loaded or bitstream "
"does not contain AHCI controller. Remove driver, load bitstream and try again
\n
"
);
"does not contain AHCI controller
\n
"
);
load_driver
=
false
;
}
}
else
{
msleep
(
1000
);
}
}
}
load_driver
=
false
;
iounmap
(
ctrl_ptr
);
iounmap
(
ctrl_ptr
);
return
ret
;
}
}
/** Calculate the difference between two time stamps and return it in microseconds */
/** Calculate the difference between two time stamps and return it in microseconds */
...
@@ -308,16 +317,12 @@ static int elphel_drv_probe(struct platform_device *pdev)
...
@@ -308,16 +317,12 @@ static int elphel_drv_probe(struct platform_device *pdev)
const
struct
of_device_id
*
match
;
const
struct
of_device_id
*
match
;
struct
ata_host
*
host
;
struct
ata_host
*
host
;
ret
=
elphel_check_load
(
dev
);
if
(
ret
<
0
)
{
return
ret
;
}
if
(
&
dev
->
kobj
)
{
if
(
&
dev
->
kobj
)
{
ret
=
sysfs_create_group
(
&
dev
->
kobj
,
&
dev_attr_root_group
);
ret
=
sysfs_create_group
(
&
dev
->
kobj
,
&
dev_attr_root_group
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
}
}
elphel_defer_load
(
dev
);
dev_info
(
&
pdev
->
dev
,
"probing Elphel AHCI driver"
);
dev_info
(
&
pdev
->
dev
,
"probing Elphel AHCI driver"
);
...
...
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