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
0e75c07d
Commit
0e75c07d
authored
Oct 25, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Plain Diff
merged with master
parents
17de2ffe
f8137eab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
22 deletions
+51
-22
ahci_elphel.c
src/drivers/ata/ahci_elphel.c
+13
-18
exif393.c
src/drivers/elphel/exif393.c
+35
-3
param_depend.h
src/drivers/elphel/param_depend.h
+3
-1
No files found.
src/drivers/ata/ahci_elphel.c
View file @
0e75c07d
...
...
@@ -96,28 +96,19 @@ static int bitstream_loaded(u32 *ptr)
return
0
;
}
static
void
elphel_defer
_load
(
struct
device
*
dev
)
static
int
elphel_check
_load
(
struct
device
*
dev
)
{
bool
check_flag
=
true
;
int
ret
=
0
;
u32
*
ctrl_ptr
=
ioremap_nocache
(
BITSTREAM_CTRL_ADDR
,
4
);
dev_info
(
dev
,
"AHCI driver loading is deferred. Load bitstream and write 1 into "
"/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
{
if
(
!
bitstream_loaded
(
ctrl_ptr
))
{
ret
=
-
1
;
dev_err
(
dev
,
"FPGA bitstream is not loaded or bitstream "
"does not contain AHCI controller
\n
"
);
load_driver
=
false
;
}
}
else
{
msleep
(
1000
);
}
"does not contain AHCI controller. Remove driver, load bitstream and try again
\n
"
);
}
load_driver
=
false
;
iounmap
(
ctrl_ptr
);
return
ret
;
}
static
irqreturn_t
elphel_irq_handler
(
int
irq
,
void
*
dev_instance
)
...
...
@@ -274,12 +265,16 @@ static int elphel_drv_probe(struct platform_device *pdev)
const
struct
of_device_id
*
match
;
struct
ata_host
*
host
;
ret
=
elphel_check_load
(
dev
);
if
(
ret
<
0
)
{
return
ret
;
}
if
(
&
dev
->
kobj
)
{
ret
=
sysfs_create_group
(
&
dev
->
kobj
,
&
dev_attr_root_group
);
if
(
ret
<
0
)
return
ret
;
}
elphel_defer_load
(
dev
);
dev_info
(
&
pdev
->
dev
,
"probing Elphel AHCI driver"
);
...
...
src/drivers/elphel/exif393.c
View file @
0e75c07d
...
...
@@ -433,6 +433,27 @@ int store_meta(int sensor_port) { //called from IRQ service - put current metada
if
(
aexif_wp
[
sensor_port
]
>
MAX_EXIF_FRAMES
)
aexif_wp
[
sensor_port
]
=
1
;
return
meta_index
;
}
/**
* @brief Go through mapping table and invalidate all tags that will be updated
* @param curr_table current mapping table
* @param curr_num the number of entries in current table
* @param new_table new mapping table of just a part of it
* @param new_num the number of entries in new table
*/
static
void
tags_invalidate
(
struct
exif_dir_table_t
*
curr_table
,
int
curr_num
,
struct
exif_dir_table_t
*
new_table
,
int
new_num
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
curr_num
;
i
++
)
{
for
(
j
=
0
;
j
<
new_num
;
j
++
)
{
if
(
curr_table
[
i
].
ltag
==
new_table
[
j
].
ltag
)
{
memset
(
&
curr_table
[
i
],
0
,
sizeof
(
struct
exif_dir_table_t
));
}
}
}
}
//!++++++++++++++++++++++++++++++++++++ open() ++++++++++++++++++++++++++++++++++++++++++++++++++++++
...
...
@@ -600,7 +621,8 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
int
sensor_port
;
// int thissize=minor_file_size(p);
int
maxsize
=
minor_max_size
(
p
);
char
*
cp
;
int
fields_num
;
char
*
cp
,
*
new_table
;
char
tmp
[
MAX_EXIF_SIZE
];
//! Or is it possible to disable IRQ while copy_from_user()?
unsigned
long
flags
;
int
disabled_err
=
0
;
...
...
@@ -620,8 +642,19 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
case
DEV393_MINOR
(
DEV393_EXIF_METADIR
):
exif_invalidate
();
cp
=
(
char
*
)
&
dir_table
;
if
(
copy_from_user
(
&
cp
[
*
off
],
buf
,
count
))
return
-
EFAULT
;
new_table
=
kmalloc
(
MAX_EXIF_FIELDS
*
sizeof
(
struct
exif_dir_table_t
),
GFP_KERNEL
);
if
(
!
new_table
)
{
return
-
ENOMEM
;
}
if
(
copy_from_user
(
new_table
,
buf
,
count
))
{
kfree
(
new_table
);
return
-
EFAULT
;
}
fields_num
=
exif_fields
;
exif_fields
=
(
*
off
+
count
)
/
sizeof
(
struct
exif_dir_table_t
);
tags_invalidate
(
dir_table
,
fields_num
,
(
struct
exif_dir_table_t
*
)
new_table
,
exif_fields
);
memcpy
(
&
cp
[
*
off
],
new_table
,
count
);
kfree
(
new_table
);
break
;
case
DEV393_MINOR
(
DEV393_EXIF_TIME
):
//write date/time first, then - midnight seconds
cp
=
(
char
*
)
&
exif_time
;
...
...
@@ -733,7 +766,6 @@ ssize_t exif_read (struct file * file, char * buf, size_t count, loff_t *of
/* This code is copied from exif_read, consider replacing it with this function invocation */
size_t
exif_get_data
(
int
sensor_port
,
unsigned
short
meta_index
,
void
*
buff
,
size_t
buff_sz
)
{
size_t
ret
=
0
;
size_t
count
=
exif_template_size
;
loff_t
off
;
int
start_p
,
page_p
,
i
;
...
...
src/drivers/elphel/param_depend.h
View file @
0e75c07d
...
...
@@ -198,7 +198,9 @@ const unsigned long param_depend_tab[]=
ONCHANGE_MEMSENSOR
|
ONCHANGE_MEMCOMPRESSOR
|
ONCHANGE_COMPMODE
|
ONCHANGE_COMPSTOP
|
ONCHANGE_COMPRESTART
|
ONCHANGE_SENSORIN
,
P_BIN_VERT
,
ONCHANGE_WINDOW
|
ONCHANGE_EXPOSURE
|
ONCHANGE_HIST
|
ONCHANGE_AEXP
|
ONCHANGE_FOCUSMODE
|
ONCHANGE_LIMITFPS
|
ONCHANGE_HIST
|
\
ONCHANGE_MEMSENSOR
|
ONCHANGE_MEMCOMPRESSOR
|
ONCHANGE_COMPMODE
|
ONCHANGE_COMPSTOP
|
ONCHANGE_COMPRESTART
|
ONCHANGE_SENSORIN
,
P_COLOR
,
ONCHANGE_COMPMODE
|
ONCHANGE_LIMITFPS
|
ONCHANGE_MEMCOMPRESSOR
,
//Oleg 20161014: trying to restart the compressor: + ONCHANGE_COMPSTOP | ONCHANGE_COMPRESTART
P_COLOR
,
ONCHANGE_COMPMODE
|
ONCHANGE_LIMITFPS
|
ONCHANGE_MEMCOMPRESSOR
|
ONCHANGE_COMPSTOP
|
ONCHANGE_COMPRESTART
,
//P_COLOR, ONCHANGE_COMPMODE | ONCHANGE_LIMITFPS | ONCHANGE_MEMCOMPRESSOR,
// P_PF_HEIGHT, ONCHANGE_RECALCSEQ | ONCHANGE_SENSORIN | ONCHANGE_LIMITFPS | ONCHANGE_MEMSENSOR | ONCHANGE_MEMCOMPRESSOR | ONCHANGE_COMPMODE | ONCHANGE_COMPSTOP | ONCHANGE_COMPRESTART ,
P_PF_HEIGHT
,
ONCHANGE_RECALCSEQ
|
ONCHANGE_WINDOW
|
ONCHANGE_EXPOSURE
|
ONCHANGE_HIST
|
ONCHANGE_AEXP
|
ONCHANGE_FOCUSMODE
|
ONCHANGE_LIMITFPS
|
ONCHANGE_HIST
|
\
ONCHANGE_MEMSENSOR
|
ONCHANGE_MEMCOMPRESSOR
|
ONCHANGE_COMPMODE
|
ONCHANGE_COMPSTOP
|
ONCHANGE_COMPRESTART
|
ONCHANGE_SENSORIN
,
...
...
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