920f44ae416568c40c0dda80d17a1b3e78a74f84
2 * Ralink RT288x SoC specific setup
4 * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7 * Parts of this file are based on Ralink's 2.6.21 BSP
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
17 #include <linux/serial_8250.h>
19 #include <asm/mips_machine.h>
20 #include <asm/reboot.h>
23 #include <asm/mach-ralink/common.h>
24 #include <asm/mach-ralink/rt288x.h>
25 #include <asm/mach-ralink/rt288x_regs.h>
27 unsigned long rt288x_mach_type
;
29 static void rt288x_restart(char *command
)
31 rt288x_sysc_wr(RT2880_RESET_SYSTEM
, SYSC_REG_RESET_CTRL
);
37 static void rt288x_halt(void)
43 static void __init
rt288x_early_serial_setup(void)
48 memset(&p
, 0, sizeof(p
));
49 p
.flags
= UPF_SKIP_TEST
;
51 p
.uartclk
= rt288x_sys_freq
;
55 p
.mapbase
= RT2880_UART0_BASE
;
56 p
.membase
= ioremap_nocache(p
.mapbase
, RT2880_UART0_SIZE
);
58 p
.irq
= RT2880_INTC_IRQ_UART0
;
60 err
= early_serial_setup(&p
);
62 printk(KERN_ERR
"RT288x: early UART0 registration failed %d\n",
65 p
.mapbase
= RT2880_UART1_BASE
;
66 p
.membase
= ioremap_nocache(p
.mapbase
, RT2880_UART1_SIZE
);
68 p
.irq
= RT2880_INTC_IRQ_UART1
;
70 err
= early_serial_setup(&p
);
72 printk(KERN_ERR
"RT288x: early UART1 registration failed %d\n",
76 const char *get_system_type(void)
78 return rt288x_sys_type
;
81 unsigned int __cpuinit
get_c0_compare_irq(void)
83 return CP0_LEGACY_COMPARE_IRQ
;
86 void __init
ramips_soc_setup(void)
88 rt288x_sysc_base
= ioremap_nocache(RT2880_SYSC_BASE
, RT2880_SYSC_SIZE
);
89 rt288x_memc_base
= ioremap_nocache(RT2880_MEMC_BASE
, RT2880_MEMC_SIZE
);
91 rt288x_detect_sys_type();
92 rt288x_detect_sys_freq();
94 printk(KERN_INFO
"%s running at %lu.%02lu MHz\n", get_system_type(),
95 rt288x_cpu_freq
/ 1000000,
96 (rt288x_cpu_freq
% 1000000) * 100 / 1000000);
98 _machine_restart
= rt288x_restart
;
99 _machine_halt
= rt288x_halt
;
100 pm_power_off
= rt288x_halt
;
102 rt288x_early_serial_setup();
105 void __init
plat_time_init(void)
107 mips_hpt_frequency
= rt288x_cpu_freq
/ 2;
110 static int __init
rt288x_machine_setup(void)
112 mips_machine_setup(rt288x_mach_type
);
117 arch_initcall(rt288x_machine_setup
);
This page took 0.041854 seconds and 3 git commands to generate.