Commit 5eebbef1 authored by Andrey Filippov's avatar Andrey Filippov

updated boson and related drivers

parent d0756d39
......@@ -1009,7 +1009,7 @@ int boson640_pgm_initsensor (int sensor_port, ///< sensor port
dev_info(g_dev_ptr,"boson640_pgm_initsensor(): {%d} frame16=%d frame=%ld: Enable EXTIF (Boson UART control from the sequencer)\n",sensor_port,frame16,getThisFrameNumber(sensor_port));
if (boson640_is_booted (sensor_port, thispars) < 2){ // not yet booted
dev_info(g_dev_ptr,"boson640_pgm_initsensor(): {%d} frame16=%d frame=%ld ABORTED as Boson not yet booted\n",sensor_port,frame16,getThisFrameNumber(sensor_port));
dev_info(g_dev_ptr,"boson640_pgm_initsensor(): {%d} frame16=%d frame=%ld ABORTED as Boson is not yet booted\n",sensor_port,frame16,getThisFrameNumber(sensor_port));
return -1; // Not yet fully booted.
}
......
......@@ -2059,7 +2059,7 @@ static ssize_t store_fpga_time(struct device *dev, struct device_attribute *attr
{
sec_usec_t sec_usec={.sec=0, .usec=0};
// avoiding floating point calcualtions in the kernel
const char *cp = buf;
char *cp = (char *) buf;
int i;
if (sscanf(buf, "%lu.%s", &sec_usec.sec, cp)>0){
sscanf(cp,"%lu",&sec_usec.usec);
......
......@@ -172,6 +172,12 @@ const unsigned long param_depend_tab[]=
ONCHANGE_MEMSENSOR | ONCHANGE_MEMCOMPRESSOR | ONCHANGE_COMPMODE | ONCHANGE_COMPSTOP | ONCHANGE_COMPRESTART ,
P_SENSOR_PHASE, ONCHANGE_SENSORPHASE | ONCHANGE_EXPOSURE | ONCHANGE_LIMITFPS | \
ONCHANGE_MEMSENSOR | ONCHANGE_MEMCOMPRESSOR | ONCHANGE_COMPMODE | ONCHANGE_COMPSTOP | ONCHANGE_COMPRESTART ,
P_SENSOR_IFACE_TIM0, ONCHANGE_SENSORPHASE, // | ONCHANGE_EXPOSURE | ONCHANGE_LIMITFPS | ONCHANGE_MEMSENSOR | ONCHANGE_MEMCOMPRESSOR | ONCHANGE_COMPMODE | ONCHANGE_COMPSTOP | ONCHANGE_COMPRESTART ,
P_SENSOR_IFACE_TIM1, ONCHANGE_SENSORPHASE, // | ONCHANGE_EXPOSURE | ONCHANGE_LIMITFPS | ONCHANGE_MEMSENSOR | ONCHANGE_MEMCOMPRESSOR | ONCHANGE_COMPMODE | ONCHANGE_COMPSTOP | ONCHANGE_COMPRESTART ,
P_SENSOR_IFACE_TIM2, ONCHANGE_SENSORPHASE, // | ONCHANGE_EXPOSURE | ONCHANGE_LIMITFPS | ONCHANGE_MEMSENSOR | ONCHANGE_MEMCOMPRESSOR | ONCHANGE_COMPMODE | ONCHANGE_COMPSTOP | ONCHANGE_COMPRESTART ,
P_SENSOR_IFACE_TIM3, ONCHANGE_SENSORPHASE, // | ONCHANGE_EXPOSURE | ONCHANGE_LIMITFPS | ONCHANGE_MEMSENSOR | ONCHANGE_MEMCOMPRESSOR | ONCHANGE_COMPMODE | ONCHANGE_COMPSTOP | ONCHANGE_COMPRESTART ,
P_FPGA_XTRA, ONCHANGE_LIMITFPS ,
//TODO NC393: Check - maybe no-need to stop/restart the compressor when changing trigger modes?
......
......@@ -682,6 +682,11 @@ int pgm_sensorphase (int sensor_port, ///< sensor port number (
///< @return always 0
{
// bypasses sequencer - OK?
// trying change phases with Boson:
// does not clear "modified", loops forever
// always comes with ASAP
// try prevpars?
#ifndef NC353
int fpga_interface = x393_sensor_interface();
x393_sensio_ctl_t sensio_ctl = {.d32=0};
......@@ -710,20 +715,27 @@ int pgm_sensorphase (int sensor_port, ///< sensor port number (
MDP(DBGB_PADD, sensor_port,"X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim1, 0x%x)\n", sensor_port, frame16, sensio_tim1 .d32)
}
}
if (FRAMEPAR_MODIFIED(P_SENSOR_IFACE_TIM2)) {
// if (FRAMEPAR_MODIFIED(P_SENSOR_IFACE_TIM2)) {
if (thispars->pars[P_SENSOR_IFACE_TIM2] != prevpars->pars[P_SENSOR_IFACE_TIM2]) {
sensio_tim2.d32 = thispars->pars[P_SENSOR_IFACE_TIM2];
// X393_SEQ_SEND1 (sensor_port, frame16, x393_sensio_tim2, sensio_tim2);
set_x393_sensio_tim2 (sensio_tim2, sensor_port); // write directly, sequencer may be not operational
sensio_ctl.set_dly = 1;
dev_dbg(g_dev_ptr,"{%d} X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim2, 0x%x)\n",sensor_port, sensor_port, frame16, sensio_tim2.d32);
// dev_dbg(g_dev_ptr,"{%d} X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim2, 0x%x)\n",sensor_port, sensor_port, frame16, sensio_tim2.d32);
// dev_info(g_dev_ptr,"{%d} X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim2, 0x%x)\n",sensor_port, sensor_port, frame16, sensio_tim2.d32);
dev_info(g_dev_ptr,"{%d} frame16= 0x%x, thispars->pars[P_SENSOR_IFACE_TIM2] = 0x%lx prevpars->pars[P_SENSOR_IFACE_TIM2]=0x%lx\n",
sensor_port, frame16, thispars->pars[P_SENSOR_IFACE_TIM2], prevpars->pars[P_SENSOR_IFACE_TIM2]);
MDP(DBGB_PADD, sensor_port,"X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim2, 0x%x)\n",sensor_port, frame16, sensio_tim2.d32)
}
if (FRAMEPAR_MODIFIED(P_SENSOR_IFACE_TIM3)) {
// if (FRAMEPAR_MODIFIED(P_SENSOR_IFACE_TIM3)) {
if (thispars->pars[P_SENSOR_IFACE_TIM3] != prevpars->pars[P_SENSOR_IFACE_TIM3]) {
sensio_tim3.d32 = thispars->pars[P_SENSOR_IFACE_TIM3];
// X393_SEQ_SEND1 (sensor_port, frame16, x393_sensio_tim3, sensio_tim3);
set_x393_sensio_tim3 (sensio_tim3, sensor_port); // write directly, sequencer may be not operational
sensio_ctl.set_dly = 1;
dev_dbg(g_dev_ptr,"{%d} X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim3, 0x%x)\n",sensor_port, sensor_port, frame16, sensio_tim3.d32);
// dev_dbg(g_dev_ptr,"{%d} X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim3, 0x%x)\n",sensor_port, sensor_port, frame16, sensio_tim3.d32);
dev_info(g_dev_ptr,"{%d} X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim3, 0x%x)\n",sensor_port, sensor_port, frame16, sensio_tim3.d32);
MDP(DBGB_PADD, sensor_port,"X393_SEQ_SEND1(0x%x, 0x%x, x393_sensio_tim3, 0x%x)\n", sensor_port, frame16, sensio_tim3.d32)
}
......@@ -732,15 +744,24 @@ int pgm_sensorphase (int sensor_port, ///< sensor port number (
sensio_ctl.quadrants = thispars->pars[P_SENSOR_PHASE] & 0x7f;
sensio_ctl.quadrants_set = 1;
}
/*
if (sensio_ctl.d32) {
x393_sensio_ctrl(sensio_ctl, sensor_port);
dev_dbg(g_dev_ptr,"{%d} x393_sensio_ctrl(0x%08x, %d))\n",sensor_port, sensio_ctl.d32, sensor_port);
MDP(DBGB_PADD, sensor_port,"x393_sensio_ctrl(0x%08x, %d))\n", sensio_ctl.d32, sensor_port)
}
*/
} else {
/* TODO 393: Add HISPI code */
}
if (sensio_ctl.d32) { // for all sensors (parallel, boson)!
x393_sensio_ctrl(sensio_ctl, sensor_port);
// dev_dbg(g_dev_ptr,"{%d} x393_sensio_ctrl(0x%08x, %d))\n",sensor_port, sensio_ctl.d32, sensor_port);
dev_info(g_dev_ptr,"{%d} x393_sensio_ctrl(0x%08x, %d))\n",sensor_port, sensio_ctl.d32, sensor_port);
MDP(DBGB_PADD, sensor_port,"x393_sensio_ctrl(0x%08x, %d))\n", sensio_ctl.d32, sensor_port)
}
return 0;
#else
......
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