Path: blob/master/arch/mips/alchemy/gpr/board_setup.c
10818 views
/*1* Copyright 2010 Wolfgang Grandegger <[email protected]>2*3* Copyright 2000-2003, 2008 MontaVista Software Inc.4* Author: MontaVista Software, Inc. <[email protected]>5*6* This program is free software; you can redistribute it and/or modify it7* under the terms of the GNU General Public License as published by the8* Free Software Foundation; either version 2 of the License, or (at your9* option) any later version.10*11* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED12* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF13* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN14* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,15* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT16* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF17* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON18* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT19* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF20* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.21*22* You should have received a copy of the GNU General Public License along23* with this program; if not, write to the Free Software Foundation, Inc.,24* 675 Mass Ave, Cambridge, MA 02139, USA.25*/2627#include <linux/gpio.h>28#include <linux/init.h>29#include <linux/interrupt.h>30#include <linux/delay.h>31#include <linux/pm.h>3233#include <asm/reboot.h>34#include <asm/mach-au1x00/au1000.h>3536#include <prom.h>3738char irq_tab_alchemy[][5] __initdata = {39[0] = { -1, AU1500_PCI_INTA, AU1500_PCI_INTB, 0xff, 0xff },40};4142static void gpr_reset(char *c)43{44/* switch System-LED to orange (red# and green# on) */45alchemy_gpio_direction_output(4, 0);46alchemy_gpio_direction_output(5, 0);4748/* trigger watchdog to reset board in 200ms */49printk(KERN_EMERG "Triggering watchdog soft reset...\n");50raw_local_irq_disable();51alchemy_gpio_direction_output(1, 0);52udelay(1);53alchemy_gpio_set_value(1, 1);54while (1)55cpu_wait();56}5758static void gpr_power_off(void)59{60while (1)61cpu_wait();62}6364void __init board_setup(void)65{66printk(KERN_INFO "Trapeze ITS GPR board\n");6768pm_power_off = gpr_power_off;69_machine_halt = gpr_power_off;70_machine_restart = gpr_reset;7172/* Enable UART1/3 */73alchemy_uart_enable(AU1000_UART3_PHYS_ADDR);74alchemy_uart_enable(AU1000_UART1_PHYS_ADDR);7576/* Take away Reset of UMTS-card */77alchemy_gpio_direction_output(215, 1);7879#ifdef CONFIG_PCI80#if defined(__MIPSEB__)81au_writel(0xf | (2 << 6) | (1 << 4), Au1500_PCI_CFG);82#else83au_writel(0xf, Au1500_PCI_CFG);84#endif85#endif86}878889