From patchwork Mon Apr 26 15:30:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 1470346 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=boundarydevices.com header.i=@boundarydevices.com header.a=rsa-sha256 header.s=google header.b=AKOr+mhr; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FTTPN3pJgz9sXH for ; Tue, 27 Apr 2021 01:30:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 57DD6403A3; Mon, 26 Apr 2021 15:30:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UOHBQbAdPwSV; Mon, 26 Apr 2021 15:30:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 2390D403A4; Mon, 26 Apr 2021 15:30:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 38D8C1BF300 for ; Mon, 26 Apr 2021 15:30:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 27C17403A4 for ; Mon, 26 Apr 2021 15:30:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6iWk_FYf2Twf for ; Mon, 26 Apr 2021 15:30:30 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by smtp4.osuosl.org (Postfix) with ESMTPS id E9B2B403A3 for ; Mon, 26 Apr 2021 15:30:29 +0000 (UTC) Received: by mail-wr1-x433.google.com with SMTP id h15so4089480wre.11 for ; Mon, 26 Apr 2021 08:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=an1iKvFvmJA6Qr/5aD8zatZCvFtcD3JbV+IBUK/DvZw=; b=AKOr+mhrI1ArYVfzNjRLxFPSigm4nyYivtsN+1OBcj2nm2A1btF3gV8asE7IxKSKlb 0dfsuRZVPVU4t9vLx6+Ys/+msA3772aFsU/4WF7V6V2MZBi71sMt5UJq2oaHepKCli/j vcxV8yYvhETjc35IFzo6dK4PVIiWSvQT/o4lg= 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:mime-version:content-transfer-encoding; bh=an1iKvFvmJA6Qr/5aD8zatZCvFtcD3JbV+IBUK/DvZw=; b=f9jAzU3Ac5Z/fj4HwaoZ6I8FbbBT23E4gfiVz6k/7NXVW7MMPYUarDAilr+yMWJ26t j8O635MJg+IxqNZRSCpYTGmOMZHRuufNmSwYxa4pjjVJncLnHaP3on/gBqwp1+LGXDCI uaVU+e1ZKjbbAXRJHYL57y1Y0AoJiN9t3pQl8MQq99XUcpKnUhoWsm5mrJzIImlUA0y7 hwv7BIbTtUWR7nfctEIvOzwUhBtNPZyPiGlZ7yYG4rZeSsAXM0viidvPSI4HEjeBKMYP HxZgBir6Gl5v8zMBHh0X1elXweoQCvkSmNSNr9fPsm4XnwL7SOch8KsYiTb4QolyKLvS TCsg== X-Gm-Message-State: AOAM533dDEvcs2HqnU3DdVTnJvqD58gzUQfoh0gERm053oHniaUzKlOy gHaxiuGPRIfF0eSCzXlgNgmwv7uWK5B8oHrE X-Google-Smtp-Source: ABdhPJx23/uY7BuF+s3u9y/JD5f+GmGUk4jmwBEaloNB/gOhYv/eoqgbHXlE816I57P+ydTno03LVg== X-Received: by 2002:a5d:4fc7:: with SMTP id h7mr24116266wrw.23.1619451027800; Mon, 26 Apr 2021 08:30:27 -0700 (PDT) Received: from p1g2.home (2a01cb000f557f0046a6b886ee605a0e.ipv6.abo.wanadoo.fr. [2a01:cb00:f55:7f00:46a6:b886:ee60:5a0e]) by smtp.gmail.com with ESMTPSA id y16sm383726wrp.78.2021.04.26.08.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 08:30:27 -0700 (PDT) From: Gary Bisson To: buildroot@buildroot.org Date: Mon, 26 Apr 2021 17:30:16 +0200 Message-Id: <20210426153019.1431844-2-gary.bisson@boundarydevices.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210426153019.1431844-1-gary.bisson@boundarydevices.com> References: <20210426153019.1431844-1-gary.bisson@boundarydevices.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/4] board/boundarydevices: update boot scripts X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gary Bisson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" - Add support for 8M Plus CPU (A1 and A0 silicon) - Simplify cpu type parsing - Update to be closer to Yocto counterpart Signed-off-by: Gary Bisson --- board/boundarydevices/common/boot.cmd | 65 ++++++++++++++---------- board/boundarydevices/common/upgrade.cmd | 25 ++++++--- 2 files changed, 56 insertions(+), 34 deletions(-) diff --git a/board/boundarydevices/common/boot.cmd b/board/boundarydevices/common/boot.cmd index dbc3b3c373..2f2bd8d045 100644 --- a/board/boundarydevices/common/boot.cmd +++ b/board/boundarydevices/common/boot.cmd @@ -1,17 +1,20 @@ setenv bootargs '' -setenv initrd_high 0xffffffff m4='' kernelimage=zImage bootcommand=bootz a_base=0x10000000 -if itest.s x51 == "x${imx_cpu}" ; then + +#grab 1st 2/3 characters of string +setexpr cpu2 sub "^(..?).*" "\\1" "${imx_cpu}" +setexpr cpu3 sub "^(..?.?).*" "\\1" "${imx_cpu}" +if itest.s x51 == "x${cpu2}" ; then a_base=0x90000000 -elif itest.s x53 == "x${imx_cpu}"; then +elif itest.s x53 == "x${cpu2}"; then a_base=0x70000000 -elif itest.s x6SX == "x${imx_cpu}" || itest.s x6ULL == "x${imx_cpu}" || itest.s x7D == "x${imx_cpu}"; then +elif itest.s x6SX == "x${cpu3}" || itest.s x6U == "x${cpu2}" || itest.s x7D == "x${cpu2}"; then a_base=0x80000000 -elif itest.s x8MQ == "x${imx_cpu}" || itest.s x8MM == "x${imx_cpu}" || itest.s x8MMQ == "x${imx_cpu}" || itest.s x8MNano == "x${imx_cpu}"; then +elif itest.s x8M == "x${cpu2}"; then a_base=0x40000000 kernelimage=Image bootcommand=booti @@ -24,8 +27,7 @@ fi setexpr a_script ${a_base} + 0x00800000 setexpr a_zImage ${a_base} + 0x00800000 setexpr a_fdt ${a_base} + 0x03000000 -setexpr a_ramdisk ${a_base} + 0x03800000 -setexpr a_initrd ${a_base} + 0x03a00000 +setexpr a_initrd ${a_base} + 0x03100000 setexpr a_reset_cause_marker ${a_base} + 0x80 setexpr a_reset_cause ${a_base} + 0x84 @@ -35,30 +37,32 @@ if itest.s "x" == "x${board}" ; then fi if itest.s "x" == "x${fdt_file}" ; then - if itest.s x6SOLO == "x${imx_cpu}" ; then - fdt_file=imx6dl-${board}.dtb; - elif itest.s x6DL == "x${imx_cpu}" ; then + if itest.s x51 == "x${cpu2}" ; then + fdt_file=imx51-${board}${m4}.dtb; + elif itest.s x53 == "x${cpu2}" ; then + fdt_file=imx53-${board}${m4}.dtb; + elif itest.s x6DL == "x${cpu3}" || itest.s x6SO == "x${cpu3}" ; then fdt_file=imx6dl-${board}.dtb; - elif itest.s x6QP == "x${imx_cpu}" ; then + elif itest.s x6QP == "x${cpu3}" ; then fdt_file=imx6qp-${board}.dtb; - elif itest.s x6SX == "x${imx_cpu}" ; then + elif itest.s x6SX == "x${cpu3}" ; then fdt_file=imx6sx-${board}${m4}.dtb; - elif itest.s x6ULL == "x${imx_cpu}" ; then + elif itest.s x6UL == "x${cpu3}" ; then fdt_file=imx6ull-${board}.dtb; - elif itest.s x7D == "x${imx_cpu}" ; then + elif itest.s x7D == "x${cpu2}" ; then fdt_file=imx7d-${board}${m4}.dtb; - elif itest.s x8MQ == "x${imx_cpu}" ; then - fdt_file=imx8mq-${board}${m4}.dtb; - elif itest.s x8MM == "x${imx_cpu}" ; then + elif itest.s x8MM == "x${cpu3}" ; then fdt_file=imx8mm-${board}${m4}.dtb; - elif itest.s x8MMQ == "x${imx_cpu}" ; then - fdt_file=imx8mm-${board}${m4}.dtb; - elif itest.s x8MNano == "x${imx_cpu}" ; then + elif itest.s x8MN == "x${cpu3}" ; then fdt_file=imx8mn-${board}${m4}.dtb; - elif itest.s x51 == "x${imx_cpu}" ; then - fdt_file=imx51-${board}.dtb; - elif itest.s x53 == "x${imx_cpu}" ; then - fdt_file=imx53-${board}.dtb; + elif itest.s x8MP == "x${cpu3}" ; then + if itest *0x30360800 == 0x00824310 ; then + fdt_file=imx8mp-a0-${board}${m4}.dtb; + else + fdt_file=imx8mp-${board}${m4}.dtb; + fi + elif itest.s x8MQ == "x${cpu3}" ; then + fdt_file=imx8mq-${board}${m4}.dtb; else fdt_file=imx6q-${board}.dtb; fi @@ -71,11 +75,20 @@ fi if load ${devtype} ${devnum}:${distro_bootpart} ${a_script} uEnv.txt ; then env import -t ${a_script} ${filesize} fi -setenv bootargs ${bootargs} console=${console},115200 vmalloc=400M consoleblank=0 rootwait fixrtc cpu=${imx_cpu} board=${board} + +if itest.s x${console} != x ; then + setenv bootargs ${bootargs} console=${console},115200 +fi +if itest.s "x" == "x$vmalloc" ; then + vmalloc=400M +fi +if itest.s x${consoleblank} == x ; then + consoleblank=0 +fi +setenv bootargs ${bootargs} vmalloc=${vmalloc} consoleblank=${consoleblank} rootwait fixrtc cpu=${imx_cpu} board=${board} uboot_release=${uboot_release} if load ${devtype} ${devnum}:${distro_bootpart} ${a_fdt} ${prefix}${fdt_file} ; then fdt addr ${a_fdt} - setenv fdt_high 0xffffffff else echo "!!!! Error loading ${prefix}${fdt_file}"; exit; diff --git a/board/boundarydevices/common/upgrade.cmd b/board/boundarydevices/common/upgrade.cmd index ce32d77b5b..a26bacd9aa 100644 --- a/board/boundarydevices/common/upgrade.cmd +++ b/board/boundarydevices/common/upgrade.cmd @@ -9,18 +9,24 @@ qspi_offset=0x0 a_base=0x12000000 block_size=0x200 -if itest.s x51 == "x${imx_cpu}"; then +#grab 1st 2/3 characters of string +setexpr cpu2 sub "^(..?).*" "\\1" "${imx_cpu}" +setexpr cpu3 sub "^(..?.?).*" "\\1" "${imx_cpu}" +if itest.s x51 == "x${cpu2}"; then a_base=0x92000000 -elif itest.s x53 == "x${imx_cpu}"; then +elif itest.s x53 == "x${cpu2}"; then a_base=0x72000000 -elif itest.s x6SX == "x${imx_cpu}" || itest.s x6ULL == "x${imx_cpu}" || itest.s x7D == "x${imx_cpu}"; then +elif itest.s x6SX == "x${cpu3}" || itest.s x6U == "x${cpu2}" || itest.s x7D == "x${cpu2}"; then a_base=0x82000000 -elif itest.s x8MQ == "x${imx_cpu}" || itest.s x8MM == "x${imx_cpu}" || itest.s x8MMQ == "x${imx_cpu}"; then +elif itest.s x8M == "x${cpu2}"; then a_base=0x42000000 offset=0x8400 -elif itest.s x8MNano == "x${imx_cpu}"; then - a_base=0x42000000 - offset=0x8000 + if itest.s x8MN == "x${cpu3}" || itest.s x8MP == "x${cpu3}"; then + offset=0x8000 + if itest ${env_part} != 0 ; then + offset=0x0 + fi + fi fi qspi_match=1 @@ -30,7 +36,10 @@ setexpr a_uImage1 ${a_qspi1} + 0x400 setexpr a_uImage2 ${a_qspi2} + 0x400 setexpr a_script ${a_base} -setenv stdout serial,vga +if itest.s "x${vidconsole}" == "x" ; then + vidconsole=vga +fi +setenv stdout serial,${vidconsole} if itest.s "x${sfname}" == "x" ; then # U-Boot resides in (e)MMC