This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3351: Can I use U-boot board detection logic for my custom board?

Part Number: AM3351

Hi,

I am adding U-boot support for custom board which is based on AM335x. When I am trying to compile u-boot sources I get following errors:

| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `do_board_detect':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.c:76: undefined reference to `ti_i2c_eeprom_am_get'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_pb':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:38: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bone':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:28: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bone_lt':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:33: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:33: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:33: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bben':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:48: undefined reference to `board_ti_get_rev'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bbg1':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:43: undefined reference to `board_ti_get_rev'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_icev2':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:80: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:80: undefined reference to `board_ti_get_rev'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_late_init':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.c:794: undefined reference to `board_ti_get_eth_mac_addr'
| arm-poky-linux-gnueabi-ld.bfd: /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.c:795: undefined reference to `board_ti_get_eth_mac_addr'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bone_lt':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:33: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_late_init':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.c:808: undefined reference to `board_ti_get_rev'
| arm-poky-linux-gnueabi-ld.bfd: /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.c:812: undefined reference to `board_ti_get_rev'
| arm-poky-linux-gnueabi-ld.bfd: /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.c:816: undefined reference to `board_ti_get_rev'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bone_lt':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:33: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bbg1':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:43: undefined reference to `board_ti_get_rev'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bone_lt':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:33: undefined reference to `board_ti_is'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_is_bben':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.h:48: undefined reference to `board_ti_get_rev'
| arm-poky-linux-gnueabi-ld.bfd: board/carrier/am335x_est4/built-in.o: in function `board_late_init':
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/board/carrier/am335x_est4/board.c:825: undefined reference to `set_board_info_env'
| /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging/Makefile:1673: recipe for target 'u-boot' failed
| make[1]: *** [u-boot] Error 1
| make[1]: Leaving directory '/home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/tmp/work/am335x_est4-poky-linux-gnueabi/u-boot-ti-staging/1_2020.01+git999-r36/u-boot-ti-staging-2020.01+git999'
| Makefile:167: recipe for target 'sub-make' failed
| make: *** [sub-make] Error 2
| make: Leaving directory '/home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/workspace/sources/u-boot-ti-staging'
| ERROR: oe_runmake failed
| WARNING: /home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/tmp/work/am335x_est4-poky-linux-gnueabi/u-boot-ti-staging/1_2020.01+git999-r36/temp/run.do_compile.11416:1 exit 1 from 'exit 1'
| ERROR: Execution of '/home/aws-fsp-build/rax-workspace/build-fsp-am335x-est4-5.4-rt-test/tmp/work/am335x_est4-poky-linux-gnueabi/u-boot-ti-staging/1_2020.01+git999-r36/temp/run.do_compile.11416' failed with exit code 1
ERROR: Task (/home/aws-fsp-build/rax-workspace/yocto/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_2020.01.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 764 tasks of which 763 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/aws-fsp-build/rax-workspace/yocto/meta-ti/recipes-bsp/u-boot/u-boot-ti-staging_2020.01.bb:do_compile
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
aws-fsp-build@ip-10-207-92-124:~/rax-workspace/build-fsp-am335x-est4-5.4-rt-test$ 

Above functions are defined in board/ti/common/ and I am including board_detect.h in my board.c file. I am creating my custom board here -> board/SYS_VENDOR/SYS_BOARD.

I added following in arch/arm/mach-omap2/am33xx/Kconfig to define new target which has TI_I2C_BOARD_DETECT also. And done all the necessary steps.

+config TARGET_AM335X_EST4
+ bool "Support am335x_est4"
+ select BOARD_LATE_INIT
+ select DM
+ select DM_GPIO
+ select DM_SERIAL
+ select TI_I2C_BOARD_DETECT

Question: Can I not use board detect logic defined in board/ti/common if my is custom board is not present in board/ti folder?

IMP NOTE: If I move my custom board files under board/ti then I do not observe above errors.

Regards,

Raxesh