struct usbd_ops *usbd_set_interface(struct usbd_ops *);
-void usb_init(void);
-int usb_receive_packet(void);
-
-void recv_setup(char *, int);
-
extern int s5p_receive_done;
extern int s5p_usb_connected;
extern otg_dev_t otg;
int usb_board_init(void) __attribute__((weak, alias("__usb_board_init")));
-#ifdef CONFIG_GENERIC_MMC
-#include <mmc.h>
-
-void usbd_set_mmc_dev(struct usbd_ops *usbd)
-{
- struct mmc *mmc;
-
- usbd->mmc_dev = 0;
- /* FIX 0x400 */
- usbd->mmc_max = 0x400;
- /* get from mmc->capacity?? */
- usbd->mmc_total = 0xf50000; /* 8GB / 0x200 */
-
- mmc = find_mmc_device(usbd->mmc_dev);
- mmc_init(mmc);
-
- usbd->mmc_blk = mmc->read_bl_len;
-}
-#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->send_data = s5p_usb_tx;
- usbd->recv_data = usb_receive_packet;
- usbd->recv_setup = recv_setup;
- usbd->tx_data = tx_data;
- usbd->rx_data = rx_data;
- usbd->tx_len = tx_len;
- usbd->rx_len = rx_len;
- usbd->ram_addr = CONFIG_SYS_DOWN_ADDR;
-
-#ifdef CONFIG_GENERIC_MMC
- usbd_set_mmc_dev(usbd);
-#endif
-
- return usbd;
-}
-
/* clear download informations */
-void s5p_usb_clear_dnfile_info(void)
+static void s5p_usb_clear_dnfile_info(void)
{
otg.dn_addr = 0;
otg.dn_filesize = 0;
}
/* clear upload informations */
-void s5p_usb_clear_upfile_info(void)
+static void s5p_usb_clear_upfile_info(void)
{
otg.up_addr = 0;
otg.up_size = 0;
}
/* start the usb controller */
-void usb_init(void)
+static void usb_init(void)
{
if (usb_board_init()) {
printf("Failed to usb_board_init\n");
printf("Connected!!\n");
}
-/* receive the packet from host PC
+/*
+ * receive the packet from host PC
* return received size
*/
-int usb_receive_packet(void)
+static int usb_receive_packet(void)
{
while (1) {
if (s5p_usb_detect_irq()) {
}
/* setup the download informations */
-void recv_setup(char *addr, int len)
+static void recv_setup(char *addr, int len)
{
s5p_usb_clear_dnfile_info();
otg.dn_ptr = (u8 *) addr;
otg.dn_filesize = len;
}
+
+#ifdef CONFIG_GENERIC_MMC
+#include <mmc.h>
+
+static void usbd_set_mmc_dev(struct usbd_ops *usbd)
+{
+ struct mmc *mmc;
+
+ usbd->mmc_dev = 0;
+ /* FIX 0x400 */
+ usbd->mmc_max = 0x400;
+ /* get from mmc->capacity?? */
+ usbd->mmc_total = 0xf50000; /* 8GB / 0x200 */
+
+ mmc = find_mmc_device(usbd->mmc_dev);
+ mmc_init(mmc);
+
+ usbd->mmc_blk = mmc->read_bl_len;
+}
+#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->send_data = s5p_usb_tx;
+ usbd->recv_data = usb_receive_packet;
+ usbd->recv_setup = recv_setup;
+ usbd->tx_data = tx_data;
+ usbd->rx_data = rx_data;
+ usbd->tx_len = tx_len;
+ usbd->rx_len = rx_len;
+ usbd->ram_addr = CONFIG_SYS_DOWN_ADDR;
+
+#ifdef CONFIG_GENERIC_MMC
+ usbd_set_mmc_dev(usbd);
+#endif
+
+ return usbd;
+}
+