2 * arch/arm/mach-orion/common.c
4 * Core functions for Marvell Orion System On Chip
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
16 #include <asm/timex.h>
17 #include <asm/mach/map.h>
18 #include <asm/arch/orion.h>
21 /*****************************************************************************
23 ****************************************************************************/
24 static struct map_desc orion_io_desc[] __initdata = {
26 .virtual = ORION_REGS_BASE,
27 .pfn = __phys_to_pfn(ORION_REGS_BASE),
28 .length = ORION_REGS_SIZE,
32 .virtual = ORION_PCIE_IO_BASE,
33 .pfn = __phys_to_pfn(ORION_PCIE_IO_BASE),
34 .length = ORION_PCIE_IO_SIZE,
38 .virtual = ORION_PCI_IO_BASE,
39 .pfn = __phys_to_pfn(ORION_PCI_IO_BASE),
40 .length = ORION_PCI_IO_SIZE,
44 .virtual = ORION_PCIE_WA_BASE,
45 .pfn = __phys_to_pfn(ORION_PCIE_WA_BASE),
46 .length = ORION_PCIE_WA_SIZE,
51 void __init orion_map_io(void)
53 iotable_init(orion_io_desc, ARRAY_SIZE(orion_io_desc));
56 /*****************************************************************************
58 ****************************************************************************/
61 * Identify device ID and rev from PCIE configuration header space '0'.
63 static void orion_id(u32 *dev, u32 *rev, char **dev_name)
65 orion_pcie_id(dev, rev);
67 if (*dev == MV88F5281_DEV_ID) {
68 if (*rev == MV88F5281_REV_D2) {
69 *dev_name = "MV88F5281-D2";
70 } else if (*rev == MV88F5281_REV_D1) {
71 *dev_name = "MV88F5281-D1";
73 *dev_name = "MV88F5281-Rev-Unsupported";
75 } else if (*dev == MV88F5182_DEV_ID) {
76 if (*rev == MV88F5182_REV_A2) {
77 *dev_name = "MV88F5182-A2";
79 *dev_name = "MV88F5182-Rev-Unsupported";
82 *dev_name = "Device-Unknown";
86 void __init orion_init(void)
91 orion_id(&dev, &rev, &dev_name);
92 printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, ORION_TCLK);
95 * Setup Orion address map
97 orion_setup_cpu_wins();
98 orion_setup_usb_wins();
99 orion_setup_eth_wins();
100 orion_setup_pci_wins();
101 orion_setup_pcie_wins();
102 if (dev == MV88F5182_DEV_ID)
103 orion_setup_sata_wins();