summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone/recipes-bsp/embeddedsw/fsbl-firmware.inc
blob: 0e855eef623f11a408f16790b50e41e9735fe446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
DESCRIPTION = "First Stage Bootloader"

inherit xlnx-embeddedsw deploy

COMPATIBLE_HOST = ".*-(elf|eabi)"
COMPATIBLE_MACHINE = "none"
COMPATIBLE_MACHINE:zynq = ".*"
COMPATIBLE_MACHINE:zynqmp = ".*"

PACKAGE_ARCH = "${MACHINE_ARCH}"

S = "${WORKDIR}/git"

APP_DIR = "undefined"
APP_DIR:zynq = "zynq_fsbl"
APP_DIR:zynqmp = "zynqmp_fsbl"

B = "${S}/lib/sw_apps/${APP_DIR}/src"

# The makefile does not handle parallelization
PARALLEL_MAKE = "-j1"

do_configure() {
    :
}

COMPILER = "${CC}"
COMPILER_FLAGS = "-O2 -c"
EXTRA_COMPILER_FLAGS = "-g -Wall -Wextra -Os -flto -ffat-lto-objects"
ARCHIVER = "${AR}"

BSP_DIR ?= "${B}/../misc/undefined"
BSP_DIR:zynq   ?= "${B}/../misc/zynq_fsbl_bsp"
BSP_DIR:zynqmp ?= "${B}/../misc/zynqmp_fsbl_bsp"
BSP_TARGETS_DIR ?= "${BSP_DIR}/psu_cortexa53_0/libsrc"

# FSBL components expect AS to be CC.
AS = "${CC}"
LINKER = "${CC}"
DUMP = "${OBJDUMP} -xSD"

def bsp_make_vars(d):
    s = ["COMPILER", "CC", "COMPILER_FLAGS", "EXTRA_COMPILER_FLAGS", "ARCHIVER", "AR", "AS", "LINKER", "DUMP"]
    return " ".join(["\"%s=%s\"" % (v, d.getVar(v)) for v in s])

EXTRA_OEMAKE = "${@bsp_make_vars(d)}"

ARM_INSTRUCTION_SET:eabi:arm = "arm"
do_compile() {
    oe_runmake
}

do_install() {
    :
}

PACKAGES = ""

# This is the default in most BSPs.  A MACHINE.conf can override this!
FSBL_IMAGE_NAME ??= "fsbl-${MACHINE}"

inherit image-artifact-names

FSBL_BASE_NAME ?= "${FSBL_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"

ESW_COMPONENT ??= "fsbl.elf"

do_deploy() {
    install -Dm 0644 ${B}/${ESW_COMPONENT} ${DEPLOYDIR}/${FSBL_BASE_NAME}.elf
    ln -sf ${FSBL_BASE_NAME}.elf ${DEPLOYDIR}/${FSBL_IMAGE_NAME}.elf
}

addtask deploy before do_build after do_install

# Disable buildpaths QA check warnings.
INSANE_SKIP:${PN} += "buildpaths"