template_init_chip_data

Name

template_init_chip_data --  Initialize chips

Synopsis

int template_init_chip_data (struct candevice_t * candev, int chipnr);

Arguments

candev

Pointer to candevice/board structure

chipnr

Number of the CAN chip on the hardware card

Description

The function template_init_chip_data is used to initialize the hardware structure containing information about the CAN chips. CHIP_TYPE represents the type of CAN chip. CHIP_TYPE can be "i82527" or "sja1000". The chip_base_addr entry represents the start of the 'official' memory map of the installed chip. It's likely that this is the same as the io_addr argument supplied at module loading time. The clock entry holds the chip clock value in Hz. The entry sja_cdr_reg holds hardware specific options for the Clock Divider register. Options defined in the sja1000.h file: CDR_CLKOUT_MASK, CDR_CLK_OFF, CDR_RXINPEN, CDR_CBP, CDR_PELICAN The entry sja_ocr_reg holds hardware specific options for the Output Control register. Options defined in the sja1000.h file: OCR_MODE_BIPHASE, OCR_MODE_TEST, OCR_MODE_NORMAL, OCR_MODE_CLOCK, OCR_TX0_LH, OCR_TX1_ZZ. The entry int_clk_reg holds hardware specific options for the Clock Out register. Options defined in the i82527.h file: iCLK_CD0, iCLK_CD1, iCLK_CD2, iCLK_CD3, iCLK_SL0, iCLK_SL1. The entry int_bus_reg holds hardware specific options for the Bus Configuration register. Options defined in the i82527.h file: iBUS_DR0, iBUS_DR1, iBUS_DT1, iBUS_POL, iBUS_CBY. The entry int_cpu_reg holds hardware specific options for the cpu interface register. Options defined in the i82527.h file: iCPU_CEN, iCPU_MUX, iCPU_SLP, iCPU_PWD, iCPU_DMC, iCPU_DSC, iCPU_RST.

Return Value

The function always returns zero

File

src/template.c