From patchwork Wed Jun 3 15:15:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Juszkiewicz X-Patchwork-Id: 1303064 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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=juszkiewicz.com.pl Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=juszkiewicz.com.pl header.i=@juszkiewicz.com.pl header.a=rsa-sha256 header.s=mail header.b=TJC29Aaq; dkim=fail reason="signature verification failed" (1024-bit key) header.d=juszkiewicz.com.pl header.i=@juszkiewicz.com.pl header.a=rsa-sha256 header.s=mail header.b=VJRYiUjy; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 49cXXj2tNvz9sRK for ; Thu, 4 Jun 2020 01:15:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 77A8C81D73; Wed, 3 Jun 2020 17:15:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=juszkiewicz.com.pl 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=juszkiewicz.com.pl header.i=@juszkiewicz.com.pl header.b="TJC29Aaq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=juszkiewicz.com.pl header.i=@juszkiewicz.com.pl header.b="VJRYiUjy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 454CC81D7B; Wed, 3 Jun 2020 17:15:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [213.251.184.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F04C581D89 for ; Wed, 3 Jun 2020 17:15:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=juszkiewicz.com.pl Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marcin@juszkiewicz.com.pl Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id 5B81A26199D; Wed, 3 Jun 2020 17:15:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=juszkiewicz.com.pl; s=mail; t=1591197322; bh=7/LhGiVyZszR+jVgzpIRV+SB+LAhJ5FquGRyxBb7Ndk=; h=From:To:Cc:Subject:Date:From; b=TJC29AaqiXyNPexksSYPsr/dSxXEY5qpfztT7E+4LT7ng2/CULGH/cpA18Kilnc0u EFv0mrcqGiimyg+YIR1AL1rJus0O1+iai/0zOltyA2AgkslsJyZxP/P/FU+suZNLMn UKlk8Mej/dCsiRgWb5ynETY7CMO8gKl7Z6alyLbE= Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6jdvajWVhAut; Wed, 3 Jun 2020 17:15:20 +0200 (CEST) Received: from puchatek.local.com.pl (89-67-26-161.dynamic.chello.pl [89.67.26.161]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 40808261952; Wed, 3 Jun 2020 17:15:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=juszkiewicz.com.pl; s=mail; t=1591197320; bh=7/LhGiVyZszR+jVgzpIRV+SB+LAhJ5FquGRyxBb7Ndk=; h=From:To:Cc:Subject:Date:From; b=VJRYiUjy4IVnqGfvOvwodEsnvTu80nRJMMetJE4zdK7UHR1XmQagN+Rpue/a1pEDo bqasM6Qkbd7AifwIViossH8A0pUkGsdK2cFIV8Nj106ZBb/fUg7fRiHwVgY4n3++Xi r7QiQukWKdCu9EcbO/OZveNru87q/Mo/umRoEE5M= From: Marcin Juszkiewicz To: u-boot@lists.denx.de Cc: Marcin Juszkiewicz Subject: [PATCH 1/2] rockchip: rockpro64: Store default env into SPI Date: Wed, 3 Jun 2020 17:15:12 +0200 Message-Id: <20200603151513.3528522-1-marcin@juszkiewicz.com.pl> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Board has flash chip on board so let store U-Boot environment there. Signed-off-by: Marcin Juszkiewicz Reviewed-by: Kever Yang --- configs/rockpro64-rk3399_defconfig | 3 ++- include/configs/rockpro64_rk3399.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git configs/rockpro64-rk3399_defconfig configs/rockpro64-rk3399_defconfig index 8c4b2f35c1..72389d0e60 100644 --- configs/rockpro64-rk3399_defconfig +++ configs/rockpro64-rk3399_defconfig @@ -1,6 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x00200000 +CONFIG_ENV_SIZE=0x8000 CONFIG_ENV_OFFSET=0x3F8000 CONFIG_ROCKCHIP_RK3399=y CONFIG_TARGET_ROCKPRO64_RK3399=y @@ -24,7 +25,7 @@ CONFIG_CMD_TIME=y CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="rk3399-rockpro64" CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -CONFIG_ENV_IS_IN_MMC=y +CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y diff --git include/configs/rockpro64_rk3399.h include/configs/rockpro64_rk3399.h index 37a08b2c00..903e9df527 100644 --- include/configs/rockpro64_rk3399.h +++ include/configs/rockpro64_rk3399.h @@ -13,8 +13,6 @@ #include -#define CONFIG_SYS_MMC_ENV_DEV 0 - #define SDRAM_BANK_SIZE (2UL << 30) #define CONFIG_USB_OHCI_NEW From patchwork Wed Jun 3 15:15:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Juszkiewicz X-Patchwork-Id: 1303065 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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=juszkiewicz.com.pl Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=juszkiewicz.com.pl header.i=@juszkiewicz.com.pl header.a=rsa-sha256 header.s=mail header.b=DWO9E7So; dkim=fail reason="signature verification failed" (1024-bit key) header.d=juszkiewicz.com.pl header.i=@juszkiewicz.com.pl header.a=rsa-sha256 header.s=mail header.b=bR9aAkmx; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 49cXXw2w8yz9sRK for ; Thu, 4 Jun 2020 01:15:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CBC5781D8C; Wed, 3 Jun 2020 17:15:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=juszkiewicz.com.pl 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=juszkiewicz.com.pl header.i=@juszkiewicz.com.pl header.b="DWO9E7So"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=juszkiewicz.com.pl header.i=@juszkiewicz.com.pl header.b="bR9aAkmx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 92F4081D73; Wed, 3 Jun 2020 17:15:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from muminek.juszkiewicz.com.pl (muminek.juszkiewicz.com.pl [IPv6:2001:41d0:1:43dd::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4274B81D8C for ; Wed, 3 Jun 2020 17:15:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=juszkiewicz.com.pl Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marcin@juszkiewicz.com.pl Received: from localhost (localhost [127.0.0.1]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTP id AAB1A261952; Wed, 3 Jun 2020 17:15:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=juszkiewicz.com.pl; s=mail; t=1591197322; bh=RvE4hxMAIrtI8emNvOJoATrawXOMkCiuH8oRmIQw/Wk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DWO9E7SopDFA6dEL9oxT9mHVHSa9qhVfJrfijDZkFR2yDoINUFVeaHRX8Jlmosuam XUodQlKo8qyPAdXhF0RoK3RJKw9lcL2+vEKW4Hd76ExYRrkCRoGm7GBSbibjuWU3u/ 6B+ZHu0wnDHeRfeBvRwzk4030EMwK6ulY1XK9+lU= Received: from muminek.juszkiewicz.com.pl ([127.0.0.1]) by localhost (muminek.juszkiewicz.com.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7fQ8BIQRStsp; Wed, 3 Jun 2020 17:15:20 +0200 (CEST) Received: from puchatek.local.com.pl (89-67-26-161.dynamic.chello.pl [89.67.26.161]) by muminek.juszkiewicz.com.pl (Postfix) with ESMTPSA id 9B76926195E; Wed, 3 Jun 2020 17:15:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=juszkiewicz.com.pl; s=mail; t=1591197320; bh=RvE4hxMAIrtI8emNvOJoATrawXOMkCiuH8oRmIQw/Wk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bR9aAkmxkQoc5BfO8zFF3d47gJQRYl31soSs4cI705HFvOsQrVb0bwsOb6EPbmwWH Pklr+bmWzBKhspj7rA81cs9T8rglPc/tdLZvwjEcGZ2lm2N2g/c8X0mROlfnqVjwA6 ahqPQTgcpw0ZMUfQBHWgrfGElL2JUKUij0MQd1uE= From: Marcin Juszkiewicz To: u-boot@lists.denx.de Cc: Marcin Juszkiewicz Subject: [PATCH 2/2] rockchip: rockpro64: add SPI boot Date: Wed, 3 Jun 2020 17:15:13 +0200 Message-Id: <20200603151513.3528522-2-marcin@juszkiewicz.com.pl> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200603151513.3528522-1-marcin@juszkiewicz.com.pl> References: <20200603151513.3528522-1-marcin@juszkiewicz.com.pl> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean U-Boot TPL 2020.07-rc3-00121-gab88251130 (Jun 03 2020 - 16:43:42) Channel 0: LPDDR4, 50MHz BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 Die BW=16 Size=2048MB Channel 1: LPDDR4, 50MHz BW=32 Col=10 Bk=8 CS0 Row=16/15 CS=1 Die BW=16 Size=2048MB 256B stride 256B stride lpddr4_set_rate: change freq to 400000000 mhz 0, 1 lpddr4_set_rate: change freq to 800000000 mhz 1, 0 Trying to boot from BOOTROM Returning to boot ROM... U-Boot SPL 2020.07-rc3-00121-gab88251130 (Jun 03 2020 - 16:43:42 +0200) Trying to boot from SPI U-Boot 2020.07-rc3-00121-gab88251130 (Jun 03 2020 - 16:43:42 +0200) SoC: Rockchip rk3399 Reset cause: RST Model: Pine64 RockPro64 v2.1 DRAM: 3.9 GiB PMIC: RK808 MMC: mmc@fe310000: 2, mmc@fe320000: 1, sdhci@fe330000: 0 Loading Environment from SPI Flash... SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB *** Warning - bad CRC, using default environment In: serial Out: vidconsole Err: vidconsole Model: Pine64 RockPro64 v2.1 Net: eth0: ethernet@fe300000 Hit any key to stop autoboot: 0 => Signed-off-by: Marcin Juszkiewicz Reviewed-by: Kever Yang --- arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 12 +++++++++++- configs/rockpro64-rk3399_defconfig | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git arch/arm/dts/rk3399-rockpro64-u-boot.dtsi arch/arm/dts/rk3399-rockpro64-u-boot.dtsi index deaa3efd39..bac09df4a3 100644 --- arch/arm/dts/rk3399-rockpro64-u-boot.dtsi +++ arch/arm/dts/rk3399-rockpro64-u-boot.dtsi @@ -11,7 +11,17 @@ }; chosen { - u-boot,spl-boot-order = "same-as-spl", &sdmmc, &sdhci; + u-boot,spl-boot-order = "same-as-spl", &spi_flash, &sdmmc, &sdhci; + }; + + config { + u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ + }; +}; + +&spi1 { + spi_flash: flash@0 { + u-boot,dm-pre-reloc; }; }; diff --git configs/rockpro64-rk3399_defconfig configs/rockpro64-rk3399_defconfig index 72389d0e60..9fdda2ba4f 100644 --- configs/rockpro64-rk3399_defconfig +++ configs/rockpro64-rk3399_defconfig @@ -8,6 +8,8 @@ CONFIG_TARGET_ROCKPRO64_RK3399=y CONFIG_NR_DRAM_BANKS=1 CONFIG_DEBUG_UART_BASE=0xFF1A0000 CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_SPL_SPI_FLASH_SUPPORT=y +CONFIG_SPL_SPI_SUPPORT=y CONFIG_DEBUG_UART=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rockpro64.dtb" CONFIG_MISC_INIT_R=y @@ -15,6 +17,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 +CONFIG_SPL_SPI_LOAD=y CONFIG_TPL=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPT=y