projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cf2cfdf
)
slugimage: Added support for 16MiB flash chips
author
Rod Whitby
<rod@whitby.id.au>
Fri, 10 Aug 2007 12:54:47 +0000
(12:54 +0000)
committer
Rod Whitby
<rod@whitby.id.au>
Fri, 10 Aug 2007 12:54:47 +0000
(12:54 +0000)
SVN-Revision: 8387
scripts/slugimage.pl
patch
|
blob
|
history
diff --git
a/scripts/slugimage.pl
b/scripts/slugimage.pl
index da98c999e67f2167b9de91d74de508444278975b..3d2735d0f13049b62f169bf6526bb206af656cc1 100755
(executable)
--- a/
scripts/slugimage.pl
+++ b/
scripts/slugimage.pl
@@
-391,10
+391,9
@@
sub readInFirmware {
my($filename, $partitions_ref) = @_;
my($firmware_buf);
my($filename, $partitions_ref) = @_;
my($firmware_buf);
- my($total_length) = 0x800000;
open FILE,$filename or die "Can't find firmware image \"$filename\": $!\n";
open FILE,$filename or die "Can't find firmware image \"$filename\": $!\n";
- read FILE,$firmware_buf,$
total_length or die "Can't read $total_length
bytes from \"$filename\": $!\n";
+ read FILE,$firmware_buf,$
flash_len or die "Can't read $flash_len
bytes from \"$filename\": $!\n";
close FILE or die "Can't close \"$filename\": $!\n";
$debug and printf("Read 0x%08X bytes from \"%s\"\n", length($firmware_buf), $filename);
close FILE or die "Can't close \"$filename\": $!\n";
$debug and printf("Read 0x%08X bytes from \"%s\"\n", length($firmware_buf), $filename);
@@
-930,7
+929,7
@@
sub defaultPartitions {
# Main routine starts here ...
# Main routine starts here ...
-my($unpack, $pack, $little, $input, $output, $redboot);
+my($unpack, $pack, $little, $
fatflash, $
input, $output, $redboot);
my($kernel, $sysconf, $ramdisk, $fisdir);
my($microcode, $trailer, $ethaddr, $loader);
my($kernel, $sysconf, $ramdisk, $fisdir);
my($microcode, $trailer, $ethaddr, $loader);
@@
-946,6
+945,7
@@
if (!GetOptions("d|debug" => \$debug,
"u|unpack" => \$unpack,
"p|pack" => \$pack,
"l|little" => \$little,
"u|unpack" => \$unpack,
"p|pack" => \$pack,
"l|little" => \$little,
+ "F|fatflash" => \$fatflash,
"i|input=s" => \$input,
"o|output=s" => \$output,
"b|redboot=s" => \$redboot,
"i|input=s" => \$input,
"o|output=s" => \$output,
"b|redboot=s" => \$redboot,
@@
-965,6
+965,7
@@
if (!GetOptions("d|debug" => \$debug,
print " [-u|--unpack] Unpack a firmware image\n";
print " [-p|--pack] Pack a firmware image\n";
print " [-l|--little] Convert Kernel and Ramdisk to little-endian\n";
print " [-u|--unpack] Unpack a firmware image\n";
print " [-p|--pack] Pack a firmware image\n";
print " [-l|--little] Convert Kernel and Ramdisk to little-endian\n";
+ print " [-F|--fatflash] Generate an image for 16MB flash\n";
print " [-i|--input] <file> Input firmware image filename\n";
print " [-o|--output] <file> Output firmware image filename\n";
print " [-b|--redboot] <file> Input/Output RedBoot filename\n";
print " [-i|--input] <file> Input firmware image filename\n";
print " [-o|--output] <file> Output firmware image filename\n";
print " [-b|--redboot] <file> Input/Output RedBoot filename\n";
@@
-1047,6
+1048,18
@@
if (defined $little) {
} @partitions;
}
} @partitions;
}
+if (defined $fatflash) {
+ $flash_len = 0x01000000;
+ map {
+ if (($_->{'name'} eq 'FIS directory') or
+ ($_->{'name'} eq 'Loader config') or
+ ($_->{'name'} eq 'Microcode') or
+ ($_->{'name'} eq 'Trailer')) {
+ $_->{'offset'} += 0x00800000;
+ }
+ } @partitions;
+}
+
if (defined $ethaddr) {
map {
if ($_->{'name'} eq 'EthAddr') {
if (defined $ethaddr) {
map {
if ($_->{'name'} eq 'EthAddr') {