[adm5120] switch to 2.6.24
[openwrt/svn-archive/archive.git] / target / linux / adm5120 / files / arch / mips / adm5120 / setup.c
1 /*
2 * $Id$
3 *
4 * ADM5120 specific setup
5 *
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
8 *
9 * This code was based on the ADM5120 specific port of the Linux 2.6.10 kernel
10 * done by Jeroen Vreeken
11 * Copyright (C) 2005 Jeroen Vreeken (pe1rxq@amsat.org)
12 *
13 * Jeroen's code was based on the Linux 2.4.xx source codes found in various
14 * tarballs released by Edimax for it's ADM5120 based devices
15 * Copyright (C) ADMtek Incorporated
16 *
17 * This program is free software; you can redistribute it and/or modify it
18 * under the terms of the GNU General Public License version 2 as published
19 * by the Free Software Foundation.
20 *
21 */
22
23 #include <linux/init.h>
24 #include <linux/kernel.h>
25 #include <linux/io.h>
26
27 #include <asm/reboot.h>
28 #include <asm/time.h>
29
30 #include <adm5120_info.h>
31 #include <adm5120_defs.h>
32 #include <adm5120_switch.h>
33 #include <adm5120_board.h>
34
35 static char *prom_names[ADM5120_PROM_LAST+1] __initdata = {
36 [ADM5120_PROM_GENERIC] = "Generic",
37 [ADM5120_PROM_CFE] = "CFE",
38 [ADM5120_PROM_UBOOT] = "U-Boot",
39 [ADM5120_PROM_MYLOADER] = "MyLoader",
40 [ADM5120_PROM_ROUTERBOOT] = "RouterBOOT",
41 [ADM5120_PROM_BOOTBASE] = "Bootbase"
42 };
43
44 static void __init adm5120_report(void)
45 {
46 printk(KERN_INFO "SoC : ADM%04X%s revision %d, running "
47 "at %ldMHz\n",
48 adm5120_product_code,
49 adm5120_package_bga() ? "" : "P",
50 adm5120_revision, (adm5120_speed / 1000000));
51 printk(KERN_INFO "Bootdev : %s flash\n",
52 adm5120_nand_boot ? "NAND":"NOR");
53 printk(KERN_INFO "Prom : %s\n", prom_names[adm5120_prom_type]);
54 }
55
56 void __init plat_mem_setup(void)
57 {
58 adm5120_soc_init();
59 adm5120_mem_init();
60 adm5120_report();
61
62 _machine_restart = adm5120_restart;
63 _machine_halt = adm5120_halt;
64 pm_power_off = adm5120_halt;
65
66 set_io_port_base(KSEG1);
67 }