From patchwork Mon Jun 1 20:42:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1325 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E59BC3F1D9 for ; Mon, 1 Jun 2020 22:42:48 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id l144sf4811702pfd.8 for ; Mon, 01 Jun 2020 13:42:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1591044167; cv=pass; d=google.com; s=arc-20160816; b=PqsGXivMAhvhuL6NVXeEM4uwx7WzEIPnGAef2F/GVKxVUcTKNhYJj83eQian0tAiMs AZuwMw4Y7e1GTIsycR7d8Ug1OfyVA46mZyXRSoABEsQV7FKtA+3Sp7JnsKV904futy1t EsU632rc/zKs1dZxEGWoV4SiJ0gvay9KOhVISh4bqyIo2XbPZaj67JpjONjVMDXKOUTi roa5pNJU8LQkl9hzS8jWd8YrUAm9iyFbjW6FggOYrixHQa9esPGN9sWtIPo9ykDEl63+ E54so7xagJKnnZHV5ikXjyAqxtKb27Xv64XCYjbILJZ9GgP15e5DWIaMdzXKHAMFx1m6 hScw== 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=dim9clgQF+4mRxJBohX7xiQMYpXHolHTeI0bbwYUnhg=; b=mh42mT2oYciRhZmQM4LczZQTwVbDyvwr/PfnBih/jU6Nc9+rWBdkM4iBOBggzsQceD euzpzFr86tY94qAgF62q+Bzf3J+BsxAVT75Ip8+sDdYcBGjtNK++aLEidM1Yj2FUrOAV M4be8wzQMjSFVpf/ee8AxPF/0GTWHZq5YNDZ65ruscAnWKu86d1H4KMWWaDIi8jWouD/ rXbLzHrL9ICPmmOsX6KPyOYPcQB6isMcd1mgNCh4KHz5zzueGUYIaUPkX2l9FNpzhP2C UnqcO464Eqsz2jg8ZxozfAI30rRPKC9Em6OrpAWfzccZSiNDoJf2/Iexxan8G+G/oAdj u5NQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=n2PD2ota; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 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=dim9clgQF+4mRxJBohX7xiQMYpXHolHTeI0bbwYUnhg=; b=jeg6KpUSWaa+Eth+GGFVX/mEzUaZrSIgffS7fOMSHGE0mWM8Awtl5jgac8zC46Uqcf 8YlJAjGVM+J2tHN41sKiOL2EaJkVs4NNtzH7NtjWqfVEI/Gjrb5+oFoA4KLIPYl+mwuv nXa5scLaTMfRJ55Pi8fPE/XPROcFyVKDEUWfs= 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=dim9clgQF+4mRxJBohX7xiQMYpXHolHTeI0bbwYUnhg=; b=aEVIzmH1iovhip+ZOEKtPqLw4Pu6hL7f15xobxu0SsyVz9309AjiE7C689gVB3S7gC v0pg/Odh11H785hUJx2iR/0dYbjoi7Lj3BM30ptDo8Od/681jPllIx/S9Cafia+Mb5KZ +n+BMogqrjKtmhjuBBK8nQWh3pkAir//+HClFjXGKqFQEWGvgf895Q8Xsn5eIDH0MGde v3tIXUlEXN0JsbcoRhtljHhrwCw/iqYgQ1bEtjcZe1ZVtqlCqoX/C+0sHV1cYs2BYJhA +zDzP99f20mL8eo0izaCFrRHgtZ/zgkKkAnLGjcpLdkaSxsxML4GIexxyxaQISbqtzrO miOA== X-Gm-Message-State: AOAM532w3viaJhgKfc9KEEPQetl7Sm8Bwr1iRTUXK22zmIBc+xKGWqt7 zJg3ArfLc6o1TFCipS1ervYXE1Xo X-Google-Smtp-Source: ABdhPJyHj87RYOyR1u7PWGvspOAvjqWGIIv7ItFlNO7jFN8xFcNGlwQnj1aNdvecbQnUWJUVGhoDYw== X-Received: by 2002:a17:90a:64c9:: with SMTP id i9mr1298258pjm.135.1591044167746; Mon, 01 Jun 2020 13:42:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:3c1:: with SMTP id 184ls3505687pgd.11.gmail; Mon, 01 Jun 2020 13:42:47 -0700 (PDT) X-Received: by 2002:a63:d04b:: with SMTP id s11mr19915473pgi.384.1591044167252; Mon, 01 Jun 2020 13:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591044167; cv=none; d=google.com; s=arc-20160816; b=AL3asfBE2FA82IqFqkha39kpMA1qPQHnzu+FL7AnwA3DlZER3suST/LfNKNOZaJkZs L4uufeSdqgCOFG668wA6AOMhaNb5hJ4hpUnICFqMl52j05KuUzdspZ50pbPye2xXQfkx C0alaBF7HOZvOqXQumle7IpNOE1mbrBH7wGjgAX1Rqa+tUSY4/lBHsgyuTOLGO+Qzsw1 lPmWfbOmdA/POgItIuLxCn53MQJw8ODpclRcON9QJpg97QB60ccmaatNycT/s/OnnBq6 8YlOjuUHnj/YSh9ZEHyFlrHNMCX5Pf+4EImfsX6qQD/0iJwXhJgDfvjcQxfKh2M8v+UG 7WLQ== 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=DOxyptf9FQQNcFAfnmKvWlTL2iTcXIqsnIhBYOAg8BQ=; b=faE+G4f6X+tWpbAe5m2UGrdQ9N1M3ZHFa9Ct5rSYkiqHZnAfWUWYsiHGvDxSwhyENx outL/NM4pYc0r2Yt/Egphld/irqp7IVUjUaPT16D9ZNoiqTlqQwzvkZF6nxBOfuEKcCh LMPbX5/6gVhbW11/rz6YFPYCUbVx8EwVVPrGFxRGHDcd4yC5gOMhhml7w/NjSQFYEarA VcsfzT/cvxJdvI7T5ZunGGAeQLxqFE4ZuypwL0JZk/Hf4yETKltu90L7wadg8fdVHvEC a3pP309JI4xxkkKyw/m97nRU52wy5u0TvoIgnWR+/yzj4QIcdLZhHWeoDQqJc+4Bg/Or dvGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=n2PD2ota; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u8sor330842pjn.34.2020.06.01.13.42.47 for (Google Transport Security); Mon, 01 Jun 2020 13:42:47 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90b:110d:: with SMTP id gi13mr1316899pjb.173.1591044166947; Mon, 01 Jun 2020 13:42:46 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:658b:ecbc:7ea4:1996]) by smtp.gmail.com with ESMTPSA id k7sm283581pga.87.2020.06.01.13.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 13:42:46 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass , Hugh Cole-Baker Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v2 3/4] roc-rk3399-pc: Add SPI boot Date: Tue, 2 Jun 2020 02:12:12 +0530 Message-Id: <20200601204213.466120-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200601204213.466120-1-jagan@amarulasolutions.com> References: <20200601204213.466120-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=n2PD2ota; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 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 Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- 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 1c1539bcb9..4b98dd9cfc 100644 --- a/configs/roc-pc-mezzanine-rk3399_defconfig +++ b/configs/roc-pc-mezzanine-rk3399_defconfig @@ -7,12 +7,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 18c343f9f9..e5ff570b87 100644 --- a/configs/roc-pc-rk3399_defconfig +++ b/configs/roc-pc-rk3399_defconfig @@ -8,12 +8,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