summaryrefslogtreecommitdiff
path: root/target/linux/etrax/patches-2.6.30
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/etrax/patches-2.6.30')
-rw-r--r--target/linux/etrax/patches-2.6.30/100-cris-makefiles.patch51
-rw-r--r--target/linux/etrax/patches-2.6.30/200-samsung_flash.patch11
-rw-r--r--target/linux/etrax/patches-2.6.30/201-flashsize.patch88
-rw-r--r--target/linux/etrax/patches-2.6.30/400-Kconfig_source.patch15
-rw-r--r--target/linux/etrax/patches-2.6.30/500-i2c_gvc.patch41
5 files changed, 206 insertions, 0 deletions
diff --git a/target/linux/etrax/patches-2.6.30/100-cris-makefiles.patch b/target/linux/etrax/patches-2.6.30/100-cris-makefiles.patch
new file mode 100644
index 0000000000..bf43914f73
--- /dev/null
+++ b/target/linux/etrax/patches-2.6.30/100-cris-makefiles.patch
@@ -0,0 +1,51 @@
+--- a/arch/cris/Makefile
++++ b/arch/cris/Makefile
+@@ -40,7 +40,7 @@ endif
+
+ LD = $(CROSS_COMPILE)ld -mcrislinux
+
+-OBJCOPYFLAGS := -O binary -R .note -R .comment -S
++OBJCOPYFLAGS := -O binary -R .bss -R .note -R .note.gnu.build-id -R .comment -S
+
+ CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
+
+--- a/arch/cris/arch-v10/boot/Makefile
++++ b/arch/cris/arch-v10/boot/Makefile
+@@ -2,8 +2,6 @@
+ # arch/cris/arch-v10/boot/Makefile
+ #
+
+-OBJCOPYFLAGS = -O binary --remove-section=.bss
+-
+ subdir- := compressed rescue
+ targets := Image
+
+@@ -13,7 +11,7 @@ $(obj)/Image: vmlinux FORCE
+
+ $(obj)/compressed/vmlinux: $(obj)/Image FORCE
+ $(Q)$(MAKE) $(build)=$(obj)/compressed $@
+- $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
++# $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
+
+ $(obj)/zImage: $(obj)/compressed/vmlinux
+ @cp $< $@
+--- a/arch/cris/arch-v10/boot/compressed/Makefile
++++ b/arch/cris/arch-v10/boot/compressed/Makefile
+@@ -6,7 +6,6 @@ asflags-y += $(LINUXINCLUDE)
+ ccflags-y += -O2 $(LINUXINCLUDE)
+ ldflags-y += -T $(srctree)/$(src)/decompress.lds
+ OBJECTS = $(obj)/head.o $(obj)/misc.o
+-OBJCOPYFLAGS = -O binary --remove-section=.bss
+
+ quiet_cmd_image = BUILD $@
+ cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
+--- a/arch/cris/arch-v10/boot/rescue/Makefile
++++ b/arch/cris/arch-v10/boot/rescue/Makefile
+@@ -5,7 +5,6 @@
+ ccflags-y += -O2 $(LINUXINCLUDE)
+ asflags-y += $(LINUXINCLUDE)
+ ldflags-y += -T $(srctree)/$(src)/rescue.lds
+-OBJCOPYFLAGS = -O binary --remove-section=.bss
+ obj-$(CONFIG_ETRAX_AXISFLASHMAP) = head.o
+ OBJECT := $(obj)/head.o
+
diff --git a/target/linux/etrax/patches-2.6.30/200-samsung_flash.patch b/target/linux/etrax/patches-2.6.30/200-samsung_flash.patch
new file mode 100644
index 0000000000..d04c2794d4
--- /dev/null
+++ b/target/linux/etrax/patches-2.6.30/200-samsung_flash.patch
@@ -0,0 +1,11 @@
+--- a/drivers/mtd/chips/cfi_cmdset_0002.c
++++ b/drivers/mtd/chips/cfi_cmdset_0002.c
+@@ -374,7 +374,7 @@ struct mtd_info *cfi_cmdset_0002(struct
+
+ cfi_fixup_major_minor(cfi, extp);
+
+- if (extp->MajorVersion != '1' ||
++ if (extp->MajorVersion < '1' || extp->MajorVersion > '3' ||
+ (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
+ if (cfi->mfr == MANUFACTURER_SAMSUNG &&
+ (extp->MajorVersion == '3' && extp->MinorVersion == '3')) {
diff --git a/target/linux/etrax/patches-2.6.30/201-flashsize.patch b/target/linux/etrax/patches-2.6.30/201-flashsize.patch
new file mode 100644
index 0000000000..42a467f749
--- /dev/null
+++ b/target/linux/etrax/patches-2.6.30/201-flashsize.patch
@@ -0,0 +1,88 @@
+--- a/arch/cris/arch-v10/drivers/axisflashmap.c
++++ b/arch/cris/arch-v10/drivers/axisflashmap.c
+@@ -113,7 +113,7 @@ static struct map_info map_cse1 = {
+
+ /* If no partition-table was found, we use this default-set. */
+ #define MAX_PARTITIONS 7
+-#define NUM_DEFAULT_PARTITIONS 3
++#define NUM_DEFAULT_PARTITIONS 2
+
+ /*
+ * Default flash size is 2MB. CONFIG_ETRAX_PTABLE_SECTOR is most likely the
+@@ -122,19 +122,14 @@ static struct map_info map_cse1 = {
+ */
+ 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
++ .size = 0x00,
++ .offset = 0
+ },
+ {
+- .name = "filesystem",
+- .size = 5 * CONFIG_ETRAX_PTABLE_SECTOR,
+- .offset = 0x200000 - (5 * CONFIG_ETRAX_PTABLE_SECTOR)
++ .name = "rootfs",
++ .size = 0x200000,
++ .offset = 0x200000
+ }
+ };
+
+@@ -281,6 +276,11 @@ static int __init init_axis_flash(void)
+ 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
+@@ -293,6 +293,31 @@ static int __init init_axis_flash(void)
+ 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[1].offset = axis_default_partitions[0].size;
++ }
++
+ if (mymtd) {
+ mymtd->owner = THIS_MODULE;
+ ptable_head = (struct partitiontable_head *)(FLASH_CACHED_ADDR +
+--- a/arch/cris/arch-v10/lib/hw_settings.S
++++ b/arch/cris/arch-v10/lib/hw_settings.S
+@@ -60,3 +60,5 @@
+ .dword R_PORT_PB_SET
+ .dword PB_SET_VALUE
+ .dword 0 ; No more register values
++ .ascii "ACME_PART_MAGIC"
++ .dword 0xdeadc0de
diff --git a/target/linux/etrax/patches-2.6.30/400-Kconfig_source.patch b/target/linux/etrax/patches-2.6.30/400-Kconfig_source.patch
new file mode 100644
index 0000000000..ed2bfe459f
--- /dev/null
+++ b/target/linux/etrax/patches-2.6.30/400-Kconfig_source.patch
@@ -0,0 +1,15 @@
+--- a/arch/cris/Kconfig
++++ b/arch/cris/Kconfig
+@@ -662,6 +662,12 @@ source "drivers/block/Kconfig"
+
+ source "drivers/ide/Kconfig"
+
++source "drivers/scsi/Kconfig"
++
++source "drivers/media/Kconfig"
++
++source "sound/Kconfig"
++
+ source "drivers/net/Kconfig"
+
+ source "drivers/i2c/Kconfig"
diff --git a/target/linux/etrax/patches-2.6.30/500-i2c_gvc.patch b/target/linux/etrax/patches-2.6.30/500-i2c_gvc.patch
new file mode 100644
index 0000000000..dc63165c5e
--- /dev/null
+++ b/target/linux/etrax/patches-2.6.30/500-i2c_gvc.patch
@@ -0,0 +1,41 @@
+--- a/arch/cris/arch-v10/drivers/Kconfig
++++ b/arch/cris/arch-v10/drivers/Kconfig
+@@ -450,11 +450,18 @@ config ETRAX_I2C
+ i2c_arg = I2C_READARG(STA013_READ_ADDR, reg);
+ val = ioctl(fd, _IO(ETRAXI2C_IOCTYPE, I2C_READREG), i2c_arg);
+
++config ETRAX_I2C_GVC
++ bool "I2C GVC support"
++ depends on ETRAX_ARCH_V10 && !ETRAX_I2C
++ select ETRAX_I2C_USES_PB_NOT_PB_I2C
++ help
++ Enables an I2C driver with Geert Vancompernolle improvement.
++
+ # this is true for most products since PB-I2C seems to be somewhat
+ # flawed..
+ config ETRAX_I2C_USES_PB_NOT_PB_I2C
+ bool "I2C uses PB not PB-I2C"
+- depends on ETRAX_I2C
++ depends on ETRAX_I2C || ETRAX_I2C_GVC
+ help
+ Select whether to use the special I2C mode in the PB I/O register or
+ not. This option needs to be selected in order to use some drivers
+@@ -478,7 +485,7 @@ config ETRAX_I2C_CLK_PORT
+
+ config ETRAX_I2C_EEPROM
+ bool "I2C EEPROM (non-volatile RAM) support"
+- depends on ETRAX_I2C
++ depends on ETRAX_I2C || ETRAX_I2C_GVC
+ help
+ Enables I2C EEPROM (non-volatile RAM) on PB0 and PB1 using the I2C
+ driver. Select size option: Probed, 2k, 8k, 16k.
+--- a/arch/cris/arch-v10/drivers/Makefile
++++ b/arch/cris/arch-v10/drivers/Makefile
+@@ -4,6 +4,7 @@
+
+ obj-$(CONFIG_ETRAX_AXISFLASHMAP) += axisflashmap.o
+ obj-$(CONFIG_ETRAX_I2C) += i2c.o
++obj-$(CONFIG_ETRAX_I2C_GVC) += i2c_gvc.o
+ obj-$(CONFIG_ETRAX_I2C_EEPROM) += eeprom.o
+ obj-$(CONFIG_ETRAX_GPIO) += gpio.o
+ obj-$(CONFIG_ETRAX_DS1302) += ds1302.o