#include <malloc.h>
/* version of USB Downloader Application */
-#define APP_VERSION "1.3.2"
+#define APP_VERSION "1.3.3"
#ifdef CONFIG_CMD_MTDPARTS
#include <jffs2/load_kernel.h>
do_reset();
return 0;
#endif
+ case COMMAND_PROGRESS:
+ if (usbd->set_progress)
+ usbd->set_progress(arg);
+ return 1;
default:
printf("Error: Unknown command -> (%d)\n", (int)cmd);
- return 0;
+ return 1;
}
/* Erase and Write to NAND */
#include <common.h>
#include "usbd.h"
#include "usb-hs-otg.h"
+#ifdef CONFIG_S5PC1XXFB
#include <fbutils.h>
+#endif
static char tx_data[8] = "MPL";
static long tx_len = 4;
#ifdef CONFIG_S5PC1XXFB
fb_printf("Download Start\n");
- exit_font();
+ draw_progress(40, 0, FONT_WHITE);
#endif
+}
+void usb_stop(void)
+{
+ s5p_usb_stop();
+#ifdef CONFIG_S5PC1XXFB
+ exit_font();
+#endif
}
/*
}
#endif
+#ifdef CONFIG_S5PC1XXFB
+static void set_progress(int progress)
+{
+ draw_progress(40, progress, FONT_WHITE);
+}
+#endif
/*
* This function is interfaced between
* USB Device Controller and USB Downloader
struct usbd_ops *usbd_set_interface(struct usbd_ops *usbd)
{
usbd->usb_init = usb_init;
- usbd->usb_stop = s5p_usb_stop;
+ usbd->usb_stop = usb_stop;
usbd->send_data = s5p_usb_tx;
usbd->recv_data = usb_receive_packet;
usbd->recv_setup = recv_setup;
usbd->tx_len = tx_len;
usbd->rx_len = rx_len;
usbd->ram_addr = CONFIG_SYS_DOWN_ADDR;
-
+#ifdef CONFIG_S5PC1XXFB
+ usbd->set_progress = set_progress;
+#endif
#ifdef CONFIG_GENERIC_MMC
usbd_set_mmc_dev(usbd);
#endif
#define COMMAND_DOWN_PHONE 220
#define COMMAND_CHANGE_USB 221
#endif
+#define COMMAND_PROGRESS 230
/*
* USB Downloader Operations
ulong mmc_max;
ulong mmc_blk;
ulong mmc_total;
+
+ void (*set_progress)(int);
};
/* This function is interfaced between USB Device Controller and USB Downloader