2 * (C) Copyright 2000-2004
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Texas Instruments, <www.ti.com>
8 * Matt Porter <mporter@ti.com>
10 * SPDX-License-Identifier: GPL-2.0+
16 #include <asm/u-boot.h>
17 #include <asm/utils.h>
21 static int getcymodem(void) {
27 void spl_ymodem_load_image(void)
33 connection_info_t info;
35 ulong store_addr = ~0;
39 info.mode = xyzModem_ymodem;
40 ret = xyzModem_stream_open(&info, &err);
42 while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0) {
45 spl_parse_image_header((struct image_header *)buf);
46 store_addr = addr + spl_image.load_addr;
49 memcpy((char *)store_addr, buf, res);
53 printf("Retrying...\n");
57 xyzModem_stream_close(&err);
58 xyzModem_stream_terminate(false, &getcymodem);
60 printf("Loaded %d bytes\n", size);