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: 1232665 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=QUBn1HOB; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 48B2NG2cMTz9sRh for ; Mon, 3 Feb 2020 20:19:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 51643806F7; Mon, 3 Feb 2020 10:19:46 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="QUBn1HOB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0DD7E8067D; Mon, 3 Feb 2020 10:19:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D4BB08067D for ; Mon, 3 Feb 2020 10:19:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pj1-x1042.google.com with SMTP id m13so6136731pjb.2 for ; Mon, 03 Feb 2020 01:19:41 -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=njloR6RnzBzwuajhnMFpJCPE7u99uFz5ka4i0f0tAv5nrjJumFRzHJHv0T4l41LSSx MoKfIaAG7kMa6JQpriBrO/cUfiDvPubTYVvHtsTIe/i/gI7+29OUlMpdGoGnS90CeZOq 3JDfcUBj+g83nDsymTdu3egd/c4KXsQpT51E60uf1sp8Fm64Haz8j+bUCIelklYX/bZ9 X7fRis8fPAWIRaAntLxuXNWpSL08/VzAh1Irg85FVttVTQeZTMyEvKbrDp/tHkXy07z9 O+p0g/J1TzinmnjfPN199MHxMejRBZcE/S3ciYgkwftGT/AWuFz28XkIU/DdYArek434 jXHw== X-Gm-Message-State: APjAAAX7+M0DiFuU2GDRI8pIyi+O9sDqT7e2Ecbo4hT3I8mAbmSxopx1 g1aOq7QQ1lkKioZhIIidHmQKtQ== 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-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, linux-rockchip@lists.infradead.org Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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: 1232666 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=aaYFtZ8f; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48B2NL215gz9sRm for ; Mon, 3 Feb 2020 20:20:02 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 30023816E1; Mon, 3 Feb 2020 10:19:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="aaYFtZ8f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B8D068183D; Mon, 3 Feb 2020 10:19:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D231281496 for ; Mon, 3 Feb 2020 10:19:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pj1-x1042.google.com with SMTP id m13so6136803pjb.2 for ; Mon, 03 Feb 2020 01:19:44 -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=YzD5BxYKtUjtIXdyt82t5ePhk71Hm+esT/Cd453nwyeBIERf6yM/cuFK9ZY6UtJu95 CxNj2jaZvQfFzO8BtZDsw7iEKZU8wZXbNIO9jNxJvNrptUkcPF32Nmxdh8mYJZYAAF9M DGdEwSku763ZVLSLeTr3qZnxKphrMIuyOmO7yct56JDUfYMIAcOBC55jtNCoMN367KCR 1u9RxOomYBvw9xFK5hX5uBp/zFrKvc4ESJhk8/Yacu2zvihnw+d/dsvewn9RPQMT7eBL QCF/zz3GBMsDPmH2JlFj/mtSBPZtOlfHio6eVsaPuJB8E0grABDLFAXVPCmw4WDz9Kfb U/Fg== X-Gm-Message-State: APjAAAVJeb/jKiVE00TBid2HlJYA8NhzE1wlAZX6+Ngx3Cfue6/ooM0T kf5Hw0cSlLTGoLRaPO9tu1QjVg== 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-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, linux-rockchip@lists.infradead.org Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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"