u-boot/arch/arm/include/asm/arch-tegra2/uart-spi-switch.h
Simon Glass cb93481268 tegra2: Implement SPI / UART GPIO switch
The Tegra2 Seaboard has the unfortunate feature that SPI and the console
UART are multiplexed on the same pins. We need to switch between one
and the other during SPI and console activity.

This new file implements a switch and keeps track of which peripheral
owns the pins. It also flips over the controlling GPIO as needed

Since we are adding a second file to board/nvidia/common, we create
a proper Makefile there and remove the direct board.o include from
board/nvidia/seaboard/Makefile

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2011-12-24 10:23:31 +01:00

46 lines
1.5 KiB
C

/*
* Copyright (c) 2011 The Chromium OS Authors.
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef _UART_SPI_SWITCH_H
#define _UART_SPI_SWITCH_H
#if defined(CONFIG_SPI_UART_SWITCH)
/*
* Signal that we are about to use the UART. This unfortunate hack is
* required by Seaboard, which cannot use its console and SPI at the same
* time! If the board file provides this, the board config will declare it.
* Let this be a lesson for others.
*/
void pinmux_select_uart(NS16550_t regs);
/*
* Signal that we are about the use the SPI bus.
*/
void pinmux_select_spi(void);
#else /* not CONFIG_SPI_UART_SWITCH */
static inline void pinmux_select_uart(NS16550_t regs) {}
static inline void pinmux_select_spi(void) {}
#endif
#endif