cpmac: patch to reimplement rx ring with EOQ markers to avoid reset storms (closes...
[openwrt.git] / target / linux / etrax / patches / cris / 014-partition-tables.patch
1 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings.S
2 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings.S 2007-05-29 23:30:35.000000000 +0200
3 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings.S 2007-05-29 23:33:44.000000000 +0200
4 @@ -60,3 +60,5 @@
5 .dword R_PORT_PB_SET
6 .dword PB_SET_VALUE
7 .dword 0 ; No more register values
8 + .ascii "ACME_PART_MAGIC" ; Magic number
9 + .dword 0xdeadc0de
10 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_416.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_416.S
11 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_416.S 2007-05-29 23:30:35.000000000 +0200
12 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_416.S 2007-05-29 23:33:44.000000000 +0200
13 @@ -60,3 +60,5 @@
14 .dword R_PORT_PB_SET
15 .dword PB_SET_VALUE
16 .dword 0 ; No more register values
17 + .ascii "ACME_PART_MAGIC" ; Magic number
18 + .dword 0xdeadc0de
19 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_816.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_816.S
20 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_816.S 2007-05-29 23:30:35.000000000 +0200
21 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_816.S 2007-05-29 23:33:44.000000000 +0200
22 @@ -60,3 +60,5 @@
23 .dword R_PORT_PB_SET
24 .dword PB_SET_VALUE
25 .dword 0 ; No more register values
26 + .ascii "ACME_PART_MAGIC" ; Magic number
27 + .dword 0xdeadc0de
28 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_832.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_832.S
29 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_832.S 2007-05-29 23:30:35.000000000 +0200
30 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_832.S 2007-05-29 23:33:44.000000000 +0200
31 @@ -60,3 +60,5 @@
32 .dword R_PORT_PB_SET
33 .dword PB_SET_VALUE
34 .dword 0 ; No more register values
35 + .ascii "ACME_PART_MAGIC" ; Magic number
36 + .dword 0xdeadc0de
37 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_MCM.S linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_MCM.S
38 --- linux-2.6.19.2.orig/arch/cris/arch-v10/boot/compressed/hw_settings_MCM.S 2007-05-29 23:30:35.000000000 +0200
39 +++ linux-2.6.19.2/arch/cris/arch-v10/boot/compressed/hw_settings_MCM.S 2007-05-29 23:33:44.000000000 +0200
40 @@ -60,3 +60,5 @@
41 .dword R_PORT_PB_SET
42 .dword PB_SET_VALUE
43 .dword 0 ; No more register values
44 + .ascii "ACME_PART_MAGIC" ; Magic number
45 + .dword 0xdeadc0de
46 diff -urN linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/axisflashmap.c linux-2.6.19.2/arch/cris/arch-v10/drivers/axisflashmap.c
47 --- linux-2.6.19.2.orig/arch/cris/arch-v10/drivers/axisflashmap.c 2007-05-29 23:30:36.000000000 +0200
48 +++ linux-2.6.19.2/arch/cris/arch-v10/drivers/axisflashmap.c 2007-05-29 23:36:31.000000000 +0200
49 @@ -421,6 +421,11 @@
50 struct partitiontable_entry *ptable;
51 int use_default_ptable = 1; /* Until proven otherwise. */
52 const char pmsg[] = " /dev/flash%d at 0x%08x, size 0x%08x\n";
53 + unsigned int kernel_part_size = 0;
54 + unsigned char *flash_mem = (unsigned char*)(FLASH_CACHED_ADDR);
55 + unsigned int flash_scan_count = 0;
56 + const char *part_magic = "ACME_PART_MAGIC";
57 + unsigned int magic_len = strlen(part_magic);
58
59 if (!(mymtd = flash_probe())) {
60 /* There's no reason to use this module if no flash chip can
61 @@ -432,6 +437,32 @@
62 mymtd->name, mymtd->size);
63 axisflash_mtd = mymtd;
64 }
65 + /* scan flash to findout where out partition starts */
66 +
67 + printk(KERN_INFO "Scanning flash for end of kernel magic\n");
68 + for(flash_scan_count = 0; flash_scan_count < 100000; flash_scan_count++){
69 + if(strncmp(&flash_mem[flash_scan_count], part_magic, magic_len - 1) == 0){
70 + //printk(KERN_INFO "Found end of kernel magic at 0x%.08X\n", flash_scan_count);
71 + kernel_part_size = flash_mem[flash_scan_count + magic_len ];
72 + kernel_part_size <<= 8;
73 + kernel_part_size += flash_mem[flash_scan_count + magic_len + 2];
74 + kernel_part_size <<= 8;
75 + kernel_part_size += flash_mem[flash_scan_count + magic_len + 1];
76 + kernel_part_size <<= 8;
77 + kernel_part_size += flash_mem[flash_scan_count + magic_len + 3];
78 + printk(KERN_INFO "Kernel ends at 0x%.08X\n", kernel_part_size);
79 + flash_scan_count = 1100000;
80 + }
81 + }
82 +
83 +
84 + if(kernel_part_size){
85 + kernel_part_size = (kernel_part_size & 0xffff0000);
86 + //printk(KERN_INFO "Configuring partition sizes total flash 0x%.08X - kernel 0x%.08X - rootfs 0x%.08X\n", mymtd->size, kernel_part_size, mymtd->size - kernel_part_size);
87 + axis_default_partitions[0].size = kernel_part_size;
88 + axis_default_partitions[1].size = mymtd->size - axis_default_partitions[0].size;
89 + axis_default_partitions[1].offset = axis_default_partitions[0].size;
90 + }
91
92 if (mymtd) {
93 mymtd->owner = THIS_MODULE;
94 @@ -527,7 +558,7 @@
95
96 if (mymtd) {
97 if (use_default_ptable) {
98 - printk(KERN_INFO " Using default partition table.\n");
99 + printk(KERN_INFO " Using ACME partition table.\n");
100 err = add_mtd_partitions(mymtd, axis_default_partitions,
101 NUM_DEFAULT_PARTITIONS);
102 } else {
This page took 0.056604 seconds and 5 git commands to generate.