summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2011-08-01 13:26:08 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2011-08-01 13:26:08 +0200
commit38e356a749191c1832c9726b0b6cb913737af700 (patch)
treee8649d752a11d05d20615b2d4fd3a506baab516b
parent2ee33f7b7bb6f36dcee29f7df1e6122b55139e92 (diff)
different make bulkallmod fixes
-rw-r--r--mk/vars.mk2
-rw-r--r--package/DirectFB/Makefile5
-rw-r--r--package/asterisk/Makefile1
-rw-r--r--package/cluster-glue/Makefile2
-rw-r--r--package/libhugetlbfs/Makefile1
-rw-r--r--package/llvm/patches/patch-Makefile_rules11
-rw-r--r--package/mplayer/Makefile11
-rw-r--r--package/mplayer/patches/patch-Makefile12
-rw-r--r--package/mplayer/patches/patch-stream_asf_mmst_streaming_c23
-rw-r--r--package/mplayer/patches/patch-stream_asf_streaming_c27
-rw-r--r--package/openjdk/Makefile2
-rw-r--r--package/resource-agents/Makefile2
-rw-r--r--package/xf86-video-geode/patches/patch-src_z4l_c10
-rw-r--r--rules.mk1
-rw-r--r--target/config/Config.in23
-rw-r--r--target/linux/config/Config.in.bluetooth2
-rw-r--r--target/linux/config/Config.in.crypto2
-rw-r--r--target/linux/patches/2.6.39/cris.patch13194
-rw-r--r--target/linux/patches/2.6.39/ocf-20100325.patch90188
19 files changed, 103494 insertions, 25 deletions
diff --git a/mk/vars.mk b/mk/vars.mk
index 3e8a26094..3776b57b4 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -120,7 +120,7 @@ LINUX_HEADER_DIR:= $(STAGING_DIR)/linux-header
KERNEL_MODULE_FLAGS:= ARCH=${ARCH} KERNELVERSION="2.6" \
KERNEL_PATH=${LINUX_DIR} KERNELDIR=${LINUX_DIR} KERNEL_DIR=${LINUX_DIR} \
PREFIX=/usr CROSS_COMPILE="${TARGET_CROSS}" \
- LDFLAGS="" CFLAGS_MODULE="-fhonour-copts" V=1
+ LDFLAGS="$(ADK_TARGET_KERNEL_LDFLAGS)" CFLAGS_MODULE="-fhonour-copts" V=1
TARGET_CONFIGURE_OPTS= PATH='${TARGET_PATH}' \
AR='$(TARGET_CROSS)ar' \
diff --git a/package/DirectFB/Makefile b/package/DirectFB/Makefile
index c9b404fe2..db3a9f115 100644
--- a/package/DirectFB/Makefile
+++ b/package/DirectFB/Makefile
@@ -38,10 +38,9 @@ CONFIGURE_ARGS+= --with-inputdrivers=linuxinput,keyboard,ps2mouse \
# This is to overcome libtool fuckup - when building without,
# libtool calls (the correct) ld directly without parameters,
# which then chooses the wrong default emulation (which is
-# probably the real problem here). LDEMULATION overrides ld's
-# wrong choice.
+# probably the real problem here).
ifeq (${ADK_TARGET_SYSTEM_LEMOTE_YEELONG},y)
-XAKE_FLAGS+= LDEMULATION=elf64ltsmip
+XAKE_FLAGS+= LDFLAGS=$(ADK_TARGET_ABI_CFLAGS)
endif
post-install:
diff --git a/package/asterisk/Makefile b/package/asterisk/Makefile
index c948531b2..d3a55ad1f 100644
--- a/package/asterisk/Makefile
+++ b/package/asterisk/Makefile
@@ -60,6 +60,7 @@ CONFIGURE_ARGS= --with-z=${STAGING_TARGET_DIR}/usr \
--without-nbs \
--without-netsnmp \
--without-newt \
+ --without-openais \
--without-osptk \
--without-oss \
--without-popt \
diff --git a/package/cluster-glue/Makefile b/package/cluster-glue/Makefile
index f968db8d2..a2d8f365e 100644
--- a/package/cluster-glue/Makefile
+++ b/package/cluster-glue/Makefile
@@ -13,6 +13,8 @@ PKG_BUILDDEP:= glib bzip2 e2fsprogs
PKG_URL:= http://www.linux-ha.org/wiki/Cluster_Glue
PKG_SITES:= http://openadk.org/distfiles/
+PKG_CFLINE_CLUSTER_GLUE:= depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC
+
include $(TOPDIR)/mk/package.mk
$(eval $(call PKG_template,CLUSTER_GLUE,cluster-glue,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
diff --git a/package/libhugetlbfs/Makefile b/package/libhugetlbfs/Makefile
index b41283736..11d8cc9a4 100644
--- a/package/libhugetlbfs/Makefile
+++ b/package/libhugetlbfs/Makefile
@@ -13,6 +13,7 @@ PKG_URL:= http://libhugetlbfs.ozlabs.org/
PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=libhugetlbfs/}
PKG_CFLINE_LIBHUGETLBFS:= depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC
+PKG_ARCH_DEPENDS:= x86 x86_64 arm
include $(TOPDIR)/mk/package.mk
diff --git a/package/llvm/patches/patch-Makefile_rules b/package/llvm/patches/patch-Makefile_rules
new file mode 100644
index 000000000..51ead24f5
--- /dev/null
+++ b/package/llvm/patches/patch-Makefile_rules
@@ -0,0 +1,11 @@
+--- llvm-2.9.orig/Makefile.rules 2011-03-25 07:26:58.000000000 +0100
++++ llvm-2.9/Makefile.rules 2011-07-30 12:32:43.143700539 +0200
+@@ -550,7 +550,7 @@ endif
+ ifndef KEEP_SYMBOLS
+ Strip := $(PLATFORMSTRIPOPTS)
+ StripWarnMsg := "(without symbols)"
+- Install.StripFlag += -s
++ Install.StripFlag +=
+ endif
+
+ ifdef TOOL_NO_EXPORTS
diff --git a/package/mplayer/Makefile b/package/mplayer/Makefile
index ee2e09a44..2529c1eec 100644
--- a/package/mplayer/Makefile
+++ b/package/mplayer/Makefile
@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
PKG_NAME:= mplayer
PKG_VERSION:= 1.0-32749
-PKG_RELEASE:= 2
+PKG_RELEASE:= 3
PKG_MD5SUM:= aadc5d8cca503c8b18b3ed00b3a52cf5
PKG_DESCR:= popular video player
PKG_SECTION:= multimedia
@@ -17,7 +17,7 @@ PKG_BUILDDEP+= libX11 libXv libpng libXext jpeg
PKG_URL:= http://www.mplayerhq.hu/
PKG_SITES:= http://openadk.org/distfiles/
-PKG_ARCH_DEPENDS:= x86 x86_64 mips mipsel mips64 mips64el
+PKG_ARCH_DEPENDS:= x86 x86_64 mips
PKG_FLAVOURS_MPLAYER:= WITH_DIRECTFB
PKGFD_WITH_DIRECTFB:= enable DirectFB video output support
@@ -30,15 +30,12 @@ include ${TOPDIR}/mk/package.mk
$(eval $(call PKG_template,MPLAYER,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
# gcc 4.5 produces internal compiler error with -Os
-TCFLAGS:=$(subst Os,O2,$(TCFLAGS))
+TARGET_CFLAGS:=$(subst Os,O2,$(TARGET_CFLAGS))
CONFIG_STYLE:= minimal
FAKE_FLAGS+= INSTALLSTRIP=''
-ifeq (${ADK_LINUX_MIPS64EL},y)
-EXTRA_CFLAGS:= -DARCH_MIPS64
-endif
-ifeq (${ADK_LINUX_MIPS64},y)
+ifeq (${ADK_TARGET_SYSTEM_LEMOTE_YEELONG},y)
EXTRA_CFLAGS:= -DARCH_MIPS64
endif
diff --git a/package/mplayer/patches/patch-Makefile b/package/mplayer/patches/patch-Makefile
index 3f57255db..bb8529c8c 100644
--- a/package/mplayer/patches/patch-Makefile
+++ b/package/mplayer/patches/patch-Makefile
@@ -1,6 +1,14 @@
--- mplayer-1.0-32749.orig/Makefile 2011-01-03 11:27:11.000000000 +0100
-+++ mplayer-1.0-32749/Makefile 2011-02-05 18:20:49.000000000 +0100
-@@ -816,7 +816,7 @@ mencoder$(EXESUF) mplayer$(EXESUF):
++++ mplayer-1.0-32749/Makefile 2011-07-29 17:44:21.073424743 +0200
+@@ -185,7 +185,6 @@ SRCS_COMMON-$(NEED_STRSEP) +=
+ SRCS_COMMON-$(NEED_SWAB) += osdep/swab.c
+ SRCS_COMMON-$(NEED_VSSCANF) += osdep/vsscanf.c
+ SRCS_COMMON-$(NETWORKING) += stream/stream_netstream.c \
+- stream/asf_mmst_streaming.c \
+ stream/asf_streaming.c \
+ stream/cookies.c \
+ stream/http.c \
+@@ -816,7 +815,7 @@ mencoder$(EXESUF) mplayer$(EXESUF):
$(CC) -o $@ $^ $(EXTRALIBS)
codec-cfg$(EXESUF): codec-cfg.c codec-cfg.h help_mp.h
diff --git a/package/mplayer/patches/patch-stream_asf_mmst_streaming_c b/package/mplayer/patches/patch-stream_asf_mmst_streaming_c
new file mode 100644
index 000000000..b16cec430
--- /dev/null
+++ b/package/mplayer/patches/patch-stream_asf_mmst_streaming_c
@@ -0,0 +1,23 @@
+--- mplayer-1.0-32749.orig/stream/asf_mmst_streaming.c 2011-01-03 11:26:52.000000000 +0100
++++ mplayer-1.0-32749/stream/asf_mmst_streaming.c 2011-07-29 17:29:01.494032168 +0200
+@@ -359,20 +359,7 @@ static int interp_header (uint8_t *heade
+ }
+
+ } else {
+-#if 0
+- int b = i;
+- printf ("unknown object (guid: %016llx, %016llx, len: %lld)\n", guid_1, guid_2, length);
+- for (; b < length; b++)
+- {
+- if (isascii(header[b]) || isalpha(header[b]))
+- printf("%c ", header[b]);
+- else
+- printf("%x ", header[b]);
+- }
+- printf("\n");
+-#else
+ mp_msg(MSGT_NETWORK,MSGL_WARN,MSGTR_MPDEMUX_MMST_UnknownObject);
+-#endif
+ }
+
+ // mp_msg(MSGT_NETWORK,MSGL_INFO,"length : %lld\n", length);
diff --git a/package/mplayer/patches/patch-stream_asf_streaming_c b/package/mplayer/patches/patch-stream_asf_streaming_c
new file mode 100644
index 000000000..4fa3b696b
--- /dev/null
+++ b/package/mplayer/patches/patch-stream_asf_streaming_c
@@ -0,0 +1,27 @@
+--- mplayer-1.0-32749.orig/stream/asf_streaming.c 2011-01-03 11:26:52.000000000 +0100
++++ mplayer-1.0-32749/stream/asf_streaming.c 2011-07-29 17:54:35.013424616 +0200
+@@ -38,7 +38,6 @@
+
+ #include "stream.h"
+ #include "libmpdemux/demuxer.h"
+-#include "asf_mmst_streaming.h"
+ #include "network.h"
+ #include "tcp.h"
+
+@@ -87,16 +86,6 @@ static int asf_streaming_start( stream_t
+ if( fd==-2 ) return -1;
+ }
+
+- //Is protocol mms or mmst?
+- if (!strcasecmp(proto, "mmst") || !strcasecmp(proto, "mms"))
+- {
+- mp_msg(MSGT_NETWORK,MSGL_V,"Trying ASF/TCP...\n");
+- fd = asf_mmst_streaming_start( stream );
+- stream->streaming_ctrl->url->port = port;
+- if( fd>-1 ) return fd;
+- mp_msg(MSGT_NETWORK,MSGL_V," ===> ASF/TCP failed\n");
+- if( fd==-2 ) return -1;
+- }
+
+ //Is protocol http, http_proxy, or mms?
+ if (!strcasecmp(proto, "http_proxy") || !strcasecmp(proto, "http") ||
diff --git a/package/openjdk/Makefile b/package/openjdk/Makefile
index 2233c476b..db8e28e6b 100644
--- a/package/openjdk/Makefile
+++ b/package/openjdk/Makefile
@@ -24,7 +24,7 @@ PKG_SITES:= http://download.java.net/openjdk/jdk6/promoted/b22/ \
http://icedtea.classpath.org/download/drops/ \
http://icedtea.classpath.org/download/source/
-PKG_CFLINE_OPENJDK:= depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC
+PKG_CFLINE_OPENJDK:= depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC && !ADK_TARGET_SYSTEM_LEMOTE_YEELONG
# autotools infrastructure for OpenJDK
ICEDTEA_NAME:= icedtea6
diff --git a/package/resource-agents/Makefile b/package/resource-agents/Makefile
index 50b5fafe7..b68da9226 100644
--- a/package/resource-agents/Makefile
+++ b/package/resource-agents/Makefile
@@ -12,6 +12,8 @@ PKG_SECTION:= ha
PKG_URL:= https://github.com/ClusterLabs/resource-agents
PKG_SITES:= http://openadk.org/distfiles/
+PKG_CFLINE_RESOURCE_AGENTS:= depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_EGLIBC
+
include $(TOPDIR)/mk/package.mk
$(eval $(call PKG_template,RESOURCE_AGENTS,resource-agents,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
diff --git a/package/xf86-video-geode/patches/patch-src_z4l_c b/package/xf86-video-geode/patches/patch-src_z4l_c
new file mode 100644
index 000000000..6875eb2f3
--- /dev/null
+++ b/package/xf86-video-geode/patches/patch-src_z4l_c
@@ -0,0 +1,10 @@
+--- xf86-video-geode-2.11.10.orig/src/z4l.c 2010-11-09 10:20:07.000000000 +0100
++++ xf86-video-geode-2.11.10/src/z4l.c 2011-07-31 20:58:18.763424329 +0200
+@@ -55,7 +55,6 @@ typedef long long __s64;
+ #define __u64 __u_64
+ typedef unsigned long long __u64;
+
+-#include "linux/videodev.h"
+ #define __user
+ #include "linux/videodev2.h"
+
diff --git a/rules.mk b/rules.mk
index c0f81f438..44500f761 100644
--- a/rules.mk
+++ b/rules.mk
@@ -32,6 +32,7 @@ ADK_TARGET_ENDIAN:= $(strip $(subst ",, $(ADK_TARGET_ENDIAN)))
ADK_TARGET_CPU_ARCH:= $(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
ADK_TARGET_ABI_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS)))
+ADK_TARGET_KERNEL_LDFLAGS:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_LDFLAGS)))
ADK_TARGET_ABI:= $(strip $(subst ",, $(ADK_TARGET_ABI)))
ADK_TARGET_IP:= $(strip $(subst ",, $(ADK_TARGET_IP)))
ADK_TARGET_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
diff --git a/target/config/Config.in b/target/config/Config.in
index 5162a6c72..4ab0999be 100644
--- a/target/config/Config.in
+++ b/target/config/Config.in
@@ -32,15 +32,12 @@ endchoice
choice
prompt "Target Kernel"
depends on ADK_TARGET_SYSTEM_LEMOTE_YEELONG
-config ADK_TARGET_KERNEL
- boolean "Choose target kernel"
+config ADK_TARGET_KERNEL64
+ boolean "64 Bit Kernel"
config ADK_TARGET_KERNEL32
boolean "32 Bit Kernel"
-config ADK_TARGET_KERNEL64
- boolean "64 Bit Kernel"
-
endchoice
config ADK_o32
@@ -61,17 +58,15 @@ config ADK_TARGET_ABI
choice
prompt "Target ABI"
depends on ADK_TARGET_KERNEL64 && ADK_LINUX_MIPS
-config ADK_ABI
- boolean "Choose target ABI"
-
-config ADK_TARGET_ABI_O32
- boolean "O32 ABI (old)"
- select ADK_o32
config ADK_TARGET_ABI_N32
boolean "N32 ABI (new)"
select ADK_n32
+config ADK_TARGET_ABI_O32
+ boolean "O32 ABI (old)"
+ select ADK_o32
+
config ADK_TARGET_ABI_N64
boolean "N64 ABI"
select ADK_n64
@@ -269,6 +264,12 @@ config ADK_TARGET_ABI_CFLAGS
default "-mabi=n32 -Wl,-m -Wl,elf32ltsmipn32" if ADK_TARGET_ABI_N32
default "-mabi=64 -Wl,-m -Wl,elf64ltsmip" if ADK_TARGET_ABI_N64
+config ADK_TARGET_KERNEL_LDFLAGS
+ string
+ default "-mabi=64 -m elf64ltsmip" if ADK_TARGET_ABI_N32
+ default "-mabi=64 -m elf64ltsmip" if ADK_TARGET_ABI_O32
+ default "-mabi=64 -m elf64ltsmip" if ADK_TARGET_ABI_N64
+
config ADK_TARGET_CFLAGS
string
default "-march=geode" if ADK_CPU_GEODE
diff --git a/target/linux/config/Config.in.bluetooth b/target/linux/config/Config.in.bluetooth
index 26ac067b1..73760d14c 100644
--- a/target/linux/config/Config.in.bluetooth
+++ b/target/linux/config/Config.in.bluetooth
@@ -82,6 +82,7 @@ config ADK_KPACKAGE_KMOD_BT_HCIBTUSB
tristate
default n
depends on ADK_KPACKAGE_KMOD_BT
+ depends on ADK_TARGET_WITH_USB
help
Bluetooth HCI USB driver.
This driver is required if you want to use Bluetooth devices with
@@ -106,6 +107,7 @@ config ADK_KPACKAGE_KMOD_BT_HCIBCM203X
select ADK_KPACKAGE_KMOD_FW_LOADER
select ADK_KPACKAGE_KMOD_BT_HCIBTUSB
depends on ADK_KPACKAGE_KMOD_BT
+ depends on ADK_LINUX_X86 || ADK_LINUX_X86_64
help
Bluetooth HCI BCM203x USB driver.
This driver provides the firmware loading mechanism for the Broadcom
diff --git a/target/linux/config/Config.in.crypto b/target/linux/config/Config.in.crypto
index ff6fb6b00..694443350 100644
--- a/target/linux/config/Config.in.crypto
+++ b/target/linux/config/Config.in.crypto
@@ -65,6 +65,8 @@ config ADK_KPACKAGE_KMOD_OCF_HIFN
default n
select ADK_KERNEL_OCF_OCF
depends on ADK_TARGET_WITH_PCI || ADK_TARGET_WITH_MINIPCI
+ depends on !ADK_HARDWARE_QEMU
+ depends on ADK_LINUX_X86 || ADK_LINUX_X86_64
select ADK_KPACKAGE_KMOD_CRYPTO_AES
help
Engine for cryptodev that uses Hifn based accelerators
diff --git a/target/linux/patches/2.6.39/cris.patch b/target/linux/patches/2.6.39/cris.patch
new file mode 100644
index 000000000..f58391a5d
--- /dev/null
+++ b/target/linux/patches/2.6.39/cris.patch
@@ -0,0 +1,13194 @@
+diff -Nur linux-2.6.39.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2.6.39/arch/cris/arch-v10/drivers/axisflashmap.c
+--- linux-2.6.39.orig/arch/cris/arch-v10/drivers/axisflashmap.c 2011-05-19 06:06:34.000000000 +0200
++++ linux-2.6.39/arch/cris/arch-v10/drivers/axisflashmap.c 2011-07-28 16:16:35.633425525 +0200
+@@ -113,7 +113,7 @@
+
+ /* If no partition-table was found, we use this default-set. */
+ #define MAX_PARTITIONS 7
+-#define NUM_DEFAULT_PARTITIONS 3
++#define NUM_DEFAULT_PARTITIONS 4
+
+ /*
+ * Default flash size is 2MB. CONFIG_ETRAX_PTABLE_SECTOR is most likely the
+@@ -122,19 +122,24 @@
+ */
+ static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
+ {
+- .name = "boot firmware",
+- .size = CONFIG_ETRAX_PTABLE_SECTOR,
++ .name = "kernel",
++ .size = 0x00,
+ .offset = 0
+ },
+ {
+- .name = "kernel",
+- .size = 0x200000 - (6 * CONFIG_ETRAX_PTABLE_SECTOR),
+- .offset = CONFIG_ETRAX_PTABLE_SECTOR
++ .name = "rootfs",
++ .size = 0x200000 ,
++ .offset = 0x200000
++ },
++ {
++ .name = "cfgfs",
++ .size = 0x20000 ,
++ .offset = CONFIG_ETRAX_MTD_SIZE - 0x20000
+ },
+ {
+- .name = "filesystem",
+- .size = 5 * CONFIG_ETRAX_PTABLE_SECTOR,
+- .offset = 0x200000 - (5 * CONFIG_ETRAX_PTABLE_SECTOR)
++ .name = "linux",
++ .size = CONFIG_ETRAX_MTD_SIZE - 0x20000,
++ .offset = 0
+ }
+ };
+
+@@ -275,6 +280,11 @@
+ struct partitiontable_entry *ptable;
+ int use_default_ptable = 1; /* Until proven otherwise. */
+ const char pmsg[] = " /dev/flash%d at 0x%08x, size 0x%08x\n";
++ unsigned int kernel_part_size = 0;
++ unsigned char *flash_mem = (unsigned char*)(FLASH_CACHED_ADDR);
++ unsigned int flash_scan_count = 0;
++ const char *part_magic = "ACME_PART_MAGIC";
++ unsigned int magic_len = strlen(part_magic);
+
+ if (!(mymtd = flash_probe())) {
+ /* There's no reason to use this module if no flash chip can
+@@ -286,6 +296,31 @@
+ mymtd->name, mymtd->size);
+ axisflash_mtd = mymtd;
+ }
++ /* scan flash to findout where out partition starts */
++
++ printk(KERN_INFO "Scanning flash for end of kernel magic\n");
++ for(flash_scan_count = 0; flash_scan_count < 100000; flash_scan_count++){
++ if(strncmp(&flash_mem[flash_scan_count], part_magic, magic_len - 1) == 0)
++ {
++ kernel_part_size = flash_mem[flash_scan_count + magic_len ];
++ kernel_part_size <<= 8;
++ kernel_part_size += flash_mem[flash_scan_count + magic_len + 2];
++ kernel_part_size <<= 8;
++ kernel_part_size += flash_mem[flash_scan_count + magic_len + 1];
++ kernel_part_size <<= 8;
++ kernel_part_size += flash_mem[flash_scan_count + magic_len + 3];
++ printk(KERN_INFO "Kernel ends at 0x%.08X\n", kernel_part_size);
++ flash_scan_count = 1100000;
++ }
++ }
++
++
++ if(kernel_part_size){
++ kernel_part_size = (kernel_part_size & 0xffff0000);
++ axis_default_partitions[0].size = kernel_part_size;
++ axis_default_partitions[1].size = mymtd->size - axis_default_partitions[0].size - axis_default_partitions[2].size;
++ axis_default_partitions[1].offset = axis_default_partitions[0].size;
++ }
+
+ if (mymtd) {
+ mymtd->owner = THIS_MODULE;
+@@ -354,21 +389,6 @@
+ use_default_ptable = !ptable_ok;
+ }
+
+- if (romfs_in_flash) {
+- /* Add an overlapping device for the root partition (romfs). */
+-
+- axis_partitions[pidx].name = "romfs";
+- axis_partitions[pidx].size = romfs_length;
+- axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
+- axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;
+-
+- printk(KERN_INFO
+- " Adding readonly flash partition for romfs image:\n");
+- printk(pmsg, pidx, axis_partitions[pidx].offset,
+- axis_partitions[pidx].size);
+- pidx++;
+- }
+-
+ #ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
+ if (mymtd) {
+ main_partition.size = mymtd->size;
+@@ -391,36 +411,6 @@
+ if (err)
+ panic("axisflashmap could not add MTD partitions!\n");
+ }
+-
+- if (!romfs_in_flash) {
+- /* Create an RAM device for the root partition (romfs). */
+-
+-#if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)
+- /* No use trying to boot this kernel from RAM. Panic! */
+- printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM "
+- "device due to kernel (mis)configuration!\n");
+- panic("This kernel cannot boot from RAM!\n");
+-#else
+- struct mtd_info *mtd_ram;
+-
+- mtd_ram = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
+- if (!mtd_ram)
+- panic("axisflashmap couldn't allocate memory for "
+- "mtd_info!\n");
+-
+- printk(KERN_INFO " Adding RAM partition for romfs image:\n");
+- printk(pmsg, pidx, (unsigned)romfs_start,
+- (unsigned)romfs_length);
+-
+- err = mtdram_init_device(mtd_ram,
+- (void *)romfs_start,
+- romfs_length,
+- "romfs");
+- if (err)
+- panic("axisflashmap could not initialize MTD RAM "
+- "device!\n");
+-#endif
+- }
+ return err;
+ }
+
+diff -Nur linux-2.6.39.orig/arch/cris/arch-v10/drivers/axisflashmap.c.orig linux-2.6.39/arch/cris/arch-v10/drivers/axisflashmap.c.orig
+--- linux-2.6.39.orig/arch/cris/arch-v10/drivers/axisflashmap.c.orig 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.39/arch/cris/arch-v10/drivers/axisflashmap.c.orig 2011-05-19 06:06:34.000000000 +0200
+@@ -0,0 +1,430 @@
++/*
++ * Physical mapping layer for MTD using the Axis partitiontable format
++ *
++ * Copyright (c) 2001, 2002 Axis Communications AB
++ *
++ * This file is under the GPL.
++ *
++ * First partition is always sector 0 regardless of if we find a partitiontable
++ * or not. In the start of the next sector, there can be a partitiontable that
++ * tells us what other partitions to define. If there isn't, we use a default
++ * partition split defined below.
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/types.h>
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++
++#include <linux/mtd/concat.h>
++#include <linux/mtd/map.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/mtdram.h>
++#include <linux/mtd/partitions.h>
++
++#include <asm/axisflashmap.h>
++#include <asm/mmu.h>
++#include <arch/sv_addr_ag.h>
++
++#ifdef CONFIG_CRIS_LOW_MAP
++#define FLASH_UNCACHED_ADDR KSEG_8
++#define FLASH_CACHED_ADDR KSEG_5
++#else
++#define FLASH_UNCACHED_ADDR KSEG_E
++#define FLASH_CACHED_ADDR KSEG_F
++#endif
++
++#if CONFIG_ETRAX_FLASH_BUSWIDTH==1
++#define flash_data __u8
++#elif CONFIG_ETRAX_FLASH_BUSWIDTH==2
++#define flash_data __u16
++#elif CONFIG_ETRAX_FLASH_BUSWIDTH==4
++#define flash_data __u32
++#endif
++
++/* From head.S */
++extern unsigned long romfs_start, romfs_length, romfs_in_flash;
++
++/* The master mtd for the entire flash. */
++struct mtd_info* axisflash_mtd = NULL;
++
++/* Map driver functions. */
++
++static map_word flash_read(struct map_info *map, unsigned long ofs)
++{
++ map_word tmp;
++ tmp.x[0] = *(flash_data *)(map->map_priv_1 + ofs);
++ return tmp;
++}
++
++static void flash_copy_from(struct map_info *map, void *to,
++ unsigned long from, ssize_t len)
++{
++ memcpy(to, (void *)(map->map_priv_1 + from), len);
++}
++
++static void flash_write(struct map_info *map, map_word d, unsigned long adr)
++{
++ *(flash_data *)(map->map_priv_1 + adr) = (flash_data)d.x[0];
++}
++
++/*
++ * The map for chip select e0.
++ *
++ * We run into tricky coherence situations if we mix cached with uncached
++ * accesses to we only use the uncached version here.
++ *
++ * The size field is the total size where the flash chips may be mapped on the
++ * chip select. MTD probes should find all devices there and it does not matter
++ * if there are unmapped gaps or aliases (mirrors of flash devices). The MTD
++ * probes will ignore them.
++ *
++ * The start address in map_priv_1 is in virtual memory so we cannot use
++ * MEM_CSE0_START but must rely on that FLASH_UNCACHED_ADDR is the start
++ * address of cse0.
++ */
++static struct map_info map_cse0 = {
++ .name = "cse0",
++ .size = MEM_CSE0_SIZE,
++ .bankwidth = CONFIG_ETRAX_FLASH_BUSWIDTH,
++ .read = flash_read,
++ .copy_from = flash_copy_from,
++ .write = flash_write,
++ .map_priv_1 = FLASH_UNCACHED_ADDR
++};
++
++/*
++ * The map for chip select e1.
++ *
++ * If there was a gap between cse0 and cse1, map_priv_1 would get the wrong
++ * address, but there isn't.
++ */
++static struct map_info map_cse1 = {
++ .name = "cse1",
++ .size = MEM_CSE1_SIZE,
++ .bankwidth = CONFIG_ETRAX_FLASH_BUSWIDTH,
++ .read = flash_read,
++ .copy_from = flash_copy_from,
++ .write = flash_write,
++ .map_priv_1 = FLASH_UNCACHED_ADDR + MEM_CSE0_SIZE
++};
++
++/* If no partition-table was found, we use this default-set. */
++#define MAX_PARTITIONS 7
++#define NUM_DEFAULT_PARTITIONS 3
++
++/*
++ * Default flash size is 2MB. CONFIG_ETRAX_PTABLE_SECTOR is most likely the
++ * size of one flash block and "filesystem"-partition needs 5 blocks to be able
++ * to use JFFS.
++ */
++static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
++ {
++ .name = "boot firmware",
++ .size = CONFIG_ETRAX_PTABLE_SECTOR,
++ .offset = 0
++ },
++ {
++ .name = "kernel",
++ .size = 0x200000 - (6 * CONFIG_ETRAX_PTABLE_SECTOR),
++ .offset = CONFIG_ETRAX_PTABLE_SECTOR
++ },
++ {
++ .name = "filesystem",
++ .size = 5 * CONFIG_ETRAX_PTABLE_SECTOR,
++ .offset = 0x200000 - (5 * CONFIG_ETRAX_PTABLE_SECTOR)
++ }
++};
++
++/* Initialize the ones normally used. */
++static struct mtd_partition axis_partitions[MAX_PARTITIONS] = {
++ {
++ .name = "part0",
++ .size = CONFIG_ETRAX_PTABLE_SECTOR,
++ .offset = 0
++ },
++ {
++ .name = "part1",
++ .size = 0,
++ .offset = 0
++ },
++ {
++ .name = "part2",
++ .size = 0,
++ .offset = 0
++ },
++ {
++ .name = "part3",
++ .size = 0,
++ .offset = 0
++ },
++ {
++ .name = "part4",
++ .size = 0,
++ .offset = 0
++ },
++ {
++ .name = "part5",
++ .size = 0,
++ .offset = 0
++ },
++ {
++ .name = "part6",
++ .size = 0,
++ .offset = 0
++ },
++};
++
++#ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
++/* Main flash device */
++static struct mtd_partition main_partition = {
++ .name = "main",
++ .size = 0,
++ .offset = 0
++};
++#endif
++
++/*
++ * Probe a chip select for AMD-compatible (JEDEC) or CFI-compatible flash
++ * chips in that order (because the amd_flash-driver is faster).
++ */
++static struct mtd_info *probe_cs(struct map_info *map_cs)
++{
++ struct mtd_info *mtd_cs = NULL;
++
++ printk(KERN_INFO
++ "%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
++ map_cs->name, map_cs->size, map_cs->map_priv_1);
++
++#ifdef CONFIG_MTD_CFI
++ mtd_cs = do_map_probe("cfi_probe", map_cs);
++#endif
++#ifdef CONFIG_MTD_JEDECPROBE
++ if (!mtd_cs)
++ mtd_cs = do_map_probe("jedec_probe", map_cs);
++#endif
++
++ return mtd_cs;
++}
++
++/*
++ * Probe each chip select individually for flash chips. If there are chips on
++ * both cse0 and cse1, the mtd_info structs will be concatenated to one struct
++ * so that MTD partitions can cross chip boundries.
++ *
++ * The only known restriction to how you can mount your chips is that each
++ * chip select must hold similar flash chips. But you need external hardware
++ * to do that anyway and you can put totally different chips on cse0 and cse1
++ * so it isn't really much of a restriction.
++ */
++static struct mtd_info *flash_probe(void)
++{
++ struct mtd_info *mtd_cse0;
++ struct mtd_info *mtd_cse1;
++ struct mtd_info *mtd_cse;
++
++ mtd_cse0 = probe_cs(&map_cse0);
++ mtd_cse1 = probe_cs(&map_cse1);
++
++ if (!mtd_cse0 && !mtd_cse1) {
++ /* No chip found. */
++ return NULL;
++ }
++
++ if (mtd_cse0 && mtd_cse1) {
++ struct mtd_info *mtds[] = { mtd_cse0, mtd_cse1 };
++
++ /* Since the concatenation layer adds a small overhead we
++ * could try to figure out if the chips in cse0 and cse1 are
++ * identical and reprobe the whole cse0+cse1 window. But since
++ * flash chips are slow, the overhead is relatively small.
++ * So we use the MTD concatenation layer instead of further
++ * complicating the probing procedure.
++ */
++ mtd_cse = mtd_concat_create(mtds, ARRAY_SIZE(mtds),
++ "cse0+cse1");
++ if (!mtd_cse) {
++ printk(KERN_ERR "%s and %s: Concatenation failed!\n",
++ map_cse0.name, map_cse1.name);
++
++ /* The best we can do now is to only use what we found
++ * at cse0.
++ */
++ mtd_cse = mtd_cse0;
++ map_destroy(mtd_cse1);
++ }
++ } else {
++ mtd_cse = mtd_cse0? mtd_cse0 : mtd_cse1;
++ }
++
++ return mtd_cse;
++}
++
++/*
++ * Probe the flash chip(s) and, if it succeeds, read the partition-table
++ * and register the partitions with MTD.
++ */
++static int __init init_axis_flash(void)
++{
++ struct mtd_info *mymtd;
++ int err = 0;
++ int pidx = 0;
++ struct partitiontable_head *ptable_head = NULL;
++ struct partitiontable_entry *ptable;
++ int use_default_ptable = 1; /* Until proven otherwise. */
++ const char pmsg[] = " /dev/flash%d at 0x%08x, size 0x%08x\n";
++
++ if (!(mymtd = flash_probe())) {
++ /* There's no reason to use this module if no flash chip can
++ * be identified. Make sure that's understood.
++ */
++ printk(KERN_INFO "axisflashmap: Found no flash chip.\n");
++ } else {
++ printk(KERN_INFO "%s: 0x%08x bytes of flash memory.\n",
++ mymtd->name, mymtd->size);
++ axisflash_mtd = mymtd;
++ }
++
++ if (mymtd) {
++ mymtd->owner = THIS_MODULE;
++ ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR +
++ CONFIG_ETRAX_PTABLE_SECTOR +
++ PARTITION_TABLE_OFFSET);
++ }
++ pidx++; /* First partition is always set to the default. */
++
++ if (ptable_head && (ptable_head->magic == PARTITION_TABLE_MAGIC)
++ && (ptable_head->size <
++ (MAX_PARTITIONS * sizeof(struct partitiontable_entry) +
++ PARTITIONTABLE_END_MARKER_SIZE))
++ && (*(unsigned long*)((void*)ptable_head + sizeof(*ptable_head) +
++ ptable_head->size -
++ PARTITIONTABLE_END_MARKER_SIZE)
++ == PARTITIONTABLE_END_MARKER)) {
++ /* Looks like a start, sane length and end of a
++ * partition table, lets check csum etc.
++ */
++ int ptable_ok = 0;
++ struct partitiontable_entry *max_addr =
++ (struct partitiontable_entry *)
++ ((unsigned long)ptable_head + sizeof(*ptable_head) +
++ ptable_head->size);
++ unsigned long offset = CONFIG_ETRAX_PTABLE_SECTOR;
++ unsigned char *p;
++ unsigned long csum = 0;
++
++ ptable = (struct partitiontable_entry *)
++ ((unsigned long)ptable_head + sizeof(*ptable_head));
++
++ /* Lets be PARANOID, and check the checksum. */
++ p = (unsigned char*) ptable;
++
++ while (p <= (unsigned char*)max_addr) {
++ csum += *p++;
++ csum += *p++;
++ csum += *p++;
++ csum += *p++;
++ }
++ ptable_ok = (csum == ptable_head->checksum);
++
++ /* Read the entries and use/show the info. */
++ printk(KERN_INFO " Found a%s partition table at 0x%p-0x%p.\n",
++ (ptable_ok ? " valid" : "n invalid"), ptable_head,
++ max_addr);
++
++ /* We have found a working bootblock. Now read the
++ * partition table. Scan the table. It ends when
++ * there is 0xffffffff, that is, empty flash.
++ */
++ while (ptable_ok
++ && ptable->offset != 0xffffffff
++ && ptable < max_addr
++ && pidx < MAX_PARTITIONS) {
++
++ axis_partitions[pidx].offset = offset + ptable->offset;
++ axis_partitions[pidx].size = ptable->size;
++
++ printk(pmsg, pidx, axis_partitions[pidx].offset,
++ axis_partitions[pidx].size);
++ pidx++;
++ ptable++;
++ }
++ use_default_ptable = !ptable_ok;
++ }
++
++ if (romfs_in_flash) {
++ /* Add an overlapping device for the root partition (romfs). */
++
++ axis_partitions[pidx].name = "romfs";
++ axis_partitions[pidx].size = romfs_length;
++ axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
++ axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;
++
++ printk(KERN_INFO
++ " Adding readonly flash partition for romfs image:\n");
++ printk(pmsg, pidx, axis_partitions[pidx].offset,
++ axis_partitions[pidx].size);
++ pidx++;
++ }
++
++#ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
++ if (mymtd) {
++ main_partition.size = mymtd->size;
++ err = add_mtd_partitions(mymtd, &main