From patchwork Mon Feb 3 09:19:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11362297 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 58E69138D for ; Mon, 3 Feb 2020 09:19:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8A3820721 for ; Mon, 3 Feb 2020 09:19:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n46mbsiL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="QUBn1HOB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8A3820721 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wMbQ8APN0e6UTV5AbTwUZOqgg/j/y1yi4DRQZ3Cg/NM=; b=n46mbsiLhWS71l jWRGxqcbh2xaUTJN7TN8tkoVai6mZvu+74wX326nCDp+6wCg6WVmd9nOv+/D15ciQEpsKXulDpLts cFTerCKPZ3eba6tHKgxuzy+lNDAdYY74NM1l2hZRRmpA5G6/UOQVxFfs5J0E2Rz2k3/qbod5MuLmB 7bzOx7Jow7QnHQfCYtqXKBrSGDx9g8OZM4712kPuxRQLgX7ESaYfMRtWCJwFA6BeT5k/s8scr2YZS J8Iubq0P8NPbgPyFgSs5jdHB/a4bFsiHMGtXGe+fbJqJMmt/88ZjXgEYdVm8byrrUJz+xfs16Jevp kfdazDDxbexvayM3wXdA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyXtQ-0000uO-Ft; Mon, 03 Feb 2020 09:19:44 +0000 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyXtN-0000tY-4n for linux-rockchip@lists.infradead.org; Mon, 03 Feb 2020 09:19:42 +0000 Received: by mail-pj1-x1041.google.com with SMTP id q39so6134529pjc.0 for ; Mon, 03 Feb 2020 01:19:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KrEOf2RWwYNFbhGzPdZ9kcko1qdFahrtFrFx8lHe2qU=; b=QUBn1HOBtoCVH4AXUlm3iVYkIyo+vF3uIzlKcYBnUabjQfQhu8aSd/TsvLKCRPBhL3 2n7/noy1XQkE7d7y3q/nS1S1Tleoe/J8zDOmqsERSEAmXRjfaw4JZGTTG5qUg6IWb9+U nyfrDhABv/ArAylMrX06RcNyPjUvDf+d+VmCQ= 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:mime-version :content-transfer-encoding; bh=KrEOf2RWwYNFbhGzPdZ9kcko1qdFahrtFrFx8lHe2qU=; b=kswGVHueieHrpZ6SzfxDJk/QQ8Ions+eOFqMEay4triFwHRH6/J3Q4axkUus0bAx/F kDBQ2Vb05okHGCYThxScwIr362y3mBq8Df6QVy6E2yNF7sDs+7AYSVoj06mrClX55KnR hFdVlQEAJNNugSZ/AAprqC1F1vxVtmCyyJ4HYeEGVuZHBMD66FHYGsFUVwCI73MaMPHg W2JxC5Adl8h38r/oFacZwmO+Oo+V/zpbnwYUP2XQUnCyAalfz4ofYkZ81NwoA4R2a1oM V1JydHfSsd7NWOmak6ziNOJiU3lfLuZTNJRCqLDuRzU8KkmeQbTqnz1Q+Gg5s2PwB9xe 2a8Q== X-Gm-Message-State: APjAAAWSNybszwkgPWw1xeZMJnsdAu5t9v6j3N7gwWIDLs9k+f+TXk++ qdfdQI9tCU90MteAf8u5M/WtVg== X-Google-Smtp-Source: APXvYqxr8fNczV2tsI9wZJz/HqN4Z8ckIPwjOBI2NskruKVvIARfL4Xx/Qt7YgHLI5z+Q8mb4aQRKA== X-Received: by 2002:a17:90b:14a:: with SMTP id em10mr28344453pjb.4.1580721579993; Mon, 03 Feb 2020 01:19:39 -0800 (PST) Received: from localhost.localdomain ([49.206.202.24]) by smtp.gmail.com with ESMTPSA id w11sm18828318pfn.4.2020.02.03.01.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 01:19:39 -0800 (PST) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Subject: [PATCH 1/2] rk3399: Add boot flash script offet, size Date: Mon, 3 Feb 2020 14:49:23 +0530 Message-Id: <20200203091924.15385-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200203_011941_624345_187F896C X-CRM114-Status: UNSURE ( 7.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Most of the SPI flash devices in rockchip (rk3399) are 16MiB size. So, let's use the script offset at the end of 8K.  This way it cannot overlap any offsets being used by software components in flash layout. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- include/configs/rk3399_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index 89a8a44bbe..01a9174bd2 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -48,6 +48,8 @@ #define ENV_MEM_LAYOUT_SETTINGS \ "scriptaddr=0x00500000\0" \ + "script_offset_f=0xffe000\0" \ + "script_size_f=0x2000\0" \ "pxefile_addr_r=0x00600000\0" \ "fdt_addr_r=0x01f00000\0" \ "kernel_addr_r=0x02080000\0" \ From patchwork Mon Feb 3 09:19:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11362299 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0AE07138D for ; Mon, 3 Feb 2020 09:19:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBE1F2070A for ; Mon, 3 Feb 2020 09:19:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rbPUKqQR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="aaYFtZ8f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBE1F2070A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=LGMyRtHLQ+sDXLyaX4r1DndbZmLZUyZh38Cq3WCM/I8=; b=rbPUKqQRRyW/wOC81KUkhzpmfB PiE3FyMrolJARL/2iQEeev3GDiZwcSmHnE6VoGNteIsnzUsUGH4uU3TYpoEWXv4k5Qkp5vPV7rEJg TnZIJDa07SYU480IBnMm5K3lnBshmj69W9JVgyJzFuv1K7cer9v6l7HrdVydworg/bnLrUqtStGEM 31iaaPSVNWL2n9HKBV7LLCQDC/ExkC2qOICQcg4ZMDTzTXNkaOqRaotKhVFrKSOlXsHJCnaKhwRh1 jpF/OUhU0afa2nM2Y5NdYHPNEnxGZsM/lxWrfsUUC2tb/aqJnucDVNo4VEv7k/vjjkYqKlTIqz6Nr CMs29xOg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyXtS-0000v8-S9; Mon, 03 Feb 2020 09:19:46 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iyXtP-0000uA-WF for linux-rockchip@lists.infradead.org; Mon, 03 Feb 2020 09:19:45 +0000 Received: by mail-pj1-x1044.google.com with SMTP id r67so6061183pjb.0 for ; Mon, 03 Feb 2020 01:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AlBeKrVei/i3cKvKx+SZQOUbyUG1KJm4RFMeGSev+1c=; b=aaYFtZ8fTE3NQdIZ+7fhhuNa9atWIWXDaF5mBaB/EEt8GOxxoLncecGM5HiVu/R5bd lXfOmVVZXfjvyoScsZAQCBeYEkkiEN6d96XZETiO494YCGWi/j1N6F9EJ/Oa/LCjDcXS bP5NfXYGYxlCG4dgEkoOnVZ2s3N7XKbt6HC0Y= 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=AlBeKrVei/i3cKvKx+SZQOUbyUG1KJm4RFMeGSev+1c=; b=Tt87D4ZhKEUsoiYDRXobgO/ujORqVNhH8I1pCIS551FMNHZrReritKkwnCVjRHJUu8 xRxJWVc58I8cqt5I2+CBCmgWZWk9x+s4tjkzmUdGiRRUxAHKqZkLMO04TauiqpU3rw0W Gp4ovtDlwHZ1La+QlQwqMgk0WU1VqsIWybEsnEukrAU1o8tZBTcsiJUrGqcGkaoEG3PD U4MeFs8Kbj6ODwbIMgtJZeloN2lUeJKSKiUCyktKwRACN1JQL00x75UkViW1rPhyIj7x 15KRKpk8vOdbgJGl+OMdl4Z7FZLnV4SG7xFDDRs/L24tVISsgvWRAzAaL7cFXAEVyAzy Vbtg== X-Gm-Message-State: APjAAAUsnMLSxP/FQD38TgAQgLeQmKbK5EZA/ylNjD0IhzzfyFA7qp4e q7Vp8TvKNfzoFdsiJpWGBGnPjMj6OnA= X-Google-Smtp-Source: APXvYqxdnjMdnjapp0uWViqs8leXaiZgUB3KUZwOqIkzvuHi8ecBTnFIyglbmtjA+ooptHIoWLnteg== X-Received: by 2002:a17:902:654d:: with SMTP id d13mr21745391pln.187.1580721583258; Mon, 03 Feb 2020 01:19:43 -0800 (PST) Received: from localhost.localdomain ([49.206.202.24]) by smtp.gmail.com with ESMTPSA id w11sm18828318pfn.4.2020.02.03.01.19.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 01:19:42 -0800 (PST) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Subject: [PATCH 2/2] rockchip: Add SF distro bootcmd Date: Mon, 3 Feb 2020 14:49:24 +0530 Message-Id: <20200203091924.15385-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200203091924.15385-1-jagan@amarulasolutions.com> References: <20200203091924.15385-1-jagan@amarulasolutions.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200203_011944_034513_0DA512FC X-CRM114-Status: GOOD ( 12.13 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , linux-rockchip@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Add distro boot command support for SPI flash in Rockchip. This distro boot will read the boot script at specific location at the flash and start sourcing the same. Included the SF device at the last of the target devices list since all the rest of the devices on the list have more possibility to boot the distribution due to the size of the SPI flash is concern. Signed-off-by: Jagan Teki --- include/configs/rockchip-common.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h index b55e09a9ca..8e7c994266 100644 --- a/include/configs/rockchip-common.h +++ b/include/configs/rockchip-common.h @@ -41,11 +41,26 @@ #define BOOT_TARGET_DHCP(func) #endif +#if CONFIG_IS_ENABLED(CMD_SF) + #define BOOT_TARGET_SF(func) func(SF, sf, na) +#else + #define BOOT_TARGET_SF(func) +#endif + +#define BOOTENV_DEV_SF(devtypeu, devtypel, instance) \ + "bootcmd_sf=sf probe 0 0 0 && " \ + "sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && " \ + "source ${scriptaddr}; echo SCRIPT FAILED: continuing...;\0" + +#define BOOTENV_DEV_NAME_SF(devtypeu, devtypel, instance) \ + "sf " + #define BOOT_TARGET_DEVICES(func) \ BOOT_TARGET_MMC(func) \ BOOT_TARGET_USB(func) \ BOOT_TARGET_PXE(func) \ - BOOT_TARGET_DHCP(func) + BOOT_TARGET_DHCP(func) \ + BOOT_TARGET_SF(func) #ifdef CONFIG_ARM64 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"