projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow nvram access to kernel modules on brcm-2.6
[openwrt.git]
/
target
/
linux
/
linux-2.6
/
patches
/
brcm
/
002-flash-map.patch
diff --git
a/target/linux/linux-2.6/patches/brcm/002-flash-map.patch
b/target/linux/linux-2.6/patches/brcm/002-flash-map.patch
index
406255b
..
b8aeafa
100644
(file)
--- a/
target/linux/linux-2.6/patches/brcm/002-flash-map.patch
+++ b/
target/linux/linux-2.6/patches/brcm/002-flash-map.patch
@@
-1,7
+1,7
@@
-diff -Nur linux-2.6.1
2.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.
5-flash/drivers/mtd/maps/bcm47xx-flash.c
---- linux-2.6.1
2.5/drivers/mtd/maps/bcm47xx-flash.c
1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.1
2.5-flash/drivers/mtd/maps/bcm47xx-flash.c 2005-11-06 20:36:42.5531985
00 +0100
-@@ -0,0 +1,3
29
@@
+diff -Nur linux-2.6.1
5-rc5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.15-rc
5-flash/drivers/mtd/maps/bcm47xx-flash.c
+--- linux-2.6.1
5-rc5/drivers/mtd/maps/bcm47xx-flash.c
1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.1
5-rc5-flash/drivers/mtd/maps/bcm47xx-flash.c 2005-12-19 00:33:31.2762410
00 +0100
+@@ -0,0 +1,3
16
@@
+/*
+ * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
+ * Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org>
+/*
+ * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
+ * Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org>
@@
-36,8
+36,6
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
+ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
+ *
-+ * $Id: bcm47xx-flash.c,v 1.1 2004/10/21 07:18:31 jolt Exp $
-+ *
+ * Flash mapping for BCM947XX boards
+ */
+
+ * Flash mapping for BCM947XX boards
+ */
+
@@
-48,17
+46,12
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+#include <asm/io.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <asm/io.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
++#ifdef CONFIG_MTD_PARTITIONS
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/partitions.h>
++#endif
+#include <linux/config.h>
+#include <linux/config.h>
-+#include <typedefs.h>
-+#include <bcmutils.h>
-+#include <bcmnvram.h>
-+#include <trxhdr.h>
-+
+
+
-+#ifdef CONFIG_MTD_PARTITIONS
-+extern struct mtd_partition * init_mtd_partitions(struct mtd_info *mtd, size_t size);
-+#endif
++#include <trxhdr.h>
+
+#define WINDOW_ADDR 0x1c000000
+#define WINDOW_SIZE (0x400000*2)
+
+#define WINDOW_ADDR 0x1c000000
+#define WINDOW_SIZE (0x400000*2)
@@
-193,9
+186,8
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+
+ int cfe_size_flag;
+
+
+ int cfe_size_flag;
+
-+ cfe_size_flag = find_cfe_size(mtd,size);
-+
+ /* if cfe_size_flag=0, cfe size is 256 kb, else 384 kb */
+ /* if cfe_size_flag=0, cfe size is 256 kb, else 384 kb */
++ cfe_size_flag = find_cfe_size(mtd, size);
+
+ /* boot loader */
+ bcm947xx_parts[0].offset = 0;
+
+ /* boot loader */
+ bcm947xx_parts[0].offset = 0;
@@
-209,12
+201,11
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+ /* nvram */
+ if (cfe_size_flag == 0) {
+ bcm947xx_parts[3].offset = size - mtd->erasesize;
+ /* nvram */
+ if (cfe_size_flag == 0) {
+ bcm947xx_parts[3].offset = size - mtd->erasesize;
-+ bcm947xx_parts[3].size = mtd->erasesize;
+ } else {
+ /* nvram (old 128kb config partition on netgear wgt634u) */
+ bcm947xx_parts[3].offset = bcm947xx_parts[0].size;
+ } else {
+ /* nvram (old 128kb config partition on netgear wgt634u) */
+ bcm947xx_parts[3].offset = bcm947xx_parts[0].size;
-+ bcm947xx_parts[3].size = 1024*128;
+ }
+ }
++ bcm947xx_parts[3].size = mtd->erasesize;
+
+ /* linux (kernel and rootfs) */
+ if (cfe_size_flag == 0) {
+
+ /* linux (kernel and rootfs) */
+ if (cfe_size_flag == 0) {
@@
-222,7
+213,7
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+ bcm947xx_parts[1].size = bcm947xx_parts[3].offset -
+ bcm947xx_parts[1].offset;
+ } else {
+ bcm947xx_parts[1].size = bcm947xx_parts[3].offset -
+ bcm947xx_parts[1].offset;
+ } else {
-+ /* do not count the elf loader, which is on one
sector
*/
++ /* do not count the elf loader, which is on one
block
*/
+ bcm947xx_parts[1].offset = bcm947xx_parts[0].size +
+ bcm947xx_parts[3].size + mtd->erasesize;
+ bcm947xx_parts[1].size = size -
+ bcm947xx_parts[1].offset = bcm947xx_parts[0].size +
+ bcm947xx_parts[3].size + mtd->erasesize;
+ bcm947xx_parts[1].size = size -
@@
-235,19
+226,18
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+ if (find_root(mtd,size,&bcm947xx_parts[2])==0) {
+ /* entirely jffs2 */
+ bcm947xx_parts[4].name = NULL;
+ if (find_root(mtd,size,&bcm947xx_parts[2])==0) {
+ /* entirely jffs2 */
+ bcm947xx_parts[4].name = NULL;
-+ if (cfe_size_flag == 0) {
-+ bcm947xx_parts[2].size = bcm947xx_parts[3].offset -
-+ bcm947xx_parts[2].offset;
-+ } else {
-+ bcm947xx_parts[2].size = size - bcm947xx_parts[2].offset -
-+ bcm947xx_parts[3].size;
-+ }
++ bcm947xx_parts[2].size = size - bcm947xx_parts[2].offset -
++ bcm947xx_parts[3].size;
+ } else {
+ /* legacy setup */
+ /* calculate leftover flash, and assign it to the jffs2 partition */
+ if (cfe_size_flag == 0) {
+ bcm947xx_parts[4].offset = bcm947xx_parts[2].offset +
+ bcm947xx_parts[2].size;
+ } else {
+ /* legacy setup */
+ /* calculate leftover flash, and assign it to the jffs2 partition */
+ if (cfe_size_flag == 0) {
+ bcm947xx_parts[4].offset = bcm947xx_parts[2].offset +
+ bcm947xx_parts[2].size;
++ if ((bcm947xx_parts[4].offset % mtd->erasesize) > 0) {
++ bcm947xx_parts[4].offset += mtd->erasesize -
++ (bcm947xx_parts[4].offset % mtd->erasesize);
++ }
+ bcm947xx_parts[4].size = bcm947xx_parts[3].offset -
+ bcm947xx_parts[4].offset;
+ } else {
+ bcm947xx_parts[4].size = bcm947xx_parts[3].offset -
+ bcm947xx_parts[4].offset;
+ } else {
@@
-264,8
+254,6
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+
+ return bcm947xx_parts;
+}
+
+ return bcm947xx_parts;
+}
-+
-+EXPORT_SYMBOL(init_mtd_partitions);
+#endif
+
+int __init init_bcm947xx_map(void)
+#endif
+
+int __init init_bcm947xx_map(void)
@@
-297,7
+285,7
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+
+ size = bcm947xx_mtd->size;
+
+
+ size = bcm947xx_mtd->size;
+
-+ printk(KERN_NOTICE "Flash device: 0x%x at 0x%x\n",
bcm947xx_mtd->
size, WINDOW_ADDR);
++ printk(KERN_NOTICE "Flash device: 0x%x at 0x%x\n", size, WINDOW_ADDR);
+
+#ifdef CONFIG_MTD_PARTITIONS
+ parts = init_mtd_partitions(bcm947xx_mtd, size);
+
+#ifdef CONFIG_MTD_PARTITIONS
+ parts = init_mtd_partitions(bcm947xx_mtd, size);
@@
-308,15
+296,14
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+ goto fail;
+ }
+#endif
+ goto fail;
+ }
+#endif
-+
+ return 0;
+
+ fail:
+ if (bcm947xx_mtd)
+ map_destroy(bcm947xx_mtd);
+ return 0;
+
+ fail:
+ if (bcm947xx_mtd)
+ map_destroy(bcm947xx_mtd);
-+ if (bcm947xx_map.
map_priv_1
)
-+ iounmap((void *)
bcm947xx_map.map_priv_1
);
-+ bcm947xx_map.
map_priv_1
= 0;
++ if (bcm947xx_map.
virt
)
++ iounmap((void *)
bcm947xx_map.virt
);
++ bcm947xx_map.
virt
= 0;
+ return ret;
+}
+
+ return ret;
+}
+
@@
-331,10
+318,10
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/bcm47xx-flash.c linux-2.6.12.5-flash/d
+
+module_init(init_bcm947xx_map);
+module_exit(cleanup_bcm947xx_map);
+
+module_init(init_bcm947xx_map);
+module_exit(cleanup_bcm947xx_map);
-diff -Nur linux-2.6.1
2.5/drivers/mtd/maps/Kconfig linux-2.6.12.
5-flash/drivers/mtd/maps/Kconfig
---- linux-2.6.1
2.5/drivers/mtd/maps/Kconfig 2005-08-15 02:20:18.000000000 +02
00
-+++ linux-2.6.1
2.5-flash/drivers/mtd/maps/Kconfig 2005-09-16 22:27:36.000000000 +02
00
-@@ -
357,6 +357
,12 @@
+diff -Nur linux-2.6.1
5-rc5/drivers/mtd/maps/Kconfig linux-2.6.15-rc
5-flash/drivers/mtd/maps/Kconfig
+--- linux-2.6.1
5-rc5/drivers/mtd/maps/Kconfig 2005-12-04 06:10:42.000000000 +01
00
++++ linux-2.6.1
5-rc5-flash/drivers/mtd/maps/Kconfig 2005-12-18 19:36:11.555087000 +01
00
+@@ -
299,6 +299
,12 @@
Mapping for the Flaga digital module. If you don't have one, ignore
this setting.
Mapping for the Flaga digital module. If you don't have one, ignore
this setting.
@@
-346,10
+333,10
@@
diff -Nur linux-2.6.12.5/drivers/mtd/maps/Kconfig linux-2.6.12.5-flash/drivers/m
+
config MTD_BEECH
tristate "CFI Flash device mapped on IBM 405LP Beech"
+
config MTD_BEECH
tristate "CFI Flash device mapped on IBM 405LP Beech"
- depends on MTD_CFI &&
PPC32 && 40x &&
BEECH
-diff -Nur linux-2.6.1
2.5/drivers/mtd/maps/Makefile linux-2.6.12.
5-flash/drivers/mtd/maps/Makefile
---- linux-2.6.1
2.5/drivers/mtd/maps/Makefile 2005-08-15 02:20:18.000000000 +02
00
-+++ linux-2.6.1
2.5-flash/drivers/mtd/maps/Makefile 2005-09-16 22:27:01.000000000 +02
00
+ depends on MTD_CFI && BEECH
+diff -Nur linux-2.6.1
5-rc5/drivers/mtd/maps/Makefile linux-2.6.15-rc
5-flash/drivers/mtd/maps/Makefile
+--- linux-2.6.1
5-rc5/drivers/mtd/maps/Makefile 2005-12-04 06:10:42.000000000 +01
00
++++ linux-2.6.1
5-rc5-flash/drivers/mtd/maps/Makefile 2005-12-18 19:36:11.555087000 +01
00
@@ -31,6 +31,7 @@
obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o
obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o
@@ -31,6 +31,7 @@
obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o
obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o
This page took
0.027863 seconds
and
4
git commands to generate.