Up till now it was impossible to use code from update.c when system
was not equipped with raw FLASH memory.
Such behavior prevented DFU from reusing this code.
Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
#error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
#endif
#error "CONFIG_FIT and CONFIG_OF_LIBFDT are required for auto-update feature"
#endif
-#if defined(CONFIG_SYS_NO_FLASH)
-#error "CONFIG_SYS_NO_FLASH defined, but FLASH is required for auto-update feature"
-#endif
-
#include <command.h>
#include <flash.h>
#include <net.h>
#include <command.h>
#include <flash.h>
#include <net.h>
extern ulong tftp_timeout_ms;
extern int tftp_timeout_count_max;
extern ulong tftp_timeout_ms;
extern int tftp_timeout_count_max;
-extern flash_info_t flash_info[];
+#ifndef CONFIG_SYS_NO_FLASH
+extern flash_info_t flash_info[];
static uchar *saved_prot_info;
static uchar *saved_prot_info;
static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
{
int size, rv;
static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
{
int size, rv;
+#ifndef CONFIG_SYS_NO_FLASH
static int update_flash_protect(int prot, ulong addr_first, ulong addr_last)
{
uchar *sp_info_ptr;
static int update_flash_protect(int prot, ulong addr_first, ulong addr_last)
{
uchar *sp_info_ptr;
static int update_flash(ulong addr_source, ulong addr_first, ulong size)
{
static int update_flash(ulong addr_source, ulong addr_first, ulong size)
{
+#ifndef CONFIG_SYS_NO_FLASH
ulong addr_last = addr_first + size - 1;
/* round last address to the sector boundary */
ulong addr_last = addr_first + size - 1;
/* round last address to the sector boundary */
printf("Error: could not protect flash sectors\n");
return 1;
}
printf("Error: could not protect flash sectors\n");
return 1;
}