Commit 01956c03 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

working on logger driver

parent d5584335
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ static struct elphel_buf_t _elphel_buf = {
    // Device to host stream DMA buffer for the logger
    .logger_vaddr = NULL,
    .logger_paddr = 0,
    .logger_size = 1024
    .logger_size = 1024 // should be 2**n !

};

@@ -523,23 +523,23 @@ static int elphel393_mem_probe(struct platform_device *pdev)

    printk("H2D stream buffer vaddr:            0x%08X\n",(u32) pElphel_buf -> h2d_vaddr);
    printk("H2D stream buffer paddr:            0x%08X\n",(u32) pElphel_buf -> h2d_paddr);
    printk("H2D stream buffer length:           0x%08X\n",(u32) pElphel_buf -> h2d_size * PAGE_SIZE);
    printk("H2D stream buffer length:           0x%08lX\n",(u32) pElphel_buf -> h2d_size * PAGE_SIZE);

    printk("D2H stream buffer vaddr:            0x%08X\n",(u32) pElphel_buf -> d2h_vaddr);
    printk("D2H stream buffer paddr:            0x%08X\n",(u32) pElphel_buf -> d2h_paddr);
    printk("D2H stream buffer length:           0x%08X\n",(u32) pElphel_buf -> d2h_size * PAGE_SIZE);
    printk("D2H stream buffer length:           0x%08lX\n",(u32) pElphel_buf -> d2h_size * PAGE_SIZE);

    printk("Bidirectional stream buffer vaddr:  0x%08X\n",(u32) pElphel_buf -> bidir_vaddr);
    printk("Bidirectional stream buffer paddr:  0x%08X\n",(u32) pElphel_buf -> bidir_paddr);
    printk("Bidirectional stream buffer length: 0x%08X\n",(u32) pElphel_buf -> bidir_size * PAGE_SIZE);
    printk("Bidirectional stream buffer length: 0x%08lX\n",(u32) pElphel_buf -> bidir_size * PAGE_SIZE);

    printk("HISTOGRAMS stream buffer vaddr:     0x%08X\n",(u32) pElphel_buf -> histograms_vaddr);
    printk("HISTOGRAMS stream buffer paddr:     0x%08X\n",(u32) pElphel_buf -> histograms_paddr);
    printk("HISTOGRAMS stream buffer length:    0x%08X\n",(u32) pElphel_buf -> histograms_size * PAGE_SIZE);
    printk("HISTOGRAMS stream buffer length:    0x%08lX\n",(u32) pElphel_buf -> histograms_size * PAGE_SIZE);

    printk("LOGGER stream buffer vaddr:         0x%08X\n",(u32) pElphel_buf -> logger_vaddr);
    printk("LOGGER stream buffer paddr:         0x%08X\n",(u32) pElphel_buf -> logger_paddr);
    printk("LOGGER stream buffer length:        0x%08X\n",(u32) pElphel_buf -> logger_size * PAGE_SIZE);
    printk("LOGGER stream buffer length:        0x%08lX\n",(u32) pElphel_buf -> logger_size * PAGE_SIZE);

	return 0;
}
+327 −108

File changed.

Preview size limit exceeded, changes collapsed.

+4 −3
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

void          x313_dma1_start(void);
int           x313_dma1_stop(void);
int           x313_is_dma1_on(void);
void          logger_dma_start(void);
int           logger_dma_stop(void);
int           logger_is_dma_on(void);
unsigned long x313_dma1_init(void);
void          logger_irq_cmd(int cmd);
+136 −147
Original line number Diff line number Diff line
@@ -609,7 +609,8 @@ For displaying histograms - try use latest available - not waiting fro a particu
// HISTOGRAMS_WAKEUP_ALWAYS if 0 will only wakeup processes waiting for histograms when they become available, maybe never if they are disabled
// if defined 1 - will wakeup each frame, regardless of the availability of the histograms
//#define HISTOGRAMS_WAKEUP_ALWAYS 0
void tasklet_fpga_function(unsigned long arg) {
void tasklet_fpga_function(unsigned long arg)
{
    int is_compressor_irq = 1; // TODO: add interrupts from frame sync if compressor is off
    int hist_en;
    int sensor_port = image_acq_priv.jpeg_ptr[arg].chn_num;
@@ -696,7 +697,6 @@ void tasklet_fpga_function(unsigned long arg) {
        wake_up_interruptible(&hist_y_wait_queue);    // wait queue for the G1 histogram (used as Y)
    }
#endif
//#endif /* TEST_DISABLE_CODE */
    // Process parameters
    if ((tasklet_disable & (1 << TASKLET_CTL_PGM))   == 0) {
        processPars (sensor_port, sensorproc, getThisFrameNumber(sensor_port), get_globalParam(sensor_port, G_MAXAHEAD)); // program parameters
@@ -725,13 +725,6 @@ case TASKLET_HIST_ALL: // calculate each frame
    default:                   // calculate always (safer)
        hist_en=1;
    }
/*
GLOBALPARS(0x1040)=((thisFrameNumber & 1) ==0);
GLOBALPARS(0x1041)=((thisFrameNumber & 3) ==0);
GLOBALPARS(0x1042)=((thisFrameNumber & 7) ==0);
GLOBALPARS(0x1043)=hist_en;
GLOBALPARS(0x1044)=thisFrameNumber;
 */
    if (hist_en) {
        // after updateFramePars gammaHash are from framepars[this-1]
        // after updateFramePars gammaHash are from framepars[this-1]
@@ -751,9 +744,6 @@ if (hist_en) {
        PROFILE_NOW(5);
        // Time is out?
        if ((getThisFrameNumber(sensor_port) ^ getHardFrameNumber(sensor_port,is_compressor_irq))  & PARS_FRAMES_MASK) return; // already next frame



#if HISTOGRAMS_WAKEUP_ALWAYS
    }
    wake_up_interruptible(&hist_c_wait_queue);     // wait queue for all the other (R,G2,B) histograms (color)
@@ -855,7 +845,7 @@ int image_acq_init(struct platform_device *pdev)
			dev_err(dev, "can not allocate Elphel FPGA interrupts\n");
			return -EBUSY;
		}

		image_acq_priv.jpeg_ptr[i].irq_num_sens = irq;
		irq = platform_get_irq_byname(pdev, compressor_irq_names[i]);
		if (request_irq(irq,
				compressor_irq_handler,
@@ -865,7 +855,6 @@ int image_acq_init(struct platform_device *pdev)
			dev_err(dev, "can not allocate Elphel FPGA interrupts\n");
			return -EBUSY;
		}
		image_acq_priv.jpeg_ptr[i].irq_num_sens = irq;
		image_acq_priv.jpeg_ptr[i].irq_num_comp = irq;
		image_acq_priv.jpeg_ptr[i].chn_num = i;
	}
+2 −1
Original line number Diff line number Diff line
@@ -1552,11 +1552,12 @@ struct p_names_t {
*       CCAM_MMAP_SIZE -- no. of bytes to mmap.
*/
// CCAM_DMA1_SIZE should be 2^N 
#ifdef NC353
#define CCAM_CHUNK_PER_DMA1BUF 16  /* no. of 64Kbyte chunks per buffer */
#define CCAM_WORDS_PER_DMA1BUF (CCAM_CHUNK_PER_DMA1BUF<<14) /*32bit words...*/
#define CCAM_BYTES_PER_DMA1BUF (CCAM_CHUNK_PER_DMA1BUF<<16)
#define CCAM_DMA1_SIZE CCAM_WORDS_PER_DMA1BUF

#endif


#define CCAM_MMAP_OFFSET_MMAP_HEADER 0
Loading