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
196a40df
Commit
196a40df
authored
Aug 04, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding video memor=y driver wih DT and sysfs interface to configure video memory
parent
c2b627a5
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
715 additions
and
32 deletions
+715
-32
Makefile
src/drivers/elphel/Makefile
+1
-0
imu_log393.c
src/drivers/elphel/imu_log393.c
+8
-14
pgm_functions.c
src/drivers/elphel/pgm_functions.c
+1
-13
x393_fpga_functions.c
src/drivers/elphel/x393_fpga_functions.c
+189
-0
x393_fpga_functions.h
src/drivers/elphel/x393_fpga_functions.h
+23
-0
x393_videomem.c
src/drivers/elphel/x393_videomem.c
+460
-0
x393_videomem.h
src/drivers/elphel/x393_videomem.h
+25
-0
c313a.h
src/include/elphel/c313a.h
+4
-2
driver_numbers.h
src/include/elphel/driver_numbers.h
+4
-3
No files found.
src/drivers/elphel/Makefile
View file @
196a40df
...
@@ -31,3 +31,4 @@ obj-$(CONFIG_ELPHEL393) += multi10359.o
...
@@ -31,3 +31,4 @@ obj-$(CONFIG_ELPHEL393) += multi10359.o
obj-$(CONFIG_ELPHEL393)
+=
imu_log393.o
obj-$(CONFIG_ELPHEL393)
+=
imu_log393.o
obj-$(CONFIG_ELPHEL393)
+=
cxi2c.o
obj-$(CONFIG_ELPHEL393)
+=
cxi2c.o
obj-$(CONFIG_ELPHEL393)
+=
x393_videomem.o
src/drivers/elphel/imu_log393.c
View file @
196a40df
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/of_device.h>
#include <asm/outercache.h>
#include <asm/outercache.h>
// TODO: Implement cache operations for the logger !!!!
#include <asm/cacheflush.h>
#include <asm/cacheflush.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
...
@@ -304,8 +304,7 @@ static u32 bytePtrMask = 0;
...
@@ -304,8 +304,7 @@ static u32 bytePtrMask = 0;
static
dma_addr_t
logger_phys
;
///< physical address of the DMA memory start
static
dma_addr_t
logger_phys
;
///< physical address of the DMA memory start
static
int
logger_fpga_configured
=
0
;
static
int
logger_fpga_configured
=
0
;
static
const
struct
of_device_id
elphel393_logger_of_match
[];
static
const
struct
of_device_id
elphel393_logger_of_match
[];
/** @brief Global pointer to basic device structure. This pointer is used in debugfs output functions */
static
struct
device
*
g_dev_ptr
;
///< Global pointer to basic device structure. This pointer is used in debugfs output functions
static
struct
device
*
g_dev_ptr
;
wait_queue_head_t
logger_wait_queue
;
wait_queue_head_t
logger_wait_queue
;
#endif
#endif
...
@@ -914,15 +913,11 @@ static ssize_t imu_read(struct file * file, char * buf, size_t count, loff_t *of
...
@@ -914,15 +913,11 @@ static ssize_t imu_read(struct file * file, char * buf, size_t count, loff_t *of
}
}
}
}
/**
/** Handle interrupts the logger. This handler is installed without SA_INTERRUPT
* @brief Handle interrupts from sensor channels. This handler is installed without SA_INTERRUPT
* flag meaning that interrupts are enabled during processing. Such behavior is recommended in LDD3. */
* flag meaning that interrupts are enabled during processing. Such behavior is recommended in LDD3.
static
irqreturn_t
logger_irq_handler
(
int
irq
,
///< [in] interrupt number
* @param[in] irq interrupt number
void
*
dev_id
)
///< [in] pointer to driver's private data structure
* @param[in] dev_id pointer to driver's private data structure #jpeg_ptr_t corresponding to
///< @return \e IRQ_HANDLED if interrupt was processed and \e IRQ_NONE otherwise
* the channel which raise interrupt
* @return \e IRQ_HANDLED if interrupt was processed and \e IRQ_NONE otherwise
*/
static
irqreturn_t
logger_irq_handler
(
int
irq
,
void
*
dev_id
)
{
{
x393_mult_saxi_al_t
mult_saxi_dwp
=
x393_mult_saxi_pointers
(
MULT_SAXI_CHN
);
x393_mult_saxi_al_t
mult_saxi_dwp
=
x393_mult_saxi_pointers
(
MULT_SAXI_CHN
);
if
(
mult_saxi_dwp
.
addr32
<
logger_offs32
){
if
(
mult_saxi_dwp
.
addr32
<
logger_offs32
){
...
@@ -1263,8 +1258,7 @@ static struct platform_driver elphel393_logger = {
...
@@ -1263,8 +1258,7 @@ static struct platform_driver elphel393_logger = {
},
},
};
};
//module_init(logger_init);
module_platform_driver
(
elphel393_logger
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_AUTHOR
(
"Andrey Filippov <andrey@elphel.com>."
);
MODULE_AUTHOR
(
"Andrey Filippov <andrey@elphel.com>."
);
MODULE_DESCRIPTION
(
IMU_MODULE_DESCRIPTION
);
MODULE_DESCRIPTION
(
IMU_MODULE_DESCRIPTION
);
src/drivers/elphel/pgm_functions.c
View file @
196a40df
...
@@ -191,25 +191,15 @@
...
@@ -191,25 +191,15 @@
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/init.h>
//#include <linux/autoconf.h>
#include <linux/vmalloc.h>
#include <linux/vmalloc.h>
//#include <asm/system.h>
#include <asm/byteorder.h> // endians
#include <asm/byteorder.h> // endians
#include <asm/io.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/irq.h>
#include <linux/delay.h>
#include <linux/delay.h>
//#include <asm/delay.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <elphel/c313a.h>
#include <elphel/c313a.h>
//#include <asm/elphel/exifa.h>
//#include "fpgactrl.h" // defines port_csp0_addr, port_csp4_addr
//#include "fpga_sdram.h" // use a single fpga_initSDRAM(void)
//#include "fpgaconfi2c.h" //to control clocks
//#include "cc3x3.h"
//#include "fpga_io.h"
//#include "x3x3.h" // hardware definitions
#include "framepars.h"
#include "framepars.h"
#include "sensor_common.h"
#include "sensor_common.h"
#include "multi10359.h"
#include "multi10359.h"
...
@@ -218,10 +208,8 @@
...
@@ -218,10 +208,8 @@
#include "quantization_tables.h"
#include "quantization_tables.h"
#include "latency.h"
#include "latency.h"
#include "pgm_functions.h"
#include "pgm_functions.h"
//#include "cxdma.h" // is_dma_on()
#include "jpeghead.h" // to program FPGA Huffman tables
#include "jpeghead.h" // to program FPGA Huffman tables
#include "legacy_defines.h" // temporarily
#include "legacy_defines.h" // temporarily
#include "sensor_i2c.h"
#include "sensor_i2c.h"
...
...
src/drivers/elphel/x393_fpga_functions.c
0 → 100644
View file @
196a40df
This diff is collapsed.
Click to expand it.
src/drivers/elphel/x393_fpga_functions.h
0 → 100644
View file @
196a40df
/***************************************************************************//**
* @file x393_fpga_functions.h
* @brief Reimplementation of Python methods to program FPGA parameters
* @copyright Copyright 2016 (C) 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 2 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/>.
*******************************************************************************/
//typedef enum {DIRECT,ABSOLUTE,RELATIVE} x393cmd_t;
#include "x393.h"
int
setup_sensor_memory
(
int
num_sensor
,
int
frame_sa
,
int
frame_sa_inc
,
int
last_frame_num
,
int
frame_full_width
,
int
window_width
,
int
window_height
,
int
window_left
,
int
window_top
,
x393cmd_t
x393cmd
,
int
frame16
);
int
setup_compressor_memory
(
int
num_sensor
,
int
frame_sa
,
int
frame_sa_inc
,
int
last_frame_num
,
int
frame_full_width
,
int
window_width
,
int
window_height
,
int
window_left
,
int
window_top
,
int
byte32
,
int
tile_width
,
int
tile_vstep
,
int
tile_height
,
int
extra_pages
,
int
disable_need
,
x393cmd_t
x393cmd
,
int
frame16
);
src/drivers/elphel/x393_videomem.c
0 → 100644
View file @
196a40df
This diff is collapsed.
Click to expand it.
src/drivers/elphel/x393_videomem.h
0 → 100644
View file @
196a40df
/***************************************************************************//**
* @file x393_videomem.h
* @brief Driver for the external DDR3 memory of x393 (currently 0.5GB)
* @copyright Copyright 2016 (C) 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 2 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/>.
*******************************************************************************/
struct
elphel_video_buf_t
{
int
frame_start
[
4
];
///< Channel 0 frame start (in bytes)
int
frame_full_width
[
4
];
///< Channel 0 frame full width (in bytes). 1 memory page is 2048 bytes (128 bursts)
int
frame_height
[
4
];
///< Channel 0 maximal frame height in pixel lines
int
frames_in_buffer
[
4
];
///< Number of frames in channel 0 buffer
};
src/include/elphel/c313a.h
View file @
196a40df
...
@@ -856,8 +856,10 @@
...
@@ -856,8 +856,10 @@
/// when the 4-bit counter is combined with the software variable to get the full 32-bit frame number.<br/>
/// when the 4-bit counter is combined with the software variable to get the full 32-bit frame number.<br/>
/// Each parameter page includes 927 parameter registers, as well as 97 bit mask ones to speed up updates between frames.<br/>
/// Each parameter page includes 927 parameter registers, as well as 97 bit mask ones to speed up updates between frames.<br/>
/// So if no parameters are changed - nothing to be copied from page to page.
/// So if no parameters are changed - nothing to be copied from page to page.
#define PARS_FRAMES 16
#ifndef PARS_FRAMES
#define PARS_FRAMES_MASK (PARS_FRAMES-1) ///< Maximal frame number (15 for NC393)
#define PARS_FRAMES 16
#define PARS_FRAMES_MASK (PARS_FRAMES-1) ///< Maximal frame number (15 for NC393)
#endif
/// Keeping the same size of past frames storage as in 353:<br/>
/// Keeping the same size of past frames storage as in 353:<br/>
///#define PASTPARS_SAVE_ENTRIES (PARS_FRAMES << 8) // 2048<br/>
///#define PASTPARS_SAVE_ENTRIES (PARS_FRAMES << 8) // 2048<br/>
///#define PASTPARS_SAVE_ENTRIES_MASK ((PARS_FRAMES << 8)-1) // 0x7ff
///#define PASTPARS_SAVE_ENTRIES_MASK ((PARS_FRAMES << 8)-1) // 0x7ff
...
...
src/include/elphel/driver_numbers.h
View file @
196a40df
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#define IMAGERAW_MAJOR 131
#define IMAGERAW_MAJOR 131
#define IMAGEACQ_MAJOR 140
#define IMAGEACQ_MAJOR 140
#define LOGGER_MAJOR 141
#define LOGGER_MAJOR 141
#define VIDEOMEM_MAJOR 142 // implement raw access to memory and/or 16-bit image buffers over membridge interface
/// MINORS
/// MINORS
...
...
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