diff options
author | Michael Neuling <mikey@neuling.org> | 2016-07-28 17:15:32 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-08-02 18:12:49 +1000 |
commit | c043065cf92358104e617b5c6aabbe619de76b0b (patch) | |
tree | 8f523164baeb14c937ae71f549ae5daa438a1b6c /libflash/ecc.c | |
parent | 17c22dbd6b011211a040dc2839d2e3e560fa0806 (diff) | |
download | skiboot-c043065cf92358104e617b5c6aabbe619de76b0b.zip skiboot-c043065cf92358104e617b5c6aabbe619de76b0b.tar.gz skiboot-c043065cf92358104e617b5c6aabbe619de76b0b.tar.bz2 |
flash: Make size 64 bit safe
This makes the size of flash 64 bit safe so that we can have flash
devices greater than 4GB. This is especially useful for mambo disks
passed through to Linux.
Fortunately the device tree interface and the linux device driver are
64bit safe so no changes are required there.
Userspace gard and flash tools are also updated to ensure "make check"
still passes.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Reviewed-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/ecc.c')
-rw-r--r-- | libflash/ecc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libflash/ecc.c b/libflash/ecc.c index 9cd6ad2..0be80b1 100644 --- a/libflash/ecc.c +++ b/libflash/ecc.c @@ -17,6 +17,7 @@ /* This is based on the hostboot ecc code */ #include <stdint.h> +#include <inttypes.h> #include <ccan/endian/endian.h> @@ -181,7 +182,7 @@ static inline uint64_t eccflipbit(uint64_t data, uint8_t bit) * @retval: 0 - success * @retfal: other - fail */ -int memcpy_from_ecc(uint64_t *dst, struct ecc64 *src, uint32_t len) +int memcpy_from_ecc(uint64_t *dst, struct ecc64 *src, uint64_t len) { beint64_t data; uint8_t ecc; @@ -190,8 +191,8 @@ int memcpy_from_ecc(uint64_t *dst, struct ecc64 *src, uint32_t len) if (len & 0x7) { /* TODO: we could probably handle this */ - FL_ERR("ECC data length must be 8 byte aligned length:%i\n", - len); + FL_ERR("ECC data length must be 8 byte aligned length:%" PRIx64 "\n", + len); return -1; } @@ -232,15 +233,15 @@ int memcpy_from_ecc(uint64_t *dst, struct ecc64 *src, uint32_t len) * @retval: 0 - success * @retfal: other - fail */ -int memcpy_to_ecc(struct ecc64 *dst, const uint64_t *src, uint32_t len) +int memcpy_to_ecc(struct ecc64 *dst, const uint64_t *src, uint64_t len) { struct ecc64 ecc_word; - uint32_t i; + uint64_t i; if (len & 0x7) { /* TODO: we could probably handle this */ - FL_ERR("Data to add ECC bytes to must be 8 byte aligned length: %i\n", - len); + FL_ERR("Data to add ECC bytes to must be 8 byte aligned length: %" + PRIx64 "\n", len); return -1; } |