From patchwork Thu Jul 19 10:31:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 946183 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=boundarydevices.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=boundarydevices-com.20150623.gappssmtp.com header.i=@boundarydevices-com.20150623.gappssmtp.com header.b="sitiA7lI"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41WVgN1fNfz9s4Z for ; Thu, 19 Jul 2018 20:31:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6E9B788FC9; Thu, 19 Jul 2018 10:31:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pJC_sL3ofaya; Thu, 19 Jul 2018 10:31:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 38F6088FE3; Thu, 19 Jul 2018 10:31:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 9B9471CF047 for ; Thu, 19 Jul 2018 10:31:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9921389D23 for ; Thu, 19 Jul 2018 10:31:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g7G9FVu4Mg-G for ; Thu, 19 Jul 2018 10:31:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id F360A89D1E for ; Thu, 19 Jul 2018 10:31:27 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id v14-v6so7542656wro.5 for ; Thu, 19 Jul 2018 03:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kslAIq6IqR/n8s99Jb9k2+udac6ghXhrxXpXZX3qLSw=; b=sitiA7lIOi0OKu/60t6H8o9j/iDMmRA1QExPgxzw9Q6Gf5lmGQX7Sr1KzNtbKxcvga UrEoc/nTJQ9a2NtQB49j7ZxxazioD261G5o0HXqaPLMHls888ZPUtuSjop9SiJ4awK1E PtCWgzNi9pKJB++TH6OqrqirRg/+JG41II7BL4ShPIW4uXq8NtZJZbOqLNFA//2bsWj7 scWp4yl7mUhknAuuldO9/l1FIOLXJMyv+ahU0AqplLqx6LJrLf8rjtUQN9XNCT9y3m0v D9gCRIa62VqkdsiA3GmN61iyU8Fri4r1/xxQZMr4sw7J92a4x9WEeAy+D+WLQvzpIhy1 90nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kslAIq6IqR/n8s99Jb9k2+udac6ghXhrxXpXZX3qLSw=; b=uDxR0FvY54nCfeEXInZ4VW+KWl5fYXxcsycES98N/FXDCD3ZQNwKr79tjJvhFcKRF6 Bthv3i5tSgZjWdc7jr1oTlBlJcDNTo4J3DwBV5WofECTdwVvYPrDN66/4V/eSXPgtv63 e/mOtiNLY8QyUGxBXzmhQFvxmJLtPk0lCeSgImPvHaKBENQqQhHBc1+bI5u7paqaG/lE TqkhxTkcFfvXJhIC5uM8zYtdNFxLa30ba6KanniL0lrXhNuaXhgM23zgVuAIBPg410zi kCa2D8fNplEi1oFbUyvdKcM2N9AX5V079Evup46TROEJ69Jn0+YDBC+Vx42x/WnfGq9k rBZQ== X-Gm-Message-State: AOUpUlGm4b/GUbOw0U87W1bvXfegSPgMXVR3unhbKccUyQD1GBuPTrdj 5v0NlxeIAUncJpsFjaDFXx5EChMhKMw= X-Google-Smtp-Source: AAOMgpfQmMCUmaCfedH5vlHwukiq4PuVriXHlIbNBxALNFNlwH9WWp378WLvHHiQn36bhe+3U6/+Eg== X-Received: by 2002:adf:e491:: with SMTP id i17-v6mr7362476wrm.145.1531996286293; Thu, 19 Jul 2018 03:31:26 -0700 (PDT) Received: from g751.home (2a01cb040a78e30028cbd66b90cf39f4.ipv6.abo.wanadoo.fr. [2a01:cb04:a78:e300:28cb:d66b:90cf:39f4]) by smtp.googlemail.com with ESMTPSA id u4-v6sm11003723wrt.31.2018.07.19.03.31.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 03:31:25 -0700 (PDT) From: Gary Bisson To: buildroot@buildroot.org Date: Thu, 19 Jul 2018 12:31:08 +0200 Message-Id: <20180719103109.19887-7-gary.bisson@boundarydevices.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180719103109.19887-1-gary.bisson@boundarydevices.com> References: <20180719103109.19887-1-gary.bisson@boundarydevices.com> Subject: [Buildroot] [PATCH v2 6/7] board/boundarydevices: add i.MX8MQ support to u-boot scripts X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas.petazzoni@bootlin.com MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" - Update RAM address - Update kernel image name for ARM64 - Update U-Boot boot command for ARM64 - Remove obsolete cmd_xxx_present check - Remove obsolete wlan.mac parameter - Add cmd_mipi command for MIPI-DSI interface Signed-off-by: Gary Bisson --- board/boundarydevices/common/boot.cmd | 40 +++++++------- board/boundarydevices/common/upgrade.cmd | 69 +++++++++++++++++++++--- 2 files changed, 81 insertions(+), 28 deletions(-) diff --git a/board/boundarydevices/common/boot.cmd b/board/boundarydevices/common/boot.cmd index 7602b0139e..760363da9b 100644 --- a/board/boundarydevices/common/boot.cmd +++ b/board/boundarydevices/common/boot.cmd @@ -2,6 +2,8 @@ setenv bootargs '' setenv initrd_high 0xffffffff m4='' +kernelimage=zImage +bootcommand=bootz a_base=0x10000000 if itest.s x51 == "x${imx_cpu}" ; then a_base=0x90000000 @@ -9,10 +11,14 @@ elif itest.s x53 == "x${imx_cpu}"; then a_base=0x70000000 elif itest.s x6SX == "x${imx_cpu}" || itest.s x7D == "x${imx_cpu}"; then a_base=0x80000000 - if itest.s "x1" == "x$m4enabled" ; then - run m4boot; - m4='-m4'; - fi +elif itest.s x8MQ == "x${imx_cpu}"; then + a_base=0x40000000 + kernelimage=Image + bootcommand=booti +fi +if itest.s "x1" == "x${m4enabled}" ; then + run m4boot; + m4='-m4'; fi setexpr a_script ${a_base} + 0x00800000 @@ -39,10 +45,12 @@ if itest.s "x" == "x${fdt_file}" ; then fdt_file=imx6sx-${board}${m4}.dtb; elif itest.s x7D == "x${imx_cpu}" ; then fdt_file=imx7d-${board}${m4}.dtb; + elif itest.s x8MQ == "x${imx_cpu}" ; then + fdt_file=imx8mq-${board}${m4}.dtb; elif itest.s x51 == "x${imx_cpu}" ; then - fdt_file=imx51-${board}${m4}.dtb; + fdt_file=imx51-${board}.dtb; elif itest.s x53 == "x${imx_cpu}" ; then - fdt_file=imx53-${board}${m4}.dtb; + fdt_file=imx53-${board}.dtb; else fdt_file=imx6q-${board}.dtb; fi @@ -66,16 +74,12 @@ else exit; fi -cmd_xxx_present= fdt resize if itest.s "x" != "x${cmd_custom}" ; then run cmd_custom - cmd_xxx_present=1; fi - if itest.s "x" != "x${cmd_hdmi}" ; then run cmd_hdmi - cmd_xxx_present=1; if itest.s x == x${allow_noncea} ; then setenv bootargs ${bootargs} mxc_hdmi.only_cea=1; echo "only CEA modes allowed on HDMI port"; @@ -87,25 +91,18 @@ fi if itest.s "x" != "x${cmd_lcd}" ; then run cmd_lcd - cmd_xxx_present=1; fi if itest.s "x" != "x${cmd_lcd2}" ; then run cmd_lcd2 - cmd_xxx_present=1; fi if itest.s "x" != "x${cmd_lvds}" ; then run cmd_lvds - cmd_xxx_present=1; fi if itest.s "x" != "x${cmd_lvds2}" ; then run cmd_lvds2 - cmd_xxx_present=1; fi - -if itest.s "x" == "x${cmd_xxx_present}" ; then - echo "!!!!!!!!!!!!!!!!" - echo "warning: your u-boot may be outdated, please upgrade" - echo "!!!!!!!!!!!!!!!!" +if itest.s "x" != "x${cmd_mipi}" ; then + run cmd_mipi fi if test "sata" = "${devtype}" ; then @@ -126,7 +123,6 @@ fi if itest.s "x" != "x${wlmac}" ; then setenv bootargs ${bootargs} wlcore.mac=${wlmac} - setenv bootargs ${bootargs} wlan.mac=${wlmac} fi if itest.s "x" != "x${gpumem}" ; then @@ -149,7 +145,7 @@ if itest.s "x" != "x${show_env}" ; then printenv fi -if load ${devtype} ${devnum}:${distro_bootpart} ${a_zImage} ${prefix}zImage ; then - bootz ${a_zImage} - ${a_fdt} +if load ${devtype} ${devnum}:${distro_bootpart} ${a_zImage} ${prefix}${kernelimage} ; then + ${bootcommand} ${a_zImage} - ${a_fdt} fi echo "Error loading kernel image" diff --git a/board/boundarydevices/common/upgrade.cmd b/board/boundarydevices/common/upgrade.cmd index 249185dba4..24b705eb76 100644 --- a/board/boundarydevices/common/upgrade.cmd +++ b/board/boundarydevices/common/upgrade.cmd @@ -7,6 +7,7 @@ offset=0x400 erase_size=0xC0000 qspi_offset=0x0 a_base=0x12000000 +block_size=0x200 if itest.s x51 == "x${imx_cpu}"; then a_base=0x92000000 @@ -14,6 +15,9 @@ elif itest.s x53 == "x${imx_cpu}"; then a_base=0x72000000 elif itest.s x6SX == "x${imx_cpu}" || itest.s x7D == "x${imx_cpu}"; then a_base=0x82000000 +elif itest.s x8MQ == "x${imx_cpu}"; then + a_base=0x42000000 + offset=0x8400 fi qspi_match=1 @@ -25,6 +29,54 @@ setexpr a_script ${a_base} setenv stdout serial,vga +if itest.s "x${sfname}" == "x" ; then +# U-Boot resides in (e)MMC +if itest.s "x${env_dev}" == "x" || itest.s "x${env_part}" == "x"; then + echo "Please set env_dev/part to the appropriate values" + exit +fi + +# Load bootloader binary for this board +if ${fs}load ${devtype} ${devnum}:${distro_bootpart} ${a_uImage1} u-boot.$uboot_defconfig ; then +else + echo "File u-boot.$uboot_defconfig not found on SD card" ; + exit +fi + +# Compute block count for filesize and offset +setexpr cntoffset ${offset} / ${block_size} +setexpr cntfile ${filesize} / ${block_size} +# Add 1 in case the $filesize is not a multiple of $block_size +setexpr cntfile ${cntfile} + 1 + +# Select media partition (if different from main partition) +mmc dev ${env_dev} ${env_part} + +# Read and compare current U-Boot +mmc read ${a_uImage2} ${cntoffset} ${cntfile} +if cmp.b ${a_uImage1} ${a_uImage2} ${filesize} ; then + echo "------- U-Boot versions match" ; + exit ; +fi + +echo "Need U-Boot upgrade" ; +echo "Program in 5 seconds" ; +for n in 5 4 3 2 1 ; do + echo $n ; + sleep 1 ; +done +mmc write ${a_uImage1} ${cntoffset} ${cntfile} + +# Make sure to boot from the proper partition +if itest ${env_part} != 0 ; then + mmc partconf ${env_dev} 1 ${env_part} 0 +fi + +# Switch back to main eMMC partition (to avoid confusion) +mmc dev ${env_dev} + +else +# U-Boot resides in NOR flash if sf probe || sf probe || sf probe 1 27000000 || sf probe 1 27000000 ; then echo "probed SPI ROM" ; else @@ -32,9 +84,13 @@ else exit fi +if itest.s "x${sfname}" == "xat45db041d" ; then + erase_size=0x7e000 +fi + if itest.s x7D == "x${imx_cpu}"; then echo "check qspi parameter block" ; - if ${fs}load ${devtype} ${devnum}:1 ${a_qspi1} qspi-${sfname}.${uboot_defconfig} ; then + if ${fs}load ${devtype} ${devnum}:${distro_bootpart} ${a_qspi1} qspi-${sfname}.${uboot_defconfig} ; then else echo "parameter file qspi-${sfname}.${uboot_defconfig} not found on SD card" exit @@ -63,7 +119,7 @@ fi echo "check U-Boot" ; -if ${fs}load ${devtype} ${devnum}:1 ${a_uImage1} u-boot.$uboot_defconfig ; then +if ${fs}load ${devtype} ${devnum}:${distro_bootpart} ${a_uImage1} u-boot.$uboot_defconfig ; then else echo "File u-boot.$uboot_defconfig not found on SD card" ; exit @@ -80,7 +136,7 @@ if cmp.b ${a_uImage1} ${a_uImage2} $filesize ; then if itest.s "${qspi_match}" == "1" ; then echo "------- upgrade not needed" ; if itest.s "x" != "x${next}" ; then - if ${fs}load ${devtype} ${devnum}:1 ${a_script} ${next} ; then + if ${fs}load ${devtype} ${devnum}:${distro_bootpart} ${a_script} ${next} ; then source ${a_script} else echo "${next} not found on SD card" @@ -142,13 +198,14 @@ if itest.s x7D == "x${imx_cpu}"; then fi if itest.s "x" != "x${next}" ; then - if ${fs}load ${devtype} ${devnum}:1 ${a_script} ${next} ; then + if ${fs}load ${devtype} ${devnum}:${distro_bootpart} ${a_script} ${next} ; then source ${a_script} else - echo "${next} not found on ${devtype} ${devnum}" + echo "${next} not found on ${devtype} ${devnum}:${distro_bootpart}" fi fi +fi -while echo "---- U-Boot upgraded. reset" ; do +while echo "---- U-Boot upgraded. Please reset the board" ; do sleep 120 done