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.

Compiler/AM3352: Including MLO.byteswap in yocto image output

Part Number: AM3352

Tool/software: TI C/C++ Compiler

Hi

I have a new board defined in u-boot-ti-staging that compiles successfully giving me usable artefacts in the build directory of the recipe under yocto (specifically /build/tmp/work/myboard-poky-linux-gnueabi/u-boot-ti-staging/1_2020.01+gitAUTOINC+9addfeb8bf-r6/build)

one of these that I am using is the MLO.byteswap to run the SPL from SPI NOR flash 

This artefact is currently only found in the "build" directory; it is not deployed or packaged for the recipe

I have tried overloading the UBOOT_SPI_SPL_BINARY  in my recipe .bbappend as this looks like it gets handled in the install, deployment and packaging stages (and the u-boot-spl.bin file it originally refers to appears to be used)

UBOOT_SPI_SPL_BINARY= "MLO.byteswap"
UBOOT_SPI_SPL_IMAGE= "MLO.byteswap"

checking with bitbake -e these changes does appear to get picked up by the build.

However this does not appear to change any of the files that end up in the image/boot or deploy or package directories

- the u-boot-spl.bin that was the previous value for the UBOOT_SPI_SPL_BINARY  still seems to be deployed and packaged

Any ideas as to what I am missing? or what I need to do to get this file installed/deployed and packaged?

All the best

- Richard

  • Hi,

    Can you check this thead:

    https://e2e.ti.com/support/processors/f/791/t/676056?PROCESSOR-SDK-AM335X-Yocto-build-of-MLO-and-U-boot-for-SPI-flash

    Is the byteswap file showing up in the build directory. In that case, just need to build in the instructions to move it to deploy.

    Thanks.

  • Thanks

    yes its in the build directory I listed

    your linked thread refers to am335x_evm_spiboot_config which no longer exists

    in u-boot-ti.inc there are a variety of variables that look to be for the purpose of SPI NOR deployment

    specifically these ones that I mention overloading in my bbappend :

    # SPI NOR Flash binaries
    UBOOT_SPI_SPL_BINARY = "u-boot-spl.bin"
    
    # SPI NOR Flash deployed images
    UBOOT_SPI_SPL_IMAGE = "u-boot-spl-${MACHINE}-${PV}-${PR}.bin"

    can you explain if/how these are used? or whether it's a case of requiring to overload/append the do_install_append and do_deploy_append methods?

    it would be good if you could also explain use of the do_install_append_keystone method/task:
    within my build the UBOOT_CONFIG string is empty and UBOOT_MACHINE is myboard_config which if I am reading it correctly should mean that this task if it were executed should be doing

    		if [ "x${UBOOT_SPI_SPL_BINARY}" != "x" ]; then
    			install ${B}/spl/${UBOOT_SPI_SPL_BINARY} ${D}/boot/${UBOOT_SPI_SPL_IMAGE}
    			ln -sf ${UBOOT_SPI_SPL_IMAGE} ${D}/boot/${UBOOT_SPI_SPL_BINARY}
    		fi
    
    		if [ "x${UBOOT_SPI_BINARY}" != "x" ]; then
    			install ${B}/${UBOOT_SPI_BINARY} ${D}/boot/${UBOOT_SPI_IMAGE}
    			ln -sf ${UBOOT_SPI_IMAGE} ${D}/boot/${UBOOT_SPI_BINARY}
    		fi
    
    		if [ "x${UBOOT_SPI_GPH_BINARY}" != "x" ]; then
    			install ${B}/${UBOOT_SPI_GPH_BINARY} ${D}/boot/${UBOOT_SPI_GPH_IMAGE}
    			ln -sf ${UBOOT_SPI_GPH_IMAGE} ${D}/boot/${UBOOT_SPI_GPH_BINARY}
    		fi
    	fi

    which is pretty much how I would be appending the install method if I were to do it myself

    Thanks for any advice

    All the best

    - Richard

  • Hi Richard,

    Those targets were added to support our Keystone platform of devices (our Distro covers several TI SoCs). They should serve as a good proxy for getting the deploy directory set up the way you like for AM335x.

    I hope this is helpful to you.

    Thanks.

  • Thanks 

    I added my own do_deploy_append to do the lifting - reusing the existing variables

    do_deploy_append() {
      if [ "x${UBOOT_SPI_SPL_BINARY}" != "x" ]; then
        install ${B}/${UBOOT_SPI_SPL_BINARY} ${DEPLOYDIR}/${UBOOT_SPI_SPL_IMAGE}
      fi
    
      if [ "x${UBOOT_SPI_BINARY}" != "x" ]; then
        install ${B}/${UBOOT_SPI_BINARY} ${DEPLOYDIR}/${UBOOT_SPI_IMAGE}
      fi
    
      
    }

    Thanks for the pointers

    All the best

    - Richard