Commit dcff74ce authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: dt3155: replace u_int and u_long usage

Use u32 and u64 instead, that's the proper thing to do.

Cc: Scott Smedley <ss@aao.gov.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5d392111
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
------------------------------------------------------------------- -------------------------------------------------------------------
02-Aug-2002 NJC allocator now steps in 1MB increments, rather 02-Aug-2002 NJC allocator now steps in 1MB increments, rather
than doubling its size each time. than doubling its size each time.
Also, allocator_init(u_int *) now returns Also, allocator_init(u32 *) now returns
(in the first arg) the size of the free (in the first arg) the size of the free
space. This is no longer consistent with space. This is no longer consistent with
using the allocator as a module, and some changes using the allocator as a module, and some changes
...@@ -195,7 +195,7 @@ int allocator_free_dma(unsigned long address) ...@@ -195,7 +195,7 @@ int allocator_free_dma(unsigned long address)
* On cleanup everything is released. If the list is not empty, that a * On cleanup everything is released. If the list is not empty, that a
* problem of our clients * problem of our clients
*/ */
int allocator_init(u_long *allocator_max) int allocator_init(u64 *allocator_max)
{ {
/* check how much free memory is there */ /* check how much free memory is there */
void *remapped; void *remapped;
......
...@@ -24,5 +24,5 @@ ...@@ -24,5 +24,5 @@
void allocator_free_dma(unsigned long address); void allocator_free_dma(unsigned long address);
unsigned long allocator_allocate_dma(unsigned long kilobytes, int priority); unsigned long allocator_allocate_dma(unsigned long kilobytes, int priority);
int allocator_init(u_long *); int allocator_init(u64 *);
void allocator_cleanup(void); void allocator_cleanup(void);
...@@ -35,7 +35,7 @@ MA 02111-1307 USA ...@@ -35,7 +35,7 @@ MA 02111-1307 USA
#define _DT3155_INC #define _DT3155_INC
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/types.h> /* u_int etc. */ #include <linux/types.h>
#include <linux/time.h> /* struct timeval */ #include <linux/time.h> /* struct timeval */
#else #else
#include <sys/ioctl.h> #include <sys/ioctl.h>
...@@ -71,16 +71,16 @@ MA 02111-1307 USA ...@@ -71,16 +71,16 @@ MA 02111-1307 USA
/* Configuration structure */ /* Configuration structure */
struct dt3155_config_s { struct dt3155_config_s {
u_int acq_mode; u32 acq_mode;
u_int cols, rows; u32 cols, rows;
u_int continuous; u32 continuous;
}; };
/* hold data for each frame */ /* hold data for each frame */
typedef struct { typedef struct {
u_long addr; /* address of the buffer with the frame */ u64 addr; /* address of the buffer with the frame */
u_long tag; /* unique number for the frame */ u64 tag; /* unique number for the frame */
struct timeval time; /* time that capture took place */ struct timeval time; /* time that capture took place */
} frame_info_t; } frame_info_t;
...@@ -101,14 +101,14 @@ struct dt3155_fbuffer_s { ...@@ -101,14 +101,14 @@ struct dt3155_fbuffer_s {
int locked_buf; /* Buffers used by user */ int locked_buf; /* Buffers used by user */
int ready_que[BOARD_MAX_BUFFS]; int ready_que[BOARD_MAX_BUFFS];
u_long ready_head; /* The most recent buffer located here */ u64 ready_head; /* The most recent buffer located here */
u_long ready_len; /* The number of ready buffers */ u64 ready_len; /* The number of ready buffers */
int even_happened; int even_happened;
int even_stopped; int even_stopped;
int stop_acquire; /* Flag to stop interrupts */ int stop_acquire; /* Flag to stop interrupts */
u_long frame_count; /* Counter for frames acquired by this card */ u64 frame_count; /* Counter for frames acquired by this card */
}; };
...@@ -122,14 +122,14 @@ struct dt3155_fbuffer_s { ...@@ -122,14 +122,14 @@ struct dt3155_fbuffer_s {
/* There is one status structure for each card. */ /* There is one status structure for each card. */
typedef struct dt3155_status_s { typedef struct dt3155_status_s {
int fixed_mode; /* if 1, we are in fixed frame mode */ int fixed_mode; /* if 1, we are in fixed frame mode */
u_long reg_addr; /* Register address for a single card */ u64 reg_addr; /* Register address for a single card */
u_long mem_addr; /* Buffer start addr for this card */ u64 mem_addr; /* Buffer start addr for this card */
u_long mem_size; /* This is the amount of mem available */ u64 mem_size; /* This is the amount of mem available */
u_int irq; /* this card's irq */ u32 irq; /* this card's irq */
struct dt3155_config_s config; /* configuration struct */ struct dt3155_config_s config; /* configuration struct */
struct dt3155_fbuffer_s fbuffer; /* frame buffer state struct */ struct dt3155_fbuffer_s fbuffer; /* frame buffer state struct */
u_long state; /* this card's state */ u64 state; /* this card's state */
u_int device_installed; /* Flag if installed. 1=installed */ u32 device_installed; /* Flag if installed. 1=installed */
} dt3155_status_t; } dt3155_status_t;
/* Reference to global status structure */ /* Reference to global status structure */
...@@ -161,9 +161,9 @@ extern struct dt3155_status_s dt3155_status[MAXBOARDS]; ...@@ -161,9 +161,9 @@ extern struct dt3155_status_s dt3155_status[MAXBOARDS];
/* User code will probably want to declare one of these for each card */ /* User code will probably want to declare one of these for each card */
typedef struct dt3155_read_s { typedef struct dt3155_read_s {
u_long offset; u64 offset;
u_long frame_seq; u64 frame_seq;
u_long state; u64 state;
frame_info_t frame_info; frame_info_t frame_info;
} dt3155_read_t; } dt3155_read_t;
......
...@@ -130,14 +130,14 @@ u8 *dt3155_lbase[ MAXBOARDS ] = { NULL ...@@ -130,14 +130,14 @@ u8 *dt3155_lbase[ MAXBOARDS ] = { NULL
/* DT3155 registers */ /* DT3155 registers */
u8 *dt3155_bbase = NULL; /* kernel logical address of the * u8 *dt3155_bbase = NULL; /* kernel logical address of the *
* buffer region */ * buffer region */
u_int dt3155_dev_open[ MAXBOARDS ] = {0 u32 dt3155_dev_open[ MAXBOARDS ] = {0
#if MAXBOARDS == 2 #if MAXBOARDS == 2
, 0 , 0
#endif #endif
}; };
u_int ndevices = 0; u32 ndevices = 0;
u_long unique_tag = 0;; u64 unique_tag = 0;;
/* /*
...@@ -180,7 +180,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs ) ...@@ -180,7 +180,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
int minor = -1; int minor = -1;
int index; int index;
unsigned long flags; unsigned long flags;
u_long buffer_addr; u64 buffer_addr;
/* find out who issued the interrupt */ /* find out who issued the interrupt */
for ( index = 0; index < ndevices; index++ ) { for ( index = 0; index < ndevices; index++ ) {
...@@ -249,7 +249,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs ) ...@@ -249,7 +249,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
{ {
/* GCS (Aug 2, 2002) -- In field mode, dma the odd field /* GCS (Aug 2, 2002) -- In field mode, dma the odd field
into the lower half of the buffer */ into the lower half of the buffer */
const u_long stride = dt3155_status[ minor ].config.cols; const u64 stride = dt3155_status[ minor ].config.cols;
buffer_addr = dt3155_fbuffer[ minor ]-> buffer_addr = dt3155_fbuffer[ minor ]->
frame_info[ dt3155_fbuffer[ minor ]->active_buf ].addr frame_info[ dt3155_fbuffer[ minor ]->active_buf ].addr
+ (DT3155_MAX_ROWS / 2) * stride; + (DT3155_MAX_ROWS / 2) * stride;
...@@ -311,8 +311,8 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs ) ...@@ -311,8 +311,8 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
dt3155_fbuffer[ minor ]->stop_acquire = 0; dt3155_fbuffer[ minor ]->stop_acquire = 0;
dt3155_fbuffer[ minor ]->even_stopped = 0; dt3155_fbuffer[ minor ]->even_stopped = 0;
printk(KERN_DEBUG "dt3155: state is now %lx\n", printk(KERN_DEBUG "dt3155: state is now %x\n",
dt3155_status[minor].state); (u32)dt3155_status[minor].state);
} }
else else
{ {
...@@ -428,7 +428,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs ) ...@@ -428,7 +428,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
*****************************************************/ *****************************************************/
static void dt3155_init_isr(int minor) static void dt3155_init_isr(int minor)
{ {
const u_long stride = dt3155_status[ minor ].config.cols; const u64 stride = dt3155_status[ minor ].config.cols;
switch (dt3155_status[ minor ].state & DT3155_STATE_MODE) switch (dt3155_status[ minor ].state & DT3155_STATE_MODE)
{ {
...@@ -522,11 +522,10 @@ static void dt3155_init_isr(int minor) ...@@ -522,11 +522,10 @@ static void dt3155_init_isr(int minor)
* ioctl() * ioctl()
* *
*****************************************************/ *****************************************************/
static int dt3155_ioctl ( static int dt3155_ioctl(struct inode *inode,
struct inode *inode, struct file *file,
struct file *file, unsigned int cmd,
u_int cmd, unsigned long arg)
u_long arg)
{ {
int minor = MINOR(inode->i_rdev); /* What device are we ioctl()'ing? */ int minor = MINOR(inode->i_rdev); /* What device are we ioctl()'ing? */
...@@ -706,8 +705,8 @@ static int dt3155_open( struct inode* inode, struct file* filep) ...@@ -706,8 +705,8 @@ static int dt3155_open( struct inode* inode, struct file* filep)
} }
if (dt3155_status[ minor ].state != DT3155_STATE_IDLE) { if (dt3155_status[ minor ].state != DT3155_STATE_IDLE) {
printk ("DT3155: Not in idle state (state = %lx)\n", printk ("DT3155: Not in idle state (state = %x)\n",
dt3155_status[ minor ].state); (u32)dt3155_status[ minor ].state);
return -EBUSY; return -EBUSY;
} }
...@@ -763,7 +762,7 @@ static ssize_t dt3155_read(struct file *filep, char __user *buf, ...@@ -763,7 +762,7 @@ static ssize_t dt3155_read(struct file *filep, char __user *buf,
{ {
/* which device are we reading from? */ /* which device are we reading from? */
int minor = MINOR(filep->f_dentry->d_inode->i_rdev); int minor = MINOR(filep->f_dentry->d_inode->i_rdev);
u_long offset; u64 offset;
int frame_index; int frame_index;
frame_info_t *frame_info_p; frame_info_t *frame_info_p;
...@@ -821,11 +820,11 @@ static ssize_t dt3155_read(struct file *filep, char __user *buf, ...@@ -821,11 +820,11 @@ static ssize_t dt3155_read(struct file *filep, char __user *buf,
offset = frame_info_p->addr - dt3155_status[minor].mem_addr; offset = frame_info_p->addr - dt3155_status[minor].mem_addr;
put_user(offset, (unsigned int *) buf); put_user(offset, (unsigned int *) buf);
buf += sizeof(u_long); buf += sizeof(u64);
put_user( dt3155_status[minor].fbuffer.frame_count, (unsigned int *) buf); put_user( dt3155_status[minor].fbuffer.frame_count, (unsigned int *) buf);
buf += sizeof(u_long); buf += sizeof(u64);
put_user(dt3155_status[minor].state, (unsigned int *) buf); put_user(dt3155_status[minor].state, (unsigned int *) buf);
buf += sizeof(u_long); buf += sizeof(u64);
if (copy_to_user(buf, frame_info_p, sizeof(frame_info_t))) if (copy_to_user(buf, frame_info_p, sizeof(frame_info_t)))
return -EFAULT; return -EFAULT;
...@@ -899,7 +898,7 @@ static int find_PCI (void) ...@@ -899,7 +898,7 @@ static int find_PCI (void)
/* Now, just go out and make sure that this/these device(s) is/are /* Now, just go out and make sure that this/these device(s) is/are
actually mapped into the kernel address space */ actually mapped into the kernel address space */
if ((error = pci_read_config_dword( pci_dev, PCI_BASE_ADDRESS_0, if ((error = pci_read_config_dword( pci_dev, PCI_BASE_ADDRESS_0,
(u_int *) &base))) (u32 *) &base)))
{ {
printk("DT3155: Was not able to find device \n"); printk("DT3155: Was not able to find device \n");
goto err; goto err;
...@@ -932,7 +931,7 @@ static int find_PCI (void) ...@@ -932,7 +931,7 @@ static int find_PCI (void)
dt3155_status[ pci_index-1 ].device_installed = 1; dt3155_status[ pci_index-1 ].device_installed = 1;
printk("DT3155: Installing device %d w/irq %d and address %p\n", printk("DT3155: Installing device %d w/irq %d and address %p\n",
pci_index, pci_index,
(u_int)dt3155_status[pci_index-1].irq, (u32)dt3155_status[pci_index-1].irq,
dt3155_lbase[pci_index-1]); dt3155_lbase[pci_index-1]);
} }
...@@ -945,7 +944,7 @@ err: ...@@ -945,7 +944,7 @@ err:
return DT_3155_FAILURE; return DT_3155_FAILURE;
} }
u_long allocatorAddr = 0; u64 allocatorAddr = 0;
/***************************************************** /*****************************************************
* init_module() * init_module()
...@@ -1024,10 +1023,10 @@ int init_module(void) ...@@ -1024,10 +1023,10 @@ int init_module(void)
dt3155_status[ index ].config.cols, dt3155_status[ index ].config.cols,
dt3155_status[ index ].config.rows); dt3155_status[ index ].config.rows);
printk("DT3155: m_addr = 0x%x; m_size = %ld; " printk("DT3155: m_addr = 0x%x; m_size = %ld; "
"state = %ld; device_installed = %d\n", "state = %d; device_installed = %d\n",
(u_int)dt3155_status[ index ].mem_addr, (u32)dt3155_status[ index ].mem_addr,
dt3155_status[ index ].mem_size, (long int)dt3155_status[ index ].mem_size,
dt3155_status[ index ].state, (u32)dt3155_status[ index ].state,
dt3155_status[ index ].device_installed); dt3155_status[ index ].device_installed);
} }
......
...@@ -38,7 +38,7 @@ extern wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS]; ...@@ -38,7 +38,7 @@ extern wait_queue_head_t dt3155_read_wait_queue[MAXBOARDS];
#endif #endif
/* number of devices */ /* number of devices */
extern u_int ndevices; extern u32 ndevices;
extern int dt3155_errno; extern int dt3155_errno;
......
...@@ -55,12 +55,12 @@ MA 02111-1307 USA ...@@ -55,12 +55,12 @@ MA 02111-1307 USA
/****** local copies of board's 32 bit registers ******/ /****** local copies of board's 32 bit registers ******/
u_long even_dma_start_r; /* bit 0 should always be 0 */ u64 even_dma_start_r; /* bit 0 should always be 0 */
u_long odd_dma_start_r; /* .. */ u64 odd_dma_start_r; /* .. */
u_long even_dma_stride_r; /* bits 0&1 should always be 0 */ u64 even_dma_stride_r; /* bits 0&1 should always be 0 */
u_long odd_dma_stride_r; /* .. */ u64 odd_dma_stride_r; /* .. */
u_long even_pixel_fmt_r; u64 even_pixel_fmt_r;
u_long odd_pixel_fmt_r; u64 odd_pixel_fmt_r;
FIFO_TRIGGER_R fifo_trigger_r; FIFO_TRIGGER_R fifo_trigger_r;
XFER_MODE_R xfer_mode_r; XFER_MODE_R xfer_mode_r;
...@@ -68,8 +68,8 @@ CSR1_R csr1_r; ...@@ -68,8 +68,8 @@ CSR1_R csr1_r;
RETRY_WAIT_CNT_R retry_wait_cnt_r; RETRY_WAIT_CNT_R retry_wait_cnt_r;
INT_CSR_R int_csr_r; INT_CSR_R int_csr_r;
u_long even_fld_mask_r; u64 even_fld_mask_r;
u_long odd_fld_mask_r; u64 odd_fld_mask_r;
MASK_LENGTH_R mask_length_r; MASK_LENGTH_R mask_length_r;
FIFO_FLAG_CNT_R fifo_flag_cnt_r; FIFO_FLAG_CNT_R fifo_flag_cnt_r;
......
...@@ -36,8 +36,8 @@ MA 02111-1307 USA ...@@ -36,8 +36,8 @@ MA 02111-1307 USA
/* macros to access registers */ /* macros to access registers */
#define WriteMReg(Address, Data) (*((u_long *)(Address)) = Data) #define WriteMReg(Address, Data) (*((u64 *)(Address)) = Data)
#define ReadMReg(Address, Data) (Data = *((u_long *)(Address))) #define ReadMReg(Address, Data) (Data = *((u64 *)(Address)))
/***************** 32 bit register globals **************/ /***************** 32 bit register globals **************/
...@@ -71,114 +71,114 @@ MA 02111-1307 USA ...@@ -71,114 +71,114 @@ MA 02111-1307 USA
/******** Assignments and Typedefs for 32 bit Memory Mapped Registers ********/ /******** Assignments and Typedefs for 32 bit Memory Mapped Registers ********/
typedef union fifo_trigger_tag { typedef union fifo_trigger_tag {
u_long reg; u64 reg;
struct { struct {
u_long PACKED:6; u64 PACKED:6;
u_long :9; u64 :9;
u_long PLANER:7; u64 PLANER:7;
u_long :9; u64 :9;
} fld; } fld;
} FIFO_TRIGGER_R; } FIFO_TRIGGER_R;
typedef union xfer_mode_tag { typedef union xfer_mode_tag {
u_long reg; u64 reg;
struct { struct {
u_long :2; u64 :2;
u_long FIELD_TOGGLE:1; u64 FIELD_TOGGLE:1;
u_long :5; u64 :5;
u_long :2; u64 :2;
u_long :22; u64 :22;
} fld; } fld;
} XFER_MODE_R; } XFER_MODE_R;
typedef union csr1_tag { typedef union csr1_tag {
u_long reg; u64 reg;
struct { struct {
u_long CAP_CONT_EVE:1; u64 CAP_CONT_EVE:1;
u_long CAP_CONT_ODD:1; u64 CAP_CONT_ODD:1;
u_long CAP_SNGL_EVE:1; u64 CAP_SNGL_EVE:1;
u_long CAP_SNGL_ODD:1; u64 CAP_SNGL_ODD:1;
u_long FLD_DN_EVE :1; u64 FLD_DN_EVE :1;
u_long FLD_DN_ODD :1; u64 FLD_DN_ODD :1;
u_long SRST :1; u64 SRST :1;
u_long FIFO_EN :1; u64 FIFO_EN :1;
u_long FLD_CRPT_EVE:1; u64 FLD_CRPT_EVE:1;
u_long FLD_CRPT_ODD:1; u64 FLD_CRPT_ODD:1;
u_long ADDR_ERR_EVE:1; u64 ADDR_ERR_EVE:1;
u_long ADDR_ERR_ODD:1; u64 ADDR_ERR_ODD:1;
u_long CRPT_DIS :1; u64 CRPT_DIS :1;
u_long RANGE_EN :1; u64 RANGE_EN :1;
u_long :16; u64 :16;
} fld; } fld;
} CSR1_R; } CSR1_R;
typedef union retry_wait_cnt_tag { typedef union retry_wait_cnt_tag {
u_long reg; u64 reg;
struct { struct {
u_long RTRY_WAIT_CNT:8; u64 RTRY_WAIT_CNT:8;
u_long :24; u64 :24;
} fld; } fld;
} RETRY_WAIT_CNT_R; } RETRY_WAIT_CNT_R;
typedef union int_csr_tag { typedef union int_csr_tag {
u_long reg; u64 reg;
struct { struct {
u_long FLD_END_EVE :1; u64 FLD_END_EVE :1;
u_long FLD_END_ODD :1; u64 FLD_END_ODD :1;
u_long FLD_START :1; u64 FLD_START :1;
u_long :5; u64 :5;
u_long FLD_END_EVE_EN:1; u64 FLD_END_EVE_EN:1;
u_long FLD_END_ODD_EN:1; u64 FLD_END_ODD_EN:1;
u_long FLD_START_EN :1; u64 FLD_START_EN :1;
u_long :21; u64 :21;
} fld; } fld;
} INT_CSR_R; } INT_CSR_R;
typedef union mask_length_tag { typedef union mask_length_tag {
u_long reg; u64 reg;
struct { struct {
u_long MASK_LEN_EVE:5; u64 MASK_LEN_EVE:5;
u_long :11; u64 :11;
u_long MASK_LEN_ODD:5; u64 MASK_LEN_ODD:5;
u_long :11; u64 :11;
} fld; } fld;
} MASK_LENGTH_R; } MASK_LENGTH_R;
typedef union fifo_flag_cnt_tag { typedef union fifo_flag_cnt_tag {
u_long reg; u64 reg;
struct { struct {
u_long AF_COUNT:7; u64 AF_COUNT:7;
u_long :9; u64 :9;
u_long AE_COUNT:7; u64 AE_COUNT:7;
u_long :9; u64 :9;
} fld; } fld;
} FIFO_FLAG_CNT_R; } FIFO_FLAG_CNT_R;
typedef union iic_clk_dur { typedef union iic_clk_dur {
u_long reg; u64 reg;
struct { struct {
u_long PHASE_1:8; u64 PHASE_1:8;
u_long PHASE_2:8; u64 PHASE_2:8;
u_long PHASE_3:8; u64 PHASE_3:8;
u_long PHASE_4:8; u64 PHASE_4:8;
} fld; } fld;
} IIC_CLK_DUR_R; } IIC_CLK_DUR_R;
typedef union iic_csr1_tag { typedef union iic_csr1_tag {
u_long reg; u64 reg;
struct { struct {
u_long AUTO_EN :1; u64 AUTO_EN :1;
u_long BYPASS :1; u64 BYPASS :1;
u_long SDA_OUT :1; u64 SDA_OUT :1;
u_long SCL_OUT :1; u64 SCL_OUT :1;
u_long :4; u64 :4;
u_long AUTO_ABORT :1; u64 AUTO_ABORT :1;
u_long DIRECT_ABORT:1; u64 DIRECT_ABORT:1;
u_long SDA_IN :1; u64 SDA_IN :1;
u_long SCL_IN :1; u64 SCL_IN :1;
u_long :4; u64 :4;
u_long AUTO_ADDR :8; u64 AUTO_ADDR :8;
u_long RD_DATA :8; u64 RD_DATA :8;
} fld; } fld;
} IIC_CSR1_R; } IIC_CSR1_R;
...@@ -186,14 +186,14 @@ typedef union iic_csr1_tag { ...@@ -186,14 +186,14 @@ typedef union iic_csr1_tag {
* iic_csr2_tag * iic_csr2_tag
*/ */
typedef union iic_csr2_tag { typedef union iic_csr2_tag {
u_long reg; u64 reg;
struct { struct {
u_long DIR_WR_DATA :8; u64 DIR_WR_DATA :8;
u_long DIR_SUB_ADDR:8; u64 DIR_SUB_ADDR:8;
u_long DIR_RD :1; u64 DIR_RD :1;
u_long DIR_ADDR :7; u64 DIR_ADDR :7;
u_long NEW_CYCLE :1; u64 NEW_CYCLE :1;
u_long :7; u64 :7;
} fld; } fld;
} IIC_CSR2_R; } IIC_CSR2_R;
...@@ -203,10 +203,10 @@ typedef union iic_csr2_tag { ...@@ -203,10 +203,10 @@ typedef union iic_csr2_tag {
* dma_upper_lmt_tag * dma_upper_lmt_tag
*/ */
typedef union dma_upper_lmt_tag { typedef union dma_upper_lmt_tag {
u_long reg; u64 reg;
struct { struct {
u_long DMA_UPPER_LMT_VAL:24; u64 DMA_UPPER_LMT_VAL:24;
u_long :8; u64 :8;
} fld; } fld;
} DMA_UPPER_LMT_R; } DMA_UPPER_LMT_R;
...@@ -214,12 +214,12 @@ typedef union dma_upper_lmt_tag { ...@@ -214,12 +214,12 @@ typedef union dma_upper_lmt_tag {
/* /*
* Global declarations of local copies of boards' 32 bit registers * Global declarations of local copies of boards' 32 bit registers
*/ */
extern u_long even_dma_start_r; /* bit 0 should always be 0 */ extern u64 even_dma_start_r; /* bit 0 should always be 0 */
extern u_long odd_dma_start_r; /* .. */ extern u64 odd_dma_start_r; /* .. */
extern u_long even_dma_stride_r; /* bits 0&1 should always be 0 */ extern u64 even_dma_stride_r; /* bits 0&1 should always be 0 */
extern u_long odd_dma_stride_r; /* .. */ extern u64 odd_dma_stride_r; /* .. */
extern u_long even_pixel_fmt_r; extern u64 even_pixel_fmt_r;
extern u_long odd_pixel_fmt_r; extern u64 odd_pixel_fmt_r;
extern FIFO_TRIGGER_R fifo_trigger_r; extern FIFO_TRIGGER_R fifo_trigger_r;
extern XFER_MODE_R xfer_mode_r; extern XFER_MODE_R xfer_mode_r;
...@@ -227,8 +227,8 @@ extern CSR1_R csr1_r; ...@@ -227,8 +227,8 @@ extern CSR1_R csr1_r;
extern RETRY_WAIT_CNT_R retry_wait_cnt_r; extern RETRY_WAIT_CNT_R retry_wait_cnt_r;
extern INT_CSR_R int_csr_r; extern INT_CSR_R int_csr_r;
extern u_long even_fld_mask_r; extern u64 even_fld_mask_r;
extern u_long odd_fld_mask_r; extern u64 odd_fld_mask_r;
extern MASK_LENGTH_R mask_length_r; extern MASK_LENGTH_R mask_length_r;
extern FIFO_FLAG_CNT_R fifo_flag_cnt_r; extern FIFO_FLAG_CNT_R fifo_flag_cnt_r;
......
...@@ -220,7 +220,7 @@ inline void printques( int m ) ...@@ -220,7 +220,7 @@ inline void printques( int m )
* the start address up to the beginning of the * the start address up to the beginning of the
* next 4MB chunk (assuming bufsize < 4MB). * next 4MB chunk (assuming bufsize < 4MB).
*****************************************************/ *****************************************************/
u_long adjust_4MB (u_long buf_addr, u_long bufsize) { u64 adjust_4MB (u64 buf_addr, u64 bufsize) {
if (((buf_addr+bufsize) & UPPER_10_BITS) != (buf_addr & UPPER_10_BITS)) if (((buf_addr+bufsize) & UPPER_10_BITS) != (buf_addr & UPPER_10_BITS))
return (buf_addr+bufsize) & UPPER_10_BITS; return (buf_addr+bufsize) & UPPER_10_BITS;
else else
...@@ -235,26 +235,26 @@ u_long adjust_4MB (u_long buf_addr, u_long bufsize) { ...@@ -235,26 +235,26 @@ u_long adjust_4MB (u_long buf_addr, u_long bufsize) {
* buffers. If there is not enough free space * buffers. If there is not enough free space
* try for less memory. * try for less memory.
*****************************************************/ *****************************************************/
void allocate_buffers (u_long *buf_addr, u_long* total_size_kbs, void allocate_buffers (u64 *buf_addr, u64* total_size_kbs,
u_long bufsize) u64 bufsize)
{ {
/* Compute the minimum amount of memory guaranteed to hold all /* Compute the minimum amount of memory guaranteed to hold all
MAXBUFFERS such that no buffer crosses the 4MB boundary. MAXBUFFERS such that no buffer crosses the 4MB boundary.
Store this value in the variable "full_size" */ Store this value in the variable "full_size" */
u_long allocator_max; u64 allocator_max;
u_long bufs_per_chunk = (FOUR_MB / bufsize); u64 bufs_per_chunk = (FOUR_MB / bufsize);
u_long filled_chunks = (MAXBUFFERS-1) / bufs_per_chunk; u64 filled_chunks = (MAXBUFFERS-1) / bufs_per_chunk;
u_long leftover_bufs = MAXBUFFERS - filled_chunks * bufs_per_chunk; u64 leftover_bufs = MAXBUFFERS - filled_chunks * bufs_per_chunk;
u_long full_size = bufsize /* possibly unusable part of 1st chunk */ u64 full_size = bufsize /* possibly unusable part of 1st chunk */
+ filled_chunks * FOUR_MB /* max # of completely filled 4mb chunks */ + filled_chunks * FOUR_MB /* max # of completely filled 4mb chunks */
+ leftover_bufs * bufsize; /* these buffs will be in a partly filled + leftover_bufs * bufsize; /* these buffs will be in a partly filled
chunk at beginning or end */ chunk at beginning or end */
u_long full_size_kbs = 1 + (full_size-1) / 1024; u64 full_size_kbs = 1 + (full_size-1) / 1024;
u_long min_size_kbs = 2*ndevices*bufsize / 1024; u64 min_size_kbs = 2*ndevices*bufsize / 1024;
u_long size_kbs; u64 size_kbs;
/* Now, try to allocate full_size. If this fails, keep trying for /* Now, try to allocate full_size. If this fails, keep trying for
less & less memory until it succeeds. */ less & less memory until it succeeds. */
...@@ -264,13 +264,13 @@ void allocate_buffers (u_long *buf_addr, u_long* total_size_kbs, ...@@ -264,13 +264,13 @@ void allocate_buffers (u_long *buf_addr, u_long* total_size_kbs,
#endif #endif
size_kbs = full_size_kbs; size_kbs = full_size_kbs;
*buf_addr = 0; *buf_addr = 0;
printk ("DT3155: We would like to get: %d KB\n", (u_int)(full_size_kbs)); printk ("DT3155: We would like to get: %d KB\n", (u32)(full_size_kbs));
printk ("DT3155: ...but need at least: %d KB\n", (u_int)(min_size_kbs)); printk ("DT3155: ...but need at least: %d KB\n", (u32)(min_size_kbs));
printk ("DT3155: ...the allocator has: %d KB\n", (u_int)(allocator_max)); printk ("DT3155: ...the allocator has: %d KB\n", (u32)(allocator_max));
size_kbs = (full_size_kbs <= allocator_max ? full_size_kbs : allocator_max); size_kbs = (full_size_kbs <= allocator_max ? full_size_kbs : allocator_max);
if (size_kbs > min_size_kbs) { if (size_kbs > min_size_kbs) {
if ((*buf_addr = allocator_allocate_dma (size_kbs, GFP_KERNEL)) != 0) { if ((*buf_addr = allocator_allocate_dma (size_kbs, GFP_KERNEL)) != 0) {
printk ("DT3155: Managed to allocate: %d KB\n", (u_int)size_kbs); printk ("DT3155: Managed to allocate: %d KB\n", (u32)size_kbs);
*total_size_kbs = size_kbs; *total_size_kbs = size_kbs;
return; return;
} }
...@@ -298,17 +298,17 @@ void allocate_buffers (u_long *buf_addr, u_long* total_size_kbs, ...@@ -298,17 +298,17 @@ void allocate_buffers (u_long *buf_addr, u_long* total_size_kbs,
* 4MB boundary. Also, add error checking. This * 4MB boundary. Also, add error checking. This
* function will return -ENOMEM when not enough memory. * function will return -ENOMEM when not enough memory.
*****************************************************/ *****************************************************/
u_long dt3155_setup_buffers(u_long *allocatorAddr) u64 dt3155_setup_buffers(u64 *allocatorAddr)
{ {
u_long index; u64 index;
u_long rambuff_addr; /* start of allocation */ u64 rambuff_addr; /* start of allocation */
u_long rambuff_size; /* total size allocated to driver */ u64 rambuff_size; /* total size allocated to driver */
u_long rambuff_acm; /* accumlator, keep track of how much u64 rambuff_acm; /* accumlator, keep track of how much
is left after being split up*/ is left after being split up*/
u_long rambuff_end; /* end of rambuff */ u64 rambuff_end; /* end of rambuff */
u_long numbufs; /* number of useful buffers allocated (per device) */ u64 numbufs; /* number of useful buffers allocated (per device) */
u_long bufsize = DT3155_MAX_ROWS * DT3155_MAX_COLS; u64 bufsize = DT3155_MAX_ROWS * DT3155_MAX_COLS;
int m; /* minor # of device, looped for all devs */ int m; /* minor # of device, looped for all devs */
/* zero the fbuffer status and address structure */ /* zero the fbuffer status and address structure */
...@@ -327,8 +327,8 @@ u_long dt3155_setup_buffers(u_long *allocatorAddr) ...@@ -327,8 +327,8 @@ u_long dt3155_setup_buffers(u_long *allocatorAddr)
/* allocate a large contiguous chunk of RAM */ /* allocate a large contiguous chunk of RAM */
allocate_buffers (&rambuff_addr, &rambuff_size, bufsize); allocate_buffers (&rambuff_addr, &rambuff_size, bufsize);
printk( "DT3155: mem info\n" ); printk( "DT3155: mem info\n" );
printk( " - rambuf_addr = 0x%x \n", (u_int)rambuff_addr ); printk( " - rambuf_addr = 0x%x \n", (u32)rambuff_addr );
printk( " - length (kb) = %u \n", (u_int)rambuff_size ); printk( " - length (kb) = %u \n", (u32)rambuff_size );
if( rambuff_addr == 0 ) if( rambuff_addr == 0 )
{ {
printk( KERN_INFO printk( KERN_INFO
...@@ -350,7 +350,7 @@ u_long dt3155_setup_buffers(u_long *allocatorAddr) ...@@ -350,7 +350,7 @@ u_long dt3155_setup_buffers(u_long *allocatorAddr)
/* Following line is OK, will waste buffers if index /* Following line is OK, will waste buffers if index
* not evenly divisible by ndevices -NJC*/ * not evenly divisible by ndevices -NJC*/
numbufs = index / ndevices; numbufs = index / ndevices;
printk (" - numbufs = %u\n", (u_int) numbufs); printk (" - numbufs = %u\n", (u32) numbufs);
if (numbufs < 2) { if (numbufs < 2) {
printk( KERN_INFO printk( KERN_INFO
"DT3155: Error setup_buffers() couldn't allocate 2 bufs/board\n" ); "DT3155: Error setup_buffers() couldn't allocate 2 bufs/board\n" );
......
...@@ -42,7 +42,7 @@ extern struct dt3155_fbuffer_s *dt3155_fbuffer[MAXBOARDS]; ...@@ -42,7 +42,7 @@ extern struct dt3155_fbuffer_s *dt3155_fbuffer[MAXBOARDS];
/* Initialize the buffering system. This should */ /* Initialize the buffering system. This should */
/* be called prior to enabling interrupts */ /* be called prior to enabling interrupts */
u_long dt3155_setup_buffers(u_long *allocatorAddr); u64 dt3155_setup_buffers(u64 *allocatorAddr);
/* Get the next frame of data if it is ready. Returns */ /* Get the next frame of data if it is ready. Returns */
/* zero if no data is ready. If there is data but */ /* zero if no data is ready. If there is data but */
......
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