summaryrefslogtreecommitdiff
path: root/tools/mxsboot.c
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2015-10-14 08:46:36 (GMT)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2015-10-14 08:46:36 (GMT)
commit13a3972585af60ec367d209cedbd3601e0c77467 (patch)
tree4b3312669b3e501f6bc10b39d8c7bbf516f07aac /tools/mxsboot.c
parent208bd51396fb606dbdcf45b064e6b372d7dd3e81 (diff)
parent297faccca2235e359012118495b9b73451d54bb9 (diff)
downloadu-boot-13a3972585af60ec367d209cedbd3601e0c77467.tar.xz
Merge remote-tracking branch 'u-boot/master'
Diffstat (limited to 'tools/mxsboot.c')
-rw-r--r--tools/mxsboot.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/mxsboot.c b/tools/mxsboot.c
index 15eec91..3434c81 100644
--- a/tools/mxsboot.c
+++ b/tools/mxsboot.c
@@ -7,6 +7,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#include <endian.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -556,15 +557,15 @@ static int mx28_create_sd_image(int infd, int outfd)
cb = (struct mx28_sd_config_block *)buf;
- cb->signature = 0x00112233;
- cb->primary_boot_tag = 0x1;
- cb->secondary_boot_tag = 0x1;
- cb->num_copies = 1;
- cb->drv_info[0].chip_num = 0x0;
- cb->drv_info[0].drive_type = 0x0;
- cb->drv_info[0].tag = 0x1;
- cb->drv_info[0].first_sector_number = sd_sector + 4;
- cb->drv_info[0].sector_count = (size - 4) / 512;
+ cb->signature = htole32(0x00112233);
+ cb->primary_boot_tag = htole32(0x1);
+ cb->secondary_boot_tag = htole32(0x1);
+ cb->num_copies = htole32(1);
+ cb->drv_info[0].chip_num = htole32(0x0);
+ cb->drv_info[0].drive_type = htole32(0x0);
+ cb->drv_info[0].tag = htole32(0x1);
+ cb->drv_info[0].first_sector_number = htole32(sd_sector + 4);
+ cb->drv_info[0].sector_count = htole32((size - 4) / 512);
wr_size = write(outfd, buf, size);
if (wr_size != size) {