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
9f42f3da
Commit
9f42f3da
authored
Aug 16, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging with applications
parent
11bcb946
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
150 additions
and
68 deletions
+150
-68
Makefile
src/drivers/elphel/Makefile
+2
-1
framepars.c
src/drivers/elphel/framepars.c
+80
-59
sensor_common.c
src/drivers/elphel/sensor_common.c
+2
-2
x393_fpga_functions.c
src/drivers/elphel/x393_fpga_functions.c
+51
-0
x393_fpga_functions.h
src/drivers/elphel/x393_fpga_functions.h
+4
-1
c313a.h
src/include/uapi/elphel/c313a.h
+7
-1
x393_devices.h
src/include/uapi/elphel/x393_devices.h
+4
-4
No files found.
src/drivers/elphel/Makefile
View file @
9f42f3da
...
...
@@ -32,4 +32,5 @@ obj-$(CONFIG_ELPHEL393) += imu_log393.o
obj-$(CONFIG_ELPHEL393)
+=
cxi2c.o
obj-$(CONFIG_ELPHEL393)
+=
x393_videomem.o
obj-$(CONFIG_ELPHEL393)
+=
detect_sensors.o
\ No newline at end of file
obj-$(CONFIG_ELPHEL393)
+=
detect_sensors.o
obj-$(CONFIG_ELPHEL393)
+=
x393_fpga_functions.o
\ No newline at end of file
src/drivers/elphel/framepars.c
View file @
9f42f3da
This diff is collapsed.
Click to expand it.
src/drivers/elphel/sensor_common.c
View file @
9f42f3da
...
...
@@ -957,7 +957,7 @@ int image_acq_init(struct platform_device *pdev)
#endif
dev_
dbg
(
dev
,
"Elphel FPGA interrupts initialized
\n
"
);
dev_
info
(
dev
,
"Elphel FPGA interrupts initialized
\n
"
);
dev_dbg
(
dev
,
"reset all compressors
\n
"
);
for
(
i
=
0
;
i
<
SENSOR_PORTS
;
i
++
)
{
reset_compressor
(
i
);
...
...
@@ -969,7 +969,7 @@ int image_acq_init(struct platform_device *pdev)
//init_pgm_proc (); // setup pointers to functions (not sensor-specific)
//MDD1(printk("reset_qtables()\n"));
framepars_init
(
pdev
);
//
framepars_init(pdev);
return
0
;
}
...
...
src/drivers/elphel/x393_fpga_functions.c
View file @
9f42f3da
...
...
@@ -14,11 +14,62 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
#include <linux/spinlock.h>
#include <uapi/elphel/c313a.h> // PARS_FRAMES_MASK
#include "x393.h"
#include "x393_fpga_functions.h"
#define REPEAT_STATUS_READ 10 ///< Number of times status is re-read waiting for a new timestamp
static
DEFINE_SPINLOCK
(
fpga_time_lock
);
// Nothing to init? Started in pgm_detectsesnor through sensor_common:sequencer_stop_run_reset
#if 0
int init_command_sequencer(int sensor_port)
{
return 0;
}
#endif
/** Read time (seconds and microseconds) from the FPGA RTC */
sec_usec_t
*
get_fpga_rtc
(
sec_usec_t
*
ts
)
///< Pointer to a sec/usec structure to fill in
///< @return structure link to a passed structure
{
// sec_usec_t ts = {.sec=0, .usec=0};
x393_rtc_status_t
stat
;
x393_status_ctrl_t
stat_ctrl
=
{.
d32
=
0
};
// x393_rtc_usec_t usec;
// x393_rtc_sec_t sec;
int
i
;
if
(
!
ts
)
return
NULL
;
spin_lock
(
&
fpga_time_lock
);
stat
=
x393_rtc_status
();
stat_ctrl
.
mode
=
1
;
stat_ctrl
.
seq_num
=
stat
.
seq_num
+
1
;
set_x393_rtc_set_status
(
stat_ctrl
);
// Requests single status, latches current time
for
(
i
=
0
;
i
<
REPEAT_STATUS_READ
;
i
++
)
{
stat
=
x393_rtc_status
();
if
(
stat
.
seq_num
==
stat_ctrl
.
seq_num
)
{
ts
->
sec
=
x393_rtc_status_sec
().
sec
;
ts
->
usec
=
x393_rtc_status_usec
().
usec
;
break
;
}
}
spin_unlock
(
&
fpga_time_lock
);
return
ts
;
}
/** Set FPGA RTC to specified time */
void
set_fpga_rtc
(
sec_usec_t
ts
)
///< timestamp providing seconds and microseconds
{
x393_rtc_usec_t
usec
;
x393_rtc_sec_t
sec
;
usec
.
usec
=
ts
.
usec
;
sec
.
sec
=
ts
.
sec
;
spin_lock
(
&
fpga_time_lock
);
set_x393_rtc_usec
(
usec
);
set_x393_rtc_sec_set
(
sec
);
// And apply
spin_unlock
(
&
fpga_time_lock
);
}
src/drivers/elphel/x393_fpga_functions.h
View file @
9f42f3da
...
...
@@ -16,4 +16,7 @@
*******************************************************************************/
//typedef enum {DIRECT,ABSOLUTE,RELATIVE} x393cmd_t;
#include "x393.h"
void
fpga_table_write_nice
(
int
addr
,
int
len
,
unsigned
long
*
data
);
//void fpga_table_write_nice (int addr, int len, unsigned long * data);
sec_usec_t
*
get_fpga_rtc
(
sec_usec_t
*
ts
);
void
set_fpga_rtc
(
sec_usec_t
ts
);
src/include/uapi/elphel/c313a.h
View file @
9f42f3da
...
...
@@ -208,7 +208,7 @@
*/
// parameter indexes will be updated to group-related ones into the same groups of 32
// NOTE: P_* and G_* should not end with numbers - numbers will be used in PHP constants to add to the constant value (ELPHEL_AAA3 will be treated as ELPHEL_AAA+3)
//
#define P_NUMBER 1024 //number of registers (was 64) - NOTE: obsolete?
#define P_NUMBER 1024 //number of registers (was 64) - NOTE: obsolete?
#define P_SENSOR 1
/**< if set to 0 - will (re)detect sensor, if set to None - won't bother <ul>
<li> 4 - ZR32112MLC - now there is no way to see color/mono
<li> 5 - ZR32112PLC
...
...
@@ -1694,6 +1694,12 @@ struct sensorproc_t {
//#define EXPOSURE_UNIT 100 // to move to finer exposure settings - current unit in microseconds. TODO: Propagate it to drivers...
#define EXPOSURE_UNIT 1 ///< to move to finer exposure settings - current unit in microseconds. TODO: Propagate it to drivers...
typedef
struct
{
unsigned
long
usec
;
unsigned
long
sec
;
}
sec_usec_t
;
/// width,height, quality are still needed even with new Exif - it is used to rebuild JPEG header
// most parameters are moved out, but width, height, quality are needed for JPEG header, so currently the following are used:
...
...
src/include/uapi/elphel/x393_devices.h
View file @
9f42f3da
...
...
@@ -37,10 +37,10 @@
#define DEV393_EXIF_META2 ("exif_meta2", "exif_elphel", 125, 34, "0666", "c") ///< sensor port 2: write metadata, concurrently opened files. All writes are atomic
#define DEV393_EXIF_META3 ("exif_meta3", "exif_elphel", 125, 35, "0666", "c") ///< sensor port 3: write metadata, concurrently opened files. All writes are atomic
#define DEV393_FRAMEPARS0 ("frameparsall0","framepars_operations",1
25
,80, "0666", "c") ///< Access frame parameters for channel 0 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS1 ("frameparsall1","framepars_operations",1
25
,81, "0666", "c") ///< Access frame parameters for channel 1 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS2 ("frameparsall2","framepars_operations",1
25
,82, "0666", "c") ///< Access frame parameters for channel 2 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS3 ("frameparsall3","framepars_operations",1
25
,83, "0666", "c") ///< Access frame parameters for channel 3 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS0 ("frameparsall0","framepars_operations",1
30
,80, "0666", "c") ///< Access frame parameters for channel 0 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS1 ("frameparsall1","framepars_operations",1
30
,81, "0666", "c") ///< Access frame parameters for channel 1 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS2 ("frameparsall2","framepars_operations",1
30
,82, "0666", "c") ///< Access frame parameters for channel 2 (schedule modification, read with mmap)
#define DEV393_FRAMEPARS3 ("frameparsall3","framepars_operations",1
30
,83, "0666", "c") ///< Access frame parameters for channel 3 (schedule modification, read with mmap)
#define DEV393_JTAG_RESET ("fpgaresetjtag", "x393_jtag", 132, 0, "0666", "c") ///< Just close open files (same as jtagraw)
#define DEV393_JTAG_RAW ("jtagraw", "x393_jtag", 132, 0, "0666", "c") ///< Just close open files (same as jtagraw)
...
...
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