From 6076d11b411a100a1c1c4c61f40428f30e203d74 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Wed, 26 Jun 2013 15:54:24 +1000 Subject: u-boot-xlnx: Changed MicroBlaze specific configure * Handles generation of the config.mk, this avoids the need for a manual config.mk to be provided, it depends on the information provided in xparameters.h. * Added 'MACHINE_XPARAMETERS' which points to a machine specific xparameters.h file. Signed-off-by: Nathan Rossi --- recipes-bsp/u-boot/u-boot-extra.inc | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/recipes-bsp/u-boot/u-boot-extra.inc b/recipes-bsp/u-boot/u-boot-extra.inc index f07284a5..329a7754 100644 --- a/recipes-bsp/u-boot/u-boot-extra.inc +++ b/recipes-bsp/u-boot/u-boot-extra.inc @@ -12,14 +12,32 @@ do_deploy_append() { ln -sf ${DEST_ELF} ${SRC_ELF}.elf } -# Install the MicroBlaze System configuration into the board configuration +# Install the MicroBlaze System configuration into the board configuration, +# and generate a u-boot specific config.mk do_configure_prepend () { - if [ "${SOC_FAMILY}" = "microblaze" ]; then - if [ -e ${WORKDIR}/config.mk ]; then - cp ${WORKDIR}/config.mk ${S}/board/xilinx/microblaze-generic/ - fi - if [ -e ${WORKDIR}/xparameters.h ]; then - cp ${WORKDIR}/xparameters.h ${S}/board/xilinx/microblaze-generic/ + if [ "${SOC_FAMILY}" = "microblaze" -a ! -z "${MACHINE_XPARAMETERS}" ]; then + if [ ! -z "${MACHINE_XPARAMETERS}" -a -e "${MACHINE_XPARAMETERS}" ]; then + CONFIG_MK=${S}/board/xilinx/microblaze-generic/config.mk + cp ${MACHINE_XPARAMETERS} ${S}/board/xilinx/microblaze-generic/xparameters.h + + # Generate the config.mk from CFLAGS and XPARAMETERS file + echo "# This file is generated by the meta-xilinx layer." > ${CONFIG_MK} + echo "" >> ${CONFIG_MK} + + # Export CCARGS + for i in ${TUNE_CCARGS}; do + echo "PLATFORM_CPPFLAGS += $i" >> ${CONFIG_MK} + done + + echo "" >> ${CONFIG_MK} + + # Calculate the TEXT_BASE address at RAM_END - 4MB + RAM_START=$(grep "XILINX_RAM_START" ${MACHINE_XPARAMETERS} | grep -o "0x.*$") + RAM_SIZE=$(grep "XILINX_RAM_SIZE" ${MACHINE_XPARAMETERS} | grep -o "0x.*$") + BASE_OFFSET=$(printf "0x%08x" "$[$RAM_START + $RAM_SIZE - 0x400000]") + + echo "TEXT_BASE = $BASE_OFFSET" >> ${CONFIG_MK} + echo "CONFIG_SYS_TEXT_BASE = $BASE_OFFSET" >> ${CONFIG_MK} fi fi -} +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf