Commit 196a40df authored by Andrey Filippov's avatar Andrey Filippov

adding video memor=y driver wih DT and sysfs interface to configure video memory

parent c2b627a5
......@@ -31,3 +31,4 @@ obj-$(CONFIG_ELPHEL393) += multi10359.o
obj-$(CONFIG_ELPHEL393) += imu_log393.o
obj-$(CONFIG_ELPHEL393) += cxi2c.o
obj-$(CONFIG_ELPHEL393) += x393_videomem.o
......@@ -40,7 +40,7 @@
#include <linux/interrupt.h>
#include <linux/platform_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 <linux/module.h>
#include <linux/slab.h>
......@@ -304,8 +304,7 @@ static u32 bytePtrMask = 0;
static dma_addr_t logger_phys; ///< physical address of the DMA memory start
static int logger_fpga_configured = 0;
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;
static struct device *g_dev_ptr; ///< Global pointer to basic device structure. This pointer is used in debugfs output functions
wait_queue_head_t logger_wait_queue;
#endif
......@@ -914,15 +913,11 @@ static ssize_t imu_read(struct file * file, char * buf, size_t count, loff_t *of
}
}
/**
* @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.
* @param[in] irq interrupt number
* @param[in] dev_id pointer to driver's private data structure #jpeg_ptr_t corresponding to
* 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)
/** Handle interrupts the logger. This handler is installed without SA_INTERRUPT
* 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
void *dev_id) ///< [in] pointer to driver's private data structure
///< @return \e IRQ_HANDLED if interrupt was processed and \e IRQ_NONE otherwise
{
x393_mult_saxi_al_t mult_saxi_dwp = x393_mult_saxi_pointers(MULT_SAXI_CHN);
if (mult_saxi_dwp.addr32 < logger_offs32){
......@@ -1263,8 +1258,7 @@ static struct platform_driver elphel393_logger = {
},
};
//module_init(logger_init);
module_platform_driver(elphel393_logger);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Andrey Filippov <andrey@elphel.com>.");
MODULE_DESCRIPTION(IMU_MODULE_DESCRIPTION);
......@@ -191,25 +191,15 @@
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/init.h>
//#include <linux/autoconf.h>
#include <linux/vmalloc.h>
//#include <asm/system.h>
#include <asm/byteorder.h> // endians
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/delay.h>
//#include <asm/delay.h>
#include <asm/uaccess.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 "sensor_common.h"
#include "multi10359.h"
......@@ -218,10 +208,8 @@
#include "quantization_tables.h"
#include "latency.h"
#include "pgm_functions.h"
//#include "cxdma.h" // is_dma_on()
#include "jpeghead.h" // to program FPGA Huffman tables
#include "legacy_defines.h" // temporarily
#include "legacy_defines.h" // temporarily
#include "sensor_i2c.h"
......
This diff is collapsed.
/***************************************************************************//**
* @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);
This diff is collapsed.
/***************************************************************************//**
* @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
};
......@@ -856,8 +856,10 @@
/// 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/>
/// So if no parameters are changed - nothing to be copied from page to page.
#define PARS_FRAMES 16
#define PARS_FRAMES_MASK (PARS_FRAMES-1) ///< Maximal frame number (15 for NC393)
#ifndef PARS_FRAMES
#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/>
///#define PASTPARS_SAVE_ENTRIES (PARS_FRAMES << 8) // 2048<br/>
///#define PASTPARS_SAVE_ENTRIES_MASK ((PARS_FRAMES << 8)-1) // 0x7ff
......
......@@ -18,14 +18,15 @@
#define IMAGERAW_MAJOR 131
#define IMAGEACQ_MAJOR 140
#define LOGGER_MAJOR 141
#define VIDEOMEM_MAJOR 142 // implement raw access to memory and/or 16-bit image buffers over membridge interface
/// MINORS
#define LOGGER_MINOR 1
#define LOGGER_CTL_MINOR 2
#define IMAGERAW_MINOR_FRAME 1
#define IMAGERAW_MINOR_FPN 2
#define IMAGERAW_MINOR_UNLOCK 3
#define IMAGERAW_MINOR_FRAME 1
#define IMAGERAW_MINOR_FPN 2
#define IMAGERAW_MINOR_UNLOCK 3
#define CIRCBUF_MINOR 0x20
#define CIRCBUF_MINOR_CHN_0 0x20
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment