From patchwork Mon Jun 8 18:17:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1343 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 721663F1E7 for ; Mon, 8 Jun 2020 20:17:37 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id l144sf14122052pfd.8 for ; Mon, 08 Jun 2020 11:17:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1591640256; cv=pass; d=google.com; s=arc-20160816; b=wbOmw8XYtv0d2N0cDUqPYsdoxLLWs4C3VGn1yqs3tz6azvoJMmUiyKxl20KYm2GDC/ 6E3uHq0XhCGUf4jVI6q+nRf+pwGVRXLpislHza5I9hrb67e5WlVrS3P92gDhYn+KRemh Ft3W0amxKud4e1rShq+Le2BoOksUiztgu7hQS9CwqJoIb2lJ8WR1Z88IZ0u6x5sB3SEK Z+p8Irj3kF2uVHMhJ/8jloqJRM7RNiDa1yRdmIUfGzylYSSCMfwxaqJri7blFBlSncDr iKjM0U8QraRxDMBhz4aqpIvJeqVTxWJBNGMhZAeiJmGGHTnX6Nlr0tIGtwPWn17f6FKs 4oCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=1UOAeMmhAeGUQoDwvCxnqxNpn/J1sPKFR/iKliCK/iw=; b=Pa/cqMmv//PrMjVOGQOkIFmfQugRuY6+CDNEtFmFghOLGHhJGYs/tunXhK9Yw9Z1bX mbliclxGn9hvDhER+CDrNaYmjD8NAzKh2JHfVu401gxcZiriXvaFnqfLRfLhB7f+mmw9 XGWr18pH19CIrz8/57h4hMav1sZNfvPM+qZWHzzf7yAOeutb7HPEioM0NXgAfYpp+SO9 zyIgDCL7Bf0dT7/xQNxcHeFxuy2v7mUBuZ8xdv+NCH1qZBc5YOJ8YU0Jbu5NNVOE7vDM XiqGbcFka6m9xjbmxFYVb2+HyCQtIIK8/FoANFipwBPyCk5UqyPFTvnZiFqtMxZXy7IJ 8emQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hGa1nFfL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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 :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=1UOAeMmhAeGUQoDwvCxnqxNpn/J1sPKFR/iKliCK/iw=; b=KJiKDCh9uUk4XTst0QH8Le1Ydy3c0CIdYaWK2n0gL2yxS6sj8JNrPGGdmiAZZyTgTi 34dfVGmoEJ829RwdBNY788mZil1q2R+o8R5aLD94vqhG3JudCgcFvgEfChUO4YQ5DA9f e9aXA/aQL7URMBRObIbGQoW7Jn8xjhG97lXOA= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=1UOAeMmhAeGUQoDwvCxnqxNpn/J1sPKFR/iKliCK/iw=; b=qxKiXnWEJpjGr3ljIGKUPPMMxNm4Hqg6/OzHuxuD2vUqdQjAfNcCWsJvKbyb4g6HOJ DR7Px5Ps1trrIpEbrTycFaw2dXi2rAJwYOrlRW8CjBWykNXLgs4jJH7w1Z3mXyF+8zB7 +jwgGrr1/h/lLjX4+t31J1Sjk4XrHizR/mygmMd6aSG9AqhgWampwLF3MBi8ZX7Pyo/5 6WVBnQknXNQT+7owWQodcV+7wCJTFA4WY6EfLoZrFb1O7G/gbjd6AdeKSCMYN2tv+gji MgeBQd7fmG9wlR9s4AtG8DF+m3GbbSckY6LcQN+M22N3ss2nCFA5M0mR/DxlDXXw+qH+ 6XPQ== X-Gm-Message-State: AOAM53001z0biYjZ38pYJE/oAcnmiWaYuKPMKyKbb5jhCjaQ5PlUyJtH FZ04/knnYkb2n4/+nFfdFs0i/HNg X-Google-Smtp-Source: ABdhPJwHg9H3ujPBzmzOmfEfQ3LJ/Wjhtwc8M6gNSRwtylYI6MlH3rKIYVbUi01D8Hx0KLYpUBtG/A== X-Received: by 2002:a17:90a:2a04:: with SMTP id i4mr535059pjd.91.1591640255590; Mon, 08 Jun 2020 11:17:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:820a:: with SMTP id w10ls3164189pfd.11.gmail; Mon, 08 Jun 2020 11:17:35 -0700 (PDT) X-Received: by 2002:a63:348:: with SMTP id 69mr21228282pgd.68.1591640255082; Mon, 08 Jun 2020 11:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591640255; cv=none; d=google.com; s=arc-20160816; b=ZAaL38/ZxnCu4YMPLerTcL14ZI/6hgoqYesHC6Dka1cczNReifeCg+EfaDzSx3RTjy Ii5xDjlAptrxoFns/bkVL7du2DIEPT23z9Nnn0+g11jd1kX3wwf48WONCbdrFvxAiRWh 9D/qIrQQbhJ4sClGw75bgLx9IYowWJ74CVKhEDYRnTUuVzKbctwy/cPmIy5WmpX073VG QF5yFkoGrcMQM2ff3W1UgyX04ExdKuOH/LaIHzQGSikw07spHI/gQE9V8ODLN8CBHiG4 1FIxRHQ7yRQkejt/Gf/PLQzz6PLQ9agDXvGDxU996XniwKptBffk5+d22Txioaz1Dr7h yC3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Np7xlYBqpRyhamB8FZX9N86LOOp4HKzovA516TU3LJ0=; b=W595+Ggk5uZz2ewInL34D/RR9g04P5qlzDhpXSj1LsHdZk2jd7olG7EMd/YeACbwh1 tbcLDWL7NQ9bU+of1x8XsEymqzO5au05nc638+1ioyhT8JnbTavBXMVisIPYCpRirFz1 oQ65KcZLEzyRDaKfuvvuo8hetIbzfAPD1jyFqB7so8Rkd4nAgGz+ypCekiH11O5gYT+B thgWIhA9Ii8Y5Kiot5CyWtEQhsjxsRUJRW4bkqhr4tzpaOkknIWY6gSazZyIi8Z2+WBt YzSWpNgxEWNYupYRMwt4kE44MoMV85LCzbEjLpljpSAcIpsJ6UjltatP2EJBskC+J3/4 2zIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hGa1nFfL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id k16sor10741395pgi.18.2020.06.08.11.17.35 for (Google Transport Security); Mon, 08 Jun 2020 11:17:35 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a63:d34a:: with SMTP id u10mr20189048pgi.297.1591640254749; Mon, 08 Jun 2020 11:17:34 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9043:af95:b7b4:3ade]) by smtp.gmail.com with ESMTPSA id t7sm180213pju.42.2020.06.08.11.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 11:17:33 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v4 3/4] roc-rk3399-pc: Add SPI boot Date: Mon, 8 Jun 2020 14:17:07 -0400 Message-Id: <20200608181708.17842-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200608181708.17842-1-jagan@amarulasolutions.com> References: <20200608181708.17842-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hGa1nFfL; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , U-Boot TPL 2020.07-rc3-00090-gd4e919f927-dirty (Jun 01 2020 - 23:45:53) Channel 0: LPDDR4, 50MHz BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB Channel 1: LPDDR4, 50MHz BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 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-00087-ga21e9fd385 (Jun 02 2020 - 00:09:45 +0530) Trying to boot from MMC1 NOTICE: BL31: v2.2(release): NOTICE: BL31: Built : 15:05:37, May 12 2020 U-Boot 2020.07-rc3-00087-ga21e9fd385 (Jun 02 2020 - 00:09:45 +0530) SoC: Rockchip rk3399 Reset cause: POR Model: Firefly ROC-RK3399-PC Board DRAM: 3.9 GiB PMIC: RK808 MMC: mmc@fe320000: 1, sdhci@fe330000: 0 Loading Environment from SPI Flash... SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Model: Firefly ROC-RK3399-PC Board Reviewed-by: Kever Yang Signed-off-by: Jagan Teki --- Changes for v4: - none arch/arm/dts/rk3399-roc-pc-u-boot.dtsi | 12 +++++++++++- configs/roc-pc-mezzanine-rk3399_defconfig | 3 +++ configs/roc-pc-rk3399_defconfig | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi index 141dd0b306..fc155e6903 100644 --- a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi +++ b/arch/arm/dts/rk3399-roc-pc-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", &spi_flash, &sdhci, &sdmmc; + }; + + config { + u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ }; vcc_hub_en: vcc_hub_en-regulator { @@ -40,6 +44,12 @@ vin-supply = <&vcc_vbus_typec0>; }; +&spi1 { + spi_flash: flash@0 { + u-boot,dm-pre-reloc; + }; +}; + &vdd_log { regulator-min-microvolt = <430000>; regulator-init-microvolt = <950000>; diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig index 9c6fd0c98c..03ba519af1 100644 --- a/configs/roc-pc-mezzanine-rk3399_defconfig +++ b/configs/roc-pc-mezzanine-rk3399_defconfig @@ -9,12 +9,15 @@ CONFIG_TARGET_ROC_PC_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-roc-pc-mezzanine.dtb" 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_TPL_GPIO_SUPPORT=y CONFIG_CMD_BOOTZ=y diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig index b225eb38fe..b59b54bd89 100644 --- a/configs/roc-pc-rk3399_defconfig +++ b/configs/roc-pc-rk3399_defconfig @@ -9,12 +9,15 @@ CONFIG_TARGET_ROC_PC_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-roc-pc.dtb" 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_TPL_GPIO_SUPPORT=y CONFIG_CMD_BOOTZ=y