Exemplo n.º 1
0
int do_ramdump(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{

	exynos_usbd_dn_addr = USBD_DOWN_ADDR;	/* Default Address */

	exynos_receive_done = 0;

	exynos_usbctl_init();
	exynos_usbc_activate();

	printf("Now, Waiting for USB RAMDUMP\n");

	while (1) {
		if (EXYNOS_USBD_DETECT_IRQ()) {
			exynos_udc_int_hndlr();
			EXYNOS_USBD_CLEAR_IRQ();
		}

		if (exynos_receive_done)
			break;

		if (serial_tstc()) {
			serial_getc();
			break;
		}
	}

	/* when operation is done, usbd must be stopped */
	exynos_usb_stop();

	printf("Finished RAMDUMP\n");

	return 0;
}
Exemplo n.º 2
0
int do_usbd_dnw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{

	if (argv[0][0] == 'u') {
		DNW = 0;
	}
	else {
		DNW = 1;
		exynos_got_header = 0;
	}

	switch (argc) {
	case 1 :
		exynos_usbd_dn_addr = USBD_DOWN_ADDR;	/* Default Address */
		break;
	case 2 :
		exynos_usbd_dn_addr = simple_strtoul(argv[1], NULL, 16);
		break;
	default:
		printf ("Usage:\n%s\n", cmdtp->usage);
		return 1;
	}

	exynos_receive_done = 0;
	exynoy_usb_phy_on();

	printf("Download address 0x%08x\n", exynos_usbd_dn_addr);
	printf("Now, Waiting for DNW to transmit data\n");

	while (1) {
		if (!exynos_usb_wait_cable_insert()) {
			exynos_usbctl_init();
			exynos_usbc_activate();
		}
		if (EXYNOS_USBD_DETECT_IRQ()) {
			exynos_udc_int_hndlr();
			EXYNOS_USBD_CLEAR_IRQ();
		}

		if (exynos_receive_done)
			break;

		if (serial_tstc()) {
			serial_getc();
			break;
		}
	}

	/* when operation is done, usbd must be stopped */
	exynos_usb_stop();

	return 0;
}
Exemplo n.º 3
0
void fboot_usbctl_init(void)
{
	exynos_usbctl_init();
	is_fastboot = 1;
}