int board_init(void) { /* adress of boot parameters */ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; #ifdef CONFIG_ATMEL_SPI ma5d4evk_spi0_hw_init(); #endif #ifdef CONFIG_GENERIC_ATMEL_MCI ma5d4evk_mci0_hw_init(); ma5d4evk_mci1_hw_init(); #endif #ifdef CONFIG_MACB ma5d4evk_macb0_hw_init(); #endif #ifdef CONFIG_LCD ma5d4evk_lcd_hw_init(); #endif #ifdef CONFIG_CMD_USB ma5d4evk_usb_hw_init(); #endif #ifdef CONFIG_USB_GADGET_ATMEL_USBA at91_udp_hw_init(); #endif board_identify(); /* Reset CAN controllers */ at91_set_pio_output(AT91_PIO_PORTB, 21, 0); udelay(100); at91_set_pio_output(AT91_PIO_PORTB, 21, 1); at91_pio3_set_pio_pulldown(AT91_PIO_PORTB, 21, 0); return 0; }
void board_init(void) { #ifdef KEY_RC_BOARD /* On board Button initialization */ ioport_configure_pin(BUTTON_IRQ_PIN_1,IOPORT_DIR_INPUT | IOPORT_PULL_UP); ioport_configure_pin(BUTTON_IRQ_PIN_2,IOPORT_DIR_INPUT | IOPORT_PULL_UP); ioport_configure_pin(BUTTON_IRQ_PIN_3,IOPORT_DIR_INPUT | IOPORT_PULL_UP); set_button_pins_for_normal_mode(); /* Initialize the IRQ lines' interrupt behaviour. */ DISABLE_ALL_BUTTON_IRQS(); /* LED Init */ /* LCD initialization for inactive use */ /* On board LED initialization */ ioport_configure_pin(LCD_CS_ON_BOARD, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH); ioport_set_port_dir(IOPORT_PORTE,KEY_RC_IO_MASK,IOPORT_DIR_OUTPUT); ioport_set_port_level(IOPORT_PORTE,KEY_RC_IO_MASK,KEY_RC_IO_MASK); ioport_set_pin_dir(IOPORT_CREATE_PIN(PORTG , 2),IOPORT_DIR_INPUT); ioport_set_pin_mode(IOPORT_CREATE_PIN(PORTG , 2), IOPORT_MODE_PULLUP); LATCH_INIT(); /* Init ADC for the Accelerometer */ adc_init(); // LATCH_INIT(); /* Enable Accelerometer by enabling the PWR pin in the Latch */ acc_init(); update_latch_status(); /* Apply latch pulse to set LED status */ pulse_latch(); #else /* To identify if it is a plain or STB*/ board_identify(); /* On board LED initialization */ ioport_configure_pin(LED0_RCB,IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH); ioport_configure_pin(LED1_RCB,IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH); ioport_configure_pin(LED2_RCB,IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH); /* On board Switch initialization */ ioport_configure_pin(GPIO_PUSH_BUTTON_0,IOPORT_DIR_INPUT | IOPORT_PULL_UP); #ifdef BREAKOUT_BOARD //Enable RCB_BB RS232 level converter ioport_set_port_dir(IOPORT_PORTD,BB_SIO_MASK,IOPORT_DIR_OUTPUT); ioport_set_port_level(IOPORT_PORTD,BB_SIO_MASK,BB_SIO_VAL); #endif #endif }
void spl_board_init(void) { #ifdef CONFIG_ATMEL_SPI ma5d4evk_spi0_hw_init(); #endif #ifdef CONFIG_GENERIC_ATMEL_MCI ma5d4evk_mci0_hw_init(); ma5d4evk_mci1_hw_init(); #endif board_identify(); }