Commit 64c2d002 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

fixed vaddr and void pointers

parent 9b8552f6
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
//#define DEBUG
#include <linux/device.h> #include <linux/device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -133,7 +134,30 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev) ...@@ -133,7 +134,30 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev)
} }
} }
// TODO: take data from pElphel_buf (calc buf_ptr for each channel) circbuf_priv[0].buf_size = pElphel_buf->circbuf_chn0_size*PAGE_SIZE;
circbuf_priv[0].phys_addr = pElphel_buf->circbuf_chn0_paddr;
circbuf_priv[0].buf_ptr = pElphel_buf->circbuf_chn0_vaddr;
circbuf_priv[1].buf_size = pElphel_buf->circbuf_chn1_size*PAGE_SIZE;
circbuf_priv[1].phys_addr = pElphel_buf->circbuf_chn1_paddr;
circbuf_priv[1].buf_ptr = pElphel_buf->circbuf_chn1_vaddr;
circbuf_priv[2].buf_size = pElphel_buf->circbuf_chn2_size*PAGE_SIZE;
circbuf_priv[2].phys_addr = pElphel_buf->circbuf_chn2_paddr;
circbuf_priv[2].buf_ptr = pElphel_buf->circbuf_chn2_vaddr;
circbuf_priv[3].buf_size = pElphel_buf->circbuf_chn3_size*PAGE_SIZE;
circbuf_priv[3].phys_addr = pElphel_buf->circbuf_chn3_paddr;
circbuf_priv[3].buf_ptr = pElphel_buf->circbuf_chn3_vaddr;
for (i = 0; i < SENSOR_PORTS; i++) {
circbuf_priv[i].buf_size32 = circbuf_priv[i].buf_size>>2; // used in many places
ccam_dma_buf_ptr[i] = circbuf_priv[i].buf_ptr;
set_globalParam(i, G_CIRCBUFSIZE, circbuf_priv[i].buf_size);
}
/*
// DONE: take data from pElphel_buf (calc buf_ptr for each channel)
for (i = 0; i < SENSOR_PORTS; i++) { for (i = 0; i < SENSOR_PORTS; i++) {
// nobody knows what the 1st 1MB is for... // nobody knows what the 1st 1MB is for...
circbuf_priv[i].buf_ptr = dma_buf_ptr + BYTE2DW(CIRCBUF_START_OFFSET + i * CCAM_DMA_SIZE); circbuf_priv[i].buf_ptr = dma_buf_ptr + BYTE2DW(CIRCBUF_START_OFFSET + i * CCAM_DMA_SIZE);
...@@ -145,6 +169,7 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev) ...@@ -145,6 +169,7 @@ int init_ccam_dma_buf_ptr(struct platform_device *pdev)
// set circular buffer size in bytes // set circular buffer size in bytes
set_globalParam(i, G_CIRCBUFSIZE, circbuf_priv[i].buf_size); set_globalParam(i, G_CIRCBUFSIZE, circbuf_priv[i].buf_size);
} }
*/
return 0; return 0;
} }
......
...@@ -187,8 +187,8 @@ int elphelmem_update_partitions(void){ ...@@ -187,8 +187,8 @@ int elphelmem_update_partitions(void){
tmpsize = CIRCBUF_START_OFFSET; tmpsize = CIRCBUF_START_OFFSET;
// fill out buffers info // fill out buffers info
_elphel_buf.circbuf_chn0_vaddr = _elphel_buf.vaddr; _elphel_buf.circbuf_chn0_vaddr = _elphel_buf.vaddr+tmpsize;
_elphel_buf.circbuf_chn0_paddr = _elphel_buf.paddr; _elphel_buf.circbuf_chn0_paddr = _elphel_buf.paddr+tmpsize;
tmpsize += _elphel_buf.circbuf_chn0_size*PAGE_SIZE; tmpsize += _elphel_buf.circbuf_chn0_size*PAGE_SIZE;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/ *******************************************************************************/
#define DEBUG
#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>
......
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