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
515823ea
Commit
515823ea
authored
Aug 23, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding memory-only logger
parent
dbe9d70b
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
482 additions
and
24 deletions
+482
-24
clk-si5338.c
src/drivers/clk/clk-si5338.c
+1
-1
Makefile
src/drivers/elphel/Makefile
+2
-1
framepars.c
src/drivers/elphel/framepars.c
+115
-16
klogger_393.c
src/drivers/elphel/klogger_393.c
+325
-0
klogger_393.h
src/drivers/elphel/klogger_393.h
+24
-0
mt9x001.c
src/drivers/elphel/mt9x001.c
+1
-1
sensor_common.c
src/drivers/elphel/sensor_common.c
+1
-1
sensor_i2c.c
src/drivers/elphel/sensor_i2c.c
+4
-4
x393_fpga_functions.c
src/drivers/elphel/x393_fpga_functions.c
+8
-0
x393_devices.h
src/include/uapi/elphel/x393_devices.h
+1
-0
No files found.
src/drivers/clk/clk-si5338.c
View file @
515823ea
...
@@ -4579,7 +4579,7 @@ static void si5338_init_of(struct i2c_client *client)
...
@@ -4579,7 +4579,7 @@ static void si5338_init_of(struct i2c_client *client)
return
;
return
;
}
}
init_type
=
1
;
init_type
=
1
;
/
*
falling to initialization */
/
/ no break :
falling to initialization */
case
1
:
case
1
:
pre_init
(
client
,
1
);
// clear outputs and muxes - they will be programmed later
pre_init
(
client
,
1
);
// clear outputs and muxes - they will be programmed later
break
;
break
;
...
...
src/drivers/elphel/Makefile
View file @
515823ea
...
@@ -34,3 +34,4 @@ obj-$(CONFIG_ELPHEL393) += cxi2c.o
...
@@ -34,3 +34,4 @@ obj-$(CONFIG_ELPHEL393) += cxi2c.o
obj-$(CONFIG_ELPHEL393)
+=
x393_videomem.o
obj-$(CONFIG_ELPHEL393)
+=
x393_videomem.o
obj-$(CONFIG_ELPHEL393)
+=
detect_sensors.o
obj-$(CONFIG_ELPHEL393)
+=
detect_sensors.o
obj-$(CONFIG_ELPHEL393)
+=
x393_fpga_functions.o
obj-$(CONFIG_ELPHEL393)
+=
x393_fpga_functions.o
obj-$(CONFIG_ELPHEL393)
+=
klogger_393.o
\ No newline at end of file
src/drivers/elphel/framepars.c
View file @
515823ea
This diff is collapsed.
Click to expand it.
src/drivers/elphel/klogger_393.c
0 → 100644
View file @
515823ea
This diff is collapsed.
Click to expand it.
src/drivers/elphel/klogger_393.h
0 → 100644
View file @
515823ea
/**
* @file klogger_393.c
* @brief Header file for klogger_393.c
* @copyright Copyright (C) 2016 Elphel, Inc.
* @par <b>License</b>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KLOGGER_393_H
#define KLOGGER_393_H
int
klog393_puts
(
const
char
*
str
);
int
klog393_ts
(
const
char
*
str
);
#endif
src/drivers/elphel/mt9x001.c
View file @
515823ea
...
@@ -2197,7 +2197,7 @@ int mt9x001_init(struct platform_device *pdev)
...
@@ -2197,7 +2197,7 @@ int mt9x001_init(struct platform_device *pdev)
{
{
int
res
;
int
res
;
struct
device
*
dev
=
&
pdev
->
dev
;
struct
device
*
dev
=
&
pdev
->
dev
;
const
struct
of_device_id
*
match
;
//
const struct of_device_id *match;
int
sensor_port
;
int
sensor_port
;
for
(
sensor_port
=
0
;
sensor_port
<
SENSOR_PORTS
;
sensor_port
++
)
{
for
(
sensor_port
=
0
;
sensor_port
<
SENSOR_PORTS
;
sensor_port
++
)
{
...
...
src/drivers/elphel/sensor_common.c
View file @
515823ea
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* - tasklets
* - tasklets
* - device driver that includes waiting for the next frame regardless of compression
* - device driver that includes waiting for the next frame regardless of compression
* @copyright Copyright (C) 2016 Elphel, Inc.
* @copyright Copyright (C) 2016 Elphel, Inc.
*
*
@par <b>License</b>
* This program is free software: you can redistribute it and/or modify
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* the Free Software Foundation, either version 3 of the License, or
...
...
src/drivers/elphel/sensor_i2c.c
View file @
515823ea
...
@@ -59,7 +59,7 @@ struct x393_i2c_device_list {
...
@@ -59,7 +59,7 @@ struct x393_i2c_device_list {
x393_i2c_device_t
i2c_dev
;
x393_i2c_device_t
i2c_dev
;
struct
list_head
list
;
struct
list_head
list
;
};
};
const
char
of_prop_name
[]
=
"elphel393-sensor-i2c,i2c_devices"
;
const
char
sensor_i2c_
of_prop_name
[]
=
"elphel393-sensor-i2c,i2c_devices"
;
const
char
group_name
[]
=
"i2c_classes"
;
const
char
group_name
[]
=
"i2c_classes"
;
const
int
max_buf_len
=
4096
-
256
;
///< stop output when only 256 bytes are left in the caller's buffer
const
int
max_buf_len
=
4096
-
256
;
///< stop output when only 256 bytes are left in the caller's buffer
const
int
max_i2c_classes
=
256
;
const
int
max_i2c_classes
=
256
;
...
@@ -190,7 +190,7 @@ int i2c_page_alloc(int chn)
...
@@ -190,7 +190,7 @@ int i2c_page_alloc(int chn)
#else
#else
spin_unlock_irqrestore
(
sensori2c_locks
[
chn
],
flags
);
spin_unlock_irqrestore
(
sensori2c_locks
[
chn
],
flags
);
#endif
#endif
dev_dbg
(
sdev
,
"Allocated page= %d for port %d, is RESET(
chn=%d,
group= 0x%08x bits = 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x )
\n
"
,
dev_dbg
(
sdev
,
"Allocated page= %d for port %d, is RESET(group= 0x%08x bits = 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x )
\n
"
,
(
g
<<
5
)
+
b
,
chn
,
free_i2c_groups
[
chn
],
(
g
<<
5
)
+
b
,
chn
,
free_i2c_groups
[
chn
],
free_i2c_pages
[
chn
][
0
],
free_i2c_pages
[
chn
][
1
],
free_i2c_pages
[
chn
][
2
],
free_i2c_pages
[
chn
][
3
],
free_i2c_pages
[
chn
][
0
],
free_i2c_pages
[
chn
][
1
],
free_i2c_pages
[
chn
][
2
],
free_i2c_pages
[
chn
][
3
],
free_i2c_pages
[
chn
][
4
],
free_i2c_pages
[
chn
][
5
],
free_i2c_pages
[
chn
][
6
],
free_i2c_pages
[
chn
][
7
]);
free_i2c_pages
[
chn
][
4
],
free_i2c_pages
[
chn
][
5
],
free_i2c_pages
[
chn
][
6
],
free_i2c_pages
[
chn
][
7
]);
...
@@ -1592,9 +1592,9 @@ static void elphel393_sensor_i2c_init_of(struct platform_device *pdev) ///< Plat
...
@@ -1592,9 +1592,9 @@ static void elphel393_sensor_i2c_init_of(struct platform_device *pdev) ///< Plat
struct
device
*
dev
=&
pdev
->
dev
;
struct
device
*
dev
=&
pdev
->
dev
;
if
(
node
)
{
if
(
node
)
{
/*TODO: Configure some i2c devices here (slaves, formats, speeds) to be used by names*/
/*TODO: Configure some i2c devices here (slaves, formats, speeds) to be used by names*/
num_devs
=
of_property_count_strings
(
node
,
of_prop_name
);
num_devs
=
of_property_count_strings
(
node
,
sensor_i2c_
of_prop_name
);
for
(
nd
=
0
;
nd
<
num_devs
;
nd
++
){
for
(
nd
=
0
;
nd
<
num_devs
;
nd
++
){
if
(
of_property_read_string_index
(
node
,
of_prop_name
,
nd
,
&
config_string
))
{
if
(
of_property_read_string_index
(
node
,
sensor_i2c_
of_prop_name
,
nd
,
&
config_string
))
{
pr_err
(
"%s: No data for selected i2c device
\n
"
,
__func__
);
pr_err
(
"%s: No data for selected i2c device
\n
"
,
__func__
);
BUG
();
BUG
();
}
}
...
...
src/drivers/elphel/x393_fpga_functions.c
View file @
515823ea
...
@@ -48,6 +48,11 @@ sec_usec_t * get_fpga_rtc(sec_usec_t * ts) ///< Pointer to a sec/usec structure
...
@@ -48,6 +48,11 @@ sec_usec_t * get_fpga_rtc(sec_usec_t * ts) ///< Pointer to a sec/usec structure
// x393_rtc_sec_t sec;
// x393_rtc_sec_t sec;
int
i
;
int
i
;
if
(
!
ts
)
return
NULL
;
if
(
!
ts
)
return
NULL
;
if
(
!
is_fpga_programmed
())
{
ts
->
sec
=
0
;
ts
->
usec
=
0
;
return
ts
;
}
spin_lock_bh
(
&
fpga_time_lock
);
spin_lock_bh
(
&
fpga_time_lock
);
stat
=
x393_rtc_status
();
stat
=
x393_rtc_status
();
stat_ctrl
.
mode
=
1
;
stat_ctrl
.
mode
=
1
;
...
@@ -72,11 +77,14 @@ void set_fpga_rtc (sec_usec_t ts) ///< timestamp providing seconds and microseco
...
@@ -72,11 +77,14 @@ void set_fpga_rtc (sec_usec_t ts) ///< timestamp providing seconds and microseco
x393_rtc_sec_t
sec
;
x393_rtc_sec_t
sec
;
usec
.
usec
=
ts
.
usec
;
usec
.
usec
=
ts
.
usec
;
sec
.
sec
=
ts
.
sec
;
sec
.
sec
=
ts
.
sec
;
if
(
!
is_fpga_programmed
())
return
;
spin_lock_bh
(
&
fpga_time_lock
);
spin_lock_bh
(
&
fpga_time_lock
);
set_x393_rtc_usec
(
usec
);
set_x393_rtc_usec
(
usec
);
set_x393_rtc_sec_set
(
sec
);
// And apply
set_x393_rtc_sec_set
(
sec
);
// And apply
spin_unlock_bh
(
&
fpga_time_lock
);
spin_unlock_bh
(
&
fpga_time_lock
);
}
}
/** Check if bitstream is loaded */
/** Check if bitstream is loaded */
int
is_fpga_programmed
(
void
)
///< @return 0 - bitstream is NOT loaded, 1 - bitsteam IS loaded, -ENOMEM - error in ioremap
int
is_fpga_programmed
(
void
)
///< @return 0 - bitstream is NOT loaded, 1 - bitsteam IS loaded, -ENOMEM - error in ioremap
{
{
...
...
src/include/uapi/elphel/x393_devices.h
View file @
515823ea
...
@@ -91,6 +91,7 @@
...
@@ -91,6 +91,7 @@
#define DEV393_DETECT_SENSORS ("detect_sensors", "detect_sensors",143, 1, "0666", "c") ///< Probably not needed, only sysfs is used
#define DEV393_DETECT_SENSORS ("detect_sensors", "detect_sensors",143, 1, "0666", "c") ///< Probably not needed, only sysfs is used
#define DEV393_I2C_SENSORS ("", "elphel393-sensor-i2c",-1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?)
#define DEV393_I2C_SENSORS ("", "elphel393-sensor-i2c",-1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?)
#define DEV393_MT9X001 ("", "elphel393-mt9x001", -1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?)
#define DEV393_MT9X001 ("", "elphel393-mt9x001", -1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?)
#define DEV393_KLOGGER ("klogger_393", "klogger_393", 144, 1, "0666", "c") ///< kernel event logger to memory (no i/o)
#define _DEV393_PATH(n, ...) "/dev/"n
#define _DEV393_PATH(n, ...) "/dev/"n
...
...
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