From 12a3e297be6a9393dad0ef492d65e442ac561d28 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 6 Apr 2017 11:16:06 -0500 Subject: Add patch for CRC Debug to u-boot --- .../u-boot/u-boot-2012.10/u-boot-env-crc-dbg.patch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'recipes-bsp/u-boot') diff --git a/recipes-bsp/u-boot/u-boot-2012.10/u-boot-env-crc-dbg.patch b/recipes-bsp/u-boot/u-boot-2012.10/u-boot-env-crc-dbg.patch index 418a734..fccfbe3 100644 --- a/recipes-bsp/u-boot/u-boot-2012.10/u-boot-env-crc-dbg.patch +++ b/recipes-bsp/u-boot/u-boot-2012.10/u-boot-env-crc-dbg.patch @@ -2,7 +2,11 @@ Print out CRC values for environment diff --git a/common/env_nand.c b/common/env_nand.c +<<<<<<< HEAD index 79e8033..5536a39 100644 +======= +index 79e8033..9a9bac7 100644 +>>>>>>> Add patch for CRC Debug to u-boot --- a/common/env_nand.c +++ b/common/env_nand.c @@ -83,15 +83,22 @@ int env_init(void) @@ -19,14 +23,22 @@ index 79e8033..5536a39 100644 + calc_crc = crc32(0, tmp_env2->data, ENV_SIZE); + crc2_ok = calc_crc == tmp_env2->crc; + printf("env_relocate_spec: crc2_ok=%d saved crc=0x%x calculated crc=0x%x flags=%d\n", +<<<<<<< HEAD + crc2_ok,tmp_env2->crc,calc_crc,tmp_env2->flags); +======= ++ crc2_ok,calc_crc,tmp_env2->crc,tmp_env2->flags); +>>>>>>> Add patch for CRC Debug to u-boot #endif tmp_env1 = env_ptr; - crc1_ok = crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc; + calc_crc = crc32(0, tmp_env1->data, ENV_SIZE); + crc1_ok = saved_crc == tmp_env1->crc; + printf("env_relocate_spec: crc1_ok=%d saved crc=0x%x calculated crc=0x%x flags=%d\n", +<<<<<<< HEAD + crc1_ok,tmp_env1->crc,calc_crc,tmp_env1->flags); +======= ++ crc1_ok,calc_crc,tmp_env1->crc,tmp_env1->flags); +>>>>>>> Add patch for CRC Debug to u-boot if (!crc1_ok && !crc2_ok) { gd->env_addr = 0; @@ -48,11 +60,19 @@ index 79e8033..5536a39 100644 + calc_crc = crc32(0, tmp_env1->data, ENV_SIZE); + crc1_ok = calc_crc == tmp_env1->crc; + printf("env_relocate_spec: crc1_ok=%d saved crc=0x%x calculated crc=0x%x flags=%d\n", +<<<<<<< HEAD + crc1_ok,tmp_env1->crc,calc_crc,tmp_env1->flags); + calc_crc = crc32(0, tmp_env2->data, ENV_SIZE); + crc2_ok = calc_crc == tmp_env2->crc; + printf("env_relocate_spec: crc2_ok=%d saved crc=0x%x calculated crc=0x%x flags=%d\n", + crc2_ok,tmp_env2->crc,calc_crc,tmp_env2->flags); +======= ++ crc1_ok,calc_crc,tmp_env1->crc,tmp_env1->flags); ++ calc_crc = crc32(0, tmp_env2->data, ENV_SIZE); ++ crc2_ok = calc_crc == tmp_env2->crc; ++ printf("env_relocate_spec: crc2_ok=%d saved crc=0x%x calculated crc=0x%x flags=%d\n", ++ crc2_ok,calc_crc,tmp_env2->crc,tmp_env2->flags); +>>>>>>> Add patch for CRC Debug to u-boot if (!crc1_ok && !crc2_ok) { set_default_env("!bad CRC"); -- cgit v1.2.3