1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-26 01:33:20 +02:00

[ramips] use common get_system_type function

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17455 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2009-08-31 18:53:31 +00:00
parent a43a8c9864
commit 789ea10d57
9 changed files with 17 additions and 26 deletions

View File

@ -9,6 +9,9 @@
#ifndef __ASM_MACH_RALINK_COMMON_H #ifndef __ASM_MACH_RALINK_COMMON_H
#define __ASM_MACH_RALINK_COMMON_H #define __ASM_MACH_RALINK_COMMON_H
#define RAMIPS_SYS_TYPE_LEN 64
extern unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN];
void __init ramips_intc_irq_init(unsigned intc_base, unsigned irq, void __init ramips_intc_irq_init(unsigned intc_base, unsigned irq,
unsigned irq_base); unsigned irq_base);
u32 ramips_intc_get_status(void); u32 ramips_intc_get_status(void);

View File

@ -18,10 +18,6 @@
#include <linux/io.h> #include <linux/io.h>
void rt288x_detect_sys_type(void) __init; void rt288x_detect_sys_type(void) __init;
#define RT288X_SYS_TYPE_LEN 64
extern unsigned char rt288x_sys_type[RT288X_SYS_TYPE_LEN];
void rt288x_detect_sys_freq(void) __init; void rt288x_detect_sys_freq(void) __init;
extern unsigned long rt288x_cpu_freq; extern unsigned long rt288x_cpu_freq;

View File

@ -17,10 +17,6 @@
#include <linux/io.h> #include <linux/io.h>
void rt305x_detect_sys_type(void) __init; void rt305x_detect_sys_type(void) __init;
#define RT305X_SYS_TYPE_LEN 64
extern unsigned char rt305x_sys_type[RT305X_SYS_TYPE_LEN];
void rt305x_detect_sys_freq(void) __init; void rt305x_detect_sys_freq(void) __init;
extern unsigned long rt305x_cpu_freq; extern unsigned long rt305x_cpu_freq;

View File

@ -19,6 +19,13 @@
#include <asm/mach-ralink/common.h> #include <asm/mach-ralink/common.h>
#include <ralink_soc.h> #include <ralink_soc.h>
unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN];
const char *get_system_type(void)
{
return ramips_sys_type;
}
static void __init detect_mem_size(void) static void __init detect_mem_size(void)
{ {
unsigned long size; unsigned long size;

View File

@ -15,11 +15,10 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <asm/mach-ralink/common.h>
#include <asm/mach-ralink/rt288x.h> #include <asm/mach-ralink/rt288x.h>
#include <asm/mach-ralink/rt288x_regs.h> #include <asm/mach-ralink/rt288x_regs.h>
unsigned char rt288x_sys_type[RT288X_SYS_TYPE_LEN];
unsigned long rt288x_cpu_freq; unsigned long rt288x_cpu_freq;
EXPORT_SYMBOL_GPL(rt288x_cpu_freq); EXPORT_SYMBOL_GPL(rt288x_cpu_freq);
@ -39,7 +38,7 @@ void __init rt288x_detect_sys_type(void)
n1 = rt288x_sysc_rr(SYSC_REG_CHIP_NAME1); n1 = rt288x_sysc_rr(SYSC_REG_CHIP_NAME1);
id = rt288x_sysc_rr(SYSC_REG_CHIP_ID); id = rt288x_sysc_rr(SYSC_REG_CHIP_ID);
snprintf(rt288x_sys_type, RT288X_SYS_TYPE_LEN, snprintf(ramips_sys_type, RAMIPS_SYS_TYPE_LEN,
"Ralink %c%c%c%c%c%c%c%c id:%u rev:%u", "Ralink %c%c%c%c%c%c%c%c id:%u rev:%u",
(char) (n0 & 0xff), (char) ((n0 >> 8) & 0xff), (char) (n0 & 0xff), (char) ((n0 >> 8) & 0xff),
(char) ((n0 >> 16) & 0xff), (char) ((n0 >> 24) & 0xff), (char) ((n0 >> 16) & 0xff), (char) ((n0 >> 24) & 0xff),

View File

@ -73,11 +73,6 @@ static void __init rt288x_early_serial_setup(void)
err); err);
} }
const char *get_system_type(void)
{
return rt288x_sys_type;
}
unsigned int __cpuinit get_c0_compare_irq(void) unsigned int __cpuinit get_c0_compare_irq(void)
{ {
return CP0_LEGACY_COMPARE_IRQ; return CP0_LEGACY_COMPARE_IRQ;
@ -91,7 +86,7 @@ void __init ramips_soc_setup(void)
rt288x_detect_sys_type(); rt288x_detect_sys_type();
rt288x_detect_sys_freq(); rt288x_detect_sys_freq();
printk(KERN_INFO "%s running at %lu.%02lu MHz\n", get_system_type(), printk(KERN_INFO "%s running at %lu.%02lu MHz\n", ramips_sys_type,
rt288x_cpu_freq / 1000000, rt288x_cpu_freq / 1000000,
(rt288x_cpu_freq % 1000000) * 100 / 1000000); (rt288x_cpu_freq % 1000000) * 100 / 1000000);

View File

@ -13,6 +13,7 @@
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/mach-ralink/common.h>
#include <asm/mach-ralink/rt305x.h> #include <asm/mach-ralink/rt305x.h>
#include <asm/mach-ralink/rt305x_regs.h> #include <asm/mach-ralink/rt305x_regs.h>

View File

@ -15,11 +15,10 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <asm/mach-ralink/common.h>
#include <asm/mach-ralink/rt305x.h> #include <asm/mach-ralink/rt305x.h>
#include <asm/mach-ralink/rt305x_regs.h> #include <asm/mach-ralink/rt305x_regs.h>
unsigned char rt305x_sys_type[RT305X_SYS_TYPE_LEN];
unsigned long rt305x_cpu_freq; unsigned long rt305x_cpu_freq;
EXPORT_SYMBOL_GPL(rt305x_cpu_freq); EXPORT_SYMBOL_GPL(rt305x_cpu_freq);
@ -39,7 +38,7 @@ void __init rt305x_detect_sys_type(void)
n1 = rt305x_sysc_rr(SYSC_REG_CHIP_NAME1); n1 = rt305x_sysc_rr(SYSC_REG_CHIP_NAME1);
id = rt305x_sysc_rr(SYSC_REG_CHIP_ID); id = rt305x_sysc_rr(SYSC_REG_CHIP_ID);
snprintf(rt305x_sys_type, RT305X_SYS_TYPE_LEN, snprintf(ramips_sys_type, RAMIPS_SYS_TYPE_LEN,
"Ralink %c%c%c%c%c%c%c%c id:%u rev:%u", "Ralink %c%c%c%c%c%c%c%c id:%u rev:%u",
(char) (n0 & 0xff), (char) ((n0 >> 8) & 0xff), (char) (n0 & 0xff), (char) ((n0 >> 8) & 0xff),
(char) ((n0 >> 16) & 0xff), (char) ((n0 >> 24) & 0xff), (char) ((n0 >> 16) & 0xff), (char) ((n0 >> 24) & 0xff),

View File

@ -75,11 +75,6 @@ static void __init rt305x_early_serial_setup(void)
err); err);
} }
const char *get_system_type(void)
{
return rt305x_sys_type;
}
unsigned int __cpuinit get_c0_compare_irq(void) unsigned int __cpuinit get_c0_compare_irq(void)
{ {
return CP0_LEGACY_COMPARE_IRQ; return CP0_LEGACY_COMPARE_IRQ;
@ -93,7 +88,7 @@ void __init ramips_soc_setup(void)
rt305x_detect_sys_type(); rt305x_detect_sys_type();
rt305x_detect_sys_freq(); rt305x_detect_sys_freq();
printk(KERN_INFO "%s running at %lu.%02lu MHz\n", get_system_type(), printk(KERN_INFO "%s running at %lu.%02lu MHz\n", ramips_sys_type,
rt305x_cpu_freq / 1000000, rt305x_cpu_freq / 1000000,
(rt305x_cpu_freq % 1000000) * 100 / 1000000); (rt305x_cpu_freq % 1000000) * 100 / 1000000);