mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-01-27 16:11:06 +02:00
ramips: allow to use custom code for memory size detection
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33570 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
ea2de79f86
commit
4110f0d379
@ -14,6 +14,7 @@ extern unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN];
|
|||||||
extern unsigned long ramips_mem_base;
|
extern unsigned long ramips_mem_base;
|
||||||
extern unsigned long ramips_mem_size_min;
|
extern unsigned long ramips_mem_size_min;
|
||||||
extern unsigned long ramips_mem_size_max;
|
extern unsigned long ramips_mem_size_max;
|
||||||
|
extern unsigned long (*ramips_get_mem_size)(void);
|
||||||
|
|
||||||
void ramips_intc_irq_init(unsigned intc_base, unsigned irq, unsigned irq_base);
|
void ramips_intc_irq_init(unsigned intc_base, unsigned irq, unsigned irq_base);
|
||||||
u32 ramips_intc_get_status(void);
|
u32 ramips_intc_get_status(void);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <asm/mach-ralink/machine.h>
|
#include <asm/mach-ralink/machine.h>
|
||||||
|
|
||||||
unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN];
|
unsigned char ramips_sys_type[RAMIPS_SYS_TYPE_LEN];
|
||||||
|
unsigned long (*ramips_get_mem_size)(void);
|
||||||
|
|
||||||
const char *get_system_type(void)
|
const char *get_system_type(void)
|
||||||
{
|
{
|
||||||
@ -30,13 +31,18 @@ const char *get_system_type(void)
|
|||||||
static void __init detect_mem_size(void)
|
static void __init detect_mem_size(void)
|
||||||
{
|
{
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
void *base;
|
|
||||||
|
|
||||||
base = (void *) KSEG1ADDR(detect_mem_size);
|
if (ramips_get_mem_size) {
|
||||||
for (size = ramips_mem_size_min; size < ramips_mem_size_max;
|
size = ramips_get_mem_size();
|
||||||
size <<= 1 ) {
|
} else {
|
||||||
if (!memcmp(base, base + size, 1024))
|
void *base;
|
||||||
break;
|
|
||||||
|
base = (void *) KSEG1ADDR(detect_mem_size);
|
||||||
|
for (size = ramips_mem_size_min; size < ramips_mem_size_max;
|
||||||
|
size <<= 1 ) {
|
||||||
|
if (!memcmp(base, base + size, 1024))
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
add_memory_region(ramips_mem_base, size, BOOT_MEM_RAM);
|
add_memory_region(ramips_mem_base, size, BOOT_MEM_RAM);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user