diff options
author | John Bowler <jbowler@nslu2-linux.org> | 2005-11-14 06:29:32 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-11-14 06:29:32 +0000 |
commit | 15b6993ce68956022af5df22d110898f8b61a252 (patch) | |
tree | e9b379bbf85d4899847a615ddb67fa9f05451e13 /packages/linux/nslu2-kernel/2.6.15/10-mtdpart-redboot-fis-byteswap.patch | |
parent | b36999d27c8d713ae2421c130633a796f4e98f83 (diff) |
nslu2-kernel: upgrade to 2.6.14.2
nslu2-kernel: add (only semi working) 2.6.15-rc1
Diffstat (limited to 'packages/linux/nslu2-kernel/2.6.15/10-mtdpart-redboot-fis-byteswap.patch')
-rw-r--r-- | packages/linux/nslu2-kernel/2.6.15/10-mtdpart-redboot-fis-byteswap.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/packages/linux/nslu2-kernel/2.6.15/10-mtdpart-redboot-fis-byteswap.patch b/packages/linux/nslu2-kernel/2.6.15/10-mtdpart-redboot-fis-byteswap.patch new file mode 100644 index 0000000000..edee083e3c --- /dev/null +++ b/packages/linux/nslu2-kernel/2.6.15/10-mtdpart-redboot-fis-byteswap.patch @@ -0,0 +1,44 @@ +On IXP4XX systems the FIS directory is big endian even with a little +endian kernel. This patch recognises the FIS directory on such a +system and byte swaps it to obtain a valid table based on the 'size' +field of the FIS directory (the size field is know to always match the +erase block size on such systems, and probably all systems.) + +--- linux-2.6.15/drivers/mtd/redboot.c 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/drivers/mtd/redboot.c 1970-01-01 00:00:00.000000000 +0000 +@@ -89,8 +89,34 @@ + i = numslots; + break; + } +- if (!memcmp(buf[i].name, "FIS directory", 14)) ++ if (!memcmp(buf[i].name, "FIS directory", 14)) { ++ /* This is apparently the FIS directory entry for the ++ * FIS directory itself. The FIS directory size is ++ * one erase block, if the buf[i].size field is ++ * swab32(erasesize) then we know we are looking at ++ * a byte swapped FIS directory - swap all the entries! ++ * (NOTE: this is 'size' not 'data_length', size is ++ * the full size of the entry.) ++ */ ++ if (swab32(buf[i].size) == master->erasesize) { ++ int j; ++ for (j = 0; j < numslots && buf[j].name[0] != 0xff; ++j) { ++ /* The unsigned long fields were written with the ++ * wrong byte sex, name and pad have no byte sex. ++ */ ++# define do_swab32(x) (x) = swab32(x) ++ do_swab32(buf[j].flash_base); ++ do_swab32(buf[j].mem_base); ++ do_swab32(buf[j].size); ++ do_swab32(buf[j].entry_point); ++ do_swab32(buf[j].data_length); ++ do_swab32(buf[j].desc_cksum); ++ do_swab32(buf[j].file_cksum); ++# undef do_swab32 ++ } ++ } + break; ++ } + } + if (i == numslots) { + /* Didn't find it */ |