diff options
-rw-r--r-- | .gitlab-ci.yml | 93 | ||||
-rw-r--r-- | board/toradex/common/tdx-cfg-block.c | 4 | ||||
-rw-r--r-- | board/toradex/verdin-imx8mm/verdin-imx8mm.c | 6 |
3 files changed, 99 insertions, 4 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..1e00004628 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,93 @@ +# SPDX-License-Identifier: GPL-2.0+ + +variables: +# uncomment for the pipeline debug purpose +# CI_DEBUG_TRACE: "true" + CI_IMAGE: gitlab.int.toradex.com:4567/philippe.schenker/u-boot-toradex:bionic-20200112-21Feb2020 + DOCKER_HOST: tcp://docker:2375 + DOCKER_DRIVER: overlay2 + DOCKER_TLS_CERTDIR: "" + GIT_STRATEGY: fetch + GIT_DEPTH: "1" + +# Grab our configured image. The source for this is found at: +# https://gitlab.denx.de/u-boot/gitlab-ci-runner +image: $CI_IMAGE + +# We run some tests in different order, to catch some failures quicker. +stages: + - all-in-one-stage + +.buildman_and_testpy_template: &buildman_and_testpy_dfn + tags: [ 'all' ] + stage: all-in-one-stage + before_script: + # Clone uboot-test-hooks + - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks + - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname` + - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname` + - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd + - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd + - cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi + - cp /opt/grub/grubaa64.efi ~/grub_arm64.efi + - cp /opt/grub/grubarm.efi ~/grub_arm.efi + + after_script: + - rm -rf /tmp/uboot-test-hooks /tmp/venv + script: + # From buildman, exit code 129 means warnings only. If we've been asked to + # use clang only do one configuration. + - if [[ "${BUILDMAN}" != "" ]]; then + ret=0; + tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?; + if [[ $ret -ne 0 && $ret -ne 129 ]]; then + tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN}; + exit $ret; + fi; + fi + # "not a_test_which_does_not_exist" is a dummy -k parameter which will + # never prevent any test from running. That way, we can always pass + # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom + # value. + - virtualenv -p /usr/bin/python3 /tmp/venv + - . /tmp/venv/bin/activate + - pip install -r test/py/requirements.txt + - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD}; + export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH}; + export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci; + if [[ "${TEST_PY_BD}" != "" ]]; then + ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} + -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" + --build-dir "$UBOOT_TRAVIS_BUILD_DIR"; + ret=$?; + if [[ $ret -ne 0 ]]; then + exit $ret; + fi; + fi; + +build all 64bit Toradex boards: + tags: [ 'all' ] + stage: all-in-one-stage + variables: + ARCH: arm64 + CROSS_COMPILE: /opt/gcc-7.3.0-nolibc/aarch64-linux/bin/aarch64-linux- + TARGETS: "apalis-imx8 apalis-imx8x colibri-imx8qxp verdin-imx8mm" + script: | + for TARGET in $TARGETS; do + echo -ne "#\n#\n#\n#\n#\n#\n# Building ${TARGET}\n#\n#\n#\n#\n#\n#\n" + make "${TARGET}_defconfig" + make -j$(nproc) u-boot.bin || ret=$? + if [[ $ret -ne 0 && $ret -ne 129 ]]; then + exit $ret + fi + done + +# QA jobs for code analytics +# static code analysis with cppcheck (we can add --enable=all later) +cppcheck: + tags: [ 'all' ] + stage: all-in-one-stage + script: + - cppcheck --force --quiet --inline-suppr . + + diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 9e5fe95982..6059213615 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -578,6 +578,8 @@ static int get_cfgblock_interactive(void) static int get_cfgblock_barcode(char *barcode, struct toradex_hw *tag, u32 *serial) { + char revision[3] = {barcode[6], barcode[7], '\0'}; + if (strlen(barcode) < 16) { printf("Argument too short, barcode is 16 chars long\n"); return -1; @@ -586,7 +588,7 @@ static int get_cfgblock_barcode(char *barcode, struct toradex_hw *tag, /* Get hardware information from the first 8 digits */ tag->ver_major = barcode[4] - '0'; tag->ver_minor = barcode[5] - '0'; - tag->ver_assembly = barcode[7] - '0'; + tag->ver_assembly = simple_strtoul(revision, NULL, 10); barcode[4] = '\0'; tag->prodid = simple_strtoul(barcode, NULL, 10); diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c index 0d2620b782..6970a8d43d 100644 --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2019 Toradex + * Copyright 2019-2020 Toradex */ #include <common.h> @@ -72,9 +72,9 @@ int dram_init(void) { /* rom_pointer[1] contains the size of TEE occupies */ if (rom_pointer[1]) - gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1]; + gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE) - rom_pointer[1]; else - gd->ram_size = PHYS_SDRAM_SIZE; + gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE); return 0; } |