Path: blob/master/arch/arm/mach-mxs/mach-stmp378x_devb.c
10817 views
/*1* board setup for STMP378x-Development-Board2*3* based on mx23evk board setup and information gained form the original4* plat-stmp based board setup, now converted to mach-mxs.5*6* Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.7* Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.8*9* This program is free software; you can redistribute it and/or modify10* it under the terms of the GNU General Public License as published by11* the Free Software Foundation; version 2 of the License.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*/1819#include <linux/platform_device.h>20#include <linux/gpio.h>21#include <linux/irq.h>22#include <linux/spi/spi.h>2324#include <asm/mach-types.h>25#include <asm/mach/arch.h>26#include <asm/mach/time.h>2728#include <mach/common.h>29#include <mach/iomux-mx23.h>3031#include "devices-mx23.h"3233#define STMP378X_DEVB_MMC0_WRITE_PROTECT MXS_GPIO_NR(1, 30)34#define STMP378X_DEVB_MMC0_SLOT_POWER MXS_GPIO_NR(1, 29)3536#define STMP378X_DEVB_PAD_AUART (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL)3738static const iomux_cfg_t stmp378x_dvb_pads[] __initconst = {39/* duart (extended setup missing in old boardcode, too */40MX23_PAD_PWM0__DUART_RX,41MX23_PAD_PWM1__DUART_TX,4243/* auart */44MX23_PAD_AUART1_RX__AUART1_RX | STMP378X_DEVB_PAD_AUART,45MX23_PAD_AUART1_TX__AUART1_TX | STMP378X_DEVB_PAD_AUART,46MX23_PAD_AUART1_CTS__AUART1_CTS | STMP378X_DEVB_PAD_AUART,47MX23_PAD_AUART1_RTS__AUART1_RTS | STMP378X_DEVB_PAD_AUART,4849/* mmc */50MX23_PAD_SSP1_DATA0__SSP1_DATA0 |51(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),52MX23_PAD_SSP1_DATA1__SSP1_DATA1 |53(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),54MX23_PAD_SSP1_DATA2__SSP1_DATA2 |55(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),56MX23_PAD_SSP1_DATA3__SSP1_DATA3 |57(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),58MX23_PAD_SSP1_CMD__SSP1_CMD |59(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),60MX23_PAD_SSP1_DETECT__SSP1_DETECT |61(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),62MX23_PAD_SSP1_SCK__SSP1_SCK |63(MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),64MX23_PAD_PWM4__GPIO_1_30 | MXS_PAD_CTRL, /* write protect */65MX23_PAD_PWM3__GPIO_1_29 | MXS_PAD_CTRL, /* power enable */66};6768static struct mxs_mmc_platform_data stmp378x_dvb_mmc_pdata __initdata = {69.wp_gpio = STMP378X_DEVB_MMC0_WRITE_PROTECT,70};7172static struct spi_board_info spi_board_info[] __initdata = {73#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)74{75.modalias = "enc28j60",76.max_speed_hz = 6 * 1000 * 1000,77.bus_num = 1,78.chip_select = 0,79.platform_data = NULL,80},81#endif82};8384static void __init stmp378x_dvb_init(void)85{86int ret;8788mxs_iomux_setup_multiple_pads(stmp378x_dvb_pads,89ARRAY_SIZE(stmp378x_dvb_pads));9091mx23_add_duart();92mx23_add_auart0();9394/* power on mmc slot */95ret = gpio_request_one(STMP378X_DEVB_MMC0_SLOT_POWER,96GPIOF_OUT_INIT_LOW, "mmc0-slot-power");97if (ret)98pr_warn("could not power mmc (%d)\n", ret);99100mx23_add_mxs_mmc(0, &stmp378x_dvb_mmc_pdata);101102spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));103}104105static void __init stmp378x_dvb_timer_init(void)106{107mx23_clocks_init();108}109110static struct sys_timer stmp378x_dvb_timer = {111.init = stmp378x_dvb_timer_init,112};113114MACHINE_START(STMP378X, "STMP378X")115.map_io = mx23_map_io,116.init_irq = mx23_init_irq,117.init_machine = stmp378x_dvb_init,118.timer = &stmp378x_dvb_timer,119MACHINE_END120121122