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+
15 #include <asm/u-boot.h>
16 #include <asm/utils.h>
20 static int getcymodem(void) {
26 void spl_ymodem_load_image(void)
32 connection_info_t info;
34 ulong store_addr = ~0;
37 info.mode = xyzModem_ymodem;
38 ret = xyzModem_stream_open(&info, &err);
42 xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0) {
44 spl_parse_image_header((struct image_header *)buf);
45 store_addr = addr + spl_image.load_addr;
48 memcpy((char *)(store_addr), buf, res);
51 printf("spl: ymodem err - %s\n", xyzModem_error(err));
55 xyzModem_stream_close(&err);
56 xyzModem_stream_terminate(false, &getcymodem);
58 printf("Loaded %d bytes\n", size);