diff options
author | John Bowler <jbowler@nslu2-linux.org> | 2005-10-20 04:47:57 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-10-20 04:47:57 +0000 |
commit | 4407fe0a3f9f62d2020286f8aee23cffa9e10aa9 (patch) | |
tree | 4075ff98d5d2b08d9262cfbab8147e2a8082f92a /packages/linux/nslu2-kernel/2.6.14/10-mtdpart-redboot-fis-byteswap.patch | |
parent | 18fcf10558f472478258568f976e5bbd82d0b3d9 (diff) |
openslug-kernel: cleanup, move to 2.6.14-rc4
- potentially optional parts of openslug-image can now be removed
- removed 2.6.14-rc2
- moved to 2.6.14-rc4
- added RedBoot FIS Directory automagic byte swap
Diffstat (limited to 'packages/linux/nslu2-kernel/2.6.14/10-mtdpart-redboot-fis-byteswap.patch')
-rw-r--r-- | packages/linux/nslu2-kernel/2.6.14/10-mtdpart-redboot-fis-byteswap.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/packages/linux/nslu2-kernel/2.6.14/10-mtdpart-redboot-fis-byteswap.patch b/packages/linux/nslu2-kernel/2.6.14/10-mtdpart-redboot-fis-byteswap.patch new file mode 100644 index 0000000000..c5e322ccac --- /dev/null +++ b/packages/linux/nslu2-kernel/2.6.14/10-mtdpart-redboot-fis-byteswap.patch @@ -0,0 +1,42 @@ +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.13/drivers/mtd/redboot.c.orig 2005-10-19 17:14:19.304956677 -0700 ++++ linux-2.6.13/drivers/mtd/redboot.c 2005-10-19 17:48:16.457146582 -0700 +@@ -89,8 +89,32 @@ + 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. ++ */ ++ swab32s(&buf[j].flash_base); ++ swab32s(&buf[j].mem_base); ++ swab32s(&buf[j].size); ++ swab32s(&buf[j].entry_point); ++ swab32s(&buf[j].data_length); ++ swab32s(&buf[j].desc_cksum); ++ swab32s(&buf[j].file_cksum); ++ } ++ } + break; ++ } + } + if (i == numslots) { + /* Didn't find it */ |