summaryrefslogtreecommitdiffstats
path: root/recipes-bsp
diff options
context:
space:
mode:
authorDalon Westergreen <dwesterg@gmail.com>2016-04-18 19:02:58 -0700
committerDalon Westergreen <dwesterg@gmail.com>2016-04-18 19:54:20 -0700
commiteb352fc6168b382bebd4587baadaecd754c96229 (patch)
treec77d7d310072d24f224f66002698b60e6bca6390 /recipes-bsp
parentb27593878e1b9b51b4b3cb36639959d4744724bd (diff)
downloadmeta-altera-eb352fc6168b382bebd4587baadaecd754c96229.tar.gz
Clean up variables for uboot
-> Moved common variables to socfpga.inc
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/u-boot/u-boot-socfpga_2016.03.bb15
-rw-r--r--recipes-bsp/u-boot/u-boot-target-env.inc69
2 files changed, 1 insertions, 83 deletions
diff --git a/recipes-bsp/u-boot/u-boot-socfpga_2016.03.bb b/recipes-bsp/u-boot/u-boot-socfpga_2016.03.bb
index 1d0376e..9189715 100644
--- a/recipes-bsp/u-boot/u-boot-socfpga_2016.03.bb
+++ b/recipes-bsp/u-boot/u-boot-socfpga_2016.03.bb
@@ -6,23 +6,10 @@ SRCREV = "df61a74e6845ec9bdcdd48d2aff5e9c2c6debeaa"
6LICENSE = "GPLv2+" 6LICENSE = "GPLv2+"
7LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" 7LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
8 8
9PV = "v2016.03" 9PV = "2016.03"
10PV_append = "+git${SRCPV}" 10PV_append = "+git${SRCPV}"
11 11
12DEPENDS += "dtc-native" 12DEPENDS += "dtc-native"
13 13
14UBOOT_CONFIG ??= "cyclone5-socdk arria5-socdk de0-nano-soc sockit socrates"
15UBOOT_CONFIG[cyclone5-socdk] = "socfpga_cyclone5_defconfig"
16UBOOT_CONFIG[arria5-socdk] = "socfpga_arria5_defconfig"
17UBOOT_CONFIG[de0-nano-soc] = "socfpga_de0_nano_soc_defconfig"
18UBOOT_CONFIG[mcvevk] = "socfpga_mcvevk_defconfig"
19UBOOT_CONFIG[sockit] = "socfpga_sockit_defconfig"
20UBOOT_CONFIG[socrates] = "socfpga_socrates_defconfig"
21UBOOT_CONFIG[sr1500] = "socfpga_sr1500_defconfig"
22
23UBOOT_SUFFIX = "img"
24
25SPL_BINARY_cyclone5 = "u-boot-with-spl.sfp"
26SPL_BINARY_arria5 = "u-boot-with-spl.sfp"
27 14
28 15
diff --git a/recipes-bsp/u-boot/u-boot-target-env.inc b/recipes-bsp/u-boot/u-boot-target-env.inc
deleted file mode 100644
index c418a16..0000000
--- a/recipes-bsp/u-boot/u-boot-target-env.inc
+++ /dev/null
@@ -1,69 +0,0 @@
1# Handle severals environments generation for u-boot
2
3#Env binary size
4ENV_SIZE = "0x1000"
5
6ENV_BIN_DIR = "${WORKDIR}/target_env_bin"
7
8# Env deploy dir is the name of directory where binary envs will be deployed
9ENV_DEPLOY_DIR="u-boot-envs"
10
11# Env deploy src dir is the name of directory where txt envs will be deployed
12ENV_SRC_DEPLOY_DIR="u-boot-envs-src"
13
14do_build_mkimage_tool () {
15 HOSTCC="${CC}" HOSTLD="${LD}" HOSTLDFLAGS="${LDFLAGS}" HOSTSTRIP=true oe_runmake sandbox_defconfig
16 HOSTCC="${CC}" HOSTLD="${LD}" HOSTLDFLAGS="${LDFLAGS}" HOSTSTRIP=true oe_runmake tools
17}
18
19python do_environment_mkimage() {
20 import subprocess
21 import shutil
22 # list env variant target files
23 target_root_dir = d.getVar('WORKDIR',True)
24 # env files only for UBOOT_CONFIG
25 env_uboot_config = d.getVar('UBOOT_CONFIG',True)
26 env_files = []
27 for f in os.listdir(target_root_dir):
28 if f.endswith(".env"):
29 env_files.append(os.path.join(target_root_dir,f))
30 env_bin_dir = d.getVar("ENV_BIN_DIR",True)
31 # cleans if it exists env_bin directory
32 shutil.rmtree(env_bin_dir, ignore_errors=True)
33 # create env bin directory
34 os.mkdir(env_bin_dir)
35 print 'Building binary environments in : %s' % env_bin_dir
36 # iterate targets list to build binary environment files
37 for target_env in env_files :
38 # get only filename without path and extension
39 target_filename = os.path.splitext(os.path.basename(target_env))[0]
40 if target_filename not in env_uboot_config:
41 continue
42 # build output file path with ext
43 target_bin = os.path.join(env_bin_dir,
44 target_filename + '.bin')
45 # generated mkenvimage tool command line
46 cmd_mkimg ='cat %s | grep -v -E "^$|^\#" |' \
47 ' ./tools/mkenvimage -s %s -r -o %s -' \
48 % ( target_env,
49 d.getVar("ENV_SIZE",True), target_bin)
50 print 'Building binary for %s target:' % (target_filename)
51 print '%s' % cmd_mkimg
52 # execute shell command
53 ret = subprocess.call(cmd_mkimg, shell=True)
54 if ret: return ret
55 return 0
56}
57
58do_deploy_append() {
59 install -d ${DEPLOYDIR}
60 # deploy binary U-boot environments
61 echo "Deploying U-boot Environments binary files in ${DEPLOYDIR}/${ENV_DEPLOY_DIR}"
62 install -d ${DEPLOYDIR}/${ENV_DEPLOY_DIR}
63
64
65 cp ${ENV_BIN_DIR}/*.bin ${DEPLOYDIR}/${ENV_DEPLOY_DIR}
66}
67
68addtask build_mkimage_tool after do_compile before do_environment_mkimage
69addtask environment_mkimage after do_build_mkimage_tool before do_deploy