diff options
-rw-r--r-- | recipes-bsp/u-boot/u-boot-extra.inc | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/recipes-bsp/u-boot/u-boot-extra.inc b/recipes-bsp/u-boot/u-boot-extra.inc index e1c89d05..e476b22e 100644 --- a/recipes-bsp/u-boot/u-boot-extra.inc +++ b/recipes-bsp/u-boot/u-boot-extra.inc | |||
@@ -1,4 +1,6 @@ | |||
1 | 1 | ||
2 | inherit xilinx-utils | ||
3 | |||
2 | S = "${WORKDIR}/git" | 4 | S = "${WORKDIR}/git" |
3 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 5 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
4 | 6 | ||
@@ -16,39 +18,39 @@ do_deploy_append() { | |||
16 | ln -sf ${DEST_ELF} ${SRC_ELF}.elf | 18 | ln -sf ${DEST_ELF} ${SRC_ELF}.elf |
17 | } | 19 | } |
18 | 20 | ||
21 | # Appends the '<layer>/conf/machine/boards' path to FILESEXTRAPATHS for all | ||
22 | # layers (using the ${BBPATH}) | ||
23 | FILESEXTRAPATHS_append := "${@get_additional_bbpath_filespath('conf/machine/boards', d)}" | ||
24 | |||
25 | # Append the xparameters file to the SRC_URI if set | ||
26 | SRC_URI_append += " ${@paths_affix(d.getVar("MACHINE_XPARAMETERS", True) or '', prefix = 'file://')}" | ||
27 | |||
28 | # Full path to the xparameters.h file | ||
29 | UBOOT_XPARAMETERS ?= "${@expand_workdir_paths("MACHINE_XPARAMETERS", d)}" | ||
30 | |||
19 | # Install the MicroBlaze System configuration into the board configuration, | 31 | # Install the MicroBlaze System configuration into the board configuration, |
20 | # and generate a u-boot specific config.mk | 32 | # and generate a u-boot specific config.mk |
21 | do_configure_prepend () { | 33 | do_configure_prepend () { |
22 | if [ "${SOC_FAMILY}" = "microblaze" -a ! -z "${MACHINE_XPARAMETERS}" ]; then | 34 | if [ "${SOC_FAMILY}" = "microblaze" -a -e "${UBOOT_XPARAMETERS}" ]; then |
23 | # Find the file based on the avaliable layers (using $BBPATH) | 35 | CONFIG_MK=${S}/board/xilinx/microblaze-generic/config.mk |
24 | MACHINE_XPARAMETERS_ABSOLUTE= | 36 | cp ${UBOOT_XPARAMETERS} ${S}/board/xilinx/microblaze-generic/xparameters.h |
25 | for i in ${BBPATH}; do | ||
26 | if [ -e $i/conf/machine/boards/${MACHINE_XPARAMETERS} ]; then | ||
27 | MACHINE_XPARAMETERS_ABSOLUTE = $i/conf/machine/boards/${MACHINE_XPARAMETERS} | ||
28 | fi | ||
29 | done | ||
30 | if [ -e "${MACHINE_XPARAMETERS_ABSOLUTE}" ]; then | ||
31 | CONFIG_MK=${S}/board/xilinx/microblaze-generic/config.mk | ||
32 | cp ${MACHINE_XPARAMETERS_ABSOLUTE} ${S}/board/xilinx/microblaze-generic/xparameters.h | ||
33 | |||
34 | # Generate the config.mk from CFLAGS and XPARAMETERS file | ||
35 | echo "# This file is generated by the meta-xilinx layer." > ${CONFIG_MK} | ||
36 | echo "" >> ${CONFIG_MK} | ||
37 | 37 | ||
38 | # Export CCARGS | 38 | # Generate the config.mk from CFLAGS and XPARAMETERS file |
39 | for i in ${TUNE_CCARGS}; do | 39 | echo "# This file is generated by the meta-xilinx layer." > ${CONFIG_MK} |
40 | echo "PLATFORM_CPPFLAGS += $i" >> ${CONFIG_MK} | 40 | echo "" >> ${CONFIG_MK} |
41 | done | ||
42 | 41 | ||
43 | echo "" >> ${CONFIG_MK} | 42 | # Export CCARGS |
43 | for i in ${TUNE_CCARGS}; do | ||
44 | echo "PLATFORM_CPPFLAGS += $i" >> ${CONFIG_MK} | ||
45 | done | ||
46 | echo "" >> ${CONFIG_MK} | ||
44 | 47 | ||
45 | # Calculate the TEXT_BASE address at RAM_END - 4MB | 48 | # Calculate the TEXT_BASE address at RAM_END - 4MB |
46 | RAM_START=$(grep "XILINX_RAM_START" ${MACHINE_XPARAMETERS_ABSOLUTE} | grep -o "0x.*$") | 49 | RAM_START=$(grep "XILINX_RAM_START" ${UBOOT_XPARAMETERS} | grep -o "0x.*$") |
47 | RAM_SIZE=$(grep "XILINX_RAM_SIZE" ${MACHINE_XPARAMETERS_ABSOLUTE} | grep -o "0x.*$") | 50 | RAM_SIZE=$(grep "XILINX_RAM_SIZE" ${UBOOT_XPARAMETERS} | grep -o "0x.*$") |
48 | BASE_OFFSET=$(printf "0x%08x" "$[$RAM_START + $RAM_SIZE - 0x400000]") | 51 | BASE_OFFSET=$(printf "0x%08x" "$[$RAM_START + $RAM_SIZE - 0x400000]") |
49 | 52 | ||
50 | echo "TEXT_BASE = $BASE_OFFSET" >> ${CONFIG_MK} | 53 | echo "TEXT_BASE = $BASE_OFFSET" >> ${CONFIG_MK} |
51 | echo "CONFIG_SYS_TEXT_BASE = $BASE_OFFSET" >> ${CONFIG_MK} | 54 | echo "CONFIG_SYS_TEXT_BASE = $BASE_OFFSET" >> ${CONFIG_MK} |
52 | fi | ||
53 | fi | 55 | fi |
54 | } | 56 | } |