2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18 #include <linux/init.h>
19 #include <linux/ioport.h>
21 #include <linux/time.h>
23 #include <asm/reboot.h>
24 #include <asm/mach-ar7/ar7.h>
25 #include <asm/mach-ar7/prom.h>
27 static void ar7_machine_restart(char *command
)
29 u32
*softres_reg
= ioremap(AR7_REGS_RESET
+ AR7_RESET_SOFTWARE
, 1);
31 writel(1, softres_reg
);
34 static void ar7_machine_halt(void)
40 static void ar7_machine_power_off(void)
42 u32
*power_reg
= (u32
*)ioremap(AR7_REGS_POWER
, 1);
43 u32 power_state
= readl(power_reg
) | (3 << 30);
45 writel(power_state
, power_reg
);
49 const char *get_system_type(void)
51 u16 chip_id
= ar7_chip_id();
52 u16 titan_variant_id
= titan_chip_id();
56 return "TI AR7 (TNETD7100)";
58 return "TI AR7 (TNETD7200)";
60 return "TI AR7 (TNETD7300)";
62 switch (titan_variant_id
) {
64 return "TI AR7 (TNETV1050)";
66 return "TI AR7 (TNETV1055)";
68 return "TI AR7 (TNETV1056)";
70 return "TI AR7 (TNETV1060)";
73 return "TI AR7 (unknown)";
77 static int __init
ar7_init_console(void)
81 console_initcall(ar7_init_console
);
84 * Initializes basic routines and structures pointers, memory size (as
85 * given by the bios and saves the command line.
87 void __init
plat_mem_setup(void)
89 unsigned long io_base
;
91 _machine_restart
= ar7_machine_restart
;
92 _machine_halt
= ar7_machine_halt
;
93 pm_power_off
= ar7_machine_power_off
;
95 io_base
= (unsigned long)ioremap(AR7_REGS_BASE
, 0x10000);
97 panic("Can't remap IO base!");
98 set_io_port_base(io_base
);
102 printk(KERN_INFO
"%s, ID: 0x%04x, Revision: 0x%02x\n",
103 get_system_type(), ar7_chip_id(), ar7_chip_rev());