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
87b9b1b0
Commit
87b9b1b0
authored
Apr 22, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rocko' of git@git.elphel.com:Elphel/linux-elphel.git into rocko
parents
a9ba974c
f7668d15
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
237 additions
and
76 deletions
+237
-76
mt9f002.c
src/drivers/elphel/mt9f002.c
+216
-55
mt9f002.h
src/drivers/elphel/mt9f002.h
+1
-1
pgm_functions.c
src/drivers/elphel/pgm_functions.c
+0
-2
x393_videomem.c
src/drivers/elphel/x393_videomem.c
+20
-18
No files found.
src/drivers/elphel/mt9f002.c
View file @
87b9b1b0
This diff is collapsed.
Click to expand it.
src/drivers/elphel/mt9f002.h
View file @
87b9b1b0
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
// bit 9 should have set masking for broken frames
// bit 9 should have set masking for broken frames
// cleared bit 3 allows writing to some RO registers
// cleared bit 3 allows writing to some RO registers
//#define MT9F002_RESET_REGISTER_VALUE 0x001c
//#define MT9F002_RESET_REGISTER_VALUE 0x001c
#define MT9F002_RESET_REGISTER_VALUE 0x0
0
11c
#define MT9F002_RESET_REGISTER_VALUE 0x011c
//#define MT9F002_RESET_REGISTER_VALUE 0x0014
//#define MT9F002_RESET_REGISTER_VALUE 0x0014
// number of lines to sacrifice before generating Frame Valid
// number of lines to sacrifice before generating Frame Valid
#define MT9F002_VACT_DELAY 2
#define MT9F002_VACT_DELAY 2
...
...
src/drivers/elphel/pgm_functions.c
View file @
87b9b1b0
...
@@ -518,8 +518,6 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
...
@@ -518,8 +518,6 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
setFramePar
(
sensor_port
,
thispars
,
P_CLK_SENSOR
,
48000000
);
setFramePar
(
sensor_port
,
thispars
,
P_CLK_SENSOR
,
48000000
);
}
}
if
(
thispars
->
pars
[
P_SENSOR
]
==
SENSOR_DETECT
)
{
if
(
thispars
->
pars
[
P_SENSOR
]
==
SENSOR_DETECT
)
{
sensor
->
sensorType
=
SENSOR_NONE
;
// to prevent from initializing again
sensor
->
sensorType
=
SENSOR_NONE
;
// to prevent from initializing again
dev_dbg
(
g_dev_ptr
,
"No image sensor found
\n
"
);
dev_dbg
(
g_dev_ptr
,
"No image sensor found
\n
"
);
...
...
src/drivers/elphel/x393_videomem.c
View file @
87b9b1b0
...
@@ -88,7 +88,7 @@ static struct class *videomem_dev_class;
...
@@ -88,7 +88,7 @@ static struct class *videomem_dev_class;
// About frame full width:
// About frame full width:
// https://blog.elphel.com/2015/05/nc393-development-progress-multichannel-memory-controller-for-the-multi-sensor-camera/#Memory_mapping_and_access_types
// https://blog.elphel.com/2015/05/nc393-development-progress-multichannel-memory-controller-for-the-multi-sensor-camera/#Memory_mapping_and_access_types
static
struct
elphel_video_buf_t
buffer_settings
=
{
///< some default settings, same as in DT
static
struct
elphel_video_buf_t
buffer_settings
=
{
///< some default settings, same as in DT
.
frame_start
=
{
0x00000000
,
0x08000000
,
0x10000000
,
0x
0
8000000
},
/* Frame starts (in bytes) */
.
frame_start
=
{
0x00000000
,
0x08000000
,
0x10000000
,
0x
1
8000000
},
/* Frame starts (in bytes) */
.
frame_full_width
=
{
8192
,
8192
,
8192
,
8192
},
/* Frame full widths (in bytes). 1 memory page is 2048 bytes (128 bursts) */
.
frame_full_width
=
{
8192
,
8192
,
8192
,
8192
},
/* Frame full widths (in bytes). 1 memory page is 2048 bytes (128 bursts) */
.
frame_height
=
{
8192
,
8192
,
8192
,
8192
},
/* Channel 3 maximal frame height in pixel lines */
.
frame_height
=
{
8192
,
8192
,
8192
,
8192
},
/* Channel 3 maximal frame height in pixel lines */
.
frames_in_buffer
=
{
2
,
2
,
2
,
2
}
/* Number of frames in channel 3 buffer */
.
frames_in_buffer
=
{
2
,
2
,
2
,
2
}
/* Number of frames in channel 3 buffer */
...
@@ -446,15 +446,15 @@ int control_sensor_memory (int num_sensor, ///< sensor port number (0..3)
...
@@ -446,15 +446,15 @@ int control_sensor_memory (int num_sensor, ///< sensor port number (0..3)
}
}
dev_dbg
(
g_dev_ptr
,
"{%d} frame16=%d, cmd=%d, x393cms=%d
\n
"
,
num_sensor
,
frame16
,
cmd
,
(
int
)
x393cmd
);
dev_dbg
(
g_dev_ptr
,
"{%d} frame16=%d, cmd=%d, x393cms=%d
\n
"
,
num_sensor
,
frame16
,
cmd
,
(
int
)
x393cmd
);
dev_dbg
(
g_dev_ptr
,
"mode=0x%x (enable=%d, chn_nreset=%d, write_mem=%d, extra_pages=%d, keep_open=%d, byte32=%d, reset_frame=%d, single=%d,repetitive=%d, disable_need=%d,skip_too_late=%d )
\n
"
,
dev_dbg
(
g_dev_ptr
,
"
control_sensor_memory
mode=0x%x (enable=%d, chn_nreset=%d, write_mem=%d, extra_pages=%d, keep_open=%d, byte32=%d, reset_frame=%d, single=%d,repetitive=%d, disable_need=%d,skip_too_late=%d )
\n
"
,
mcntrl_mode
.
d32
,
mcntrl_mode
.
enable
,
mcntrl_mode
.
chn_nreset
,
mcntrl_mode
.
write_mem
,
mcntrl_mode
.
extra_pages
,
mcntrl_mode
.
d32
,
mcntrl_mode
.
enable
,
mcntrl_mode
.
chn_nreset
,
mcntrl_mode
.
write_mem
,
mcntrl_mode
.
keep_open
,
mcntrl_mode
.
byte32
,
mcntrl_mode
.
reset_frame
,
mcntrl_mode
.
single
,
mcntrl_mode
.
repetitiv
e
,
mcntrl_mode
.
extra_pages
,
mcntrl_mode
.
keep_open
,
mcntrl_mode
.
byte32
,
mcntrl_mode
.
reset_fram
e
,
mcntrl_mode
.
disable_need
,
mcntrl_mode
.
skip_too_late
);
mcntrl_mode
.
single
,
mcntrl_mode
.
repetitive
,
mcntrl_mode
.
disable_need
,
mcntrl_mode
.
skip_too_late
);
MDP
(
DBGB_VM
,
num_sensor
,
"frame16=%d, cmd=%d, x393cms=%d
\n
"
,
frame16
,
cmd
,
(
int
)
x393cmd
)
MDP
(
DBGB_VM
,
num_sensor
,
"frame16=%d, cmd=%d, x393cms=%d
\n
"
,
frame16
,
cmd
,
(
int
)
x393cmd
)
MDP
(
DBGB_VM
,
num_sensor
,
"mode=0x%x (enable=%d, chn_nreset=%d, write_mem=%d, extra_pages=%d, keep_open=%d, byte32=%d, reset_frame=%d, single=%d,repetitive=%d, disable_need=%d,skip_too_late=%d )
\n
"
,
MDP
(
DBGB_VM
,
num_sensor
,
"
control_sensor_memory
mode=0x%x (enable=%d, chn_nreset=%d, write_mem=%d, extra_pages=%d, keep_open=%d, byte32=%d, reset_frame=%d, single=%d,repetitive=%d, disable_need=%d,skip_too_late=%d )
\n
"
,
mcntrl_mode
.
d32
,
mcntrl_mode
.
enable
,
mcntrl_mode
.
chn_nreset
,
mcntrl_mode
.
write_mem
,
mcntrl_mode
.
extra_pages
,
mcntrl_mode
.
d32
,
mcntrl_mode
.
enable
,
mcntrl_mode
.
chn_nreset
,
mcntrl_mode
.
write_mem
,
mcntrl_mode
.
keep_open
,
mcntrl_mode
.
byte32
,
mcntrl_mode
.
reset_frame
,
mcntrl_mode
.
single
,
mcntrl_mode
.
repetitiv
e
,
mcntrl_mode
.
extra_pages
,
mcntrl_mode
.
keep_open
,
mcntrl_mode
.
byte32
,
mcntrl_mode
.
reset_fram
e
,
mcntrl_mode
.
disable_need
,
mcntrl_mode
.
skip_too_late
)
mcntrl_mode
.
single
,
mcntrl_mode
.
repetitive
,
mcntrl_mode
.
disable_need
,
mcntrl_mode
.
skip_too_late
)
switch
(
x393cmd
){
switch
(
x393cmd
){
...
@@ -585,7 +585,7 @@ int control_compressor_memory (int num_sensor, ///< sensor port number (0.
...
@@ -585,7 +585,7 @@ int control_compressor_memory (int num_sensor, ///< sensor port number (0.
.
extra_pages
=
1
,
// [ 4: 3] (0) 2-bit number of extra pages that need to stay (not to be overwritten) in the buffer
.
extra_pages
=
1
,
// [ 4: 3] (0) 2-bit number of extra pages that need to stay (not to be overwritten) in the buffer
.
keep_open
=
0
,
// [ 5] (0) (NA in linescan) for 8 or less rows - do not close page between accesses (not used in scanline mode)
.
keep_open
=
0
,
// [ 5] (0) (NA in linescan) for 8 or less rows - do not close page between accesses (not used in scanline mode)
.
byte32
=
1
,
// [ 6] (1) (NA in linescan) 32-byte columns (0 - 16-byte), not used in scanline mode
.
byte32
=
1
,
// [ 6] (1) (NA in linescan) 32-byte columns (0 - 16-byte), not used in scanline mode
.
linear
=
linear
,
// [ 7] (1) Use linear mode instead of tiled (for raw image files): extra_pages=0, keep_open=x, byte32=x
.
linear
=
linear
,
// [ 7] (1) Use linear mode instead of tiled (for raw image files): extra_pages=0, keep_open=x, byte32=x
.
reset_frame
=
1
,
// [ 8] (0) reset frame number
.
reset_frame
=
1
,
// [ 8] (0) reset frame number
.
single
=
0
,
// [ 9] (0) run single frame
.
single
=
0
,
// [ 9] (0) run single frame
.
repetitive
=
1
,
// [ 10] (1) run repetitive frames
.
repetitive
=
1
,
// [ 10] (1) run repetitive frames
...
@@ -614,15 +614,17 @@ int control_compressor_memory (int num_sensor, ///< sensor port number (0.
...
@@ -614,15 +614,17 @@ int control_compressor_memory (int num_sensor, ///< sensor port number (0.
return
-
EINVAL
;
return
-
EINVAL
;
}
}
dev_dbg
(
g_dev_ptr
,
"{%d} frame16=%d, cmd=%d, x393cms=%d
\n
"
,
num_sensor
,
frame16
,
cmd
,
(
int
)
x393cmd
);
dev_dbg
(
g_dev_ptr
,
"{%d} frame16=%d, cmd=%d, x393cms=%d
\n
"
,
num_sensor
,
frame16
,
cmd
,
(
int
)
x393cmd
);
dev_dbg
(
g_dev_ptr
,
"mode=0x%x (enable=%d, chn_nreset=%d, write_mem=%d, extra_pages=%d, keep_open=%d, byte32=%d, reset_frame=%d, single=%d,repetitive=%d, disable_need=%d,skip_too_late=%d )
\n
"
,
dev_dbg
(
g_dev_ptr
,
"control_compressor_memory mode=0x%x (enable=%d, chn_nreset=%d, write_mem=%d, extra_pages=%d, keep_open=%d, byte32=%d, linear=%d, reset_frame=%d, single=%d, repetitive=%d, disable_need=%d, skip_too_late=%d, copy_frame=%d, abort_late=%d)
\n
"
,
mcntrl_mode
.
d32
,
mcntrl_mode
.
enable
,
mcntrl_mode
.
chn_nreset
,
mcntrl_mode
.
write_mem
,
mcntrl_mode
.
extra_pages
,
mcntrl_mode
.
d32
,
mcntrl_mode
.
enable
,
mcntrl_mode
.
chn_nreset
,
mcntrl_mode
.
write_mem
,
mcntrl_mode
.
keep_open
,
mcntrl_mode
.
byte32
,
mcntrl_mode
.
reset_frame
,
mcntrl_mode
.
single
,
mcntrl_mode
.
repetitive
,
mcntrl_mode
.
extra_pages
,
mcntrl_mode
.
keep_open
,
mcntrl_mode
.
byte32
,
mcntrl_mode
.
linear
,
mcntrl_mode
.
disable_need
,
mcntrl_mode
.
skip_too_late
);
mcntrl_mode
.
reset_frame
,
mcntrl_mode
.
single
,
mcntrl_mode
.
repetitive
,
mcntrl_mode
.
disable_need
,
mcntrl_mode
.
skip_too_late
,
mcntrl_mode
.
copy_frame
,
mcntrl_mode
.
abort_late
);
MDP
(
DBGB_VM
,
num_sensor
,
"frame16=%d, cmd=%d, x393cms=%d
\n
"
,
frame16
,
cmd
,
(
int
)
x393cmd
)
MDP
(
DBGB_VM
,
num_sensor
,
"frame16=%d, cmd=%d, x393cms=%d
\n
"
,
frame16
,
cmd
,
(
int
)
x393cmd
)
MDP
(
DBGB_VM
,
num_sensor
,
"mode=0x%x (enable=%d, chn_nreset=%d, write_mem=%d, extra_pages=%d, keep_open=%d, byte32=%d, reset_frame=%d, single=%d,repetitive=%d, disable_need=%d,skip_too_late=%d )
\n
"
,
MDP
(
DBGB_VM
,
num_sensor
,
"control_compressor_memory mode=0x%x (enable=%d, chn_nreset=%d, write_mem=%d, extra_pages=%d, keep_open=%d, byte32=%d, linear=%d, reset_frame=%d, single=%d, repetitive=%d, disable_need=%d, skip_too_late=%d, copy_frame=%d, abort_late=%d)
\n
"
,
mcntrl_mode
.
d32
,
mcntrl_mode
.
enable
,
mcntrl_mode
.
chn_nreset
,
mcntrl_mode
.
write_mem
,
mcntrl_mode
.
extra_pages
,
mcntrl_mode
.
d32
,
mcntrl_mode
.
enable
,
mcntrl_mode
.
chn_nreset
,
mcntrl_mode
.
write_mem
,
mcntrl_mode
.
keep_open
,
mcntrl_mode
.
byte32
,
mcntrl_mode
.
reset_frame
,
mcntrl_mode
.
single
,
mcntrl_mode
.
repetitive
,
mcntrl_mode
.
extra_pages
,
mcntrl_mode
.
keep_open
,
mcntrl_mode
.
byte32
,
mcntrl_mode
.
linear
,
mcntrl_mode
.
disable_need
,
mcntrl_mode
.
skip_too_late
)
mcntrl_mode
.
reset_frame
,
mcntrl_mode
.
single
,
mcntrl_mode
.
repetitive
,
mcntrl_mode
.
disable_need
,
mcntrl_mode
.
skip_too_late
,
mcntrl_mode
.
copy_frame
,
mcntrl_mode
.
abort_late
)
switch
(
x393cmd
){
switch
(
x393cmd
){
case
ASAP
:
case
ASAP
:
...
...
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