projects
/
openwrt
/
staging
/
florian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bef15f9
)
fix handling of invalid arguments passed by some bootloaders (thanks to Jeff Hansen...
author
Gabor Juhos
<juhosg@openwrt.org>
Tue, 3 Feb 2009 07:26:31 +0000
(07:26 +0000)
committer
Gabor Juhos
<juhosg@openwrt.org>
Tue, 3 Feb 2009 07:26:31 +0000
(07:26 +0000)
SVN-Revision: 14382
target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h
patch
|
blob
|
history
target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
patch
|
blob
|
history
target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
patch
|
blob
|
history
target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
patch
|
blob
|
history
diff --git
a/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h
b/target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h
index 5aba593e290f79a71b839cccf681842f73654378..a4e6ed3ecfcfe0214810fa9d38e8fd3a96a3ec74 100644
(file)
--- a/
target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h
+++ b/
target/linux/ar71xx/files-2.6.28/arch/mips/include/asm/mach-ar71xx/ar71xx.h
@@
-59,6
+59,9
@@
#define AR91XX_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000)
#define AR91XX_WMAC_SIZE 0x30000
#define AR91XX_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000)
#define AR91XX_WMAC_SIZE 0x30000
+#define AR71XX_MEM_SIZE_MIN 0x0200000
+#define AR71XX_MEM_SIZE_MAX 0x8000000
+
#define AR71XX_CPU_IRQ_BASE 0
#define AR71XX_MISC_IRQ_BASE 8
#define AR71XX_MISC_IRQ_COUNT 8
#define AR71XX_CPU_IRQ_BASE 0
#define AR71XX_MISC_IRQ_BASE 8
#define AR71XX_MISC_IRQ_COUNT 8
diff --git
a/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
b/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
index 8e93807ae5df9e81b6bf2f55e693601c9e667989..5402e0a54389ace0337ca3e11a1428a7fbf60a90 100644
(file)
--- a/
target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
+++ b/
target/linux/ar71xx/files/arch/mips/ar71xx/prom.c
@@
-73,18
+73,31
@@
static struct board_rec boards[] __initdata = {
}
};
}
};
+static inline int is_valid_ram_addr(void *addr)
+{
+ if (((u32) addr > KSEG0) &&
+ ((u32) addr < (KSEG0 + AR71XX_MEM_SIZE_MAX)))
+ return 1;
+
+ if (((u32) addr > KSEG1) &&
+ ((u32) addr < (KSEG1 + AR71XX_MEM_SIZE_MAX)))
+ return 1;
+
+ return 0;
+}
+
static __init char *ar71xx_prom_getargv(const char *name)
{
int len = strlen(name);
int i;
static __init char *ar71xx_prom_getargv(const char *name)
{
int len = strlen(name);
int i;
- if (!
ar71xx_prom_argv
)
+ if (!
is_valid_ram_addr(ar71xx_prom_argv)
)
return NULL;
for (i = 0; i < ar71xx_prom_argc; i++) {
char *argv = ar71xx_prom_argv[i];
return NULL;
for (i = 0; i < ar71xx_prom_argc; i++) {
char *argv = ar71xx_prom_argv[i];
- if (!
argv
)
+ if (!
is_valid_ram_addr(argv)
)
continue;
if (strncmp(name, argv, len) == 0 && (argv)[len] == '=')
continue;
if (strncmp(name, argv, len) == 0 && (argv)[len] == '=')
@@
-99,10
+112,10
@@
static __init char *ar71xx_prom_getenv(const char *envname)
int len = strlen(envname);
char **env;
int len = strlen(envname);
char **env;
- if (!
ar71xx_prom_envp
)
+ if (!
is_valid_ram_addr(ar71xx_prom_envp)
)
return NULL;
return NULL;
- for (env = ar71xx_prom_envp;
*env != NULL
; env++)
+ for (env = ar71xx_prom_envp;
is_valid_ram_addr(*env)
; env++)
if (strncmp(envname, *env, len) == 0 && (*env)[len] == '=')
return *env + len + 1;
if (strncmp(envname, *env, len) == 0 && (*env)[len] == '=')
return *env + len + 1;
diff --git
a/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
b/target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
index a83f7d198b8751e17832a64b0bf8c75d88dc6276..40b11782df45ad89bdcb343a9bd9801e278fb0bb 100644
(file)
--- a/
target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
+++ b/
target/linux/ar71xx/files/arch/mips/ar71xx/setup.c
@@
-1,7
+1,7
@@
/*
* Atheros AR71xx SoC specific setup
*
/*
* Atheros AR71xx SoC specific setup
*
- * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
+ * Copyright (C) 2008
-2009
Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*
* Parts of this file are based on Atheros' 2.6.15 BSP
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*
* Parts of this file are based on Atheros' 2.6.15 BSP
@@
-33,9
+33,6
@@
#define AR71XX_BASE_FREQ 40000000
#define AR91XX_BASE_FREQ 5000000
#define AR71XX_BASE_FREQ 40000000
#define AR91XX_BASE_FREQ 5000000
-#define AR71XX_MEM_SIZE_MIN 0x0200000
-#define AR71XX_MEM_SIZE_MAX 0x8000000
-
unsigned long ar71xx_mach_type;
u32 ar71xx_cpu_freq;
unsigned long ar71xx_mach_type;
u32 ar71xx_cpu_freq;
diff --git
a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
index 5aba593e290f79a71b839cccf681842f73654378..a4e6ed3ecfcfe0214810fa9d38e8fd3a96a3ec74 100644
(file)
--- a/
target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
+++ b/
target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/ar71xx.h
@@
-59,6
+59,9
@@
#define AR91XX_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000)
#define AR91XX_WMAC_SIZE 0x30000
#define AR91XX_WMAC_BASE (AR71XX_APB_BASE + 0x000C0000)
#define AR91XX_WMAC_SIZE 0x30000
+#define AR71XX_MEM_SIZE_MIN 0x0200000
+#define AR71XX_MEM_SIZE_MAX 0x8000000
+
#define AR71XX_CPU_IRQ_BASE 0
#define AR71XX_MISC_IRQ_BASE 8
#define AR71XX_MISC_IRQ_COUNT 8
#define AR71XX_CPU_IRQ_BASE 0
#define AR71XX_MISC_IRQ_BASE 8
#define AR71XX_MISC_IRQ_COUNT 8