#ifndef _SBI_H
#define _SBI_H

#define DEVICE_IDENTIFICATION_REG_ADDR  0xb900003C  // Address of register which contains deviceId information
#define AD6834_DEVICE_ID                0x6834      // Vox200
#define AD6833_DEVICE_ID                0x6833      // Vox150
#define AD6836_DEVICE_ID                0x6836      // Vox160
#define AD6502_DEVICE_ID                0x6502      // AT200
#define AD6503_DEVICE_ID                0x6503      // AT300
#define AD6501_DEVICE_ID                0x6501      // AT100
#define AD65XX_DEVICE_ID                0x6500      // AT200/AT300/AT100

struct user_interrupt_numbers {
	int adi_6843_max_ints;
	int ap_dma_int;
	int arb2_int;
	int arb3_int;
	int arb_int;
	int bmu_int;
	int dma_int;
	int dsp0_fl0_int;
	int dsp0_fl1_int;
	int dsp0_pf0_int;
	int dsp0_pf1_int;
	int dsp1_fl0_int;
	int dsp1_fl1_int;
	int dsp1_pf0_int;
	int dsp1_pf1_int;
	int emac1_int;
	int emac2_int;
	int emac3_int;
	int gpio2_int;
	int gpio_int;
	int gpt1_int;
	int gpt2_int;
	int gpt3_int;
	int idma1_int;
	int idma2_int;
	int idma3_int;
	int pci_int;
	int per_int;
	int scu_int;
	int spa_int;
	int sphy_int;
	int spi_int;
	int sport2_rx_int;
	int sport2_tx_int;
	int uart1_int;
	int uart2;
	int uart2_int;
	int usbh_int;
	int usb_int;
	int wiu1_int;
	int wiu2_int;
}; 

struct user_board_info {

	char board_name[16];
	
	volatile unsigned int  cpu_id;	//0x683[346]
	unsigned long vendor_id;	//read hw infos from gpios?
	
	unsigned int * ram_ctrl_addr;
	unsigned int sdram_size;		//Mbytes
	unsigned int sdram_size_with_rg_loader;	//Mbytes
	
		
	unsigned int  flash_size;		//Mbytes
	unsigned long mtd_partition_jffs2_offset;
	unsigned long mtd_partition_jffs2_size;
	
	struct user_interrupt_numbers * int_nums;
	
	int first_pci_pin;
	
	
		
};

#define RAM_SIZE         (sbi_u.sdram_size)


#define ADI_6843_MAX_INTS ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->adi_6843_max_ints: -1)
#define AP_DMA_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->ap_dma_int	 : -1)
#define ARB2_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->arb2_int	 : -1)
#define ARB3_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->arb3_int	 : -1)
#define ARB_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->arb_int 	 : -1)
#define BMU_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->bmu_int 	 : -1)
#define DMA_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dma_int 	 : -1)
#define DSP0_FL0_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dsp0_fl0_int	 : -1)
#define DSP0_FL1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dsp0_fl1_int	 : -1)
#define DSP0_PF0_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dsp0_pf0_int	 : -1)
#define DSP0_PF1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dsp0_pf1_int	 : -1)
#define DSP1_FL0_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dsp1_fl0_int	 : -1)
#define DSP1_FL1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dsp1_fl1_int	 : -1)
#define DSP1_PF0_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dsp1_pf0_int	 : -1)
#define DSP1_PF1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->dsp1_pf1_int	 : -1)
#define EMAC1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->emac1_int	 : -1)
#define EMAC2_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->emac2_int	 : -1)
#define EMAC3_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->emac3_int	 : -1)
#define GPIO2_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->gpio2_int	 : -1)
#define GPIO_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->gpio_int	 : -1)
#define GPT1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->gpt1_int	 : -1)
#define GPT2_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->gpt2_int	 : -1)
#define GPT3_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->gpt3_int	 : -1)
#define IDMA1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->idma1_int	 : -1)
#define IDMA2_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->idma2_int	 : -1)
#define IDMA3_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->idma3_int	 : -1)
#define PCI_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->pci_int 	 : -1)
#define PER_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->per_int 	 : -1)
#define SCU_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->scu_int 	 : -1)
#define SPA_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->spa_int 	 : -1)
#define SPHY_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->sphy_int	 : -1)
#define SPI_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->spi_int 	 : -1)
#define SPORT2_RX_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->sport2_rx_int	 : -1)
#define SPORT2_TX_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->sport2_tx_int	 : -1)
#define UART1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->uart1_int	 : -1)
#define UART2		  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->uart2		 : -1)
#define UART2_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->uart2_int	 : -1)
#define USBH_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->usbh_int	 : -1)
#define USB_INT 	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->usb_int 	 : -1)
#define WIU1_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->wiu1_int	 : -1)
#define WIU2_INT	  ( (sbi_u && sbi_u.int_nums) ? sbi_u.int_nums->wiu2_int	 : -1)

extern struct user_board_info user_board_info;

#endif /*_SBI_H*/
