示例#1
0
void __init setup_board(void)
{
    at32_map_usart(0, 0, 0);
    at32_map_usart(1, 1, 0);
    at32_map_usart(3, 3, 0);
    at32_setup_serial_console(1);
}
void __init setup_board(void)
{
#ifdef	CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
	at32_map_usart(0, 1, 0);	/* USART 0/B: /dev/ttyS1, IRDA */
#else
	at32_map_usart(1, 0, 0);	/* USART 1/A: /dev/ttyS0, DB9 */
#endif
	/* USART 2/unused: expansion connector */
	at32_map_usart(3, 2, 0);	/* USART 3/C: /dev/ttyS2, DB9 */

	at32_setup_serial_console(0);
}
示例#3
0
static int __init merisc_init(void)
{
    detect_merisc_board_id();

    printk(KERN_NOTICE "BOARD: Merisc %s revision %s\n", merisc_model(),
           merisc_revision());

    /* Reserve pins for SDRAM */
    at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL | (1 << 26));

    if (merisc_board_id >= 1)
        at32_map_usart(2, 2, 0);

    at32_add_device_usart(0);
    at32_add_device_usart(1);
    if (merisc_board_id >= 1)
        at32_add_device_usart(2);
    at32_add_device_usart(3);
    set_hw_addr(at32_add_device_eth(0, &eth_data[0]));

    /* ADS7846 PENIRQ */
    if (merisc_board_id == 0) {
        ads7846_data.get_pendown_state = ads7846_get_pendown_state_PB26;
        at32_select_periph(GPIO_PIOB_BASE, 1 << 26,
                           GPIO_PERIPH_A, AT32_GPIOF_PULLUP);
        spi0_board_info[0].irq = AT32_EXTINT(1);
    } else {
        ads7846_data.get_pendown_state = ads7846_get_pendown_state_PB28;
        at32_select_periph(GPIO_PIOB_BASE, 1 << 28, GPIO_PERIPH_A,
                           AT32_GPIOF_PULLUP);
        spi0_board_info[0].irq = AT32_EXTINT(3);
    }

    /* ADS7846 busy pin */
    at32_select_gpio(GPIO_PIN_PA(4), AT32_GPIOF_PULLUP);

    at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));

    at32_add_device_mci(0, &mci0_data);

#ifdef CONFIG_LEDS_ATMEL_PWM
    at32_add_device_pwm((1 << 0) | (1 << 2));
    platform_device_register(&stk_pwm_led_dev);
#else
    at32_add_device_pwm((1 << 2));
#endif

    at32_select_gpio(i2c_gpio_data.sda_pin,
                     AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
    at32_select_gpio(i2c_gpio_data.scl_pin,
                     AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
    platform_device_register(&i2c_gpio_device);

    i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info));

    return 0;
}
示例#4
0
文件: mrmt.c 项目: 01org/KVMGT-kernel
static int __init mrmt1_init(void)
{
	gpio_set_value( PIN_PWR_ON, 1 );	/* Ensure PWR_ON is enabled */

	pm_power_off = mrmt_power_off;

	/* Setup USARTS (other than console) */
	at32_map_usart(2, 1, 0);	/* USART 2: /dev/ttyS1, RMT1:DB9M */
	at32_map_usart(3, 2, ATMEL_USART_RTS | ATMEL_USART_CTS);
			/* USART 3: /dev/ttyS2, RMT1:Wireless, w/ RTS/CTS */
	at32_add_device_usart(1);
	at32_add_device_usart(2);

	/* Select GPIO Key pins */
	at32_select_gpio( PIN_PWR_SW_N, AT32_GPIOF_DEGLITCH);
	at32_select_gpio( PIN_PB_LEFT, AT32_GPIOF_DEGLITCH);
	at32_select_gpio( PIN_PB_RIGHT, AT32_GPIOF_DEGLITCH);
	platform_device_register(&rmt_gpio_keys);

#ifdef CONFIG_BOARD_MRMT_RTC_I2C
	i2c_register_board_info(0, &mrmt1_i2c_rtc, 1);
#endif

#ifndef CONFIG_BOARD_MRMT_LCD_DISABLE
	/* User "alternate" LCDC inferface on Port E & D */
	/* NB: exclude LCDC_CC pin, as NGW100 reserves it for other use */
	at32_add_device_lcdc(0, &rmt_lcdc_data,
		fbmem_start, fbmem_size,
		(ATMEL_LCDC_ALT_24BIT | ATMEL_LCDC_PE_DVAL ) );
#endif

#ifdef CONFIG_BOARD_MRMT_AC97
	at32_add_device_ac97c(0, &ac97c0_data, AC97C_BOTH);
#endif

#ifdef CONFIG_BOARD_MRMT_ADS7846_TS
	/* Select the Touchscreen interrupt pin mode */
	at32_select_periph( GPIO_PIOB_BASE, 1 << (PB_EXTINT_BASE+TS_IRQ),
			GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH);
	irq_set_irq_type(AT32_EXTINT(TS_IRQ), IRQ_TYPE_EDGE_FALLING);
	at32_spi_setup_slaves(0,spi01_board_info,ARRAY_SIZE(spi01_board_info));
	spi_register_board_info(spi01_board_info,ARRAY_SIZE(spi01_board_info));
#endif

#ifdef CONFIG_BOARD_MRMT_UCB1400_TS
	/* Select the Touchscreen interrupt pin mode */
	at32_select_periph( GPIO_PIOB_BASE, 1 << (PB_EXTINT_BASE+TS_IRQ),
			GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH);
	platform_device_register(&rmt_ts_device);
#endif

	at32_select_gpio( PIN_LCD_DISP, AT32_GPIOF_OUTPUT );
	gpio_request( PIN_LCD_DISP, "LCD_DISP" );
	gpio_direction_output( PIN_LCD_DISP, 0 );	/* LCD DISP */
#ifdef CONFIG_BOARD_MRMT_LCD_DISABLE
	/* Keep Backlight and DISP off */
	at32_select_gpio( PIN_LCD_BL, AT32_GPIOF_OUTPUT );
	gpio_request( PIN_LCD_BL, "LCD_BL" );
	gpio_direction_output( PIN_LCD_BL, 0 );		/* Backlight */
#else
	gpio_set_value( PIN_LCD_DISP, 1 );	/* DISP asserted first */
#ifdef CONFIG_BOARD_MRMT_BL_PWM
	/* Use PWM for Backlight controls */
	at32_add_device_pwm(1 << PWM_CH_BL);
	platform_device_register(&rmt_pwm_led_dev);
#else
	/* Backlight always on */
	udelay( 1 );
	at32_select_gpio( PIN_LCD_BL, AT32_GPIOF_OUTPUT );
	gpio_request( PIN_LCD_BL, "LCD_BL" );
	gpio_direction_output( PIN_LCD_BL, 1 );
#endif
#endif

	/* Make sure BT and Zigbee modules in reset */
	at32_select_gpio( PIN_BT_RST, AT32_GPIOF_OUTPUT );
	gpio_request( PIN_BT_RST, "BT_RST" );
	gpio_direction_output( PIN_BT_RST, 1 );
	/* BT Module in Reset */

	at32_select_gpio( PIN_ZB_RST_N, AT32_GPIOF_OUTPUT );
	gpio_request( PIN_ZB_RST_N, "ZB_RST_N" );
	gpio_direction_output( PIN_ZB_RST_N, 0 );
	/* XBee Module in Reset */

#ifdef CONFIG_BOARD_MRMT_WIRELESS_ZB
	udelay( 1000 );
	/* Unreset the XBee Module */
	gpio_set_value( PIN_ZB_RST_N, 1 );
#endif
#ifdef CONFIG_BOARD_MRMT_WIRELESS_BT
	udelay( 1000 );
	/* Unreset the BT Module */
	gpio_set_value( PIN_BT_RST, 0 );
#endif

	return 0;
}
示例#5
0
文件: setup.c 项目: 0-T-0/ps4-linux
void __init setup_board(void)
{
	at32_map_usart(1, 0, 0);	/* USART 1: /dev/ttyS0, DB9 */
	at32_setup_serial_console(0);
}