Lines Matching refs:flash_addr
50 static __maybe_unused env_t *flash_addr = (env_t *)CONFIG_ENV_ADDR; variable
55 static __maybe_unused env_t *flash_addr = (env_t *)CONFIG_ENV_ADDR; variable
77 uchar flag1 = flash_addr->flags; in env_flash_init()
81 ulong addr1 = (ulong)&(flash_addr->data); in env_flash_init()
84 crc1_ok = crc32(0, flash_addr->data, ENV_SIZE) == flash_addr->crc; in env_flash_init()
129 debug("Protect off %08lX ... %08lX\n", (ulong)flash_addr, end_addr); in env_flash_save()
131 if (flash_sect_protect(0, (ulong)flash_addr, end_addr)) in env_flash_save()
178 rc = flash_write(&flag, (ulong)&(flash_addr->flags), in env_flash_save()
179 sizeof(flash_addr->flags)); in env_flash_save()
196 env_t *etmp = flash_addr; in env_flash_save()
199 flash_addr = flash_addr_new; in env_flash_save()
214 flash_sect_protect(1, (ulong)flash_addr, end_addr); in env_flash_save()
247 up_data = end_addr + 1 - ((long)flash_addr + CONFIG_ENV_SIZE); in env_flash_save()
257 (void *)((long)flash_addr + CONFIG_ENV_SIZE), up_data); in env_flash_save()
259 (ulong)flash_addr + CONFIG_ENV_SIZE, in env_flash_save()
265 debug("Protect off %08lX ... %08lX\n", (ulong)flash_addr, end_addr); in env_flash_save()
267 if (flash_sect_protect(0, (long)flash_addr, end_addr)) in env_flash_save()
275 if (flash_sect_erase((long)flash_addr, end_addr)) in env_flash_save()
279 rc = flash_write((char *)&env_new, (long)flash_addr, CONFIG_ENV_SIZE); in env_flash_save()
286 (ulong)flash_addr + CONFIG_ENV_SIZE, up_data); in env_flash_save()
288 (long)flash_addr + CONFIG_ENV_SIZE, in env_flash_save()
302 flash_sect_protect(1, (long)flash_addr, end_addr); in env_flash_save()
313 if (gd->env_addr != (ulong)&(flash_addr->data)) { in env_flash_load()
314 env_t *etmp = flash_addr; in env_flash_load()
317 flash_addr = flash_addr_new; in env_flash_load()
336 if (flash_addr->flags != ACTIVE_FLAG && in env_flash_load()
337 (flash_addr->flags & ACTIVE_FLAG) == ACTIVE_FLAG) { in env_flash_load()
341 flash_sect_protect(0, (ulong)flash_addr, end_addr); in env_flash_load()
343 (ulong)&(flash_addr->flags), in env_flash_load()
344 sizeof(flash_addr->flags)); in env_flash_load()
345 flash_sect_protect(1, (ulong)flash_addr, end_addr); in env_flash_load()
353 return env_import((char *)flash_addr, 1); in env_flash_load()