2 * Copyright (C) ADMtek Incorporated.
3 * Creator : daniell@admtek.com.tw
4 * Copyright 1999, 2000 MIPS Technologies, Inc.
5 * Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2005
6 * Copyright (C) 2007 OpenWrt.org
9 #include <linux/autoconf.h>
10 #include <linux/init.h>
11 #include <linux/device.h>
12 #include <linux/platform_device.h>
14 #include <asm/reboot.h>
18 #include <asm/mach-adm5120/adm5120_info.h>
19 #include <asm/mach-adm5120/adm5120_defs.h>
20 #include <asm/mach-adm5120/adm5120_irq.h>
22 extern void adm5120_time_init(void) __init
;
24 #define ADM5120_SOFTRESET 0x12000004
26 void adm5120_restart(char *command
)
28 *(u32
*)KSEG1ADDR(ADM5120_SOFTRESET
)=1;
32 void adm5120_halt(void)
34 printk(KERN_NOTICE
"\n** You can safely turn off the power\n");
39 void adm5120_power_off(void)
44 void __init
plat_mem_setup(void)
46 printk(KERN_INFO
"ADM5120 board setup\n");
48 board_time_init
= adm5120_time_init
;
50 _machine_restart
= adm5120_restart
;
51 _machine_halt
= adm5120_halt
;
52 pm_power_off
= adm5120_power_off
;
54 set_io_port_base(KSEG1
);
57 const char *get_system_type(void)
59 return adm5120_board_name();
62 static struct resource adm5120_hcd_resources
[] = {
64 .start
= ADM5120_USBC_BASE
,
65 .end
= ADM5120_USBC_BASE
+ADM5120_USBC_SIZE
-1,
66 .flags
= IORESOURCE_MEM
,
69 .start
= ADM5120_IRQ_USBC
,
70 .end
= ADM5120_IRQ_USBC
,
71 .flags
= IORESOURCE_IRQ
,
75 static struct platform_device adm5120hcd_device
= {
76 .name
= "adm5120-hcd",
78 .num_resources
= ARRAY_SIZE(adm5120_hcd_resources
),
79 .resource
= adm5120_hcd_resources
,
82 static struct platform_device
*devices
[] __initdata
= {
86 static int __init
adm5120_init(void)
88 return platform_add_devices(devices
, ARRAY_SIZE(devices
));
91 subsys_initcall(adm5120_init
);