xyz-modem: Select CRC16
PATCH 1/1 xyz-modem: Select CRC16
CONFIG_LOADB causes the xyzModem code to get built and that code depends on CONFIG_CRC16. If you don't have something else that selects CONFIG_CRC16 you can unselect it and then the final link will fail:
LD u-boot/usr/bin/m68k-linux-gnu-ld.bfd: common/xyzModem.o: in function `xyzModem_get_hdr':
u-boot/common/xyzModem.c:388:(.text.xyzModem_get_hdr+0x17a): undefined reference to `crc16_ccitt'
Since SPL/TPL can also use the xyzModem code create a Kconfig symbol for it, select CONFIG_CRC16 there and then select the new symbol from all of the users.
--- cmd/Kconfig | 1 + common/Kconfig | 6 ++++++ common/Makefile | 3 +-- common/spl/Kconfig | 1 + common/spl/Kconfig.tpl | 1 + 5 files changed, 10 insertions(+), 2 deletions(-)
cmd/Kconfig +1 -0
@@ -1412,6 +1412,7 @@ config CMD_W1 config CMD_LOADB bool "loadb" default y + select YMODEM help Load a binary file over serial line.
common/Kconfig +6 -0
@@ -1274,3 +1274,9 @@ config IO_TRACE confirm that the driver behaves the same way before and after a code change. To add support for your architecture, add '#include <iotrace.h>' to the bottom of arch/<arch>/include/asm/io.h and test. + +config YMODEM + bool + select CRC16 + help + Enable xyzModem library code
common/Makefile +1 -2
@@ -99,8 +99,7 @@ obj-$(CONFIG_$(PHASE_)LOG) += log.o obj-$(CONFIG_$(PHASE_)LOG_CONSOLE) += log_console.o obj-$(CONFIG_$(PHASE_)LOG_SYSLOG) += log_syslog.o obj-y += s_record.o -obj-$(CONFIG_CMD_LOADB) += xyzModem.o -obj-$(CONFIG_$(PHASE_)YMODEM_SUPPORT) += xyzModem.o +obj-$(CONFIG_YMODEM) += xyzModem.o obj-$(CONFIG_$(PHASE_)AVB_VERIFY) += avb_verify.o obj-$(CONFIG_$(PHASE_)STACKPROTECTOR) += stackprot.o
common/spl/Kconfig +1 -0
@@ -1655,6 +1655,7 @@ config SPL_WATCHDOG config SPL_YMODEM_SUPPORT bool "Support loading using Ymodem" depends on SPL_SERIAL + select YMODEM help While loading from serial is slow it can be a useful backup when there is no other option. The Ymodem protocol provides a reliable
common/spl/Kconfig.tpl +1 -0
@@ -336,6 +336,7 @@ config TPL_DM_SPI_FLASH config TPL_YMODEM_SUPPORT bool "Support loading using Ymodem" depends on TPL_SERIAL + select YMODEM help While loading from serial is slow it can be a useful backup when there is no other option. The Ymodem protocol provides a reliable
Signature · 1 line
2.53.0
Quoted 78 lines · Daniel Palmer
CONFIG_LOADBcauses the xyzModem code to get built and that code depends onCONFIG_CRC16. If you don't have something else that selectsCONFIG_CRC16you can unselect it and then the final link will fail:LD u-boot
/usr/bin/m68k-linux-gnu-ld.bfd:common/xyzModem.o: in function `xyzModem_get_hdr':
u-boot/common/xyzModem.c:388:(.text.xyzModem_get_hdr+0x17a): undefined reference to `crc16_ccitt'Since SPL/TPL can also use the xyzModem code create a
Kconfigsymbol for it, selectCONFIG_CRC16there and then select the new symbol from all of the users.Signed-off-by Daniel Palmer <[email protected]>--- cmd/Kconfig | 1 + common/Kconfig | 6 ++++++ common/Makefile | 3 +-- common/spl/Kconfig | 1 + common/spl/Kconfig.tpl | 1 + 5 files changed, 10 insertions(+), 2 deletions(-)cmd/Kconfig +1
-0@@ -1412,6 +1412,7 @@ config CMD_W1 config CMD_LOADB bool "loadb" default y + select YMODEM help Load a binary file over serial line.common/Kconfig +6
-0@@ -1274,3 +1274,9 @@ config IO_TRACE confirm that the driver behaves the same way before and after a code change. To add support for your architecture, add '#include <iotrace.h>' to the bottom of arch/<arch>/include/asm/io.h and test. + +config YMODEM + bool + select CRC16 + help + Enable xyzModem library codecommon/Makefile +1
-2@@ -99,8 +99,7 @@ obj-$(CONFIG_$(PHASE_)LOG) += log.o obj-$(CONFIG_$(PHASE_)LOG_CONSOLE) += log_console.o obj-$(CONFIG_$(PHASE_)LOG_SYSLOG) += log_syslog.o obj-y += s_record.o -obj-$(CONFIG_CMD_LOADB) += xyzModem.o -obj-$(CONFIG_$(PHASE_)YMODEM_SUPPORT) += xyzModem.o +obj-$(CONFIG_YMODEM) += xyzModem.o obj-$(CONFIG_$(PHASE_)AVB_VERIFY) += avb_verify.o obj-$(CONFIG_$(PHASE_)STACKPROTECTOR) += stackprot.ocommon/spl/Kconfig +1
-0@@ -1655,6 +1655,7 @@ config SPL_WATCHDOG config SPL_YMODEM_SUPPORT bool "Support loading using Ymodem" depends on SPL_SERIAL + select YMODEM help While loading from serial is slow it can be a useful backup when there is no other option. The Ymodem protocol provides a reliablecommon/spl/Kconfig.tpl +0
-0
common/spl/Kconfig.tpl config TPL_DM_SPI_FLASH · line 342
Quoted 7 lines
common/spl/Kconfig.tpl +1
-0@@ -336,6 +336,7 @@ config TPL_DM_SPI_FLASH config TPL_YMODEM_SUPPORT bool "Support loading using Ymodem" depends on TPL_SERIAL + select YMODEM help While loading from serial is slow it can be a useful backup when there is no other option. The Ymodem protocol provides a reliable
Good catch. But, as the Makefile hunk shows, we should be using $(PHASE_) here for everything, so we need to add YMODEM_SUPPORT as a main U-Boot symbol (CND_LOADB should select that) and the existing xPL_YMODEM_SUPPORT should also select CRC16/xPL_CRC16 (so we're missing TPL_CRC16, but have SPL_CRC16). Thanks!
Signature · 1 line
Tom