Daniel Laird | edb6310 | 2008-06-16 15:49:21 +0100 | [diff] [blame] | 1 | /* |
| 2 | * setup.c: Setup PNX833X Soc. |
| 3 | * |
| 4 | * Copyright 2008 NXP Semiconductors |
| 5 | * Chris Steel <chris.steel@nxp.com> |
| 6 | * Daniel Laird <daniel.j.laird@nxp.com> |
| 7 | * |
| 8 | * Based on software written by: |
Ralf Baechle | 7034228 | 2013-01-22 12:59:30 +0100 | [diff] [blame^] | 9 | * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. |
Daniel Laird | edb6310 | 2008-06-16 15:49:21 +0100 | [diff] [blame] | 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program; if not, write to the Free Software |
| 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 24 | */ |
| 25 | #include <linux/init.h> |
| 26 | #include <linux/interrupt.h> |
| 27 | #include <linux/ioport.h> |
| 28 | #include <linux/io.h> |
| 29 | #include <linux/pci.h> |
| 30 | #include <asm/reboot.h> |
| 31 | #include <pnx833x.h> |
| 32 | #include <gpio.h> |
| 33 | |
| 34 | extern void pnx833x_board_setup(void); |
| 35 | extern void pnx833x_machine_restart(char *); |
| 36 | extern void pnx833x_machine_halt(void); |
| 37 | extern void pnx833x_machine_power_off(void); |
| 38 | |
| 39 | int __init plat_mem_setup(void) |
| 40 | { |
| 41 | /* fake pci bus to avoid bounce buffers */ |
| 42 | PCI_DMA_BUS_IS_PHYS = 1; |
| 43 | |
| 44 | /* set mips clock to 320MHz */ |
| 45 | #if defined(CONFIG_SOC_PNX8335) |
| 46 | PNX8335_WRITEFIELD(0x17, CLOCK_PLL_CPU_CTL, FREQ); |
| 47 | #endif |
| 48 | pnx833x_gpio_init(); /* so it will be ready in board_setup() */ |
| 49 | |
| 50 | pnx833x_board_setup(); |
| 51 | |
| 52 | _machine_restart = pnx833x_machine_restart; |
| 53 | _machine_halt = pnx833x_machine_halt; |
| 54 | pm_power_off = pnx833x_machine_power_off; |
| 55 | |
| 56 | /* IO/MEM resources. */ |
| 57 | set_io_port_base(KSEG1); |
| 58 | ioport_resource.start = 0; |
| 59 | ioport_resource.end = ~0; |
| 60 | iomem_resource.start = 0; |
| 61 | iomem_resource.end = ~0; |
| 62 | |
| 63 | return 0; |
| 64 | } |