From patchwork Mon Jun 8 22:50:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Robinson X-Patchwork-Id: 1305442 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=OM8kt4mw; 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 49gpQQ3t54z9sQx for ; Tue, 9 Jun 2020 08:51:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7A01A8174A; Tue, 9 Jun 2020 00:50:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OM8kt4mw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 31FD6813B3; Tue, 9 Jun 2020 00:50:54 +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,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (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 0E7E5813B3 for ; Tue, 9 Jun 2020 00:50:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pbrobinson@gmail.com Received: by mail-wm1-x344.google.com with SMTP id u13so1057510wml.1 for ; Mon, 08 Jun 2020 15:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/lBOoizDjEonx3cgP6bW7rHZQmodKnYiRh3GAL4M27Y=; b=OM8kt4mwKuzlUf5V139PbbJXu/ns7peVCGo53Yk7twC+UNTBNw5Vt0nIO3L4Ac2MQO zyjyI36k3KMTGhGPwsbjt+2NU9iWVFwmh5BfUGprin4I3y/+2aiVlSBPZcjYcQrVgra8 oqxrbbDR9w+dZ6vF+TFjxX0fHpdGDjrXomKsISSgXWoLTuBKyy0l3ZU18FPDqQvj0D40 GV6WkJsWhzRRWy33xa77PTVg5i3dElRZDYz4hVlEfDqLCXQnwBBfaAf9P1rkp1UagIvI dqYZ/GHIAmhMFn7UUBV27cCuNrKaPB7TSt/zmMKbKMeZhdKKVMbJtPYo2XNX/+qxrOtj Izrg== 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=/lBOoizDjEonx3cgP6bW7rHZQmodKnYiRh3GAL4M27Y=; b=pl4YjeiCmK4Wvj9pZP51TSVA3siUgw9Shz5HPTI/mIiQ3mpSaep7amWZ4QMJXBGxv7 5IEisidjoZfOk03kLom5efWsSbsCKCS2rEsWLLz5a58aKeakX/RdGu9l0yg7es/l5022 54N9JQ4hy4sGkosCtgnbiU3+CVZAS33WdKmvGHPOEalpMVmsX/rX5Bt+cRyLFa3B/8fP +mCEHO8EoutY45LgxIBg9/bjGlbgucVk72G6iCDRsQFtGdefjnj0UDcyFbXeZiqYrIV9 fiauekYSvmqRL38Iu1K8Pc6hqNWFM910jTi6QZS8yr7SW/webbssy3IsYiwvNmzQO9jO KMBg== X-Gm-Message-State: AOAM532ekB5JuBaZsNEkrRk0vrTu+EeJSeUag6WMjf94VVvEnZDM8RsO gisUD+d1U1kewDx2UCArf4E= X-Google-Smtp-Source: ABdhPJy9L4XEKAw/XbjftAlHD0J+A1Ksktl4DQ9IARnWGIKsgimcu7M5vp5U6dbq2uArHIJUSbinfg== X-Received: by 2002:a1c:6a01:: with SMTP id f1mr889628wmc.52.1591656649642; Mon, 08 Jun 2020 15:50:49 -0700 (PDT) Received: from morpheus.roving-it.com.com (f.c.9.1.f.e.c.d.1.e.0.0.2.b.5.5.1.8.6.2.1.1.b.f.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:fb11:2681:55b2:e1:dcef:19cf]) by smtp.googlemail.com with ESMTPSA id 1sm923340wmz.13.2020.06.08.15.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 15:50:49 -0700 (PDT) From: Peter Robinson To: Kever Yang , Jagan Teki , Simon Glass , Philipp Tomsich , u-boot@lists.denx.de Cc: Peter Robinson Subject: [PATCH 3/3] rockchip: Pinebook Pro: Fix SPI flash and store env on it Date: Mon, 8 Jun 2020 23:50:30 +0100 Message-Id: <20200608225030.481733-3-pbrobinson@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200608225030.481733-1-pbrobinson@gmail.com> References: <20200608225030.481733-1-pbrobinson@gmail.com> 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 Some minor fixes for SPI flash on the Pinebook Pro and also default to saving environment to the SPI flash as it's guaranteed to be on board. Signed-off-by: Peter Robinson Reviewed-by: Kever Yang --- arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 6 +++++- configs/pinebook-pro-rk3399_defconfig | 3 +++ include/configs/pinebook-pro-rk3399.h | 9 --------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi index 296321d697..ded7db0aef 100644 --- a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi +++ b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi @@ -12,7 +12,11 @@ }; chosen { - u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; + u-boot,spl-boot-order = "same-as-spl", &sdhci, &spiflash, &sdmmc; + }; + + config { + u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ }; }; diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig index 733463556a..18b2d74253 100644 --- a/configs/pinebook-pro-rk3399_defconfig +++ b/configs/pinebook-pro-rk3399_defconfig @@ -1,6 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x00200000 +CONFIG_ENV_SIZE=0x8000 CONFIG_ROCKCHIP_RK3399=y CONFIG_TARGET_PINEBOOK_PRO_RK3399=y CONFIG_NR_DRAM_BANKS=1 @@ -17,6 +18,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 CONFIG_SPL_MTD_SUPPORT=y +CONFIG_SPL_SPI_LOAD=y CONFIG_TPL=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPIO=y @@ -32,6 +34,7 @@ CONFIG_CMD_REGULATOR=y CONFIG_SPL_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro" 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_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y diff --git a/include/configs/pinebook-pro-rk3399.h b/include/configs/pinebook-pro-rk3399.h index d910830582..d478b19917 100644 --- a/include/configs/pinebook-pro-rk3399.h +++ b/include/configs/pinebook-pro-rk3399.h @@ -14,15 +14,6 @@ #include -#if defined(CONFIG_ENV_IS_IN_MMC) -#define CONFIG_SYS_MMC_ENV_DEV 0 -#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH) -#define CONFIG_ENV_SECT_SIZE (8 * 1024) -#endif - -#undef CONFIG_SYS_SPI_U_BOOT_OFFS -#define CONFIG_SYS_SPI_U_BOOT_OFFS 1024 * 512 - #define SDRAM_BANK_SIZE (2UL << 30) #define CONFIG_USB_OHCI_NEW