From patchwork Mon Jul 22 11:59:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134863 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kGIPLEaS"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sgnB25Wbz9sBF for ; Mon, 22 Jul 2019 22:25:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EBD35C21FD3; Mon, 22 Jul 2019 12:25:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A9543C21E18; Mon, 22 Jul 2019 12:03:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BA78BC21C93; Mon, 22 Jul 2019 12:03:51 +0000 (UTC) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by lists.denx.de (Postfix) with ESMTPS id 6F22EC21E18 for ; Mon, 22 Jul 2019 11:59:57 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id m9so19043556pls.8 for ; Mon, 22 Jul 2019 04:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=pGB5w0ym1aSRceaRuHrat7r3W5fR2qY3H3lZ/xiu2+Y=; b=kGIPLEaSFdj7zKaHBC+r3T36nLTMA/loDNAck4wurMeYNMMQLMRas1HtJUo/Q/+NlT ADpsADXoIyNSm+bsdQ7svMrqewcNtzqvib2gcIlcrFF8a8W40YwnjVvBvuPH9sXErq1C 84uvPxYN2Pnuvs+dwsYwyap/3EW3xbxX6NyGIKYnIHG4khfP2cDv5zFG7h0u0bG22a2p raLmcQ/tZfc3VCfgL3EyeKdMt4rI5PhEJJu0MP9kVmLpF4I3UiKIbq9Idnepx2ot8Pk0 tyxXoea6lEzkppIR76nVZ2r2WZ9Uk/hySkINUiw36lT76vjCuBZtnzzF+HIh4rhXiKYR Umnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=pGB5w0ym1aSRceaRuHrat7r3W5fR2qY3H3lZ/xiu2+Y=; b=KQHQbSqNY2bt7qMGGxG5r1XFLn7lCwUAk7txZgXSI7ZA4kgWgC6+KmlX8h6wU42A9d dBo6jcIvTkVw/17wWlJCux/sASZV33h3rfdFlNOiDkDVXbhtGYCW4XgaeWGFQfMiwStL dtRHY+vi9FMs0aa5vov2CL6UbMfAldo4CSZQuox31bttK9lN60qmzFXCyP+jVRLpr2EB TZ3X8xAAcp90u0b218MdNkUoMAdkwNcewNUchlqkCemRSMp4ojdyW4TMM5IVZCJt0xTJ T6/t4rEYW1rEeo4kJOLYrkVT3cc35g8JOp+dBnJ6Kjdc3OZOBe8/Ib+iqshaKIyLFDsu zWQg== X-Gm-Message-State: APjAAAUeBqV6ufgAo5+U78QU1iU1/gSnxMwJkH7odMdj09OXgjg5ONmW RVd4165dDfptAdwIfU7ELX4ojDPZ X-Google-Smtp-Source: APXvYqyYFITwA/QyT5FyNUl8l4nF/c1mWK3seFeWxduWd7qsyr4rHP/neXPqqUeth+kDFUuXI6O8ig== X-Received: by 2002:a17:902:b497:: with SMTP id y23mr75351464plr.68.1563796796061; Mon, 22 Jul 2019 04:59:56 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.04.59.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 04:59:55 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:08 +0800 Message-Id: <20190722115942.24962-2-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Cc: Otavio Salvador , "Matwey V. Kornilov" Subject: [U-Boot] [PATCH 01/35] rockchip: remove redundant CONFIG_SYS_NS16550_MEM32 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The CONFIG_SYS_NS16550_MEM32 already defined in rockchip_common.h, no need to define again in soc level header. Signed-off-by: Kever Yang --- include/configs/rk3188_common.h | 2 -- include/configs/rk3328_common.h | 2 -- include/configs/rk3368_common.h | 2 -- include/configs/rk3399_common.h | 2 -- 4 files changed, 8 deletions(-) diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index 1d41702846..ec90088309 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -15,8 +15,6 @@ #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 -#define CONFIG_SYS_NS16550_MEM32 - #ifdef CONFIG_SPL_ROCKCHIP_BACK_TO_BROM /* Bootrom will load u-boot binary to 0x60000000 once return from SPL */ #endif diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index 2a81c803b6..3a8e37ef98 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -12,8 +12,6 @@ #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SKIP_LOWLEVEL_INIT -#define CONFIG_SYS_NS16550_MEM32 - #define CONFIG_SYS_INIT_SP_ADDR 0x00300000 #define CONFIG_SYS_LOAD_ADDR 0x00800800 #define CONFIG_SPL_STACK 0x00400000 diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h index 8a1e3118ae..1a859a7e43 100644 --- a/include/configs/rk3368_common.h +++ b/include/configs/rk3368_common.h @@ -23,8 +23,6 @@ #define CONFIG_ROCKCHIP_STIMER_BASE 0xff830020 #define COUNTER_FREQUENCY 24000000 -#define CONFIG_SYS_NS16550_MEM32 - #define CONFIG_SYS_INIT_SP_ADDR 0x00300000 #define CONFIG_SYS_LOAD_ADDR 0x00280000 diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index 8df0180284..63eac19a4e 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -15,8 +15,6 @@ #define COUNTER_FREQUENCY 24000000 #define CONFIG_ROCKCHIP_STIMER_BASE 0xff8680a0 -#define CONFIG_SYS_NS16550_MEM32 - #define CONFIG_SYS_INIT_SP_ADDR 0x00300000 #define CONFIG_SYS_LOAD_ADDR 0x00800800 From patchwork Mon Jul 22 11:59:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134864 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bAok0CBn"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sgtb6MhKz9s00 for ; Mon, 22 Jul 2019 22:30:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 7805CC2200A; Mon, 22 Jul 2019 12:30:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F0E09C21E26; Mon, 22 Jul 2019 12:03:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3589FC21E13; Mon, 22 Jul 2019 12:03:59 +0000 (UTC) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by lists.denx.de (Postfix) with ESMTPS id 1DB26C21E26 for ; Mon, 22 Jul 2019 12:00:00 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id m9so19043604pls.8 for ; Mon, 22 Jul 2019 05:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=I9yVNiuT+0wYd24luHXkif17Se0A+0V30jgl7ZiZu7g=; b=bAok0CBnvAk0qNCxr2FygGcGII5jdhoBKoW05nFiJYIn/AXIpeTAyK9XsptL2NS5V8 B0pWqEHEjEJuoDwbTUWf8DpHaDPbaEMt4SPEbIzLbKJmAv76xswHqy61Y9+HnzYw1KHx FNWadcE7hYcyr3BY+Q82m/QjS5VjPuEeU88OT59ou3WhJJKLFCDSPmTkIpWNSMA9B9sX hgrhJ7HZV5i0eCpZsQ97IqfXV14zCaJWfBAMAOJL3rvMoAYu90fDUzUQ6PzY/I2FWsvZ KVhN75TvZ5JjDzLnqIJDxP/+1+73+4sQCT9uKsqyzV/DyDD0HCDqXEjARx5QRqeYceVe lUkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=I9yVNiuT+0wYd24luHXkif17Se0A+0V30jgl7ZiZu7g=; b=nNby+MfQk5PI0M9TEXbzKu9QBXRafRNX328DxeKJXYFLVqXSFLWUVmmzXzsR98t5Zw +y3CcN9MMsHwQkfk0kyzy9Q8ZfFBYJZLHXRO7UFKfJuleU3hnhUkpaQmqoauh6Tx3Hls EkgKQgkqTwHJnbhF+ZmBFhZFo0nL9wmUP29dJK1D+5dwZ2f+r67cbavYWBwzn0viWNdu f5zPKCg0gZhJVbnEpw5Idd3UqNaKoNnxLLYWFAWNMWvY+N+LAnnVddFV3jzpUq1kjT7u aQKDwtRxklv7CksZGcpM29FZp3CMKfACeXru3dWtKZ/8+W/v59w4DQeMcwFVOJrPL9eo +1YA== X-Gm-Message-State: APjAAAVUfG0H6Is34wB1btw10VpIYxxBQ9UZmoSiBXYOM6AJx061mzrL yJ6I6XzXYLga42MWhj9NWkEQ6goF X-Google-Smtp-Source: APXvYqw5xH98Oi33SSu0jp0OX5evm7g1jtHRra6YNckX8cAF5z3rUf6GfcuktceEnZxLQU88XhKOFA== X-Received: by 2002:a17:902:9688:: with SMTP id n8mr73580723plp.227.1563796798747; Mon, 22 Jul 2019 04:59:58 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.04.59.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 04:59:58 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:09 +0800 Message-Id: <20190722115942.24962-3-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Cc: Otavio Salvador , Jagan Teki Subject: [U-Boot] [PATCH 02/35] rockchip: add CONFIG_IRAM_BASE for all SoCs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Rockchip SoCs have internal sram for bootrom data area and for sdram init program space. Introduce the base address in case we need to use it. Signed-off-by: Kever Yang --- include/configs/rk3128_common.h | 2 ++ include/configs/rk3188_common.h | 1 + include/configs/rk322x_common.h | 1 + include/configs/rk3288_common.h | 2 ++ include/configs/rk3328_common.h | 2 ++ include/configs/rk3368_common.h | 2 ++ include/configs/rk3399_common.h | 2 ++ include/configs/rv1108_common.h | 2 ++ 8 files changed, 14 insertions(+) diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h index 20d62439fb..d12696d6b3 100644 --- a/include/configs/rk3128_common.h +++ b/include/configs/rk3128_common.h @@ -19,6 +19,8 @@ #define CONFIG_SYS_ARCH_TIMER #define CONFIG_SYS_HZ_CLOCK 24000000 +#define CONFIG_IRAM_BASE 0x10080000 + #define CONFIG_SYS_INIT_SP_ADDR 0x60100000 #define CONFIG_SYS_LOAD_ADDR 0x60800800 diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h index ec90088309..92524b06ad 100644 --- a/include/configs/rk3188_common.h +++ b/include/configs/rk3188_common.h @@ -23,6 +23,7 @@ #define CONFIG_ROCKCHIP_MAX_INIT_SIZE (0x8000 - 0x800) #define CONFIG_ROCKCHIP_CHIP_TAG "RK31" +#define CONFIG_IRAM_BASE 0x10080000 /* spl size 32kb sram - 2kb bootrom */ #define CONFIG_SPL_MAX_SIZE (0x8000 - 0x800) diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h index cc08699944..9582cdfb64 100644 --- a/include/configs/rk322x_common.h +++ b/include/configs/rk322x_common.h @@ -24,6 +24,7 @@ #define CONFIG_ROCKCHIP_MAX_INIT_SIZE (28 << 10) #define CONFIG_ROCKCHIP_CHIP_TAG "RK32" +#define CONFIG_IRAM_BASE 0x10080000 #define CONFIG_SYS_SDRAM_BASE 0x60000000 #define SDRAM_BANK_SIZE (512UL << 20UL) diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index 5472a90633..7c7d9f8fb8 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -25,6 +25,8 @@ #define CONFIG_SYS_LOAD_ADDR 0x00800800 #define CONFIG_SPL_STACK 0xff718000 +#define CONFIG_IRAM_BASE 0xff700000 + /* RAW SD card / eMMC locations. */ #define CONFIG_SYS_SPI_U_BOOT_OFFS (128 << 10) diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index 3a8e37ef98..1cf45bbb3e 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -8,6 +8,8 @@ #include "rockchip-common.h" +#define CONFIG_IRAM_BASE 0xff090000 + #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SKIP_LOWLEVEL_INIT diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h index 1a859a7e43..340413dbba 100644 --- a/include/configs/rk3368_common.h +++ b/include/configs/rk3368_common.h @@ -23,6 +23,8 @@ #define CONFIG_ROCKCHIP_STIMER_BASE 0xff830020 #define COUNTER_FREQUENCY 24000000 +#define CONFIG_IRAM_BASE 0xff8c0000 + #define CONFIG_SYS_INIT_SP_ADDR 0x00300000 #define CONFIG_SYS_LOAD_ADDR 0x00280000 diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h index 63eac19a4e..12ad60d443 100644 --- a/include/configs/rk3399_common.h +++ b/include/configs/rk3399_common.h @@ -15,6 +15,8 @@ #define COUNTER_FREQUENCY 24000000 #define CONFIG_ROCKCHIP_STIMER_BASE 0xff8680a0 +#define CONFIG_IRAM_BASE 0xff8c0000 + #define CONFIG_SYS_INIT_SP_ADDR 0x00300000 #define CONFIG_SYS_LOAD_ADDR 0x00800800 diff --git a/include/configs/rv1108_common.h b/include/configs/rv1108_common.h index 6f61f01538..691aa51e98 100644 --- a/include/configs/rv1108_common.h +++ b/include/configs/rv1108_common.h @@ -8,6 +8,8 @@ #include #include "rockchip-common.h" +#define CONFIG_IRAM_BASE 0x10080000 + #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SKIP_LOWLEVEL_INIT From patchwork Mon Jul 22 11:59:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134865 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tQiKFGzM"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sh0H6Zh4z9s00 for ; Mon, 22 Jul 2019 22:35:27 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6F300C21FB2; Mon, 22 Jul 2019 12:35:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3D3ACC21F07; Mon, 22 Jul 2019 12:04:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1B752C21F04; Mon, 22 Jul 2019 12:04:05 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by lists.denx.de (Postfix) with ESMTPS id 11514C21DD3 for ; Mon, 22 Jul 2019 12:00:02 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id g2so17274881pfq.0 for ; Mon, 22 Jul 2019 05:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8OpYG+PnRakn9I7WzNBUmLjHXTQ+jOlqfuMDSpPdLOk=; b=tQiKFGzMXECTBoOSaHpOzMp+T8lzAZrRdo8h7Y0DNSI5I8P3sf5uCLCVbr/0ujA3j2 DX0DI40MghnGCDTICBlB2sjLXVz+fT89MGh70FghZWopiXjpthYRzkHQDsDLj+NT5zHz AJv+A67OnW605gicFE5tyRTLCXVc91yjqpHJIt2nQPZ3Xezsmc4oaEcsqPvcSu7c/bfu CDqlv24lu+Rg64YxMeyQMYa7XqQDIHWsvfGCBQDGOSOexwnCMzwb1jpDlyqDvwKAOFA+ 825Xatx9jJabwkR5ivn6wPt9K/bR2uO4GDUkwtYtqFuf3ItQqTSG/RACqBByjztHGizG tTOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8OpYG+PnRakn9I7WzNBUmLjHXTQ+jOlqfuMDSpPdLOk=; b=EicAner2X41oWzA5nSzB8vs+e6C6bdRy8tSr79qM58TUb5kkdFlA7CmHFkB1hKWv8u FYQRIzHnxYZSEq9sGR57VuICqw2LW4fqK//UBiWmSZfSTy4PkJtxvN3NzztoqyhI2+CD hcWbZcnAOqRs7T9UGCKR8XxSVe73xNQYdKa59ib5oASzTbNKgVmWapXmV4DkKRRpHBud GEMbLzsEOCfjUb8rK3xH96Ourmnol2ROgzHZIR6BSioPbW/KFpMozAw8vD2H272l9JDs FB7sn0YIgpsRSUh348D2WI5VjL2aq7ForB23ICv1IWIF2SuDOzbXwdT6qWltQSmkj3yP qLVw== X-Gm-Message-State: APjAAAX3j/ViZ9ld3vfn4NrK0o30xQPz4hQjJ64CfdRz7KYcu87hkWVA xD+W+rmcDwoQB7YLl6iJR/z+U7+q X-Google-Smtp-Source: APXvYqygTOMpS85fMCBojyX2Z6ZG0zc8uO/tSCgpp0J7l/QcnJsWB4aRle+9SyA5pfipj/w+/TGmew== X-Received: by 2002:a63:4c46:: with SMTP id m6mr73069445pgl.59.1563796800621; Mon, 22 Jul 2019 05:00:00 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.04.59.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:00 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:10 +0800 Message-Id: <20190722115942.24962-4-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 03/35] rockchip: intruduce common BROM_BOOTSOURCE_ID_ADDR X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The boot source from BootRom is store at a fix offset of IRAM, update to use the common macro instead of rk3399 specific one. Signed-off-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/bootrom.h | 2 +- arch/arm/mach-rockchip/rk3399-board-spl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/bootrom.h b/arch/arm/include/asm/arch-rockchip/bootrom.h index d67f43f09c..3499227e29 100644 --- a/arch/arm/include/asm/arch-rockchip/bootrom.h +++ b/arch/arm/include/asm/arch-rockchip/bootrom.h @@ -55,6 +55,6 @@ enum { /** * Locations of the boot-device identifier in SRAM */ -#define RK3399_BROM_BOOTSOURCE_ID_ADDR 0xff8c0010 +#define BROM_BOOTSOURCE_ID_ADDR (CONFIG_IRAM_BASE + 0x10) #endif diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index 7154d8e5d0..3624c8ea65 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -35,7 +35,7 @@ static const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { const char *board_spl_was_booted_from(void) { - u32 bootdevice_brom_id = readl(RK3399_BROM_BOOTSOURCE_ID_ADDR); + u32 bootdevice_brom_id = readl(BROM_BOOTSOURCE_ID_ADDR); const char *bootdevice_ofpath = NULL; if (bootdevice_brom_id < ARRAY_SIZE(boot_devices)) From patchwork Mon Jul 22 11:59:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134867 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PPTnQr6h"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sh5x3r4bz9s00 for ; Mon, 22 Jul 2019 22:40:21 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 14DD0C21E18; Mon, 22 Jul 2019 12:40:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 83F97C21F0C; Mon, 22 Jul 2019 12:04:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B2D67C21F06; Mon, 22 Jul 2019 12:04:07 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by lists.denx.de (Postfix) with ESMTPS id 0833CC21DD9 for ; Mon, 22 Jul 2019 12:00:04 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id g2so17274915pfq.0 for ; Mon, 22 Jul 2019 05:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=g+KLIuaCV+aWXNHTt6a9bCLey0VYNYOzGlGARaGEjgc=; b=PPTnQr6h+hO9tIw+NMszUXYlTW6Ut5k9PoBsHtIDA1saPnC1PRHuqyV/YdV86ko9tH rdLcUmAYYeX/qJHPpLMcSbss8qRmXtq/oVrLH2YbXyVzCkNUaft+IU8rE/nImCU+v0tt nu8mNNjPl2y3RKUnsEhdKdGL1WyScmx7ibJBT8kq7m4zs+2AHNrcIsgY0NePFMPQ2zmE YWU673TPgG845vPsAcbYzQL0+2uWpvKQ2FcXdpSuA6SmvNW1mq4OcdX8+D+YJShLdY/4 jceHAIQjnwzVk5fiHpH2n0MYC0pzElS6ez+/wChnyQx/e2kuWVZZrxCTJBO27XUIIgQH KXJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=g+KLIuaCV+aWXNHTt6a9bCLey0VYNYOzGlGARaGEjgc=; b=gE3c5caWa1nOc6kaVC+3vSnBwfTnttxHPBmDwWbyImWgY1tP1YGtxrD1zUYPqHHXLw qOOJ28w0x4YcOy3oiRMPq4CQXf8yxs0WuEkGfm19n/o2b15bpWly4I2Gc6VqAK67cQG5 TpyjfIzvRit2Tr6xx+I89j868bc9Jr1lrvGeW5lcOBc2uXmi7eA/3cRu/KiGasREhYlu 1N4lptE9VbLzPNgfxKD8K94dCjBlQj/j/px0G9WSH9YdQJEZq7rmNzoBPp4I3GKeUMY/ K3QHZHSQ0H9RUne4DwivQTTS5u5Mgu+QBDp0qXJYLELygPCKyrXzawGYRRUkZovSaoRR M5rA== X-Gm-Message-State: APjAAAUkYPSnR3Mzjw7HT+3K4sOhKJ/BssvH6q9WZuo+T70BY3M5o1DV fiaKOi1lDWYp3bat21DlR+MXp0W3 X-Google-Smtp-Source: APXvYqwYAdFwdpIxp9waSaQUdzdI2eCdSjDaNUHSY8FTQ3iQMtXdNHpYVd+IIsyIlwNzt6n2OY6mLA== X-Received: by 2002:a63:d34c:: with SMTP id u12mr56405512pgi.114.1563796802555; Mon, 22 Jul 2019 05:00:02 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:02 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:11 +0800 Message-Id: <20190722115942.24962-5-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 04/35] rockchip: declear boot_devices in bootrom.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" boot_devices may defined in soc file, and used in board file, we need to delear it in header file. Signed-off-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/bootrom.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/include/asm/arch-rockchip/bootrom.h b/arch/arm/include/asm/arch-rockchip/bootrom.h index 3499227e29..0da78f30b6 100644 --- a/arch/arm/include/asm/arch-rockchip/bootrom.h +++ b/arch/arm/include/asm/arch-rockchip/bootrom.h @@ -52,6 +52,8 @@ enum { BROM_LAST_BOOTSOURCE = BROM_BOOTSOURCE_USB }; +extern const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1]; + /** * Locations of the boot-device identifier in SRAM */ From patchwork Mon Jul 22 11:59:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134868 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GYX4Yk7M"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45shCd2whcz9sBF for ; Mon, 22 Jul 2019 22:45:16 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A5AF3C220AF; Mon, 22 Jul 2019 12:45:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C685CC21F02; Mon, 22 Jul 2019 12:04:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B72C6C21F19; Mon, 22 Jul 2019 12:04:11 +0000 (UTC) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by lists.denx.de (Postfix) with ESMTPS id 6A504C21E50 for ; Mon, 22 Jul 2019 12:00:06 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id s1so11247070pgr.2 for ; Mon, 22 Jul 2019 05:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=iOLW7wxpuECmfsAdS0To90Cs3CCO/XzHEtEih/fSWvA=; b=GYX4Yk7Mj588BQYZ+kOd3JhizDMJMVfneyHTBGaBWIRYT+8ctFEzQhDynDMkhZw4Bs 1PhZW7MwZJkdhca8oVDJojnabPHZpnK2Kb/VbtuConfQs5lPyaFLsrEWjibKIl64MLYI YciiA4kB4eAceoZKW4igZpm1or1dlQBeDnwpHzBqq6VxHQ9O/NdUHtPqrpxZs2CgXZqs OKUd44R44i/JfbJWOXOPWK3x+UWRz0S6nY3672rGx5xI95BODbfQb9Q5zZB7p3Q95+/o 5oUJ2XMPbxX/7s6Sc/3RFQ/xqJAj14aNolNWVaL3uhOA6eca/jUcGFIXSltJnrP7TcRv a0eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=iOLW7wxpuECmfsAdS0To90Cs3CCO/XzHEtEih/fSWvA=; b=bRUmVGqv/Q/qollE44w5HDuHg+7d1tfDZnWue8b56bfb1jIabhf7OHP6FWGvObR64h XxF82vxYST4e/LhdWlDCfu0D2tKAia55c5GiTJyYcEIVmL4r2OFU9JdsjyqoGo0LTwDE sZ6rdMLgmFH+JsZfrIRY3e1pXl5Sy3CtgVa0h9JZOEjG2otUmGK2nTob0FcU7zVc5YwR GV8InmIUT04P4OFY2uski71d+vCefZQS11vsKvR1reQEtZYUr172AGDT5OFPYidzRH/V V6IL2V1qEifjfsmi/MGVSCOzewqn843zBCoYpP2iaZM5JYw1NIimwM5F989M5orp8K5L iWGA== X-Gm-Message-State: APjAAAXwqdriW6D39owjZJuD+r+qVI09dOCGxq7qisxlH+KoRRsIPDzJ CtWh1feF72GZB9pauT7kgHyrBaSX X-Google-Smtp-Source: APXvYqz44LMa1+IoMx4xX4Y++CrMZ0RxUXfEFd6kJsiZKKR0btPc5hk6TzfqdxW4SIPNUPjFC/uNQg== X-Received: by 2002:a63:714a:: with SMTP id b10mr37653967pgn.25.1563796804853; Mon, 22 Jul 2019 05:00:04 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:04 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:12 +0800 Message-Id: <20190722115942.24962-6-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 05/35] rockchip: add common spl board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The common spl board file handles board_init_f() in SPL, and with board_early_init_f() and arch_cpu_init() callback, other operateion after board_init_f() should go to board specific spl_board_init(). Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 8 ++ arch/arm/mach-rockchip/Makefile | 1 + arch/arm/mach-rockchip/spl.c | 154 ++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+) create mode 100644 arch/arm/mach-rockchip/spl.c diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 17f31e89f3..ac86532c88 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -227,6 +227,14 @@ config TPL_ROCKCHIP_BACK_TO_BROM SPL will return to the boot rom, which will then load the U-Boot binary to keep going on. +config SPL_ROCKCHIP_COMMON_BOARD + bool "Rockchip SPL common board file" + depends on SPL + help + Rockchip SoCs have similar boot process, SPL is mainly in charge of + load and boot Trust ATF/U-Boot firmware, and DRAM init if there is + no TPL for the board. + config TPL_ROCKCHIP_COMMON_BOARD bool "" depends on TPL diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index a12b8d4434..b831ec6f2b 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -7,6 +7,7 @@ # inaccessible/protected memory (and the bootrom-helper assumes that # the stack-pointer is valid before switching to the U-Boot stack). obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o +obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl.o spl-boot-order.o obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c new file mode 100644 index 0000000000..e00b2f11dc --- /dev/null +++ b/arch/arm/mach-rockchip/spl.c @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2019 Rockchip Electronics Co., Ltd + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +void board_return_to_bootrom(void) +{ + back_to_bootrom(BROM_BOOT_NEXTSTAGE); +} + +__weak const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { +}; + +const char *board_spl_was_booted_from(void) +{ + u32 bootdevice_brom_id = readl(BROM_BOOTSOURCE_ID_ADDR); + const char *bootdevice_ofpath = NULL; + + if (bootdevice_brom_id < ARRAY_SIZE(boot_devices)) + bootdevice_ofpath = boot_devices[bootdevice_brom_id]; + + if (bootdevice_ofpath) + debug("%s: brom_bootdevice_id %x maps to '%s'\n", + __func__, bootdevice_brom_id, bootdevice_ofpath); + else + debug("%s: failed to resolve brom_bootdevice_id %x\n", + __func__, bootdevice_brom_id); + + return bootdevice_ofpath; +} + +u32 spl_boot_device(void) +{ + u32 boot_device = BOOT_DEVICE_MMC1; + +#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \ + defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \ + defined(CONFIG_TARGET_CHROMEBOOK_MINNIE) + return BOOT_DEVICE_SPI; +#endif + if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)) + return BOOT_DEVICE_BOOTROM; + + return boot_device; +} + +u32 spl_boot_mode(const u32 boot_device) +{ + return MMCSD_MODE_RAW; +} + +#if !defined(CONFIG_SUPPORT_TPL) && !defined(CONFIG_ROCKCHIP_RK3188) +#define TIMER_LOAD_COUNT_L 0x00 +#define TIMER_LOAD_COUNT_H 0x04 +#define TIMER_CONTROL_REG 0x10 +#define TIMER_EN 0x1 +#define TIMER_FMODE BIT(0) +#define TIMER_RMODE BIT(1) + +__weak void rockchip_stimer_init(void) +{ + /* If Timer already enabled, don't re-init it */ + u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); + + if (reg & TIMER_EN) + return; +#ifndef CONFIG_ARM64 + asm volatile("mcr p15, 0, %0, c14, c0, 0" + : : "r"(COUNTER_FREQUENCY)); +#endif + writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); + writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE); + writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4); + writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE + + TIMER_CONTROL_REG); +} +#endif + +__weak int board_early_init_f(void) +{ + return 0; +} + +__weak int arch_cpu_init(void) +{ + return 0; +} + +void board_init_f(ulong dummy) +{ + int ret; +#if !defined(CONFIG_SUPPORT_TPL) + struct udevice *dev; +#endif + +#ifdef CONFIG_DEBUG_UART + /* + * Debug UART can be used from here if required: + * + * debug_uart_init(); + * printch('a'); + * printhex8(0x1234); + * printascii("string"); + */ + debug_uart_init(); + debug("\nspl:debug uart enabled in %s\n", __func__); +#endif + + board_early_init_f(); + + ret = spl_early_init(); + if (ret) { + printf("spl_early_init() failed: %d\n", ret); + hang(); + } + arch_cpu_init(); +#if !defined(CONFIG_SUPPORT_TPL) + debug("\nspl:init dram\n"); + ret = uclass_get_device(UCLASS_RAM, 0, &dev); + if (ret) { + printf("DRAM init failed: %d\n", ret); + return; + } +#ifndef CONFIG_ROCKCHIP_RK3188 + rockchip_stimer_init(); +#endif +#endif +#ifdef CONFIG_SYS_ARCH_TIMER + /* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */ + timer_init(); +#endif + preloader_console_init(); +} + +#ifdef CONFIG_SPL_LOAD_FIT +int board_fit_config_name_match(const char *name) +{ + /* Just empty function now - can't decide what to choose */ + debug("%s: %s\n", __func__, name); + + return 0; +} +#endif From patchwork Mon Jul 22 11:59:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134871 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FaXhQFO+"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45shKK1Lqhz9s00 for ; Mon, 22 Jul 2019 22:50:10 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1E93AC22063; Mon, 22 Jul 2019 12:50:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 11DB7C21E56; Mon, 22 Jul 2019 12:04:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8CB12C21F1C; Mon, 22 Jul 2019 12:04:21 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id 3A364C21E73 for ; Mon, 22 Jul 2019 12:00:08 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id o13so17541150pgp.12 for ; Mon, 22 Jul 2019 05:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=+Y84opTZ193qIYEOJ6uHUEMSpgmHGtp/n7Bv9aE7rPk=; b=FaXhQFO+WV13ZNIFM38jHqEyEz8oGip5oPhOBwd6GQACdJSbH4a/udUFlPN58NkXrH Xce7GE9gmEbi00PtIBJ95BGeJIuR1G0WcCrpy5w0bzBGzhwT86sGRwFKieH6sWUa8PcJ dZR8/pknIkXffZoRXi4LhyamJdGKQXG0tUuRMsMHTBvPrGH6Q9nqnc0NvTjSuzmc6Ukk WZ+BfwC4GUjsuXz9lgqtDoEMw4TRiUXi1ZLeP7vU/zvziiqGAUfsEWFvO3vYOHj7zx7n InQSSi6l91MiOWejxwxpUs1vaBQ44Mmp062sP8EljPSYYzv7bB0VsFrydQJ5sB2v9Udl UsrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+Y84opTZ193qIYEOJ6uHUEMSpgmHGtp/n7Bv9aE7rPk=; b=ocjtKRwdhBBQZ+TjaR84XHdkPM4Mc6HSZJNMuaMITu3MpqD2wpd+djh3pnQY8RXajH wQnA22hmfktIsgfyrUQ3ce+UEYrmoIreDktOAeCADGJHmzJCY5kgt6p17myhXMvDUHay cuJDrKLBTlyLcBC+5TmEofZrU5jILv5NHBQ1NWdFJzaWJsyVeSAcFPn3Bn9uxicbBY/J XB52rMqgqS/IDZc6HqjTv4Fn3a910DYm3/rrj8gyF0rTjKYPzojtdUzOCiJanFh+AbYG aNphMyXfx/t6+XwebS7hnojo//xJtzDCwo0d3GJkMyK360RjLkpPReriolprTJWhJPKa pImw== X-Gm-Message-State: APjAAAX+Q0PxzEyzq64NqCA5lgEPEax60Q3Hn6FOKOtlJZzqFapEvqXA mJSaI71p1ArX1YHy86TLCxLJta9O X-Google-Smtp-Source: APXvYqwwLUy1swgWf8zjL74fGaGut1V+dpYBnbhLwE1JXJ//TfKIJO6BSfY8f8aiVviDIizkl033cg== X-Received: by 2002:a63:1310:: with SMTP id i16mr70330289pgl.187.1563796806723; Mon, 22 Jul 2019 05:00:06 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:06 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:13 +0800 Message-Id: <20190722115942.24962-7-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 06/35] rockchip: rk3188: init CPU freq in clock driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Init CPU frquency in clock driver instead of in SPL board file, this will help for use common board file later. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3188-board-spl.c | 22 ---------------------- drivers/clk/rockchip/clk_rk3188.c | 3 +++ 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c index c3efe0d7a9..017bc6e805 100644 --- a/arch/arm/mach-rockchip/rk3188-board-spl.c +++ b/arch/arm/mach-rockchip/rk3188-board-spl.c @@ -70,27 +70,6 @@ fallback: return BOOT_DEVICE_MMC1; } -static int setup_arm_clock(void) -{ - struct udevice *dev; - struct clk clk; - int ret; - - ret = rockchip_get_clk(&dev); - if (ret) - return ret; - - clk.id = CLK_ARM; - ret = clk_request(dev, &clk); - if (ret < 0) - return ret; - - ret = clk_set_rate(&clk, 600000000); - - clk_free(&clk); - return ret; -} - void board_init_f(ulong dummy) { struct udevice *dev; @@ -146,7 +125,6 @@ void board_init_f(ulong dummy) return; } - setup_arm_clock(); #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT) back_to_bootrom(BROM_BOOT_NEXTSTAGE); #endif diff --git a/drivers/clk/rockchip/clk_rk3188.c b/drivers/clk/rockchip/clk_rk3188.c index 9bb9959c9d..dda686cfb3 100644 --- a/drivers/clk/rockchip/clk_rk3188.c +++ b/drivers/clk/rockchip/clk_rk3188.c @@ -562,6 +562,9 @@ static int rk3188_clk_probe(struct udevice *dev) #endif rkclk_init(priv->cru, priv->grf, priv->has_bwadj); + + /* Init CPU frequency */ + rkclk_configure_cpu(priv->cru, priv->grf, APLL_HZ, priv->has_bwadj); #endif return 0; From patchwork Mon Jul 22 11:59:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134874 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ORdNZ5fA"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45shQy0gkCz9sBF for ; Mon, 22 Jul 2019 22:55:05 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6ADD2C2208F; Mon, 22 Jul 2019 12:55:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6683DC21E70; Mon, 22 Jul 2019 12:04:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4879AC21E70; Mon, 22 Jul 2019 12:04:28 +0000 (UTC) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by lists.denx.de (Postfix) with ESMTPS id 16249C21E7F for ; Mon, 22 Jul 2019 12:00:10 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id b7so19159182pls.6 for ; Mon, 22 Jul 2019 05:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZA4AS8X+XKp8QgOU5oCAliAnjI/h8WcLK/1V+DiNxUw=; b=ORdNZ5fAZHFVqo5WyE7TUVX3RpWOsIF5ZciuchJn4yFIdDA0cJNzXAtaMWHYllAFDa 11ojn/mHe+BN58+YawG3Vom5Ggp2OwmLJED7gLXwKay155rn+5NFAmXRLlOTPggHuUZ0 ENQrNet0ygY21YRyyFcan++5yg+RQkO2kZi48h9xNFGcFwiHxOA2B8e0ezqZoZUgSNdn L09o0Wt5nufGursJHVIOLk0k6aHD2Vxu4fVmpzAn+ufklnuX/cHR2LgbGM92YHwLj3y6 0pKUqdPvUa0bTojyHRCS6DUmT8kQGklyRUpOt00Jm2fv5bo+I4+9ziREYowA1aNbTE8r NjCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ZA4AS8X+XKp8QgOU5oCAliAnjI/h8WcLK/1V+DiNxUw=; b=aXdkrSR4SuNBV3BuXgSJB6q4lWtmECQUecbBk++phb7dLcM6V33KkpanIhA+ZcRZpt m2b9+brmi3Cm1Gm2hi12GbUx9tsseOlQRZCuFUd7+vN/KG/ZTG6jb9lWjb/7wTYsXm0C nMTAU2/oCUOEHEaKfc+/Jvx5YU1i2CUowd1F+aauMwVCm+d32xxzfr4Gt4xuELZ3EEMk cx+GkpsFjODdcJigzRPTLvbOrmXqFlxokXlicwNjJhXdteyrwHbjt1FyL3FrOIZh5EKX GNxO6vTy+bPwgucyJJrrebAGRxDuZemYuuNgSLcQ7wu14eefPKqGu46vFn2sAZuVoP/l ZPVQ== X-Gm-Message-State: APjAAAUEmzK6hOwS91nrO1pCznfGWbtEDqWmCiM89ZCkyjJqgJQujLWB llx8KnvEsATIy9q2YfPL6+m1HSIB X-Google-Smtp-Source: APXvYqyiJr7M7lrk3u8HS8p65/N4SO1+OD8nPKGRB921/GeoOgkB2Ok3Re/HcwcIjNm/b9vFlI4Zbw== X-Received: by 2002:a17:902:8649:: with SMTP id y9mr73638476plt.289.1563796808615; Mon, 22 Jul 2019 05:00:08 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:08 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:14 +0800 Message-Id: <20190722115942.24962-8-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 07/35] rockchip: rk3188: move usb uart init into arch_cpu_init() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The SoC feature init will be better to use arch_cpu_init() and goes to soc file. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3188-board-spl.c | 27 +++++----------------- arch/arm/mach-rockchip/rk3188/rk3188.c | 28 ++++++++++++++++++++++- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c index 017bc6e805..05ae3eca98 100644 --- a/arch/arm/mach-rockchip/rk3188-board-spl.c +++ b/arch/arm/mach-rockchip/rk3188-board-spl.c @@ -17,10 +17,7 @@ #include #include #include -#include -#include #include -#include #include #include #include @@ -70,6 +67,11 @@ fallback: return BOOT_DEVICE_MMC1; } +__weak int arch_cpu_init(void) +{ + return 0; +} + void board_init_f(ulong dummy) { struct udevice *dev; @@ -88,24 +90,7 @@ void board_init_f(ulong dummy) printascii("U-Boot SPL board init"); #endif -#ifdef CONFIG_ROCKCHIP_USB_UART - rk_clrsetreg(&grf->uoc0_con[0], - SIDDQ_MASK | UOC_DISABLE_MASK | COMMON_ON_N_MASK, - 1 << SIDDQ_SHIFT | 1 << UOC_DISABLE_SHIFT | - 1 << COMMON_ON_N_SHIFT); - rk_clrsetreg(&grf->uoc0_con[2], - SOFT_CON_SEL_MASK, 1 << SOFT_CON_SEL_SHIFT); - rk_clrsetreg(&grf->uoc0_con[3], - OPMODE_MASK | XCVRSELECT_MASK | - TERMSEL_FULLSPEED_MASK | SUSPENDN_MASK, - OPMODE_NODRIVING << OPMODE_SHIFT | - XCVRSELECT_FSTRANSC << XCVRSELECT_SHIFT | - 1 << TERMSEL_FULLSPEED_SHIFT | - 1 << SUSPENDN_SHIFT); - rk_clrsetreg(&grf->uoc0_con[0], - BYPASSSEL_MASK | BYPASSDMEN_MASK, - 1 << BYPASSSEL_SHIFT | 1 << BYPASSDMEN_SHIFT); -#endif + arch_cpu_init(); ret = spl_early_init(); if (ret) { diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c index 933484e0df..f7e12a95b2 100644 --- a/arch/arm/mach-rockchip/rk3188/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188/rk3188.c @@ -7,11 +7,12 @@ #include #include +#define GRF_BASE 0x20008000 + #ifdef CONFIG_DEBUG_UART_BOARD_INIT void board_debug_uart_init(void) { /* Enable early UART on the RK3188 */ -#define GRF_BASE 0x20008000 struct rk3188_grf * const grf = (void *)GRF_BASE; enum { GPIO1B1_SHIFT = 2, @@ -34,3 +35,28 @@ void board_debug_uart_init(void) GPIO1B0_UART2_SIN << GPIO1B0_SHIFT); } #endif + +int arch_cpu_init(void) +{ +#ifdef CONFIG_ROCKCHIP_USB_UART + struct rk3188_grf * const grf = (void *)GRF_BASE; + + rk_clrsetreg(&grf->uoc0_con[0], + SIDDQ_MASK | UOC_DISABLE_MASK | COMMON_ON_N_MASK, + 1 << SIDDQ_SHIFT | 1 << UOC_DISABLE_SHIFT | + 1 << COMMON_ON_N_SHIFT); + rk_clrsetreg(&grf->uoc0_con[2], + SOFT_CON_SEL_MASK, 1 << SOFT_CON_SEL_SHIFT); + rk_clrsetreg(&grf->uoc0_con[3], + OPMODE_MASK | XCVRSELECT_MASK | + TERMSEL_FULLSPEED_MASK | SUSPENDN_MASK, + OPMODE_NODRIVING << OPMODE_SHIFT | + XCVRSELECT_FSTRANSC << XCVRSELECT_SHIFT | + 1 << TERMSEL_FULLSPEED_SHIFT | + 1 << SUSPENDN_SHIFT); + rk_clrsetreg(&grf->uoc0_con[0], + BYPASSSEL_MASK | BYPASSDMEN_MASK, + 1 << BYPASSSEL_SHIFT | 1 << BYPASSDMEN_SHIFT); +#endif + return 0; +} From patchwork Mon Jul 22 11:59:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134877 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d2YGxvx7"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45shXS0vHZz9s00 for ; Mon, 22 Jul 2019 22:59:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CDB42C22024; Mon, 22 Jul 2019 12:59:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B72C2C21F20; Mon, 22 Jul 2019 12:04:33 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5CDFBC21F24; Mon, 22 Jul 2019 12:04:32 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by lists.denx.de (Postfix) with ESMTPS id 0CF8AC21E74 for ; Mon, 22 Jul 2019 12:00:12 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id g2so17275187pfq.0 for ; Mon, 22 Jul 2019 05:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=AKeipuYvpknxzfMT19g7xK9yESxP6R8AVGKncx9yZqU=; b=d2YGxvx7LLubjSzRwZqFoj3yax1Uj/3PSfsHRDO0mXTa5n90jgE3ekIPpLQpYKw/om ujLOUARb73WSJ4jJdJscu8Vt0mDMwVtsYVy078qeTjItY4MLk+0NNh8dcnORgtCrhz4E eYlfVOmUAZkiscZj+Cf3huySh1vqWHXfABXx0znLxNKHjXXCawbm81FzOoR5+Hv3pncK UL2T9mjKuAkeU/sF02Zybj8qefE92dt1hRa/3rl1wCOFUTnIN+uVU2c5kO92kF/QhI2k ke9bbaeZSsphWjjeZBu8a49yD7Ci5Kf+ILJtLgt7hqUhIM6ZC/HbOB/wtAb4odEopoeJ jRQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=AKeipuYvpknxzfMT19g7xK9yESxP6R8AVGKncx9yZqU=; b=FIcSpNm078xTDOg7V+z3rIe1ZxEf4QP7vag3MSj3c9tKd2UO0abewNgjt4JAm8L2Pi vVMoxFWXlYAwf6jwZd1o75+e4zB8VVKGR7w0FJ/0aMPnUBvd2c2wN7YQEP7jWHuZXl6J Oy+u6NpAwZVNdpyKk96R1olpYzuWl0FQgQWl9ZnPui++3mvhxA4vVKgY9vnrpsuX8pOU O5GQMKmuy214BDbBAgwpdXcy2whuW14djzJ9ux539XkUk+jZHP2IqbJsYtGzc6f/8Hy0 x2VV+lsJDs9KxrGkrDB2iuMVy5257pRJ0CYP4J3lN+jA4O01aCuQ82AqKizsAJsgvStu 9f9Q== X-Gm-Message-State: APjAAAXMRzEitUANm6sYkgskiKAKJVq+kLZiecZRiGURYwjN+eMT9ZcO twRAfJ4OSIRVr73Z91sFsQ8mzIzz X-Google-Smtp-Source: APXvYqyPx07RhNPrRetDGopl8wKLP+9SaYzD4XOpRuwe9PY1tkXTtQ6nLDPqRKbOaUNWdqc34X2taQ== X-Received: by 2002:a63:f118:: with SMTP id f24mr73034311pgi.322.1563796810501; Mon, 22 Jul 2019 05:00:10 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:10 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:15 +0800 Message-Id: <20190722115942.24962-9-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 08/35] rockchip: Migrate to use BOOTROM_SUPPORT driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" SPL bootrom support is a boot device just like mmc and etc, use formal boot device instead of jump to bootrom directly. Enable the Kconfig by default if ROCKCHIP_BACK_TO_BROM is enabled. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 9 +++------ arch/arm/mach-rockchip/rk3188-board-spl.c | 13 ++++++------- arch/arm/mach-rockchip/rk3288-board-spl.c | 13 ++++++------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index ac86532c88..2b4e3c7ce4 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -34,8 +34,8 @@ config ROCKCHIP_RK3188 select SPL_RAM select SPL_DRIVERS_MISC_SUPPORT select SPL_ROCKCHIP_EARLYRETURN_TO_BROM + select SPL_ROCKCHIP_BACK_TO_BROM select BOARD_LATE_INIT - select ROCKCHIP_BROM_HELPER help The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9 including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two @@ -59,9 +59,7 @@ config ROCKCHIP_RK322X select SPL_DRIVERS_MISC_SUPPORT imply SPL_SERIAL_SUPPORT imply TPL_SERIAL_SUPPORT - imply TPL_BOOTROM_SUPPORT imply TPL_ROCKCHIP_COMMON_BOARD - select ROCKCHIP_BROM_HELPER select TPL_LIBCOMMON_SUPPORT select TPL_LIBGENERIC_SUPPORT help @@ -77,7 +75,6 @@ config ROCKCHIP_RK3288 select SUPPORT_SPL select SPL select SUPPORT_TPL - imply TPL_BOOTROM_SUPPORT imply TPL_CLK imply TPL_DM imply TPL_DRIVERS_MISC_SUPPORT @@ -169,12 +166,10 @@ config ROCKCHIP_RK3399 select DM_PMIC select DM_REGULATOR_FIXED select BOARD_LATE_INIT - select ROCKCHIP_BROM_HELPER imply TPL_SERIAL_SUPPORT imply TPL_LIBCOMMON_SUPPORT imply TPL_LIBGENERIC_SUPPORT imply TPL_SYS_MALLOC_SIMPLE - imply TPL_BOOTROM_SUPPORT imply TPL_DRIVERS_MISC_SUPPORT imply TPL_OF_CONTROL imply TPL_DM @@ -211,6 +206,7 @@ config SPL_ROCKCHIP_BACK_TO_BROM bool "SPL returns to bootrom" default y if ROCKCHIP_RK3036 select ROCKCHIP_BROM_HELPER + select SPL_BOOTROM_SUPPORT depends on SPL help Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled, @@ -221,6 +217,7 @@ config TPL_ROCKCHIP_BACK_TO_BROM bool "TPL returns to bootrom" default y select ROCKCHIP_BROM_HELPER + select TPL_BOOTROM_SUPPORT depends on TPL help Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled, diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c index 05ae3eca98..33fa7d0bb7 100644 --- a/arch/arm/mach-rockchip/rk3188-board-spl.c +++ b/arch/arm/mach-rockchip/rk3188-board-spl.c @@ -26,6 +26,11 @@ DECLARE_GLOBAL_DATA_PTR; +void board_return_to_bootrom(void) +{ + back_to_bootrom(BROM_BOOT_NEXTSTAGE); +} + u32 spl_boot_device(void) { #if !CONFIG_IS_ENABLED(OF_PLATDATA) @@ -109,10 +114,6 @@ void board_init_f(ulong dummy) debug("DRAM init failed: %d\n", ret); return; } - -#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT) - back_to_bootrom(BROM_BOOT_NEXTSTAGE); -#endif } static int setup_led(void) @@ -149,8 +150,6 @@ void spl_board_init(void) } preloader_console_init(); -#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) - back_to_bootrom(BROM_BOOT_NEXTSTAGE); -#endif + return; } diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index c2e168192c..9efba47aff 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -30,6 +30,11 @@ DECLARE_GLOBAL_DATA_PTR; +void board_return_to_bootrom(void) +{ + back_to_bootrom(BROM_BOOT_NEXTSTAGE); +} + u32 spl_boot_device(void) { #if !CONFIG_IS_ENABLED(OF_PLATDATA) @@ -187,10 +192,6 @@ void board_init_f(ulong dummy) return; } #endif - -#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT) - back_to_bootrom(BROM_BOOT_NEXTSTAGE); -#endif } static int setup_led(void) @@ -227,9 +228,7 @@ void spl_board_init(void) } preloader_console_init(); -#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) - back_to_bootrom(BROM_BOOT_NEXTSTAGE); -#endif + return; } From patchwork Mon Jul 22 11:59:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134880 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kLBgLHIt"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45shfG196mz9s00 for ; Mon, 22 Jul 2019 23:04:53 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A7F04C220A7; Mon, 22 Jul 2019 13:04:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0DCF3C21F29; Mon, 22 Jul 2019 12:04:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6A51BC21F1D; Mon, 22 Jul 2019 12:04:36 +0000 (UTC) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by lists.denx.de (Postfix) with ESMTPS id 24D58C21DEC for ; Mon, 22 Jul 2019 12:00:14 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id i70so6817400pgd.4 for ; Mon, 22 Jul 2019 05:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=x+qq8ghJUmoCunc/auis15CzyrTTwiQktw1TaduALX0=; b=kLBgLHIt7b2pnMef+Bu54TtIl3G4H6RPCNj4rVGrdCoEagYqBYRCSYHrvqQ0P8cdAS JLHuCQWk3CIQSPFt2MPEK6LwxOp5Dmc0QvkX3rZBh4rehrwxQOnZFvIqk9FKc/jEmyyt scp6sjSr6sIDGxeXYWErgmyeJVTVGCsbynxupDngtOeEiZWv8XpXkbKAwvcYMgE3/YhA tozOARen93AwpjTT/D4epvjatyhTkghuHsFM+1V7aBs4sZL8YmkEZ2RA9aA220+bIZoJ UOFZy6gTwqFU35SS1aCi5Jogrlc5nAmMBXsvT98RD500m3Y3AcOvQa25a3o58WSFw9c4 WoZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=x+qq8ghJUmoCunc/auis15CzyrTTwiQktw1TaduALX0=; b=qkA0jFWaY85vkuV+55hhnNBj384h0R85MWMX1LNhLBAqbeG71lMiGUla8me81uJipJ 4j0QpA8OfIdlr8/3z3S/FlIZqiq2XtWCAvFu5Fl9hOFUelPXvLaoj1UX0treqRMoGqh3 wdYwPhi7pmwfWrMbbWupIyC8uN7OiCfgzYMg7aHfe/X62ENJSdHEPv1DyU3M+Y+hGYEB dgi5BZqu/3XINKGBZCHY/ago/6I5oma900hWNjM+vvcfcSN0HtM0OHK25X9ZAerSoImC Sd/rw9zhgps35e1LNJK/79HqPn0LsQhOWSM2YbxkSEbJgw4SwkI9eleB7vWd+oqm7/3Q uSkw== X-Gm-Message-State: APjAAAWtIaJyvn4buTpxtoRZYxIYNwRR3nWZF++irZEV/kL2Y7u/VEAV YyYlr3xSAWt4Ji12Vr5cqmPZsL9l X-Google-Smtp-Source: APXvYqw8c28kaZ/8EOt2rRZ8sxEe07ZBceTBU8p4BqXEPy0e5IQBfGYz2GzbLx8nVrZBM2K7WVXenw== X-Received: by 2002:a17:90a:e397:: with SMTP id b23mr76976338pjz.117.1563796812696; Mon, 22 Jul 2019 05:00:12 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:12 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:16 +0800 Message-Id: <20190722115942.24962-10-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 09/35] rockchip: rk3188: move spl_board_init() into rk3188.c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Clean up the rk3188.c so that we can re-use the common spl board file. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3188-board-spl.c | 36 ----------------------- arch/arm/mach-rockchip/rk3188/rk3188.c | 36 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c index 33fa7d0bb7..6370d3837e 100644 --- a/arch/arm/mach-rockchip/rk3188-board-spl.c +++ b/arch/arm/mach-rockchip/rk3188-board-spl.c @@ -114,42 +114,6 @@ void board_init_f(ulong dummy) debug("DRAM init failed: %d\n", ret); return; } -} - -static int setup_led(void) -{ -#ifdef CONFIG_SPL_LED - struct udevice *dev; - char *led_name; - int ret; - - led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led"); - if (!led_name) - return 0; - ret = led_get_by_label(led_name, &dev); - if (ret) { - debug("%s: get=%d\n", __func__, ret); - return ret; - } - ret = led_set_on(dev, 1); - if (ret) - return ret; -#endif - - return 0; -} - -void spl_board_init(void) -{ - int ret; - - ret = setup_led(); - if (ret) { - debug("LED ret=%d\n", ret); - hang(); - } preloader_console_init(); - - return; } diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c index f7e12a95b2..7a0b10a27d 100644 --- a/arch/arm/mach-rockchip/rk3188/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188/rk3188.c @@ -60,3 +60,39 @@ int arch_cpu_init(void) #endif return 0; } + +#ifdef CONFIG_SPL_BUILD +static int setup_led(void) +{ +#ifdef CONFIG_SPL_LED + struct udevice *dev; + char *led_name; + int ret; + + led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led"); + if (!led_name) + return 0; + ret = led_get_by_label(led_name, &dev); + if (ret) { + debug("%s: get=%d\n", __func__, ret); + return ret; + } + ret = led_set_on(dev, 1); + if (ret) + return ret; +#endif + + return 0; +} + +void spl_board_init(void) +{ + int ret; + + ret = setup_led(); + if (ret) { + debug("LED ret=%d\n", ret); + hang(); + } +} +#endif From patchwork Mon Jul 22 11:59:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134883 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XCc/kDFb"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45shm3627bz9s00 for ; Mon, 22 Jul 2019 23:09:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0D322C220D7; Mon, 22 Jul 2019 13:09:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5FC44C21E75; Mon, 22 Jul 2019 12:04:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0953DC21F27; Mon, 22 Jul 2019 12:04:41 +0000 (UTC) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by lists.denx.de (Postfix) with ESMTPS id E84DEC21DA6 for ; Mon, 22 Jul 2019 12:00:15 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id f25so17544241pgv.10 for ; Mon, 22 Jul 2019 05:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=e4V9i3BcQRd4c/ytgpE1Hybig9KF6cV197GHTR7vFA4=; b=XCc/kDFb7dCztBcJg/jjoApO4fF/m/tv64xWvGmR1dhEMV9Z0yx+qy6wJl2lzKSHu9 sRAR3F0pLjJA3WQkqLdsCN03c721SU9qPC/o7DP8hlOadKag+reVNNS5/P/aUqaYjPoH N127VY/y3ydC/EaHZjCzIaOdjONKMrQugsyDZ0pBWHQAMMpc+Ui28PVceBNzokICTYwh 9K34lXrRRWD19ir3p/YgpAcLKZDNgml6RkGf7uN5ElWJmDkc76PcakiZ+mWdHClWfy+Q vN99L7cqmrlJ941B4grq/wqbOLEPbjSO86p8g7yvtf+n0rQA0MXBwxwhb6qpoEdLINOP 0G7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=e4V9i3BcQRd4c/ytgpE1Hybig9KF6cV197GHTR7vFA4=; b=lWGOlXGbL753jwfR7V93cANVb/p1GYpEB2jm5mQklRx8q3aZaOY3XOi12F0r9btY6K kH79r1ooAFDOh2m0gGkpWAza+Rav82k9x3xoKes3ng9Y7fC335zaejCPhndbMpfuZnqc JWSXh2NOpvBWa0UlByVwgIvtJqJBfpc3f+4kss1U5971p+LoIlSxTNpdV9y0XgkWGRpu 40jlyWaSJRMc3SRgdU35Kfl+RdOY5yjK4tY08x76RLnqmNcQnWl/CJjiJuPX27ZJapQQ q9iMu8XIc7s4CuuuyjMLA/1zGVTLcReMn8zUIDudNPdljG3JEwCV7PiCZ/a8IuI22iJU J1pg== X-Gm-Message-State: APjAAAV15WO77VpOaTfaPXRiRNckILDyQCg2vuuCJLASq++54yDxZ8wn AYNHMvfHyGOPumO73O9cNEUMUzBP X-Google-Smtp-Source: APXvYqyYdNayO9ILEHkgN27xh6gOJczLc41aTc1u6rzIS0Qomz+8H7/JrZ3CD14qcWUYPCp6vOmc/A== X-Received: by 2002:a63:ee0c:: with SMTP id e12mr72279135pgi.184.1563796814506; Mon, 22 Jul 2019 05:00:14 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:14 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:17 +0800 Message-Id: <20190722115942.24962-11-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 10/35] rockchip: rk3188: add boot_devices mapping to support 'same-as-spl' X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The driver need a mapping to get the dts node by boot srouce ID. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3188/rk3188.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-rockchip/rk3188/rk3188.c b/arch/arm/mach-rockchip/rk3188/rk3188.c index 7a0b10a27d..08792f1674 100644 --- a/arch/arm/mach-rockchip/rk3188/rk3188.c +++ b/arch/arm/mach-rockchip/rk3188/rk3188.c @@ -4,11 +4,17 @@ */ #include #include +#include #include #include #define GRF_BASE 0x20008000 +const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { + [BROM_BOOTSOURCE_EMMC] = "dwmmc@1021c000", + [BROM_BOOTSOURCE_SD] = "dwmmc@10214000", +}; + #ifdef CONFIG_DEBUG_UART_BOARD_INIT void board_debug_uart_init(void) { From patchwork Mon Jul 22 11:59:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134885 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OIflHlou"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45shsf1PQlz9s4Y for ; Mon, 22 Jul 2019 23:14:46 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CDF86C21E74; Mon, 22 Jul 2019 13:14:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BD3A5C21DEC; Mon, 22 Jul 2019 12:04:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 07D1FC21DEC; Mon, 22 Jul 2019 12:04:45 +0000 (UTC) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by lists.denx.de (Postfix) with ESMTPS id EA8AEC21DD7 for ; Mon, 22 Jul 2019 12:00:17 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id t14so19103822plr.11 for ; Mon, 22 Jul 2019 05:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=t3/dp/LXfuFAvD8y8DwibEL3PrsvTvdD1+SgAgClSz4=; b=OIflHlouGLjYKpdjNWcl6Q1yxvYXLl1i1pp3SchzFrYztZDnYZkXjNMvSdx49h0wi0 bYPCuIpyJJ0N6HfMFRvdOb32IhyhSfyBNH2Dc6TWUe2JCRatOKdvIJsEJDUoucNdd1oB DbB7vz4nnTRF6W3mx0DX5q7D7WaVA+eF/dcO5VBGTMBlhlkzK3Nloraq8NMDwvWnexXu BcC1hbZ/vNJlPMWnckh1JA1qkHkVi7GN4Ewp0M4xjx0s/fPbrlTszoWtWrg9/ldPjseQ HmaMHmJEhweuIqcd/iMQViF53bzHjyXV9U1RoqDukwJwE9RDFt6/lK0MDJSlZx0Bf6cn MH+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=t3/dp/LXfuFAvD8y8DwibEL3PrsvTvdD1+SgAgClSz4=; b=bE1xWx9tP37Y4ovBH6AMJyPKYrHUukxYcn4PYjIx/NKA4lT2fRu7nhLBV1QqzDN9za NnEM8P9+UQAEiAwVE+fhoqOLdGgKsk8HTSoA6zF3ipJCq7pbTT5oR6hPmJhwpyg1Gaea JurATUfkrM8cJOhP3hcEnyKnuw2cTvDOkJyEASAm/9ntEbM9VbSNir08DQtWaUVnoHV1 1YuP+yUGhoevAyEv01ekLeQrmVTre4EPdgEQg/OUx6ZQ+rDXlkLetXJVEe7CFaXZr+nV Y6n34tI+05XnqdtnkXtWuCh86c93vzHYcYyohW5iIFFjp3nKsUAmmUMMFBeJERKDwkWc 2znw== X-Gm-Message-State: APjAAAWe1M1npb8Nw0Lw8ShWeutgoIWB6+p6Ke9CapeQa1MPkDMLu4WC Vatc6HOaab6HX6CLNTBh3RpuOZtd X-Google-Smtp-Source: APXvYqwLwaSj2fjJHtujygEpvoqyFmmWFf/qOdpdpUa9mLenQOslNMRL7iE4i0QLtyllcCvOS25Jfw== X-Received: by 2002:a17:902:7c96:: with SMTP id y22mr76470889pll.39.1563796816446; Mon, 22 Jul 2019 05:00:16 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:16 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:18 +0800 Message-Id: <20190722115942.24962-12-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 11/35] rockchip: rk3188: migrate to use common spl board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" rk3188 has similar boot flow in SPL with other Rockchip SoCs, migrate to use common spl board file. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 - arch/arm/mach-rockchip/rk3188-board-spl.c | 119 ---------------------- 3 files changed, 1 insertion(+), 120 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3188-board-spl.c diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 2b4e3c7ce4..66d07f672e 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -36,6 +36,7 @@ config ROCKCHIP_RK3188 select SPL_ROCKCHIP_EARLYRETURN_TO_BROM select SPL_ROCKCHIP_BACK_TO_BROM select BOARD_LATE_INIT + imply SPL_ROCKCHIP_COMMON_BOARD help The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9 including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index b831ec6f2b..b4797b4e0f 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o -obj-spl-$(CONFIG_ROCKCHIP_RK3188) += rk3188-board-spl.o obj-spl-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3328) += rk3328-board-spl.o diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c deleted file mode 100644 index 6370d3837e..0000000000 --- a/arch/arm/mach-rockchip/rk3188-board-spl.c +++ /dev/null @@ -1,119 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2015 Google, Inc - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -void board_return_to_bootrom(void) -{ - back_to_bootrom(BROM_BOOT_NEXTSTAGE); -} - -u32 spl_boot_device(void) -{ -#if !CONFIG_IS_ENABLED(OF_PLATDATA) - const void *blob = gd->fdt_blob; - struct udevice *dev; - const char *bootdev; - int node; - int ret; - - bootdev = fdtdec_get_config_string(blob, "u-boot,boot0"); - debug("Boot device %s\n", bootdev); - if (!bootdev) - goto fallback; - - node = fdt_path_offset(blob, bootdev); - if (node < 0) { - debug("node=%d\n", node); - goto fallback; - } - ret = device_get_global_by_ofnode(offset_to_ofnode(node), &dev); - if (ret) { - debug("device at node %s/%d not found: %d\n", bootdev, node, - ret); - goto fallback; - } - debug("Found device %s\n", dev->name); - switch (device_get_uclass_id(dev)) { - case UCLASS_SPI_FLASH: - return BOOT_DEVICE_SPI; - case UCLASS_MMC: - return BOOT_DEVICE_MMC1; - default: - debug("Booting from device uclass '%s' not supported\n", - dev_get_uclass_name(dev)); - } - -fallback: -#endif - return BOOT_DEVICE_MMC1; -} - -__weak int arch_cpu_init(void) -{ - return 0; -} - -void board_init_f(ulong dummy) -{ - struct udevice *dev; - int ret; - -#ifdef CONFIG_DEBUG_UART - /* - * Debug UART can be used from here if required: - * - * debug_uart_init(); - * printch('a'); - * printhex8(0x1234); - * printascii("string"); - */ - debug_uart_init(); - printascii("U-Boot SPL board init"); -#endif - - arch_cpu_init(); - - ret = spl_early_init(); - if (ret) { - debug("spl_early_init() failed: %d\n", ret); - hang(); - } - - ret = rockchip_get_clk(&dev); - if (ret) { - debug("CLK init failed: %d\n", ret); - return; - } - - ret = uclass_get_device(UCLASS_RAM, 0, &dev); - if (ret) { - debug("DRAM init failed: %d\n", ret); - return; - } - - preloader_console_init(); -} From patchwork Mon Jul 22 11:59:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134895 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="j9Pe60tE"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45shz60GJvz9s4Y for ; Mon, 22 Jul 2019 23:19:29 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D5406C2203C; Mon, 22 Jul 2019 13:19:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4630EC21F35; Mon, 22 Jul 2019 12:04:50 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BBF07C21F34; Mon, 22 Jul 2019 12:04:48 +0000 (UTC) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by lists.denx.de (Postfix) with ESMTPS id CC75BC21E1D for ; Mon, 22 Jul 2019 12:00:19 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id m9so19044201pls.8 for ; Mon, 22 Jul 2019 05:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bLi2TXagKo0vFfuc/h78OukqNqyGnJcZNoyYNHUxhX0=; b=j9Pe60tEGMmUHWx6FRA8SClqjvq9UzJjFm/WtUOc5vR9T4eEN/57NUiw/uqQQWUrei Xyo3tLMgAukU7HUcVvSSnbutK+jfLS9vkHnODgZKjOxVsPY9oqLeqdTit1O7VemIhlnq f/iJ3mLD4kFQds/8QybI1QZUvdXP+tQVBWJ1+dI9c+1H42dQkJGItq9cW4uYyx1cZ9l5 jp48QCX53c1rbgJpSjvCvT3PKIPjafTgCXTuTFpWDnB+rXUMYmF+0ZFkPNJs3L+N17B9 Ua8LXKF9AdZkyXPae8ribeZ+fdS9lWppvHDK44FKFYiXm+qWDbudvyMW7iDb5vDETr2z eocA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bLi2TXagKo0vFfuc/h78OukqNqyGnJcZNoyYNHUxhX0=; b=ESPezybHZGyS1PyaX7ZCyjiGJADKwi3SjOcdTGMtuWJXNU1vCimq6xu77wphHxhurh QA1qjYA10GAUPjxRuN7V5WrQGwXQR/BAGkKEt/mcLzhLIbeZy2JidJOtDBXvAStaMitW IL6uqg9fU99Oly5XOOVcXpQ1dlcpHl/vI39oFvEOtapzT3MvS0Ewjuvi1NbmZp8/CgzC 5P4vCwJiyJNsWq2Y+ALqpqgysfK51RJme3HmbFmMiP90AYR6c3feFd7YbHhIrRNOOBWP 3VjJzdZJTvnG3sP+DsM4HD9Lq8StPaorrNwM1s3MKyARIATluNjutqjXiEmF139zEN+i MYbA== X-Gm-Message-State: APjAAAW30AWqWSXLTNAMLL15pXOBWIpWSaQTDy8Km1BajW13/m49A2j4 Sy+BSTjgwjyUJggjzqi2LcLdLvOO X-Google-Smtp-Source: APXvYqxtGcmFn2Wi9knH0t44ekcgSHWPL9Bh5B+aTil4uCv+5jCMwBoUTvlQmZskQSjx1rJU33mgAg== X-Received: by 2002:a17:902:8a8a:: with SMTP id p10mr76549357plo.88.1563796818404; Mon, 22 Jul 2019 05:00:18 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:17 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:19 +0800 Message-Id: <20190722115942.24962-13-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 12/35] rockchip: rk322x: introduce arch_cpu_init() for SoC setting init X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Use arch_cpu_init() to init SoC secure region and move it to rk322x.c Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk322x-board-spl.c | 10 ++++++---- arch/arm/mach-rockchip/rk322x/rk322x.c | 12 ++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-rockchip/rk322x-board-spl.c b/arch/arm/mach-rockchip/rk322x-board-spl.c index c825e31c02..6bf9e444ce 100644 --- a/arch/arm/mach-rockchip/rk322x-board-spl.c +++ b/arch/arm/mach-rockchip/rk322x-board-spl.c @@ -44,7 +44,11 @@ void rockchip_stimer_init(void) TIMER_CONTROL_REG); } -#define SGRF_DDR_CON0 0x10150000 +__weak int arch_cpu_init(void) +{ + return 0; +} + void board_init_f(ulong dummy) { int ret; @@ -60,9 +64,7 @@ void board_init_f(ulong dummy) rockchip_stimer_init(); /* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */ timer_init(); - - /* Disable the ddr secure region setting to make it non-secure */ - rk_clrreg(SGRF_DDR_CON0, 0x4000); + arch_cpu_init(); } #ifdef CONFIG_SPL_LOAD_FIT diff --git a/arch/arm/mach-rockchip/rk322x/rk322x.c b/arch/arm/mach-rockchip/rk322x/rk322x.c index e5250bc784..c8c656ab4b 100644 --- a/arch/arm/mach-rockchip/rk322x/rk322x.c +++ b/arch/arm/mach-rockchip/rk322x/rk322x.c @@ -42,3 +42,15 @@ void board_debug_uart_init(void) CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT); } #endif + +int arch_cpu_init(void) +{ +#ifdef CONFIG_SPL_BUILD +#define SGRF_BASE 0x10150000 + static struct rk322x_sgrf * const sgrf = (void *)SGRF_BASE; + + /* Disable the ddr secure region setting to make it non-secure */ + rk_clrreg(&sgrf->soc_con[0], 0x4000); +#endif + return 0; +} From patchwork Mon Jul 22 11:59:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134896 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pccEdqVR"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sj4g6xmGz9s8m for ; Mon, 22 Jul 2019 23:24:17 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3228DC220A2; Mon, 22 Jul 2019 13:24:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id CCE38C21F3C; Mon, 22 Jul 2019 12:04:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 15174C21F3D; Mon, 22 Jul 2019 12:04:54 +0000 (UTC) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by lists.denx.de (Postfix) with ESMTPS id BFA1FC21E7E for ; Mon, 22 Jul 2019 12:00:21 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id 4so12148438pld.10 for ; Mon, 22 Jul 2019 05:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=H1TZbqeePJAjlcK5XXLImXYaSy28KMoWst35yy5dCx0=; b=pccEdqVRUC45iV5iOVWJfxNmIWO5Qpr6g2ov3TXjd9Ir5J59tBQLfNFCKKuq6I+/th kU34x8Or2Ro8p5RS1Dcm9j6+dV04TH170VA0eegIuZ2ZHKVbs1ccJNbKynRp1RdKCPXV N3/OU9nPNHRyAlLB49j2xniy11SDA0pfjjEq5Vzo7AEgk1gITAAMg4NHknQ+4jeXSgdO 5sVnhtqu/yOYmOsBkOGZgMnk5sdu289qRXI2wmSeJQLnHNV0fL3S2UHg+l/P5B0s8I2q ZnoWoBqohKi2ANMPiS7t/Jv6yFaZFaIwY7DcwmAMPhiVTDPl3PpOp/L5msEGUyIhNhQM bDzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=H1TZbqeePJAjlcK5XXLImXYaSy28KMoWst35yy5dCx0=; b=ThHRXMqbrbBdkriRB0az1X2ruIcRChIEh5QzJ2+eAJv/JTl4TfcJNc3TIOVaq83OJu iQkwytimOwsMWFH7hWW0ldP/h2SQiVIxxckM+xT13YjYyM9RYOsUsXEjGy6ygL+Ve42q AMb8fcPjIxaMXxpFWhHWQxZGTNCWaQA93DjqCKLLFrP4q56HXyjyBJESrax8914eXx5y tZmAx7MPdG+P9oFeUo/tgeVEJZFxeHK5hN7nryAsgBsZoSgaWWQ42IJzj2VEb8/NIeus ZZH9bQauqGW2lC3bty2H9gCFzFhhD7jZQU5yQC0nUmCw9Rt2kAiOf/+jH+ms4wSsrWdH gBUQ== X-Gm-Message-State: APjAAAXI4uuwjDq0tx3ThWRZRtAO7Li0CgZt1+VSW4gtI3gDkYNMYrx/ dJ/jfRRDLRCbgWBs5FXuhyNg6X7u X-Google-Smtp-Source: APXvYqx3nzQwTYA6MmgGa6Dz0+81lp7LDYzIMTrnIPRd+4NOLV+kN7wCbd2ss77UBqHgg38GUGcPmQ== X-Received: by 2002:a17:902:2926:: with SMTP id g35mr74785896plb.269.1563796820320; Mon, 22 Jul 2019 05:00:20 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:19 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:20 +0800 Message-Id: <20190722115942.24962-14-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 13/35] rockchip: rk322x: migrate to use common spl board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" rk322x has similar boot flow in SPL with other Rockchip SoCs, migrate to use common spl board file. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 - arch/arm/mach-rockchip/rk322x-board-spl.c | 78 ----------------------- 3 files changed, 1 insertion(+), 79 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk322x-board-spl.c diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 66d07f672e..1904322091 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -59,6 +59,7 @@ config ROCKCHIP_RK322X select TPL_NEEDS_SEPARATE_STACK if TPL select SPL_DRIVERS_MISC_SUPPORT imply SPL_SERIAL_SUPPORT + imply SPL_ROCKCHIP_COMMON_BOARD imply TPL_SERIAL_SUPPORT imply TPL_ROCKCHIP_COMMON_BOARD select TPL_LIBCOMMON_SUPPORT diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index b4797b4e0f..e58da5c899 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o -obj-spl-$(CONFIG_ROCKCHIP_RK322X) += rk322x-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3328) += rk3328-board-spl.o obj-spl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-spl.o spl-boot-order.o diff --git a/arch/arm/mach-rockchip/rk322x-board-spl.c b/arch/arm/mach-rockchip/rk322x-board-spl.c deleted file mode 100644 index 6bf9e444ce..0000000000 --- a/arch/arm/mach-rockchip/rk322x-board-spl.c +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2017 Rockchip Electronics Co., Ltd - */ - -#include -#include -#include -#include -#include - -u32 spl_boot_device(void) -{ - return BOOT_DEVICE_MMC1; -} - -u32 spl_boot_mode(const u32 boot_device) -{ - return MMCSD_MODE_RAW; -} - -#define TIMER_LOAD_COUNT_L 0x00 -#define TIMER_LOAD_COUNT_H 0x04 -#define TIMER_CONTROL_REG 0x10 -#define TIMER_EN 0x1 -#define TIMER_FMODE BIT(0) -#define TIMER_RMODE BIT(1) - -void rockchip_stimer_init(void) -{ - /* If Timer already enabled, don't re-init it */ - u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); - - if (reg & TIMER_EN) - return; - - asm volatile("mcr p15, 0, %0, c14, c0, 0" - : : "r"(COUNTER_FREQUENCY)); - - writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4); - writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE + - TIMER_CONTROL_REG); -} - -__weak int arch_cpu_init(void) -{ - return 0; -} - -void board_init_f(ulong dummy) -{ - int ret; - - ret = spl_early_init(); - if (ret) { - printf("spl_early_init() failed: %d\n", ret); - hang(); - } - preloader_console_init(); - - /* Init secure timer */ - rockchip_stimer_init(); - /* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */ - timer_init(); - arch_cpu_init(); -} - -#ifdef CONFIG_SPL_LOAD_FIT -int board_fit_config_name_match(const char *name) -{ - /* Just empty function now - can't decide what to choose */ - debug("%s: %s\n", __func__, name); - - return 0; -} -#endif From patchwork Mon Jul 22 11:59:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134900 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Li9TyCAH"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sjBF3Wmmz9sBZ for ; Mon, 22 Jul 2019 23:29:09 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1CB6EC2208D; Mon, 22 Jul 2019 13:29:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2E851C21F41; Mon, 22 Jul 2019 12:05:00 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C7C9FC21F42; Mon, 22 Jul 2019 12:04:58 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by lists.denx.de (Postfix) with ESMTPS id C7F3CC21E8A for ; Mon, 22 Jul 2019 12:00:23 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id u17so17555365pgi.6 for ; Mon, 22 Jul 2019 05:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=qc+xRPVQm9mJbJp0AFDXS3PISfRQyNuqmbfFm4KOTTc=; b=Li9TyCAHHs0Qbrf19fIswVvIZOeqXL94+2/uSIBRaE1Y5W+Tu16jWdnuotQ7jFHmLJ UYC7NzlWRZ6/7VxcJmH7lWHvKU/nQiA0vdeBQXBrpxs2V+i/iR3P64mbse93W50+rlU0 kba74smK/P/Wa1s8Kh38W8Uf7b9opXjPbiiB1R1y3VmLlkbopuCjd9IziHLt2cm8Cdev FX3+BYtOa6OPT0Qpae78kfi6UdvFHN7Ux1uIAAI33NFdngmqnEnsuiz6a2Yp2N3/3TQH BYX6k+vVUBLRuk0Wz6SQIuC3eLkDehOH5EFRbnqKKj756ADWSwOeR+ZFDT+f/qrRWcJn zrFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=qc+xRPVQm9mJbJp0AFDXS3PISfRQyNuqmbfFm4KOTTc=; b=AilMFiHCPgCgmDk0w3Xox80U/ZU0TKs1HSXZpq6NGNkGGRU5xIyoP229mfcoHIGfQj mgnpGMdW2F3JqHMktLh5iKfoBtHWrZgJtSCGlaga2fwPgEwgQJYA8uHbC6NnLBzpTmLh GIilikLf+rQglRshAOfxlqntYM8nDqt+pqd1Gc0rtA2z/MFYF4MVBoCDoZjOTXuzRBpn C7HjHlkjvvdDeIQLWBwMHyx51twzBbT4D7AIBBisZNKLXQdzm4qaVBniA+rvXDoNYad3 w+aHrfGRionj0ImJIzzyZsONZ4c/NkWQ4NIZNj9B0kGEkeGyoz3R9bFY3SDNghdXHaVe JURw== X-Gm-Message-State: APjAAAV+hhG+yfvlqV0CUEQgYs7jvhxfaVG9ZsaL0+5UwK+/SYmMJbgo a5AvguqUsAbYccIKFGpiwYngOHVp X-Google-Smtp-Source: APXvYqzmzbHS/6BefqKF3cIb+m+hOI1+CaIfNdbyCISEP4imekPpinBPsjqy89AJgLRs6bm++J1jWA== X-Received: by 2002:a65:6904:: with SMTP id s4mr66699596pgq.33.1563796822201; Mon, 22 Jul 2019 05:00:22 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:21 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:21 +0800 Message-Id: <20190722115942.24962-15-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 14/35] rockchip: rk322x: add boot_devices mapping to support 'same-as-spl' X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The driver need a mapping to get the dts node by boot srouce ID. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk322x/rk322x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-rockchip/rk322x/rk322x.c b/arch/arm/mach-rockchip/rk322x/rk322x.c index c8c656ab4b..a8677b9783 100644 --- a/arch/arm/mach-rockchip/rk322x/rk322x.c +++ b/arch/arm/mach-rockchip/rk322x/rk322x.c @@ -3,9 +3,15 @@ * (C) Copyright 2019 Rockchip Electronics Co., Ltd */ #include +#include #include #include +const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { + [BROM_BOOTSOURCE_EMMC] = "dwmmc@30020000", + [BROM_BOOTSOURCE_SD] = "dwmmc@30000000", +}; + #ifdef CONFIG_DEBUG_UART_BOARD_INIT void board_debug_uart_init(void) { From patchwork Mon Jul 22 11:59:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134905 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jJOfA47p"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sjHs2Mr7z9sBZ for ; Mon, 22 Jul 2019 23:34:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 98435C21F22; Mon, 22 Jul 2019 13:33:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B236CC21E5B; Mon, 22 Jul 2019 12:05:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 24908C21C6A; Mon, 22 Jul 2019 12:05:02 +0000 (UTC) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by lists.denx.de (Postfix) with ESMTPS id A2441C21C6A for ; Mon, 22 Jul 2019 12:00:25 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id r7so17271301pfl.3 for ; Mon, 22 Jul 2019 05:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=A7MpJpEYH+qO78L6qySMbIndEc2HziAIuE0/7zzN22Q=; b=jJOfA47pqE+Q44SO6iUitChPgmrCOfkdrmZyH8GiqztA/9uBj2SOKIpO2Hu+bs8La6 qK/Ne/xjDtaIjxazs2eq9VmFpgs1eKPA6gE2pzKS9WXvGMrSv7Xd7mneVk/FrS1yD20l 1+CFNPgu9VU1z736VkN8Nf36nidcuzB+pnjy4u10qZmpumqv2ugbpkP2b2zT4p3dZ9/m y5IfaqI/OC/1iFQKvV4uBqnatRO3O/Qqr8+lxALe2yrMbDAMWdgwCfKqZq1AMnr6VtkM DzRZp/skxI7HZ4MatBE9blqM/+jpqUJRVFHXFguwUKw+JvPwjPIJoyucWomsJDAiQmpj m+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=A7MpJpEYH+qO78L6qySMbIndEc2HziAIuE0/7zzN22Q=; b=OmwKRoD/4MZPBtnS33hpaPEok/kx75EficE1GwFSWp6HOqgGplZYwu4qDNEwFcX3ao Z9U66TPBzqUqP/a13EvP8W7uTLcl7QsmKD1pNZJ3zZiIT99ZJNiPsx+7ICc5Q/k9ySkA 6bTuH+iM8AsLLhf+tfMP5bSY12BTonN/Q+xXWcvQn2Y9+5kz7bZ3cdtpo2RnOhJ8XPZM 9kUoh21IWYKfClLhmeDbORSpW0kgrgiWmZTwtsm5Jl0L+4JAJhEGDCdZMTlA8ndCCSCj wJqovDIo/+s40zNxLNgfBsckSKs8NOJqcgS6fYb5tutOtadnk6Gni70LfNbpGpe2tXrD MsEA== X-Gm-Message-State: APjAAAWZCGq0Euw4SCLIOeE8GNbQzbziXQJhE+M6k5/8Uui5XhuA4Kmf nTvRLsU8pNhDxemb0sb8uF7dYYt0 X-Google-Smtp-Source: APXvYqz4RldGwp+hjrOyc6mlUrLuK6DJc+ndkpeSS/KXbVHM9LwtB4ltd51jy/KFYUbD7brAVTpe+A== X-Received: by 2002:a63:5048:: with SMTP id q8mr70524509pgl.446.1563796824155; Mon, 22 Jul 2019 05:00:24 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:23 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:22 +0800 Message-Id: <20190722115942.24962-16-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 15/35] rockchip: fit_spl_optee: rockchip: fix warning unit_address_vs_reg X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Update to fix warning: u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/uboot@1 has a unit name, but no reg property u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/optee@1 has a unit name, but no reg property u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /images/fdt@1 has a unit name, but no reg property u-boot.itb.tmp: Warning (unit_address_vs_reg): Node /configurations/conf@1 has a unit name, but no reg property Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/fit_spl_optee.its | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-rockchip/fit_spl_optee.its b/arch/arm/mach-rockchip/fit_spl_optee.its index 9be4b3c8d2..6ed5d486f2 100644 --- a/arch/arm/mach-rockchip/fit_spl_optee.its +++ b/arch/arm/mach-rockchip/fit_spl_optee.its @@ -11,7 +11,7 @@ #address-cells = <1>; images { - uboot@1 { + uboot { description = "U-Boot"; data = /incbin/("../../../u-boot-nodtb.bin"); type = "standalone"; @@ -20,7 +20,7 @@ compression = "none"; load = <0x61000000>; }; - optee@1 { + optee { description = "OP-TEE"; data = /incbin/("../../../tee.bin"); type = "firmware"; @@ -30,7 +30,7 @@ load = <0x68400000>; entry = <0x68400000>; }; - fdt@1 { + fdt { description = "dtb"; data = /incbin/("../../../u-boot.dtb"); type = "flat_dt"; @@ -39,12 +39,12 @@ }; configurations { - default = "conf@1"; - conf@1 { + default = "conf"; + conf { description = "Rockchip armv7 with OP-TEE"; - firmware = "optee@1"; - loadables = "uboot@1"; - fdt = "fdt@1"; + firmware = "optee"; + loadables = "uboot"; + fdt = "fdt"; }; }; }; From patchwork Mon Jul 22 11:59:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134913 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vHJuXNTe"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sjPX0Lknz9s8m for ; Mon, 22 Jul 2019 23:38:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 935A7C22055; Mon, 22 Jul 2019 13:38:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1262CC21E1D; Mon, 22 Jul 2019 12:05:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DCFE9C21E1D; Mon, 22 Jul 2019 12:05:08 +0000 (UTC) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by lists.denx.de (Postfix) with ESMTPS id 93264C21E4F for ; Mon, 22 Jul 2019 12:00:27 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id r7so17271359pfl.3 for ; Mon, 22 Jul 2019 05:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=c/Z3Vqpn+GWe6EIxK7MkNL2RnzZJshUSyizarHm0oos=; b=vHJuXNTexVXTRUNoFymJq6FprOcgu9NtmOSSJ1Q6WYTFWU/cvG5TbOBXyJPgGfS5yS 7T8lKIt522LCNLqCkTgZQTIlCqt8nG+/UtHxv2y1TB10UVnGFQgRACoG+tRojC70Xc+S 7Cl4Ya5QeWQKqoYXbmp6kficLvgVTH8cERtUz3v8YVq5atpIdfvnSkUk/nIqhn4y4jI/ Aimvlerkqk/zrNKySn+2p4sdI2/hYprQ9MLHUT05qmdVLIKTmq8r4aqpsBd9b2m61C1X uRjFlTaU/jRF5batURPF+2uxhM5sONMe9RvR5avO1sqaLJMZe2/+OV/i7d2IUY2zRR/2 kQMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=c/Z3Vqpn+GWe6EIxK7MkNL2RnzZJshUSyizarHm0oos=; b=LOYNeNyO3h0jsAIhYMz+rWkaQCmsWMbDlvSkytLUMPB1ZGadJUL582UutyFeJbCOq3 3ZzKvyT+iFykcaGwXqw33ObOKSXbHIMqdd2K84Zwul4+8d9KHGNNo3uV38XdfXZxw72F DE8Mh/gWivXj8cjlON4l6hOQ8y+CEAaLBztbCAHxtHTbs6T0kIiBLxFF75JDEJ4/GL6v gQaGZvCQYPz7U96MtqO53sOZjqC/JnIqPlzHH0LvqiEcrLTLXbfR+o0eWoDq0QJJ+41w RnIGviPqD+eFkaHQJZIQH2nF7EX+u3Mbqo1M9PAkCghIsk9100HCO9I0ksY7UDjJkcsZ qADg== X-Gm-Message-State: APjAAAXMhITb9UXKB8w3esSKUgjXICaljDbOZzC6FOcBhDerN6EpDYph NvveTtcAvkhzyxn0D5WjCOdu6x8w X-Google-Smtp-Source: APXvYqxmr+NG4AVMKEAeBhpn3XYm6RFKie2h7MSw2KBAUFFh8saZV79K9rUHyEM6yTHcEHZex1wm8A== X-Received: by 2002:a63:d941:: with SMTP id e1mr38229922pgj.75.1563796826061; Mon, 22 Jul 2019 05:00:26 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:25 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:23 +0800 Message-Id: <20190722115942.24962-17-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 16/35] rockchip: rk3288: show SPL BANNER earlier in board_init_f() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Show the SPL BANNER earlier so that we know already get into SPL. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3288-board-spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index 9efba47aff..6fbb22075c 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -167,6 +167,8 @@ void board_init_f(ulong dummy) arch_cpu_init(); + preloader_console_init(); + ret = rockchip_get_clk(&dev); if (ret) { debug("CLK init failed: %d\n", ret); @@ -227,8 +229,6 @@ void spl_board_init(void) hang(); } - preloader_console_init(); - return; } From patchwork Mon Jul 22 11:59:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134921 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ol6lIGtd"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sjW14nxbz9sMQ for ; Mon, 22 Jul 2019 23:43:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 56D40C21F18; Mon, 22 Jul 2019 13:43:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 705CBC21F3F; Mon, 22 Jul 2019 12:05:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 27C3CC21F3F; Mon, 22 Jul 2019 12:05:12 +0000 (UTC) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by lists.denx.de (Postfix) with ESMTPS id 1F5CFC21E90 for ; Mon, 22 Jul 2019 12:00:30 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id b7so19159783pls.6 for ; Mon, 22 Jul 2019 05:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=m9sBLir0dn9qwEyWfx3sandUBaDEVSkBSarr3AdCWI0=; b=Ol6lIGtdZkH4kZPJFTMPv0wv4yOqW4JSR+0VHIP0hLwINqu4p5r7o2/lPDM+vGxWeL A39fl/Yib+dvir9gvHcbV/K0MSwn1ZD1nScyrs+DmyUqgmS1ScH7AG+jiIqqqr02UXVc xNnvRAaFghVjq8LOod4lMoO9E481Uww6Tdj4mSUTj914fiKDRlAcHB2Pnbk0jWsr+EL7 X5PzLuXJyobx9w5KawndsY7ZTmGLBxM4/nNhynKygGvkIn/hBUBweijUjSfzAwLcidPG jTLB8SdZ9iH7p2PeAn+pjHyFYkmekgB+KbZFkjOTMYvlcTkzBK65YV4pvHyxBBCsyr7t DgnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=m9sBLir0dn9qwEyWfx3sandUBaDEVSkBSarr3AdCWI0=; b=JTBwsaA0LHxHJM1V7aO0mCR1DbiKPS2J3mthInjwVTdFHXymzc3V138xl2WQPjrBwN 2AsDqJHOmCdOxDsKN2JaFapHhOd7o+VyJa8x87p1XS64EOI22PaZD2Fx52yrlD2SyF+Z m6pSlg49rXxi1JsVtZN2MAVzRz/hX1DxBB8if3CHjCEOGaviH8SOCKIukQeroLthclj/ oBOpfGclxiypCrvNzu0Y+6UGqocb30oQ5iZiheiQUjPGJ+1uecWN/1TvroLNpA5XEkxS akm/DOpdVngJxedtAdk56it6t6nWDOntOmCV9u7OFoXxwWdagPObzb84Fp+UYVrr5zR2 KE/g== X-Gm-Message-State: APjAAAXJmfqmReJZq88ZnARaCHq4a7plBH5mGWg4TQJFfBYvqs9AX9y7 yLpLyvrGxhEsiVWxoSCrhPYZEDBO X-Google-Smtp-Source: APXvYqyaHl5TkOpn9okKV9Tc83UIdz5KK0X+Odt14DXiyC0bM4FLV/f6EJBF9+wzr0fdAOXJAAHM0A== X-Received: by 2002:a17:902:e306:: with SMTP id cg6mr75065667plb.263.1563796828704; Mon, 22 Jul 2019 05:00:28 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:28 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:24 +0800 Message-Id: <20190722115942.24962-18-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Cc: "Marty E. Plummer" , Michal Simek , Joe Hershberger Subject: [U-Boot] [PATCH 17/35] rockchip: rk3288: move setup_led() to firefly-rk3288 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Only firefly-rk3288 has the dts node "u-boot,boot-led", while CONFIG_SPL_LED is not enable, move code to firefly-rk3288 now in case someone need this code. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 - arch/arm/mach-rockchip/rk3288-board-spl.c | 36 ------------------- arch/arm/mach-rockchip/rk3288/Kconfig | 1 + board/firefly/firefly-rk3288/firefly-rk3288.c | 36 +++++++++++++++++++ 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 1904322091..ef9d6e1fac 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -73,7 +73,6 @@ config ROCKCHIP_RK322X config ROCKCHIP_RK3288 bool "Support Rockchip RK3288" select CPU_V7A - select SPL_BOARD_INIT if SPL select SUPPORT_SPL select SPL select SUPPORT_TPL diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index 6fbb22075c..6db5369a10 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -196,42 +196,6 @@ void board_init_f(ulong dummy) #endif } -static int setup_led(void) -{ -#ifdef CONFIG_SPL_LED - struct udevice *dev; - char *led_name; - int ret; - - led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led"); - if (!led_name) - return 0; - ret = led_get_by_label(led_name, &dev); - if (ret) { - debug("%s: get=%d\n", __func__, ret); - return ret; - } - ret = led_set_on(dev, 1); - if (ret) - return ret; -#endif - - return 0; -} - -void spl_board_init(void) -{ - int ret; - - ret = setup_led(); - if (ret) { - debug("LED ret=%d\n", ret); - hang(); - } - - return; -} - #ifdef CONFIG_SPL_OS_BOOT #define PMU_BASE 0xff730000 diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index de8d9c24f1..6e3ab1d06b 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -66,6 +66,7 @@ config TARGET_FENNEC_RK3288 config TARGET_FIREFLY_RK3288 bool "Firefly-RK3288" select BOARD_LATE_INIT + select SPL_BOARD_INIT if SPL help Firefly is a RK3288-based development board with 2 USB ports, HDMI, VGA, micro-SD card, audio, WiFi and Gigabit Ethernet, It diff --git a/board/firefly/firefly-rk3288/firefly-rk3288.c b/board/firefly/firefly-rk3288/firefly-rk3288.c index bdc02a6a79..a3f784f0a3 100644 --- a/board/firefly/firefly-rk3288/firefly-rk3288.c +++ b/board/firefly/firefly-rk3288/firefly-rk3288.c @@ -4,3 +4,39 @@ */ #include + +#ifdef CONFIG_SPL_BUILD +static int setup_led(void) +{ +#ifdef CONFIG_SPL_LED + struct udevice *dev; + char *led_name; + int ret; + + led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led"); + if (!led_name) + return 0; + ret = led_get_by_label(led_name, &dev); + if (ret) { + debug("%s: get=%d\n", __func__, ret); + return ret; + } + ret = led_set_on(dev, 1); + if (ret) + return ret; +#endif + + return 0; +} + +void spl_board_init(void) +{ + int ret; + + ret = setup_led(); + if (ret) { + debug("LED ret=%d\n", ret); + hang(); + } +} +#endif From patchwork Mon Jul 22 11:59:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134923 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mcolwfRg"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sjcf31mHz9s8m for ; Mon, 22 Jul 2019 23:48:34 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1B814C21F48; Mon, 22 Jul 2019 13:48:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E5804C21E52; Mon, 22 Jul 2019 12:05:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DC203C21E90; Mon, 22 Jul 2019 12:05:18 +0000 (UTC) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by lists.denx.de (Postfix) with ESMTPS id D975BC21E52 for ; Mon, 22 Jul 2019 12:00:32 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id u17so17555627pgi.6 for ; Mon, 22 Jul 2019 05:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=R9nm52fhcqXV1smiIsdfBNSyU2gENF115ky5G4OE+T4=; b=mcolwfRgX4rtrbFIyayxunXWo6lJSvXoxrZxjF1zII1qffiXd9dggnPCl2xJC7J/Yt yL/3/La7nwoxh2u2n1Y/llwQAzLVSgZcUEb0FTSOW5uKr+RgcRsz5KZcbpwv7QbaVRoY IIaWzsvpP0F6wPSX3dWYk5eGYf/lo37hGwXloPBAvZJn/0P0cFJ6iYbbd0fhphiiFTJK URTA4/p3jO8rDBg9XmfVA2A7unhrDAk0e9DjPiqMPmBovhFrXN1NJXr1XCWNl54m7Wo+ OJ4dg9ivKaL/8iIK7D000Z6AkyG30LcMhrvS47Ex7dJXT59daVtpWhRuQxaqGwz5vCX9 zxeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=R9nm52fhcqXV1smiIsdfBNSyU2gENF115ky5G4OE+T4=; b=c/HYvbI60J1YpNMo/ucCkYrKk4TE1d7TEiqk/0WamIiN7oC71OruTjWh72WHlMY4EI TZxLZp/KDQSzUVbuoIGYbzwH+brjm6wVGa/25XhfhWCS9/dZL7fymW3PJnWE3RP+n+n7 b/pAVU6KVeB/vw5AKnPyg2HEze0uq/ZU6gZYBe2hwm79qXy/A2IJUfG1rRYyhx3+56E6 c9yfHXbwmWi49EBGhn5FNvHYeJC2eEuziRHdbciaK+QMX91IiqWQPb9yjO0N2IrON0Fy 6sF5WCt2DZlhHus+w8g/xTWJ8n26KxQfJYygN49pLqlAxt/aVWmi4qxIbJjDOs1YTkuP izKA== X-Gm-Message-State: APjAAAU1XoTJVQEMTBT2O6kq3kWF3ltFyKAi6xsYonf1IT6JxyfM1rgj vMZkkwC5+eDqZPMG2VLjGXhD0twN X-Google-Smtp-Source: APXvYqygCWVQs7A9VPwZt2kTlGIkQjcHjkg/F8vVRq6RGOUt9Qb31aix8BeGCvjTozr1r6XT/GNJNw== X-Received: by 2002:a63:ff0c:: with SMTP id k12mr30736007pgi.186.1563796831383; Mon, 22 Jul 2019 05:00:31 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:30 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:25 +0800 Message-Id: <20190722115942.24962-19-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Cc: "Marty E. Plummer" , Alexey Brodkin , Michal Simek , Joe Hershberger Subject: [U-Boot] [PATCH 18/35] rockchip: rk3288-phycore: move phycore_init() to its own board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" phycore_init() is use for phycore board only, it should be move back to phycore-rk3288.c Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3288-board-spl.c | 39 ---------------- arch/arm/mach-rockchip/rk3288/Kconfig | 1 + board/phytec/phycore_rk3288/phycore-rk3288.c | 47 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 39 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index 6db5369a10..13cd86079b 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -25,8 +25,6 @@ #include #include #include -#include -#include DECLARE_GLOBAL_DATA_PTR; @@ -81,32 +79,6 @@ fallback: return BOOT_DEVICE_MMC1; } -#if !defined(CONFIG_SPL_OF_PLATDATA) -static int phycore_init(void) -{ - struct udevice *pmic; - int ret; - - ret = uclass_first_device_err(UCLASS_PMIC, &pmic); - if (ret) - return ret; - -#if defined(CONFIG_SPL_POWER_SUPPORT) - /* Increase USB input current to 2A */ - ret = rk818_spl_configure_usb_input_current(pmic, 2000); - if (ret) - return ret; - - /* Close charger when USB lower then 3.26V */ - ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000); - if (ret) - return ret; -#endif - - return 0; -} -#endif - __weak int arch_cpu_init(void) { return 0; @@ -175,17 +147,6 @@ void board_init_f(ulong dummy) return; } -#if !defined(CONFIG_SPL_OF_PLATDATA) - if (of_machine_is_compatible("phytec,rk3288-phycore-som")) { - ret = phycore_init(); - if (ret) { - debug("Failed to set up phycore power settings: %d\n", - ret); - return; - } - } -#endif - #if !defined(CONFIG_SUPPORT_TPL) debug("\nspl:init dram\n"); ret = uclass_get_device(UCLASS_RAM, 0, &dev); diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig index 6e3ab1d06b..87d0786ba8 100644 --- a/arch/arm/mach-rockchip/rk3288/Kconfig +++ b/arch/arm/mach-rockchip/rk3288/Kconfig @@ -85,6 +85,7 @@ config TARGET_MIQI_RK3288 config TARGET_PHYCORE_RK3288 bool "phyCORE-RK3288" select BOARD_LATE_INIT + select SPL_BOARD_INIT if SPL help Add basic support for the PCM-947 carrier board, a RK3288 based development board made by PHYTEC. This board works in a combination diff --git a/board/phytec/phycore_rk3288/phycore-rk3288.c b/board/phytec/phycore_rk3288/phycore-rk3288.c index ffe1833b06..fbf1511978 100644 --- a/board/phytec/phycore_rk3288/phycore-rk3288.c +++ b/board/phytec/phycore_rk3288/phycore-rk3288.c @@ -8,10 +8,13 @@ #include #include #include +#include #include #include #include #include "som.h" +#include +#include static int valid_rk3288_som(struct rk3288_som *som) { @@ -68,3 +71,47 @@ int rk_board_late_init(void) return 0; } + +#ifdef CONFIG_SPL_BUILD +#if !defined(CONFIG_SPL_OF_PLATDATA) +static int phycore_init(void) +{ + struct udevice *pmic; + int ret; + + ret = uclass_first_device_err(UCLASS_PMIC, &pmic); + if (ret) + return ret; + +#if defined(CONFIG_SPL_POWER_SUPPORT) + /* Increase USB input current to 2A */ + ret = rk818_spl_configure_usb_input_current(pmic, 2000); + if (ret) + return ret; + + /* Close charger when USB lower then 3.26V */ + ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000); + if (ret) + return ret; +#endif + + return 0; +} +#endif + +void spl_board_init(void) +{ +#if !defined(CONFIG_SPL_OF_PLATDATA) + int ret; + + if (of_machine_is_compatible("phytec,rk3288-phycore-som")) { + ret = phycore_init(); + if (ret) { + debug("Failed to set up phycore power settings: %d\n", + ret); + return; + } + } +#endif +} +#endif From patchwork Mon Jul 22 11:59:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134926 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pxjLHEUy"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sjkB5C69z9sDQ for ; Mon, 22 Jul 2019 23:53:22 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A1A0CC22087; Mon, 22 Jul 2019 13:53:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4C652C21F62; Mon, 22 Jul 2019 12:05:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 38F05C21F5E; Mon, 22 Jul 2019 12:05:26 +0000 (UTC) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by lists.denx.de (Postfix) with ESMTPS id BD024C21E89 for ; Mon, 22 Jul 2019 12:00:34 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id y15so17271801pfn.5 for ; Mon, 22 Jul 2019 05:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xu+PGIHjI+EfarF/ShoD6fFP4zHpl2rtAQ0CvqFNXTI=; b=pxjLHEUyO2tlmaRvr2jgqcUZtS72azIZiJocoRulHuEsRrY8f5gb5LiHa4szXXpXDp RK77+0wzUNqRkchLcLAmnyOKFUFtDAJyB5ykbLIQbE5FtcYJS5n8CIKo6abEdVipVeSq 0KMtIy6WVVi0Yun6lhlKAOLbbGM1tSTNAQ30sI6xY7EzCheMTF0eg65ALeA92mjNdDiC WLP6900yfyjKGM91TS3nqSi8IQsdfrUCr5fdE1k5VXsnc3m9mTRa7jy1XO8vMk+f7IA+ NiB38ooUD1GSbTMIYt0sBR8iGiXazPmRFf1X2gp3FegPASuFsbIaADRlfbSKNSd5TcJg LPfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=xu+PGIHjI+EfarF/ShoD6fFP4zHpl2rtAQ0CvqFNXTI=; b=nzXZXSikGbWBoy8Lt+n6aoAgCweYcBGJgGUY1K34ww1IbhvgbWT1qNQmLbe75qgVmN A7pqYOlMCusTIfrWHixCFze0xGwagHTRCPuR1m6wKzymWyMlZb07jF/rnTKtyWPjq8Ef sAZ9LXNxnXf9tbBppPwtJ+002aaiWoCwAP/gdz4zHGw34yOFExKKaRasZDr4yJLJMgms s8fiQGmM6yF1LHVQ/xCBjx0iXQY1MeVAEdHPDRPLxNIL8yXMx4xH35yYEnHYjiEMrsul xfhODLm+GAt/Aj6GWxBBMFBnrVqmqmNQvy7gqkThc8h5lhzI1E+RMSaVLXqs/EVFfFnD Zcng== X-Gm-Message-State: APjAAAUAeNTU7QfhMjG6LcvMoUbjrSW0sq74vq4yLlCLgxnK2ShOfzJN gCI2ChJ3R+XGmuRdak1pfenr4YaX X-Google-Smtp-Source: APXvYqxl/ZTWJ1tz50ZqXZZE9vzlCyntqyLjrRnxVf+t0EACRoGE8uuD3+6Mt29em9xHjx0rtErJmg== X-Received: by 2002:a65:5188:: with SMTP id h8mr38765528pgq.294.1563796833338; Mon, 22 Jul 2019 05:00:33 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:32 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:26 +0800 Message-Id: <20190722115942.24962-20-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 19/35] rockchip: rk3288: move dram_init_banksize() into soc file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Mov edram_init_banksize() into rk3288.c so that we can re-use the common SPL board file later. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3288-board-spl.c | 15 --------------- arch/arm/mach-rockchip/rk3288/rk3288.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c index 13cd86079b..97853ccdc7 100644 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c @@ -156,18 +156,3 @@ void board_init_f(ulong dummy) } #endif } - -#ifdef CONFIG_SPL_OS_BOOT - -#define PMU_BASE 0xff730000 -int dram_init_banksize(void) -{ - struct rk3288_pmu *const pmu = (void *)PMU_BASE; - size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]); - - gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; - gd->bd->bi_dram[0].size = size; - - return 0; -} -#endif diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c index 7552472fbc..2526c04c58 100644 --- a/arch/arm/mach-rockchip/rk3288/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288/rk3288.c @@ -57,3 +57,18 @@ void board_debug_uart_init(void) GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT); } #endif + +#ifdef CONFIG_SPL_OS_BOOT + +#define PMU_BASE 0xff730000 +int dram_init_banksize(void) +{ + struct rk3288_pmu *const pmu = (void *)PMU_BASE; + size_t size = rockchip_sdram_size((phys_addr_t)&pmu->sys_reg[2]); + + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + gd->bd->bi_dram[0].size = size; + + return 0; +} +#endif From patchwork Mon Jul 22 11:59:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134927 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="arI8QxH6"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sjqs5vPVz9s8m for ; Mon, 22 Jul 2019 23:58:15 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 05AC3C2205A; Mon, 22 Jul 2019 13:58:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A1C99C21F69; Mon, 22 Jul 2019 12:05:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EDBE8C21F69; Mon, 22 Jul 2019 12:05:28 +0000 (UTC) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by lists.denx.de (Postfix) with ESMTPS id DFEACC21EA2 for ; Mon, 22 Jul 2019 12:00:36 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id p184so17258183pfp.7 for ; Mon, 22 Jul 2019 05:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=J7iu2nAgidjnHYlBTmvmryU0qsjuHYJGkHa1al/k4Us=; b=arI8QxH6RG1wfGTyZSsFL6DT1+tRiR4yl8gJE8Z267hi2QNqKqnVg78MBWw/iDcpL5 TfG7HlQEmGsOuV9ahLwXpmsHwpCDH7+YD3qX83558DYLz7pb6mYhqXeof/nDfhDGSr48 u31HOcNV9wEGuGjRMKdCIN0ZcFzMpXtmXVLGVPGxmZKGAPWepEnAtFVn+pJuCeo3WMuG Hs09WL8VTAwegIlzhrLLzaiRHrp5ePL2uJ50sH6/Ug0MArqM8qCOL+k3fpRA7x4Kdm1Q AN4hA5w+EjA9sI2Sn1NcS6fKlI96eVs6ILX/ZiWdKdlg1udj2nxTkxDwLIL/3jTAg0tI 98WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=J7iu2nAgidjnHYlBTmvmryU0qsjuHYJGkHa1al/k4Us=; b=gguuPCBaBRr+ZCJAfQx30J12HQMjzAu7D1FqcnKOlkQ2fBnUjhngBHM/dTIhCk09jE MgMpKZ8+wLBfOvOuT1/TpEVxJm6dVlH+47SdxOqHqXHl/qr9NdxntEXJ7gqE4gevfRLT kiLe8WsGSlSVpELtLq8uqViVh5NEHycATlhZf1R+rqQYYmKVN2VzzrgNbl50ZAjtlWQ/ 1z0oLwtXuLibOlYuhUWVX/Z/CBmgT1JOn5U6kt49fyxfBNqWO9DklCselOOz4IB973y+ V5Rr8dQTTc5A1SwgZeMaEpef8eZpDnyQ/9/ESdLWnSVbbdyQyFrhrZpSdmF2MVlz4EpG MSXA== X-Gm-Message-State: APjAAAVbZ5Bz/a2Ojgjfgxi/q4LnbILnV1Ty4ADPqlG+Wv39oCFY3Fbj nGk+Pwa1O5m9aqxZmOYj8Xe6BjNZ X-Google-Smtp-Source: APXvYqyNio6u4JFlvy17Q9+ev1RF1eChLjhLNZz04Va25Qm5QZpsCFCOoaxl4QuwqnAfTylywCfk+Q== X-Received: by 2002:a63:2004:: with SMTP id g4mr68270948pgg.97.1563796835256; Mon, 22 Jul 2019 05:00:35 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:34 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:27 +0800 Message-Id: <20190722115942.24962-21-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 20/35] rockchip: rk3288: Migrate to use common spl board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" rk3288 has similar boot flow in SPL with other Rockchip SoCs, migrate to use common spl board file. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 - arch/arm/mach-rockchip/rk3288-board-spl.c | 158 ---------------------- 3 files changed, 1 insertion(+), 159 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3288-board-spl.c diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index ef9d6e1fac..34979206d2 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -76,6 +76,7 @@ config ROCKCHIP_RK3288 select SUPPORT_SPL select SPL select SUPPORT_TPL + imply SPL_ROCKCHIP_COMMON_BOARD imply TPL_CLK imply TPL_DM imply TPL_DRIVERS_MISC_SUPPORT diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index e58da5c899..808ca43ca0 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o -obj-spl-$(CONFIG_ROCKCHIP_RK3288) += rk3288-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3328) += rk3328-board-spl.o obj-spl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c b/arch/arm/mach-rockchip/rk3288-board-spl.c deleted file mode 100644 index 97853ccdc7..0000000000 --- a/arch/arm/mach-rockchip/rk3288-board-spl.c +++ /dev/null @@ -1,158 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2015 Google, Inc - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -void board_return_to_bootrom(void) -{ - back_to_bootrom(BROM_BOOT_NEXTSTAGE); -} - -u32 spl_boot_device(void) -{ -#if !CONFIG_IS_ENABLED(OF_PLATDATA) - const void *blob = gd->fdt_blob; - struct udevice *dev; - const char *bootdev; - int node; - int ret; - - bootdev = fdtdec_get_config_string(blob, "u-boot,boot0"); - debug("Boot device %s\n", bootdev); - if (!bootdev) - goto fallback; - - node = fdt_path_offset(blob, bootdev); - if (node < 0) { - debug("node=%d\n", node); - goto fallback; - } - ret = device_get_global_by_ofnode(offset_to_ofnode(node), &dev); - if (ret) { - debug("device at node %s/%d not found: %d\n", bootdev, node, - ret); - goto fallback; - } - debug("Found device %s\n", dev->name); - switch (device_get_uclass_id(dev)) { - case UCLASS_SPI_FLASH: - return BOOT_DEVICE_SPI; - case UCLASS_MMC: - return BOOT_DEVICE_MMC1; - default: - debug("Booting from device uclass '%s' not supported\n", - dev_get_uclass_name(dev)); - } - -fallback: -#elif defined(CONFIG_TARGET_CHROMEBOOK_JERRY) || \ - defined(CONFIG_TARGET_CHROMEBIT_MICKEY) || \ - defined(CONFIG_TARGET_CHROMEBOOK_MINNIE) || \ - defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY) - return BOOT_DEVICE_SPI; -#endif - return BOOT_DEVICE_MMC1; -} - -__weak int arch_cpu_init(void) -{ - return 0; -} - -#define TIMER_LOAD_COUNT_L 0x00 -#define TIMER_LOAD_COUNT_H 0x04 -#define TIMER_CONTROL_REG 0x10 -#define TIMER_EN 0x1 -#define TIMER_FMODE BIT(0) -#define TIMER_RMODE BIT(1) - -void rockchip_stimer_init(void) -{ - /* If Timer already enabled, don't re-init it */ - u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); - - if (reg & TIMER_EN) - return; - - asm volatile("mcr p15, 0, %0, c14, c0, 0" - : : "r"(COUNTER_FREQUENCY)); - - writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4); - writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE + - TIMER_CONTROL_REG); -} - -void board_init_f(ulong dummy) -{ - struct udevice *dev; - int ret; - -#ifdef CONFIG_DEBUG_UART - /* - * Debug UART can be used from here if required: - * - * debug_uart_init(); - * printch('a'); - * printhex8(0x1234); - * printascii("string"); - */ - debug_uart_init(); - debug("\nspl:debug uart enabled in %s\n", __func__); -#endif - ret = spl_early_init(); - if (ret) { - debug("spl_early_init() failed: %d\n", ret); - hang(); - } - - /* Init secure timer */ - rockchip_stimer_init(); - /* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */ - timer_init(); - - arch_cpu_init(); - - preloader_console_init(); - - ret = rockchip_get_clk(&dev); - if (ret) { - debug("CLK init failed: %d\n", ret); - return; - } - -#if !defined(CONFIG_SUPPORT_TPL) - debug("\nspl:init dram\n"); - ret = uclass_get_device(UCLASS_RAM, 0, &dev); - if (ret) { - debug("DRAM init failed: %d\n", ret); - return; - } -#endif -} From patchwork Mon Jul 22 11:59:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134936 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LrrB5mKR"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sjxq4ZxGz9s8m for ; Tue, 23 Jul 2019 00:03:27 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5958FC220A7; Mon, 22 Jul 2019 14:03:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F3327C21F63; Mon, 22 Jul 2019 12:05:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4CF57C21E85; Mon, 22 Jul 2019 12:05:32 +0000 (UTC) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by lists.denx.de (Postfix) with ESMTPS id A2A8CC21E85 for ; Mon, 22 Jul 2019 12:00:38 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id i189so17269424pfg.10 for ; Mon, 22 Jul 2019 05:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=GAw2VQxEXW3H2FhkdYySpFNRjMRjjklM7HLseD14lcg=; b=LrrB5mKR0PUCaVKw0w0QUWche8hn3EMlCL/023YM3lItvfcy+PVdYomcrAQXWFPPp/ zv6NosSazSTP8kQp8+66Nh/tXY0+xMV9iaE6MTWXobmxNZQEtSgmVA74NRp/Z6CKNatN neOw5iLdbcD0llsBPbdvdbWMRjHM5AfJiz08GdJ4MiwqWp32LDDEGy99ycuC4pT3OT2p nGjYLjnxpUifNF7+AtIh+kjpej3qFCdWklW3P6N+VIIASWQ66a3fIlg9551wnDhCH3IA EL22Xqak1FqIiwLwuHbAOWvtBs7wpJCbWSdzw9SC7HiBfoOeAM60nyhj6o68R9pd2jD0 Ekmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=GAw2VQxEXW3H2FhkdYySpFNRjMRjjklM7HLseD14lcg=; b=kBvEhu1suj622uMZs5Umh++96OUm9nqf9hRIYkQX+OpXjvEs473BAM59Tk4JDW+5cH Rr7Xuebg2Ji17MrLRkrQUKnFARvH4zdgbKvrVc98G8o2IOut8tDZGpkN2jzyHtjMFYMw TYDjAgMvLcBHFu/JDtjIPgolwpVABvv2BI3L9e6RbpIvpG8jq9uePCxYNCVsRfiybHDh 8CEtXZFLQ46T3saOwAwCu2iNcbstDhSSPSAoacB/820SF4a1s1grjGAOwTZ5lfDhNRUg oLTFpDl6ha1Ymwcdh534GpAIXG8Ln4K706ja5czrhOmlem/NPzgzQI4GIgJ6zS7JNk20 qnvQ== X-Gm-Message-State: APjAAAVdJU6fQeuYfFz/HffRVg1SIt0pG+fyneMN2X73cCvAr1H+mHiq BwR++R9cZ7amDN8s2eCXDNeDPanv X-Google-Smtp-Source: APXvYqzTsnklOFgAYsrDiqPVDLCqNvM1GMbWQ4gd8Lx70YFzV66R8J9X7/GimFxoFiHYn8UuNUFlPQ== X-Received: by 2002:a17:90a:25c8:: with SMTP id k66mr77062382pje.129.1563796837261; Mon, 22 Jul 2019 05:00:37 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.35 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:36 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:28 +0800 Message-Id: <20190722115942.24962-22-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 21/35] rockchip: phycore: remove no use "u-boot, boot0" in dts X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" We are using "u-boot,spl-boot-order" now and re-use the definition from rk3288-u-boot.dtsi, so remove it directly here. Signed-off-by: Kever Yang --- arch/arm/dts/rk3288-phycore-rdk.dts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/arm/dts/rk3288-phycore-rdk.dts b/arch/arm/dts/rk3288-phycore-rdk.dts index f2bb7b5f11..cc3921095c 100644 --- a/arch/arm/dts/rk3288-phycore-rdk.dts +++ b/arch/arm/dts/rk3288-phycore-rdk.dts @@ -55,11 +55,6 @@ stdout-path = &uart2; }; - config { - u-boot,dm-pre-reloc; - u-boot,boot0 = &emmc; - }; - user_buttons: user-buttons { compatible = "gpio-keys"; pinctrl-names = "default"; From patchwork Mon Jul 22 11:59:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134956 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="T0IBN0Wr"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sk3g0djXz9s8m for ; Tue, 23 Jul 2019 00:08:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id BAFFAC22084; Mon, 22 Jul 2019 14:08:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6AE15C21F60; Mon, 22 Jul 2019 12:05:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 42D2CC21F75; Mon, 22 Jul 2019 12:05:41 +0000 (UTC) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by lists.denx.de (Postfix) with ESMTPS id E520CC21DED for ; Mon, 22 Jul 2019 12:00:40 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id az7so19114948plb.5 for ; Mon, 22 Jul 2019 05:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=oJVcDTKffEj+5qMKIZ0XSttFV669SO3/5bGiJqaqS+8=; b=T0IBN0WrGRCnf+Ohs0zEuAnlFwMEmbqjKyIWeJ7rD66HsWvk6Oz6bjI0qoH2COdfo5 r+dMY5Z4zdeUcvUP03oSEJLASp/FFCwHy3+UCvinBcrEMkk/NOXjwfrYd+tMZUSx/YFD xMwd+rIossKIMQZdsSa849DyusEA3bGFmJIy1qr1MsRG/wy1/PbN7oF2gb6ZO5Esu6EY FYSra2HKK01bw3qQDyeg1HSqwPyxiRMnA04g5znHy7qfANLPedZBjQDfGb/i/QfYRMyE NfBVtw8313OXFiwefm5tMsMCy/kGI8NgiCdRG1oVlz83Nh210vbBH7VMlacRVDXTH0NN Vf1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=oJVcDTKffEj+5qMKIZ0XSttFV669SO3/5bGiJqaqS+8=; b=IL/5YUxuGh9FOKAHTkDmM0WWcLS9d8ZUDmFOAMhzfT2yaTFPmFGOVRySj2QVcA+K9W 3IWaw22ajwwow57gMWk8OWdLe9Gaimg96GpFZUASEH4xK/a1RqwXerSQzvq3xGJLMkfI t1+8+laS6YtzpAOb2gyRzmFIck2FFn9u2yNmj6Hhjoq7mjFvvh14GMt1ZxnyJMil3tC5 SWjIJWFSLUF8a7kWRwizMR0gWOir1qYpkvAA5dSDEHfZfydIRmJAKaME2y0D88xCo6kG Gl6BovTUGGddCc1syZYWyIqUV/uTX32UFzCFvon01R1Izr3QRo0kOUSjfBNgVmcfu8TP zgNg== X-Gm-Message-State: APjAAAUK2C2M2N4iBSBpcGWx26UmzAlNLCE3TTT2fTNun0oGlHm72A3P zrd76Cv6ctjL+RPtzHVbYCy+3N99 X-Google-Smtp-Source: APXvYqy8oGsfr78IZwfk2GaWScRls+yp4H/0j23kWfVNQXwRm1aNPiu16FkQnFEQ8dn66Gd+V/iV9g== X-Received: by 2002:a17:902:1003:: with SMTP id b3mr15325354pla.172.1563796839604; Mon, 22 Jul 2019 05:00:39 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:39 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:29 +0800 Message-Id: <20190722115942.24962-23-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 22/35] rockchip: rk3288-veyron: Migrate "u-boot, boot0" to "u-boot, spl-boot-order" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" "u-boot,spl-boot-order" is more flexible and other rockchip SoCs has convert to use it, migrate to use the new dts property. Signed-off-by: Kever Yang --- arch/arm/dts/rk3288-veyron.dtsi | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/arm/dts/rk3288-veyron.dtsi b/arch/arm/dts/rk3288-veyron.dtsi index 916dd486de..8754043b9b 100644 --- a/arch/arm/dts/rk3288-veyron.dtsi +++ b/arch/arm/dts/rk3288-veyron.dtsi @@ -16,11 +16,7 @@ chosen { stdout-path = &uart2; - }; - - config { - u-boot,dm-pre-reloc; - u-boot,boot0 = &spi_flash; + u-boot,spl-boot-order = &spi_flash; }; firmware { From patchwork Mon Jul 22 11:59:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134960 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uSe/Hggn"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sk9h3St6z9s8m for ; Tue, 23 Jul 2019 00:13:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 33032C220DA; Mon, 22 Jul 2019 14:13:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 33E1FC21E2B; Mon, 22 Jul 2019 12:05:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 12296C21F79; Mon, 22 Jul 2019 12:05:49 +0000 (UTC) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by lists.denx.de (Postfix) with ESMTPS id BCB25C21E96 for ; Mon, 22 Jul 2019 12:00:42 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id a93so19088428pla.7 for ; Mon, 22 Jul 2019 05:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1uI/6QOuGGX7K3th7iAa0FIt60MXEJfSm5FMvwEZ/Cg=; b=uSe/HggnL1PrxW5RkugRiAW7nPkDhGinkXvwY5p7gCEcufPUSsMSJ04T3XoaAhbXvD NbUCPTUIac7Nom/wWhVPPGqJN2FCywuGBKmwJxO7GSTwtUC8Wr2Od0au1g/87p8orz8K lSoYYABdWTB/Na6Bj21c9owqpdYnpjCRskD+QixKoBoKm400IDUb7CYiI3cFtDHL/Sue GHNX1+04l6dPUArttA9qUnjSHmMDa3qR7VF3BPakXjJCCBHGkNmvEKZayaTwSV7o8xrZ Omhdi0UetRpP7ujEky5L2HJ/FLKNfMOaJ9O890YZ8PgEsSZmst/cEGtvS86pZZZrrC0o Xbmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=1uI/6QOuGGX7K3th7iAa0FIt60MXEJfSm5FMvwEZ/Cg=; b=G0QbBay2mY+/LwFr1fAsgrGjJGp1ODY4aSZQEL08SENzFMpkAPM8K+U6D8dqw99FJ7 ikUeCHAq5HsLrEX1VrvYpWNtNJoXIY96ILr7NSA3dG51BpCmGbJWINqloEjx6sLFmaRM TTGxzIYJwwbwuuBuE95gQH+QZxhHy+LpcPMKBSocn0Q/hrEsKQlYJfO7K7FLMXAIQwau z8rNjPds4V63DxOm0xq+LReCDBY5IjIqajV3hX0C9zbmkYBe7ubidqLRv6gWgovru6cS AI/6FMpqlW32yUPG5ukj/YdwIoslRiJ1lPe9gQ0OiGI6SBhHce+hekpbI0NGy0gnYHIp +OtQ== X-Gm-Message-State: APjAAAWzXfyLZmMO8hVWZgOHw+q/foU00ejAgfbHFKw7GGVFMhoSV/pT /W/JMGCRCQc/zDCmyVcPtKVP3eH/ X-Google-Smtp-Source: APXvYqx/Ceh1HUl2tI2gY7c7dmVZGIHWOfFMcyDx2HJvVlYYdS+yt6pU64PMk2stDkZcbkDSMBgQOQ== X-Received: by 2002:a17:902:8547:: with SMTP id d7mr76406264plo.171.1563796841443; Mon, 22 Jul 2019 05:00:41 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:41 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:30 +0800 Message-Id: <20190722115942.24962-24-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 23/35] rockchip: rk3288: add boot_devices mapping to support 'same-as-spl' X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The driver need a mapping to get the dts node by boot srouce ID. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3288/rk3288.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c index 2526c04c58..de9e396288 100644 --- a/arch/arm/mach-rockchip/rk3288/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288/rk3288.c @@ -4,11 +4,17 @@ */ #include #include +#include #include #include #define GRF_BASE 0xff770000 +const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { + [BROM_BOOTSOURCE_EMMC] = "dwmmc@ff0f0000", + [BROM_BOOTSOURCE_SD] = "dwmmc@ff0c0000", +}; + #ifdef CONFIG_SPL_BUILD static void configure_l2ctlr(void) { From patchwork Mon Jul 22 11:59:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134961 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="smIrS4iE"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45skHB5M1rz9s8m for ; Tue, 23 Jul 2019 00:18:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6B5F0C22049; Mon, 22 Jul 2019 14:18:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7C23EC21F77; Mon, 22 Jul 2019 12:05:57 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0CD73C21F7E; Mon, 22 Jul 2019 12:05:55 +0000 (UTC) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by lists.denx.de (Postfix) with ESMTPS id 22419C21EA7 for ; Mon, 22 Jul 2019 12:00:45 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id w24so19137817plp.2 for ; Mon, 22 Jul 2019 05:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=s5LEiODa+uCb57YLOEGFhs055Z3ZtDMt3ZqfYXcqwe8=; b=smIrS4iEGoP+Io7yk8+1bldO9bEuVQ95dwBpeX0POorJsoR5m61bnqCeDx9ADdkMNQ imxY65+XVS91ImXKi5jug3sfyoGOqduEDIkJo9oxbIA8YHo4hMR7K3sRPKueawvle3ph eOYxIew2nG6eqSSVTMlhajymFb3DzKKZH2J+6ruL80+mYHrhMUwo6zSeKRSA4d92oOlj JDfZVTzHq0YH96RC/HLiKZc1CVuSiXHSmx3DTHrGqVI1IqczhcM4rwhYOAakceHr8yHF qCKjh/7kkdHpCJHx8RXZ5RCFpPV+xSig+xrbPnl3S6LxwK++Oqz5XvqArZfk/Zkxzznh LsYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=s5LEiODa+uCb57YLOEGFhs055Z3ZtDMt3ZqfYXcqwe8=; b=X2KHy1iWDqhp/q+6DGXYEgV7B2uHVK0E074lXwqPmE9BEejyWIA9okEc6GkfSxHPj0 usrn2iXbmEk9oIDcNUFd/5jM44GnAFJiz3w/+d9BXlghTGjJFhfP3k7NYs2/Hl/pCc/H e9IHCGFTwGIWmfzghkefReLR5bU9fwZuilMVOoTD/CDqS1IuQTR6jRnGSurqj1Y0IHdP KaJaNnhtE1s+VzMiaExJePliZPoAEsXCZ57KKX1oCoD5UONBXHAyKJsJC+0PVAje/OHf UI4icVTA2ou+wVqynwrLQG/kaBay3VypmbOErBfCLpGg5g6CtE+kxQ6UsR4feG8IuRmc 9Q7Q== X-Gm-Message-State: APjAAAVUmZ0WPvm4eolHkYqQogyMi0fgevs3VuS3dLgz4zK8ifyU1cO/ 4drrD+zYe8B0vL1Tp/arr/V/YQ4Q X-Google-Smtp-Source: APXvYqwxNj9kADfw65wJgqhFPKwaaKFfX4GzBZldP9nQ/QrmxkceqK7iaEaSpwo0wZuC5bwMhbCI0w== X-Received: by 2002:a17:902:2ac8:: with SMTP id j66mr71581161plb.273.1563796843745; Mon, 22 Jul 2019 05:00:43 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:43 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:31 +0800 Message-Id: <20190722115942.24962-25-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Cc: Otavio Salvador , Jagan Teki Subject: [U-Boot] [PATCH 24/35] rockchip: rk3328: add STIMER_BASE definition X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add the CONFIG_ROCKCHIP_STIMER_BASE so that we can use the stimer init function in tpl.c and spl.c Signed-off-by: Kever Yang --- include/configs/rk3328_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h index 1cf45bbb3e..6ed7525304 100644 --- a/include/configs/rk3328_common.h +++ b/include/configs/rk3328_common.h @@ -10,6 +10,8 @@ #define CONFIG_IRAM_BASE 0xff090000 +#define CONFIG_ROCKCHIP_STIMER_BASE 0xff1d0020 + #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SKIP_LOWLEVEL_INIT From patchwork Mon Jul 22 11:59:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134962 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TWPglhEk"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45skNr5blRz9sDQ for ; Tue, 23 Jul 2019 00:23:24 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C2ADEC22066; Mon, 22 Jul 2019 14:23:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D5756C21EB1; Mon, 22 Jul 2019 12:05:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1F554C21DFA; Mon, 22 Jul 2019 12:05:59 +0000 (UTC) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by lists.denx.de (Postfix) with ESMTPS id 0B6B5C21EB1 for ; Mon, 22 Jul 2019 12:00:47 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id 4so12149035pld.10 for ; Mon, 22 Jul 2019 05:00:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=QJ1ptHTHxiMbTW/UwgxWlZnGqL0J2zwo48NfdMOTGLA=; b=TWPglhEkozGISe45IB0Ktz+dO2xNAfCELaYRSNhaEpKuT3kY9E7gEZJS1YQCBpjqa8 eHH5UXm/fhl7JRVkGXs7lYLhm8/YFqWpZVEQmIyZK2KLGoPxaoqOeMCmkr+pF2jMHG1D D9FfLqzQT6g+IITYgfruJmk8PKIVAt4diCqylLQq6ljhB+qpjgC0W2+WBYIhZPjnYUOC E5ywt8BDpZ3Ao/xKZ7jFEsgUxuWyQrYaE0EnKDvCOTOHT1ey4yc+rLmpojyPztObrpN+ /uuliuCm3KM0qrx2pqrKUq2au8TDzWZT8K+zzjVidw1rvADDQlUCsauQYdgvxzmPqJJ5 cp6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=QJ1ptHTHxiMbTW/UwgxWlZnGqL0J2zwo48NfdMOTGLA=; b=Sd7a1Nhd7sGCgZ/VQnmxmGGPNMLBjMiPuu/QqH+Ep/ucBzcBO9fWtGCUoi+95cXoyA OPiWwxvNqTAKsKI9lkwvameCmMp79pfl63sXuV8T3mzpe15lz3KdMI3Cq4JOxC4+dVlY JRQpRsP3+KpHZ0eofcUIUatnLNiu7CJOHuz4sHvJmz+to7Y73h/6ayap/DehtztASdBn CvI/FnKuZv9fT7gcCBlXJ/UH9EnvIuu8eXdkT2P9lCWV4J8zgwYPTDIQ707fNikA3MKc BKijkgAGENeGJz8Vvf/ZMmh6/dbLUWsCiKnvKaHfflH4xhicV9OkJGax3MgiGd0m6TUd dbfQ== X-Gm-Message-State: APjAAAXNe9bjk4NN2sN40EjZYE3Zgg6MbX3IFaKZYI7SJSqM+rYBXxdM BnY8DTeoXhuc8hvzWrCIy6Nuw0sM X-Google-Smtp-Source: APXvYqzpK6/N3rdTsNRo4qG1kjdFCbG0tR/3zB+ZAAn9+9HycNjNWhdhdwqnntfkTpJVOkmo9EX7HQ== X-Received: by 2002:a17:902:b186:: with SMTP id s6mr74908681plr.343.1563796845666; Mon, 22 Jul 2019 05:00:45 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:45 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:32 +0800 Message-Id: <20190722115942.24962-26-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 25/35] rockchip: rk3328: migrate to use common spl board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" rk3328 has similar boot flow in SPL with other Rockchip SoCs, migrate to use common spl board file. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 - arch/arm/mach-rockchip/rk3328-board-spl.c | 58 ----------------------- 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3328-board-spl.c diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 34979206d2..05d207dd7a 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -105,6 +105,7 @@ config ROCKCHIP_RK3328 select ARM64 select SUPPORT_SPL select SPL + imply SPL_ROCKCHIP_COMMON_BOARD imply SPL_SERIAL_SUPPORT imply SPL_SEPARATE_BSS select ENABLE_ARM_SOC_BOOT0_HOOK diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 808ca43ca0..579a2ce8ca 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o -obj-spl-$(CONFIG_ROCKCHIP_RK3328) += rk3328-board-spl.o obj-spl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o diff --git a/arch/arm/mach-rockchip/rk3328-board-spl.c b/arch/arm/mach-rockchip/rk3328-board-spl.c deleted file mode 100644 index f24fd89e3f..0000000000 --- a/arch/arm/mach-rockchip/rk3328-board-spl.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * (C) Copyright 2016 Rockchip Electronics Co., Ltd - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -void board_debug_uart_init(void) -{ -} - -void board_init_f(ulong dummy) -{ - struct udevice *dev; - int ret; - - ret = spl_early_init(); - if (ret) { - debug("spl_early_init() failed: %d\n", ret); - hang(); - } - - preloader_console_init(); - - ret = uclass_get_device(UCLASS_RAM, 0, &dev); - if (ret) { - debug("DRAM init failed: %d\n", ret); - return; - } -} - -u32 spl_boot_mode(const u32 boot_device) -{ - return MMCSD_MODE_RAW; -} - -u32 spl_boot_device(void) -{ - return BOOT_DEVICE_MMC1; -} - -#ifdef CONFIG_SPL_LOAD_FIT -int board_fit_config_name_match(const char *name) -{ - /* Just empty function now - can't decide what to choose */ - debug("%s: %s\n", __func__, name); - - return 0; -} -#endif From patchwork Mon Jul 22 11:59:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134963 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H6QDyjxG"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45skVQ070qz9s8m for ; Tue, 23 Jul 2019 00:28:13 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 962E6C21EF1; Mon, 22 Jul 2019 14:28:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 63D95C21F81; Mon, 22 Jul 2019 12:06:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 29C7BC21E07; Mon, 22 Jul 2019 12:06:09 +0000 (UTC) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by lists.denx.de (Postfix) with ESMTPS id DD2CCC21EA8 for ; Mon, 22 Jul 2019 12:00:48 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id i2so19148572plt.1 for ; Mon, 22 Jul 2019 05:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VgBfQxtLP4Dw7n0OmT34jUZFZA60BHLgzweUy3g2/5c=; b=H6QDyjxGrQAyOTVY0gShGcuFI4l6pnb8Z6zb4AnTIrKbz68zsYefnBSyX0g4xsKcIL errwviKpm9FQzWEAPhg2wgEaU0VHHmGRvvRlzTj9133x4Sm9lKMcbdXXPTa758CuPPn4 WMxEITufvc8X7jpSUuzoblKetPpBQroRVzgKIayKbQpxswUPYk116AniiaxYc9Z15FzH PGLXJNZRZn2TUo61dYifCuVccqacHCFQ0H3KcI+yVuIwoAVq/UvFnxripc3KQhA45PAu 93QjPlucmBxUvsRjp5YIztv114Mj8CAPZOWFu08W49XXYlVo02QXms2JnhKGO8aIBsye uYYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VgBfQxtLP4Dw7n0OmT34jUZFZA60BHLgzweUy3g2/5c=; b=ZR7Aezut+zppKa/amr69iiPwXd3ssZWYdmov0gM2wFn2qhdwneioJhfCl/2O0OrpDl Ca4EKNpwcYdb8R4pqDwUOQa0+kbuSbPaAeNGGgM7itzSgA4PF746V8mJjCKfBrmhvpuy kjFlbRXp/DtPnhu02xqO/78Urhwv1z5vVzwZxDJw1t7S67A/OPRvd+xX/DDyaMjuWTL/ IzVsmqTbEb/Rt8q0/dDaWhcmXbEXSa4dOf+uNdmIMR2cGU/T80NIjRwcgmbaQu5aZj07 UrKVz6n3BQ7CXTWSejTGMJfhnB4D2oFpOooptAxZAK7k+GvJG4IhzGtmRND6iE3Mlaos 2EEA== X-Gm-Message-State: APjAAAWyx1nXzSXysjTyQm+ezRdUuyrG6jrMeJBWPlbB8rJ9YAwafcPB OZpPqNg2Rf3drgP1dPqGFBZ089nA X-Google-Smtp-Source: APXvYqyYGy43C4ECBMu2YQwnGq+oFXMm7lD0XMxrhAHEqWp9OuFoJJeWpU66ktjMVUzfL8c5GusYoQ== X-Received: by 2002:a17:902:6b85:: with SMTP id p5mr71952005plk.225.1563796847535; Mon, 22 Jul 2019 05:00:47 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:47 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:33 +0800 Message-Id: <20190722115942.24962-27-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 26/35] rockchip: rk3328: add boot_devices mapping to support 'same-as-spl' X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The driver need a mapping to get the dts node by boot srouce ID. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3328/rk3328.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-rockchip/rk3328/rk3328.c b/arch/arm/mach-rockchip/rk3328/rk3328.c index 1cf829dc34..222a8d36d3 100644 --- a/arch/arm/mach-rockchip/rk3328/rk3328.c +++ b/arch/arm/mach-rockchip/rk3328/rk3328.c @@ -4,12 +4,18 @@ */ #include +#include #include #include #include DECLARE_GLOBAL_DATA_PTR; +const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { + [BROM_BOOTSOURCE_EMMC] = "rksdmmc@ff520000", + [BROM_BOOTSOURCE_SD] = "rksdmmc@ff500000", +}; + static struct mm_region rk3328_mem_map[] = { { .virt = 0x0UL, From patchwork Mon Jul 22 11:59:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134964 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KNiGo5o6"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45skcC66W0z9s8m for ; Tue, 23 Jul 2019 00:33:13 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 55630C2207E; Mon, 22 Jul 2019 14:33:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EE88CC21F8F; Mon, 22 Jul 2019 12:06:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 629F0C21F59; Mon, 22 Jul 2019 12:06:17 +0000 (UTC) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by lists.denx.de (Postfix) with ESMTPS id D4F7BC21EB4 for ; Mon, 22 Jul 2019 12:00:50 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id 19so17269357pfa.4 for ; Mon, 22 Jul 2019 05:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7R3zyuXQxEWl2wFTx9QigwKCQejCFXN9je+L1Hptqgg=; b=KNiGo5o6TBw6VQcNEtR7G5nyvoQHJh857NvwYpFqn1Eifn6CPauMWSJm2PNFdUtslz imRdwDjEpXYcp6a5dKlH1g7gWpzRNofp8dI41ONqYDer+P6OznQOisZkEg0cv7lyqBYr JPJOrzyIKhHdTFI0POJ4jENgYeJ4/eANqjf8ulcVNxqZRk5UTVIu/4eSzAmm6d0xtMmQ HfCox455bIhsofuwq39gcYphU/p6LNvfTZW/wfQZzD7M3M7GdmIkLF2FN9XkqFHMGmJb n+uYcSLmM40hgWS2q4/YDpUnO01EoSLyXPjSvTWMOdVuvH4V1o3IdDoRXyzJGVsS/Mll UHdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7R3zyuXQxEWl2wFTx9QigwKCQejCFXN9je+L1Hptqgg=; b=EwACMDT5/P3k6BT/H/U676/sVd0XvmYoKQXqIISeUX7a+/i36jOwDfQUrEAtQTnrTt Fi0gtOVuc6QhCvqFAaQPUU7/rZHzzEYuPGGchHF8aSrQpu5qYivlWvNnwmpbM+Ec/9CG 5PbvlvwgSdY+4Dc149o8yVUBY7pFBv0mk5pUxUSpkRB4XW+DsJfd56EYqGsIrSAX9N7F 1As0gn+2R3Z8DW2U6Wf2Ax+Ff3+Dkt1+lx3apx18lmHoNP3K33qQKUBACyU+/WS7R2Yl USvs1ztEnqazAa7cqB48v1KAPVKDEryXx4LWM25oJOSF+1YM0DeHM+I7tWP+o3ng1Kom Ge/w== X-Gm-Message-State: APjAAAWekIwxqQi17I/rJo1shEbBNZGbqbtlD03BnzxF4M6no523gWCn P7SsrxEquNRmJ1gRs2SNJYIa0kIy X-Google-Smtp-Source: APXvYqwOcok6lY8pIbK3I2UwGAAxUP9pHCXHCE60kiN3vZ0LAQwiqiI9LYpnfavORwNZpQQb1a6d0g== X-Received: by 2002:a17:90b:8c8:: with SMTP id ds8mr78074065pjb.89.1563796849386; Mon, 22 Jul 2019 05:00:49 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.47 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:49 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:34 +0800 Message-Id: <20190722115942.24962-28-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 27/35] rockchip: rk3368: migrate to use common spl board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" rk3368 has similar boot flow in SPL with other Rockchip SoCs, migrate to use common spl board file. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 - arch/arm/mach-rockchip/rk3368-board-spl.c | 80 ----------------------- 3 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3368-board-spl.c diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 05d207dd7a..25214bca9c 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -125,6 +125,7 @@ config ROCKCHIP_RK3368 select SUPPORT_TPL select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL select TPL_NEEDS_SEPARATE_STACK if TPL + imply SPL_ROCKCHIP_COMMON_BOARD imply SPL_SEPARATE_BSS imply SPL_SERIAL_SUPPORT imply TPL_SERIAL_SUPPORT diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 579a2ce8ca..c7ab72c13b 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o -obj-spl-$(CONFIG_ROCKCHIP_RK3368) += rk3368-board-spl.o spl-boot-order.o obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) diff --git a/arch/arm/mach-rockchip/rk3368-board-spl.c b/arch/arm/mach-rockchip/rk3368-board-spl.c deleted file mode 100644 index 6ba106c63b..0000000000 --- a/arch/arm/mach-rockchip/rk3368-board-spl.c +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH - */ - -#include -#include -#include -#include -#include -#include -#include - -__weak int arch_cpu_init(void) -{ - return 0; -} - -#define TIMER_LOAD_COUNT_L 0x00 -#define TIMER_LOAD_COUNT_H 0x04 -#define TIMER_CONTROL_REG 0x10 -#define TIMER_EN 0x1 -#define TIMER_FMODE BIT(0) -#define TIMER_RMODE BIT(1) - -void rockchip_stimer_init(void) -{ - /* If Timer already enabled, don't re-init it */ - u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); - - if (reg & TIMER_EN) - return; - - writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4); - writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE + - TIMER_CONTROL_REG); -} - -void board_init_f(ulong dummy) -{ - struct udevice *dev; - int ret; - - ret = spl_early_init(); - if (ret) { - debug("spl_early_init() failed: %d\n", ret); - hang(); - } - - /* Init secure timer */ - rockchip_stimer_init(); - /* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */ - timer_init(); - - arch_cpu_init(); - preloader_console_init(); - - ret = uclass_get_device(UCLASS_RAM, 0, &dev); - if (ret) { - debug("DRAM init failed: %d\n", ret); - return; - } -} - -u32 spl_boot_device(void) -{ - return BOOT_DEVICE_MMC1; -} - -#ifdef CONFIG_SPL_LOAD_FIT -int board_fit_config_name_match(const char *name) -{ - /* Just empty function now - can't decide what to choose */ - debug("%s: %s\n", __func__, name); - - return 0; -} -#endif From patchwork Mon Jul 22 11:59:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134965 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jjwpmRVH"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45skjh2w7zz9s8m for ; Tue, 23 Jul 2019 00:38:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0D060C2208F; Mon, 22 Jul 2019 14:37:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7DCF6C21EA2; Mon, 22 Jul 2019 12:06:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4FD33C21F92; Mon, 22 Jul 2019 12:06:19 +0000 (UTC) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by lists.denx.de (Postfix) with ESMTPS id A19CCC21EBB for ; Mon, 22 Jul 2019 12:00:52 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id i189so17269779pfg.10 for ; Mon, 22 Jul 2019 05:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YoVvEgOi4UDqXF17eYeEGvwzRYU9b3bMIDaxDVMyJdc=; b=jjwpmRVHAgp123nQF2Xvhb0rmkHSR6LG8oVCMcFkq+K5p0bmDg/ek3YIujN7Zh+cgO KejB2e2hGi/mi8MAyDF7eaE+O0KhqkF0GyGV4J7hL3MMlURQbZ0FckZH2v/YsP2/MlW+ 4ooD1CIt1Rx8mDBLl+fDekfPMyr43xhJ4a01X0a8pWeWmFYSmYyd+8WhEnoMOxDPIpue Rxt0Nb84n0lebs7/a/fVyVlTJ9fR2WOFIUyZ71ESF4WwCHC8mCAguzslybhG5MpucmjI KR6e1lDE9obTBLFBJsg+zbEd9FjCE52dYe8xe1aGeP7nlqls6ERQQYy21XR13x5GOUvh Rwng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=YoVvEgOi4UDqXF17eYeEGvwzRYU9b3bMIDaxDVMyJdc=; b=Y6IEh9P5FYY6HiAWVl7jZ2SQPBHhgOsGmVpSP7GsBk9/+XbaEdhTLYSnS+FXDR8WLW 8rXmfk9BMa3raVh7FKJw2reDwljpycB3fvmNO2jffJ3AZjEDXLCDBsg2gf8jZVlXVP8x r3dpV1dinBgddc1sdGVJaerEu+izs8+A5MxV8nCgAqKepEYOuVph50jxmdturAOljtIj oLVdbuttNJ+iAoUj7yjhTL4sMCUkO57O1/xjSHBxPgPHrHaA4Ipte3ybhv7pw5qmV/qh NKKVox8laz1NmL1Ba1wlMEAQT3plQCQPFStJ2UEt8fiT42VaOLIrHDm3nfVhvsZjLIdk C3zA== X-Gm-Message-State: APjAAAWB9cSV7/CFyEWaPASoTglt9/+iPl+NPRPh0iZIw38lvVMbYdxM l6PmCFxJJXdvTfCPxnFtg4C5dquk X-Google-Smtp-Source: APXvYqzarrzy17pKgLyN1SldKr6M6+euyJi4gr2+NfFGiZLuQuLd8ntTl1nga8Zb1cagCRMYqIeYlQ== X-Received: by 2002:a17:90a:6097:: with SMTP id z23mr77182137pji.75.1563796851328; Mon, 22 Jul 2019 05:00:51 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:50 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:35 +0800 Message-Id: <20190722115942.24962-29-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 28/35] rockchip: rk3368: add boot_devices mapping to support 'same-as-spl' X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The driver need a mapping to get the dts node by boot srouce ID. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3368/rk3368.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-rockchip/rk3368/rk3368.c b/arch/arm/mach-rockchip/rk3368/rk3368.c index 47786f52ee..c75a5cd0c4 100644 --- a/arch/arm/mach-rockchip/rk3368/rk3368.c +++ b/arch/arm/mach-rockchip/rk3368/rk3368.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +53,11 @@ static struct mm_region rk3368_mem_map[] = { struct mm_region *mem_map = rk3368_mem_map; +const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { + [BROM_BOOTSOURCE_EMMC] = "dwmmc@ff0f0000", + [BROM_BOOTSOURCE_SD] = "dwmmc@ff0c0000", +}; + int dram_init_banksize(void) { size_t max_size = min((unsigned long)gd->ram_size, gd->ram_top); From patchwork Mon Jul 22 11:59:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134966 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hKVQxFzb"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45skqH6Ky3z9s8m for ; Tue, 23 Jul 2019 00:42:51 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 84B50C220BB; Mon, 22 Jul 2019 14:42:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E4AA4C21F9B; Mon, 22 Jul 2019 12:06:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B3E0CC21F89; Mon, 22 Jul 2019 12:06:24 +0000 (UTC) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by lists.denx.de (Postfix) with ESMTPS id AF6BFC21E08 for ; Mon, 22 Jul 2019 12:00:54 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id i18so17559045pgl.11 for ; Mon, 22 Jul 2019 05:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fuuOOs87jU/ylNLgBTLwU66Eg3jWMAmZOBBQhhmuZJg=; b=hKVQxFzbQoEXRxSZW6K5bk4mLEoplpxrwmdhZIgDijy+blkBvrCoimTf888OTC3hOG TlFdhX87eaFUL9W6tr8x3kFM71Hh0VJtLN5IP+byQnNOV1WtpAFC90xesebLkhbNiQ67 VZAb5LrJwXP4KOireMAe8lDBAY9xSKkG5BNa1c18Ol4GUSu3OBWJvx+3+SizEAFjHYyy 1fpHIPugs3WVEm41NNjSRizUd7Bs60Ti1NtLBOCigPyV77NZP3ZcdIDw6p6sxkgA9FZT gHRznaJClFXVIMZog9B3xCxeZRqwWjEQYlViL5QfPkC6HosznAX6+ty/UMsW9KNfMpNa AGPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fuuOOs87jU/ylNLgBTLwU66Eg3jWMAmZOBBQhhmuZJg=; b=sbqdEaX0Pi0iEwO/Fa0uz/YwZrwxjiENm930R+dySaaveU98ykX7X7ElecS82kfRFU QuVCSop5BQoPJbvx6CxVPyy9k1wUqOhpnswS0lwuTBNUwUTQLDGl1uEf7AcfEnYHzIW4 7D83ImJ23oagtQ46Fk083ud728h5NkPOxBNUJj60kYnvKvk6xAZOrq15hwAA/qD3VopV o5ZK1TkXJKXZOUXjyqR6ByajSxpRwiCbxKt4sm89qp94TR5HmQm9/G3qS30uUfv0QH74 Uu0/rhAa/P48P0ly8BdQWYhatxpmha/VqiKSpKksT7KvF0Uq8GOwUDaz0k4xUJ/kh345 Vk2g== X-Gm-Message-State: APjAAAVEp4wkDTR0wPQsY5m5EDu8M4XG6DISxAn5Q8GVikSK2C3S3KPh HWHRmYy0lplD1PpRX/SWZ3gjQR7e X-Google-Smtp-Source: APXvYqzEPTQTVCV3pAqYXd1O7rYiN23BHJRYHXFgqV4Seaao6q+2d6TGqIsW6rmAElWMuS83lEt43A== X-Received: by 2002:a17:90a:cb8e:: with SMTP id a14mr28054122pju.124.1563796853342; Mon, 22 Jul 2019 05:00:53 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:52 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:36 +0800 Message-Id: <20190722115942.24962-30-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 29/35] rockchip: rk3399: move spl_perform_fixups() into soc file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Move the spl_perform_fixups() into rk3399.c so that we can use common spl board file later. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3399-board-spl.c | 48 ---------------------- arch/arm/mach-rockchip/rk3399/rk3399.c | 50 +++++++++++++++++++++++ 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index 3624c8ea65..826ca443ce 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -61,54 +61,6 @@ u32 spl_boot_device(void) return boot_device; } -const char *spl_decode_boot_device(u32 boot_device) -{ - int i; - static const struct { - u32 boot_device; - const char *ofpath; - } spl_boot_devices_tbl[] = { - { BOOT_DEVICE_MMC1, "/dwmmc@fe320000" }, - { BOOT_DEVICE_MMC2, "/sdhci@fe330000" }, - { BOOT_DEVICE_SPI, "/spi@ff1d0000" }, - }; - - for (i = 0; i < ARRAY_SIZE(spl_boot_devices_tbl); ++i) - if (spl_boot_devices_tbl[i].boot_device == boot_device) - return spl_boot_devices_tbl[i].ofpath; - - return NULL; -} - -void spl_perform_fixups(struct spl_image_info *spl_image) -{ - void *blob = spl_image->fdt_addr; - const char *boot_ofpath; - int chosen; - - /* - * Inject the ofpath of the device the full U-Boot (or Linux in - * Falcon-mode) was booted from into the FDT, if a FDT has been - * loaded at the same time. - */ - if (!blob) - return; - - boot_ofpath = spl_decode_boot_device(spl_image->boot_device); - if (!boot_ofpath) { - pr_err("%s: could not map boot_device to ofpath\n", __func__); - return; - } - - chosen = fdt_find_or_add_subnode(blob, 0, "chosen"); - if (chosen < 0) { - pr_err("%s: could not find/create '/chosen'\n", __func__); - return; - } - fdt_setprop_string(blob, chosen, - "u-boot,spl-boot-device", boot_ofpath); -} - __weak void rockchip_stimer_init(void) { } diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index 0f09ea5c49..dacbcf8fdf 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -146,3 +146,53 @@ void board_debug_uart_init(void) #endif } #endif + +#ifdef CONFIG_SPL_BUILD +const char *spl_decode_boot_device(u32 boot_device) +{ + int i; + static const struct { + u32 boot_device; + const char *ofpath; + } spl_boot_devices_tbl[] = { + { BOOT_DEVICE_MMC1, "/dwmmc@fe320000" }, + { BOOT_DEVICE_MMC2, "/sdhci@fe330000" }, + { BOOT_DEVICE_SPI, "/spi@ff1d0000" }, + }; + + for (i = 0; i < ARRAY_SIZE(spl_boot_devices_tbl); ++i) + if (spl_boot_devices_tbl[i].boot_device == boot_device) + return spl_boot_devices_tbl[i].ofpath; + + return NULL; +} + +void spl_perform_fixups(struct spl_image_info *spl_image) +{ + void *blob = spl_image->fdt_addr; + const char *boot_ofpath; + int chosen; + + /* + * Inject the ofpath of the device the full U-Boot (or Linux in + * Falcon-mode) was booted from into the FDT, if a FDT has been + * loaded at the same time. + */ + if (!blob) + return; + + boot_ofpath = spl_decode_boot_device(spl_image->boot_device); + if (!boot_ofpath) { + pr_err("%s: could not map boot_device to ofpath\n", __func__); + return; + } + + chosen = fdt_find_or_add_subnode(blob, 0, "chosen"); + if (chosen < 0) { + pr_err("%s: could not find/create '/chosen'\n", __func__); + return; + } + fdt_setprop_string(blob, chosen, + "u-boot,spl-boot-device", boot_ofpath); +} +#endif From patchwork Mon Jul 22 11:59:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134970 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jYFA4JjY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45skxB68svz9s8m for ; Tue, 23 Jul 2019 00:47:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 7D89BC220D9; Mon, 22 Jul 2019 14:47:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5038FC21F8C; Mon, 22 Jul 2019 12:06:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 57761C21F8E; Mon, 22 Jul 2019 12:06:29 +0000 (UTC) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by lists.denx.de (Postfix) with ESMTPS id 978CEC21EAE for ; Mon, 22 Jul 2019 12:00:56 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id f5so8733095pgu.5 for ; Mon, 22 Jul 2019 05:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=8jYZxeFD2CRLNPomm0TbSYVrNwEUMryBDAKc8YoTzSg=; b=jYFA4JjYg2Fr6iPoD9JyvEQUTpAajIJaXS4z7VpyMeoA9SrcFDvsnMlS/8wleg68hp zaChRoWWvXCCEVzzX+3NHsT6Rk3i7E3XNwxcNXNSv++nspzFN88wnreekc4hbVEIDg/m 4b0Npn305uLjDePEOOHr0D77kqYp9zdt4jtHvBbcscEIvKIvSVIP8K6/gP5n3pzjXDSq 0P54QUyN+sqZczfCwx4vhix2fI+ZWlNoKkJJeDdS6dO562St7OkU+nThxEyePBDy2LcJ DrmNyQdKl/rhTFUVPD0FRmz6s4hlAISjoWh0v/AGOmpxQ/1O9evpSmH+WZSCw4LiqrM7 EeUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=8jYZxeFD2CRLNPomm0TbSYVrNwEUMryBDAKc8YoTzSg=; b=juptPxHCUrISbFfYtMFf+dlmYdFUM5E4u99lRlcrVBTxDLlK2A876+Um+Ac03Zfm2+ fTwI3L2zkSD4DJw+s1O6fsSsJDhP1qWBBFz6V+VVrPROXVCR90sdzq8dv0CYTTFa+KRm zJjktxaHbXwbitZIdM/jIk4Dw5wXlhF9k8VPafXiGrVgNpgnPvI+m248MXM4ZGoH3W9e aGWV5rCHt7hShO6C5ecWQc09mlLUpCEIXyUkc7go73cYVEoBJW+VvHfaLQkkh3NDH080 UC7c55pfgenyKcsdDSlsTStvd4CsKNW2qh2Me7iUPEA+JDihZtqSKAH/m7UA2/6RBrRj XdVw== X-Gm-Message-State: APjAAAU44sQHRWvVUueLIF1atgS2Mawk/kwOHWQ0tQzGUJLc9BevBphv vzRR6YisHPNAufNNRLb1f4IdAv4I X-Google-Smtp-Source: APXvYqx19SFd63Rm26wYFCCjH5ZUtqkviaHiMbnI2QLQYs1LF8gki5W8E+WBMMnYiC5QwgAQzv5VvA== X-Received: by 2002:a17:90a:30cf:: with SMTP id h73mr78001799pjb.42.1563796855163; Mon, 22 Jul 2019 05:00:55 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:54 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:37 +0800 Message-Id: <20190722115942.24962-31-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 30/35] rockchip: rk3399: show SPL BANNER earlier in board_init_f() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Show the SPL BANNER earlier so that we know already get into SPL. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3399-board-spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index 826ca443ce..b790ad909c 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -130,6 +130,8 @@ void board_init_f(ulong dummy) pr_err("DRAM init failed: %d\n", ret); return; } + + preloader_console_init(); } #if defined(SPL_GPIO_SUPPORT) @@ -188,8 +190,6 @@ void spl_board_init(void) if (regulators_enable_boot_on(false)) debug("%s: Cannot enable boot on regulator\n", __func__); #endif - - preloader_console_init(); } #ifdef CONFIG_SPL_LOAD_FIT From patchwork Mon Jul 22 11:59:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134971 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Uj7/J2ZD"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sl2z1Rbpz9s8m for ; Tue, 23 Jul 2019 00:52:59 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CFBE4C21E29; Mon, 22 Jul 2019 14:52:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A191EC21F9A; Mon, 22 Jul 2019 12:06:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id ACC84C21E0D; Mon, 22 Jul 2019 12:06:32 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id 9CC2DC21E0D for ; Mon, 22 Jul 2019 12:00:58 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id t132so17546196pgb.9 for ; Mon, 22 Jul 2019 05:00:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=wu0cTMTKvvIZlWpbBwv/Ll8oDJhAM3slRVKi/NPOCVw=; b=Uj7/J2ZDai9jocIKRtJgPGSRc901dTKitPeNUtmf0zG2dtamCsbj4Do6So7l6hVJFw qhlCbq2J4HmqJpv0MOq2FxJj52PAEgrLlNbuIbcXhRlp+Sv68oI5YJuJHDerqyNbF2gP HHwyp5uig2Mhkkr9GNNMkRSwY1vLWE+YldINsXgNLkhN25PVvQSLS/nykKlwgQCccWdi 6BpQ/mucLvATjIvzqVJG/vCgcJ4vWsLiOULocW/ptslwB2d9Rds6+qtUK7UIppNwhtl3 BrGfhOz0AxogklAaTNpauXBcmAXb401pSlDEt3cwVMrn/nohAE9fvsG9ZiLj4IOQWjYs lqKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=wu0cTMTKvvIZlWpbBwv/Ll8oDJhAM3slRVKi/NPOCVw=; b=jNJGsdMgUDdE7RV6EqSrnPQiJqPv4MGAk05nEqipuDDrK1CWo4khqY0GSTV3k3Empa dKfQ6SzUjWOZqJjv9dNSJJBH+zVu9J51i0IKup2hrZ24dUZpxjHAijDvokXz4no7LljF FIhrZasaFrj3f8cxJuD3XDb7JN51JBGlzzg1RKKceK7zMFyDoRNcSEyDV1yeTN4roxP8 qmHvgHY7FvtEaqtMetkU7Q8ATcJlaOY8g3Q4ZSlhrnQqWZuLHIQ363kaqhcVdH3XsueZ P87cYxL/S3Rv4xinb+RzwGe3U9BImDNeYo78qNJV31gi87A+BbXQA3V60iXcOKqONF/e 1ucQ== X-Gm-Message-State: APjAAAWuGnIQ0cfdC2mh4L5Q86m5GByyqonTTLyu2u8ddafoZy35uZgO X24T1V5ek15VelwoHSrinr9siLrS X-Google-Smtp-Source: APXvYqweekKpf4FBTLIzE5gbCFq7/IyWevKpzsHWTAeF1FpfUjeKeN+I11m2wWjF0L0KCnsOUb3wkA== X-Received: by 2002:a17:90a:bb8a:: with SMTP id v10mr77874479pjr.78.1563796857188; Mon, 22 Jul 2019 05:00:57 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:56 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:38 +0800 Message-Id: <20190722115942.24962-32-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 31/35] rockchip: rk3399: move SoC setting into arch_cpu_init() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" SoC setting like DDR secure region and EMMC clock setting should go to arch_cpu_init(). Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3399-board-spl.c | 27 ++++++----------------- arch/arm/mach-rockchip/rk3399/rk3399.c | 25 ++++++++++++++++++--- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index b790ad909c..2757c27da0 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -65,11 +64,14 @@ __weak void rockchip_stimer_init(void) { } +__weak int arch_cpu_init(void) +{ + return 0; +} + void board_init_f(ulong dummy) { struct udevice *dev; - struct rk3399_pmusgrf_regs *sgrf; - struct rk3399_grf_regs *grf; int ret; #ifdef CONFIG_DEBUG_UART @@ -100,29 +102,14 @@ void board_init_f(ulong dummy) debug("U-Boot SPL board init\n"); #endif + arch_cpu_init(); + ret = spl_early_init(); if (ret) { debug("spl_early_init() failed: %d\n", ret); hang(); } - /* - * Disable DDR and SRAM security regions. - * - * As we are entered from the BootROM, the region from - * 0x0 through 0xfffff (i.e. the first MB of memory) will - * be protected. This will cause issues with the DW_MMC - * driver, which tries to DMA from/to the stack (likely) - * located in this range. - */ - sgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF); - rk_clrsetreg(&sgrf->ddr_rgn_con[16], 0x1ff, 0); - rk_clrreg(&sgrf->slv_secure_con4, 0x2000); - - /* eMMC clock generator: disable the clock multipilier */ - grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); - rk_clrreg(&grf->emmccore_con[11], 0x0ff); - rockchip_stimer_init(); ret = uclass_get_device(UCLASS_RAM, 0, &dev); diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index dacbcf8fdf..6c8fdc195a 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -80,11 +80,30 @@ int dram_init_banksize(void) int arch_cpu_init(void) { - /* We do some SoC one time setting here. */ - struct rk3399_grf_regs * const grf = (void *)GRF_BASE; - /* Emmc clock generator: disable the clock multipilier */ +#ifdef CONFIG_SPL_BUILD + struct rk3399_pmusgrf_regs *sgrf; + struct rk3399_grf_regs *grf; + + /* + * Disable DDR and SRAM security regions. + * + * As we are entered from the BootROM, the region from + * 0x0 through 0xfffff (i.e. the first MB of memory) will + * be protected. This will cause issues with the DW_MMC + * driver, which tries to DMA from/to the stack (likely) + * located in this range. + */ + sgrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUSGRF); + rk_clrsetreg(&sgrf->ddr_rgn_con[16], 0x1ff, 0); + rk_clrreg(&sgrf->slv_secure_con4, 0x2000); + + /* eMMC clock generator: disable the clock multipilier */ + grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); + printf("%s sgrf %lx grf %lx\n", __func__, (u64)sgrf, (u64)grf); + printf("%s %x\n", __func__, &grf->emmccore_con[11]); rk_clrreg(&grf->emmccore_con[11], 0x0ff); +#endif return 0; } From patchwork Mon Jul 22 11:59:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134972 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qWlSPqzF"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45sl8P6mnGz9s8m for ; Tue, 23 Jul 2019 00:57:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CB5C8C21F9F; Mon, 22 Jul 2019 14:57:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 035F0C21F97; Mon, 22 Jul 2019 12:06:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B1391C21F97; Mon, 22 Jul 2019 12:06:36 +0000 (UTC) Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by lists.denx.de (Postfix) with ESMTPS id B2BA8C21EC3 for ; Mon, 22 Jul 2019 12:01:00 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id p184so17258714pfp.7 for ; Mon, 22 Jul 2019 05:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JI6a+Q/B5V0Uqdi1Ykj+o6equ2BFk3+Lt4A5nj/jBdo=; b=qWlSPqzFIBP3fd5PCaaaMVDGX8HC5lhlKdajRfsMAxe8f9DpvhSXBVgH1jvsmxzYyM tg9sw1AYh2Sj6YCAq+/0OnuIYLTAojVzeI9kAX4TBubgS4uXFfLijugtbn3wyNhaDNDY tuy7zK4qtMhYw6KZ8z7YOfRPqKU1i0nyQbqbdgBU/wVVLH0y09R/re0mIGVeFu3bQjdQ 2TNp2Ly3wpyIp+yrMWL+vJCim83jBEj5FXZjYA9AbVskXEeje9zsTZOb/7EGtRXlWj1T Xaz/DShTyLZ3y8A4TozvdSOmMABVb+LTJd8znStVECfwqA99UH8Qt5+WbatsNlV70VJD OrWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=JI6a+Q/B5V0Uqdi1Ykj+o6equ2BFk3+Lt4A5nj/jBdo=; b=I5mdI2rzPtI4CLgMMKSATWoqFAm0QDS4v3W9fQxyxZlsUa4MbRRF8s1juNdvSrcLWL s4YekRYzMViqffh0Ddqt1Cfd5TJPwi/hrH2P5pu3dPNDtF2q+yXN0IIVo5IU67hhbRkj DP2iltnXeeXnrbcjqH6+fS3nImzCTC1+anHLEsZGbfQzg0SngC/AwzCGLhZwFKy4CeF5 avDQqaajiN3m8tnNS4NaAl++1qJhaPt+tluqdtZLvveiwy5nLpJm6w2kJDOn/xH7qRyL zQu6ZW1C1RkXMb/Mhb8UADkvtQBtV1GkIV4ZSwvAOC27tMouon1YIArfLMoQc6Yk5B/D VvQQ== X-Gm-Message-State: APjAAAVonMoM9ZwBMxcrifYJh5ZEiozswfsGLGryHub700Lv1GaLYabp peS8zjS2/X6eGHaETvTSRDk1FIBU X-Google-Smtp-Source: APXvYqw5KbXjXPP0IuOANAGfx/0B9Oec+Ow8FL6qEY47Eg3r8/qYci1N6AIU0f37l+nLqP6eb7e95A== X-Received: by 2002:a17:90a:c391:: with SMTP id h17mr77274003pjt.131.1563796859190; Mon, 22 Jul 2019 05:00:59 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:00:58 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:39 +0800 Message-Id: <20190722115942.24962-33-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 32/35] rockchip: rk3399; move spl_board_init() into soc file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Move spl_board_init() into rk3399.c so that we can re-use the common SPL board file later. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3399-board-spl.c | 61 --------------------- arch/arm/mach-rockchip/rk3399/rk3399.c | 64 ++++++++++++++++++++++- 2 files changed, 63 insertions(+), 62 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index 2757c27da0..81a99f8e40 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -10,16 +10,13 @@ #include #include #include -#include #include #include #include -#include #include #include #include #include -#include void board_return_to_bootrom(void) { @@ -121,64 +118,6 @@ void board_init_f(ulong dummy) preloader_console_init(); } -#if defined(SPL_GPIO_SUPPORT) -static void rk3399_force_power_on_reset(void) -{ - ofnode node; - struct gpio_desc sysreset_gpio; - - debug("%s: trying to force a power-on reset\n", __func__); - - node = ofnode_path("/config"); - if (!ofnode_valid(node)) { - debug("%s: no /config node?\n", __func__); - return; - } - - if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0, - &sysreset_gpio, GPIOD_IS_OUT)) { - debug("%s: could not find a /config/sysreset-gpio\n", __func__); - return; - } - - dm_gpio_set_value(&sysreset_gpio, 1); -} -#endif - -void spl_board_init(void) -{ -#if defined(SPL_GPIO_SUPPORT) - struct rk3399_cru *cru = rockchip_get_cru(); - - /* - * The RK3399 resets only 'almost all logic' (see also in the TRM - * "3.9.4 Global software reset"), when issuing a software reset. - * This may cause issues during boot-up for some configurations of - * the application software stack. - * - * To work around this, we test whether the last reset reason was - * a power-on reset and (if not) issue an overtemp-reset to reset - * the entire module. - * - * While this was previously fixed by modifying the various places - * that could generate a software reset (e.g. U-Boot's sysreset - * driver, the ATF or Linux), we now have it here to ensure that - * we no longer have to track this through the various components. - */ - if (cru->glb_rst_st != 0) - rk3399_force_power_on_reset(); -#endif - -#if defined(SPL_DM_REGULATOR) - /* - * Turning the eMMC and SPI back on (if disabled via the Qseven - * BIOS_ENABLE) signal is done through a always-on regulator). - */ - if (regulators_enable_boot_on(false)) - debug("%s: Cannot enable boot on regulator\n", __func__); -#endif -} - #ifdef CONFIG_SPL_LOAD_FIT int board_fit_config_name_match(const char *name) { diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index 6c8fdc195a..3f414f1ca5 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -4,12 +4,16 @@ */ #include +#include #include +#include #include #include +#include #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -166,7 +170,7 @@ void board_debug_uart_init(void) } #endif -#ifdef CONFIG_SPL_BUILD +#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) const char *spl_decode_boot_device(u32 boot_device) { int i; @@ -214,4 +218,62 @@ void spl_perform_fixups(struct spl_image_info *spl_image) fdt_setprop_string(blob, chosen, "u-boot,spl-boot-device", boot_ofpath); } + +#if defined(SPL_GPIO_SUPPORT) +static void rk3399_force_power_on_reset(void) +{ + ofnode node; + struct gpio_desc sysreset_gpio; + + debug("%s: trying to force a power-on reset\n", __func__); + + node = ofnode_path("/config"); + if (!ofnode_valid(node)) { + debug("%s: no /config node?\n", __func__); + return; + } + + if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0, + &sysreset_gpio, GPIOD_IS_OUT)) { + debug("%s: could not find a /config/sysreset-gpio\n", __func__); + return; + } + + dm_gpio_set_value(&sysreset_gpio, 1); +} +#endif + +void spl_board_init(void) +{ +#if defined(SPL_GPIO_SUPPORT) + struct rk3399_cru *cru = rockchip_get_cru(); + + /* + * The RK3399 resets only 'almost all logic' (see also in the TRM + * "3.9.4 Global software reset"), when issuing a software reset. + * This may cause issues during boot-up for some configurations of + * the application software stack. + * + * To work around this, we test whether the last reset reason was + * a power-on reset and (if not) issue an overtemp-reset to reset + * the entire module. + * + * While this was previously fixed by modifying the various places + * that could generate a software reset (e.g. U-Boot's sysreset + * driver, the ATF or Linux), we now have it here to ensure that + * we no longer have to track this through the various components. + */ + if (cru->glb_rst_st != 0) + rk3399_force_power_on_reset(); +#endif + +#if defined(SPL_DM_REGULATOR) + /* + * Turning the eMMC and SPI back on (if disabled via the Qseven + * BIOS_ENABLE) signal is done through a always-on regulator). + */ + if (regulators_enable_boot_on(false)) + debug("%s: Cannot enable boot on regulator\n", __func__); +#endif +} #endif From patchwork Mon Jul 22 11:59:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134979 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RvtaN4+Z"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45slFq1cmJz9sLt for ; Tue, 23 Jul 2019 01:02:23 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E9916C21FD3; Mon, 22 Jul 2019 15:02:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 95000C21FA4; Mon, 22 Jul 2019 12:06:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E98F8C21FA4; Mon, 22 Jul 2019 12:06:43 +0000 (UTC) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by lists.denx.de (Postfix) with ESMTPS id 967C9C21DA2 for ; Mon, 22 Jul 2019 12:01:02 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id 4so12149412pld.10 for ; Mon, 22 Jul 2019 05:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=nZDZTU7kjp/6dVaGyG3t6OX5cMmGqm78d8KPDobDPQs=; b=RvtaN4+ZLbDwyFxCCs6FI1Tpctcc5wDNoQal4N3BnJC8rpDJSBx9/U2P/gbDH2phjO of7uBW92A+fWtVaBIwgNjVJ16aDX7yrxjzj16JrDaSQWTAuZGn0s1ycXpfSqI9nFHDYr 1MEqRYJkGhlx1zbc5c9kSjHJZeCFdPD6y/MMTINjwpZRlPwrycXQ7ANXauaorq7vktv9 yhJluTwhjOl8eJexVCQ28wWWUNVXp8v9lHDkmy24q2IOAi+yp+pl44b9izcP1nsZB5H+ zPImvyduYL5GR9ZwUfHyii+fUDh6gBXDmdp2khtu5DxVFH14muYV5aKjF46DHa0RQG8o c7dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=nZDZTU7kjp/6dVaGyG3t6OX5cMmGqm78d8KPDobDPQs=; b=jMQKMQ3HNYFqR/6UuwZFGI7s2wlnWRGFxTZWYnlvc0u8/SHl4Y9UyQAlmJhJ5LpzaI qscuzhWGaPAVclmNfSFs/360Sp3jqO4TSbRs/IwGTOYvHDbL6uEu4hxthLPbdz7jiR5s 7GORd2xYBhbjlq/qRJ7fIBBAFdPXoccr0/xGZJecL1Vh6GAS9FbcdEyGGih00hum2emo TgAPuFwTSvHcX50njg5NP8ID6x2IFzbA4KK/le2zA0nxk9vBvgPTVC88PuOCcUblVJdT mjuxuXkaPAXkECn7nWUWqxET54CH4s+Zz05MC3K9rCXJzHdBnVNexkp/6WF/tjO5yp2y g9HQ== X-Gm-Message-State: APjAAAXP+oLzCFnwKrvdK2k8OTWKy1J4eh4waHP6+VohxFm4+adIt2oP 3keWrwSugbbpNtFKPWRsS2aEkjmP X-Google-Smtp-Source: APXvYqzXTxaK+sVN7hRQ2ArJ+2P8bSy9t+x5i4oMl7GIPMQHIEdBwHlEidlurH+Dch3QS/1RMDqAdA== X-Received: by 2002:a17:902:aa83:: with SMTP id d3mr73075787plr.74.1563796861230; Mon, 22 Jul 2019 05:01:01 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.00.59 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:01:00 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:40 +0800 Message-Id: <20190722115942.24962-34-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 33/35] rockchip: rk3399: move boot_devices into soc file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Move boot_devices definition into rk3399.c, so that we can share the common code for board_spl_was_booted_from(). Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/rk3399-board-spl.c | 6 +----- arch/arm/mach-rockchip/rk3399/rk3399.c | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index 81a99f8e40..e6325274c3 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -23,11 +23,7 @@ void board_return_to_bootrom(void) back_to_bootrom(BROM_BOOT_NEXTSTAGE); } -static const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { - [BROM_BOOTSOURCE_EMMC] = "/sdhci@fe330000", - [BROM_BOOTSOURCE_SPINOR] = "/spi@ff1d0000", - [BROM_BOOTSOURCE_SD] = "/dwmmc@fe320000", -}; +__weak const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {}; const char *board_spl_was_booted_from(void) { diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index 3f414f1ca5..bca1871b9a 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +21,12 @@ DECLARE_GLOBAL_DATA_PTR; #define GRF_EMMCCORE_CON11 0xff77f02c #define GRF_BASE 0xff770000 +const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = { + [BROM_BOOTSOURCE_EMMC] = "/sdhci@fe330000", + [BROM_BOOTSOURCE_SPINOR] = "/spi@ff1d0000", + [BROM_BOOTSOURCE_SD] = "/dwmmc@fe320000", +}; + static struct mm_region rk3399_mem_map[] = { { .virt = 0x0UL, From patchwork Mon Jul 22 11:59:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134983 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M5kbJVax"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45slMj6PDfz9s8m for ; Tue, 23 Jul 2019 01:07:27 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 7EC0BC22077; Mon, 22 Jul 2019 15:07:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E4A0DC21FAA; Mon, 22 Jul 2019 12:06:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 512DEC21FAA; Mon, 22 Jul 2019 12:06:45 +0000 (UTC) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by lists.denx.de (Postfix) with ESMTPS id 88BBAC21EC9 for ; Mon, 22 Jul 2019 12:01:04 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id k8so19145680plt.3 for ; Mon, 22 Jul 2019 05:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7i9nWDZrM3xyeRk1EIgGRokZvt+E51F2uvFAK9uaFc0=; b=M5kbJVaxljTNFuiNkcLIG29oXkj87u3/eL7kpF4VwthrRb1+KF4hsgKVOFCSv24JyE 3mlHynTfLep2r0hrI+4yE7is6dCpY76qqw8ZUgN+SZrTdRsKOW7PRUG1BYr1nfiuOqea YWYoieKHuoyruPIZYHzfq4828yMFw9NE73mCDc085lEa0Xhv0Ga494V+utQJXQLMylIX QVRIDNXGDNH6x24YzFqss1Vx1Ke8XJ6ck+ncAVhvTvOr57Ml95esEYp9CHiQ+HwWnZzG eleOCdISIPVX3BiI0cL9sC1KGR/3FqfQLeoJHKd73Hkzago32CjLhiNGmCVDHQ/7c1YJ fB9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7i9nWDZrM3xyeRk1EIgGRokZvt+E51F2uvFAK9uaFc0=; b=qJRD/hVm8WT2WkrQvFl2FEZ1sd/BAy9iE7XzCEAfneT4GzS0JUf/HSCs/9+1Uma9ui xQN/nZicSWqvD8e7P1CJXWYEWn9YPoPxBrbaOYmWTuOfGyzazm1Zqwv4t5Z69FZtoipE S7IKgQxNPqzhuHoBg4QSboGAYaBLmk6/OxIVfU1uBcIJ+BI3J/VvbFZbQ74ebMn9Ao9a FlCmO7hqV2jWBo4hnx+ke3y8prXBNM6qPpoCPE4aVtuF5BXbfO7Nh4kZuPjoDd7j+G3j l1QUPJaDRojF6Nez6yECMB4aKY+wYDTKn2Pix4YRy5RDTJxjM5L8IM7folzkyZ9LiFKH U+Ow== X-Gm-Message-State: APjAAAUxxPYHJtVpqPpJI/EkWCq6TQRCDV5/ubEa9VM6Guths/4fOMJ+ i/2IxHVACmlhhY/NTGlxVJFQAcwJ X-Google-Smtp-Source: APXvYqxNKNY5W4pdk+H4341DKk0Qzn4XCFVhleAtAnnIO8w+7IxC2bI5G2KXB97N8Qsi68jtk9Hmug== X-Received: by 2002:a17:902:2926:: with SMTP id g35mr74789328plb.269.1563796863047; Mon, 22 Jul 2019 05:01:03 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.01.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:01:02 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:41 +0800 Message-Id: <20190722115942.24962-35-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 34/35] rockchip: rk3399: move chromebook bob specific flow to its board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a board_early_init_f() in board_init_f() and move the board specific init code into its own board file. Signed-off-by: Kever Yang --- .../arm/include/asm/arch-rockchip/sys_proto.h | 4 ---- arch/arm/mach-rockchip/rk3399-board-spl.c | 20 ++++++------------ board/google/gru/gru.c | 21 +++++++++++++++++++ 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sys_proto.h b/arch/arm/include/asm/arch-rockchip/sys_proto.h index 905c774c15..de5a8f11a9 100644 --- a/arch/arm/include/asm/arch-rockchip/sys_proto.h +++ b/arch/arm/include/asm/arch-rockchip/sys_proto.h @@ -6,8 +6,4 @@ #ifndef _ASM_ARCH_SYS_PROTO_H #define _ASM_ARCH_SYS_PROTO_H - -/* provided to defeat compiler optimisation in board_init_f() */ -void gru_dummy_function(int i); - #endif /* _ASM_ARCH_SYS_PROTO_H */ diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c index e6325274c3..cb481c58ec 100644 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c @@ -57,6 +57,11 @@ __weak void rockchip_stimer_init(void) { } +__weak int board_early_init_f(void) +{ + return 0; +} + __weak int arch_cpu_init(void) { return 0; @@ -70,20 +75,6 @@ void board_init_f(ulong dummy) #ifdef CONFIG_DEBUG_UART debug_uart_init(); -# ifdef CONFIG_TARGET_CHROMEBOOK_BOB - int sum, i; - - /* - * Add a delay and ensure that the compiler does not optimise this out. - * This is needed since the power rails tail a while to turn on, and - * we get garbage serial output otherwise. - */ - sum = 0; - for (i = 0; i < 150000; i++) - sum += i; - gru_dummy_function(sum); -#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */ - /* * Debug UART can be used from here if required: * @@ -95,6 +86,7 @@ void board_init_f(ulong dummy) debug("U-Boot SPL board init\n"); #endif + board_early_init_f(); arch_cpu_init(); ret = spl_early_init(); diff --git a/board/google/gru/gru.c b/board/google/gru/gru.c index b116b1a549..c2895e1267 100644 --- a/board/google/gru/gru.c +++ b/board/google/gru/gru.c @@ -10,7 +10,28 @@ int board_init(void) return 0; } +#ifdef CONFIG_SPL_BUILD /* provided to defeat compiler optimisation in board_init_f() */ void gru_dummy_function(int i) { } + +int board_early_init_f(void) +{ +# ifdef CONFIG_TARGET_CHROMEBOOK_BOB + int sum, i; + + /* + * Add a delay and ensure that the compiler does not optimise this out. + * This is needed since the power rails tail a while to turn on, and + * we get garbage serial output otherwise. + */ + sum = 0; + for (i = 0; i < 150000; i++) + sum += i; + gru_dummy_function(sum); +#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */ + + return 0; +} +#endif From patchwork Mon Jul 22 11:59:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1134989 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BAVP6DDY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45slTG0h7dz9sBF for ; Tue, 23 Jul 2019 01:12:18 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id BEE04C22062; Mon, 22 Jul 2019 15:12:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 44CF9C21FAE; Mon, 22 Jul 2019 12:06:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A5672C21FB1; Mon, 22 Jul 2019 12:06:52 +0000 (UTC) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by lists.denx.de (Postfix) with ESMTPS id 4D44CC21DAF for ; Mon, 22 Jul 2019 12:01:06 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id t14so19105142plr.11 for ; Mon, 22 Jul 2019 05:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=n1Xu48mguq9dHveqP7N5vXR6twU22L/0X1X9b2STggI=; b=BAVP6DDYYNE5xDpB/rLAWJPgpI9fP5LbLTq4HJ8DXLfppwEWf9IuJKGT+G3aTtKPzi eYjaEMueawI0wwD1+FFuIv7D1HgkWyp+YsDTuDKHyF0wTKor5r3QDoOeczKVNJHNX6D2 M3QY7CoxvhfhGmHvgZJx/dZrg1mmfHAId8elxIJDrctdEhc0xD7007IaM5LzmjDDCmpd 4w5YXEMk3Gs+1p2rIQGmwcYVbM0bnLl83Cyp3apfWaA2KSmuHB2zYmQRCKbm2pp8jmvK TYhK/+UBuRvIgZ0B/FRC5YBYBEfrFZvdbtlDzPE0WileKKnxNW6sh7jCW/ooTPE/nq+H pI5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=n1Xu48mguq9dHveqP7N5vXR6twU22L/0X1X9b2STggI=; b=UGFKsVujiaUp8DVIzyaOg6p5jmpsm3VuLlvx1fdWkIgyAcarXkwVTSJYkamxG2Bb7R UAPj0jYBiS5Jio0na42Lts7qh3IvDs89hmdFBEtcLpXxna+2OtWQzTRmarygC1YLClvJ VtnaDa38kctwLY6MV4Pe2/Cunlqs92L2W1hQlSz5GZbBgbRHCcozQWMtJft+4T07aG9Y bZAPazEssa/lqM3250CiOjsv+GfolD85rbxujEAR+G7Tyt0i2od8juvtGVKvkbaKRMPI bJgg8PNeny0fxZ1NBBRoivoAuP1eW3g578JMwCe2u1QAKnoc1yUxdbNa6lK6cNlMsFE9 hHqw== X-Gm-Message-State: APjAAAX2azFhSpzrMV0FvTI6hWe3WXCBYns3hKQPw9E9ltwHskkaQilL IzSoHRWH8CLdp8fOOpZmrNv+f/R6 X-Google-Smtp-Source: APXvYqytcE+tSGCfuzh7eJSXcLzzin86Du0pe/RgOYANR/WC046uMOCPrA2Ygstkzd+0mpycc+MhFg== X-Received: by 2002:a17:902:b497:: with SMTP id y23mr75357133plr.68.1563796864891; Mon, 22 Jul 2019 05:01:04 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id u134sm37621218pfc.19.2019.07.22.05.01.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 05:01:04 -0700 (PDT) From: Kever Yang To: u-boot@lists.denx.de Date: Mon, 22 Jul 2019 19:59:42 +0800 Message-Id: <20190722115942.24962-36-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190722115942.24962-1-kever.yang@rock-chips.com> References: <20190722115942.24962-1-kever.yang@rock-chips.com> Subject: [U-Boot] [PATCH 35/35] rockchip: rk3399: Migrate to use common spl board file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" rk3399 has similar boot flow in SPL with other Rockchip SoCs, migrate to use common spl board file. Signed-off-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/Makefile | 1 - arch/arm/mach-rockchip/rk3399-board-spl.c | 117 ---------------------- 3 files changed, 1 insertion(+), 118 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3399-board-spl.c diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 25214bca9c..81dee9e5c7 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -170,6 +170,7 @@ config ROCKCHIP_RK3399 select DM_PMIC select DM_REGULATOR_FIXED select BOARD_LATE_INIT + imply SPL_ROCKCHIP_COMMON_BOARD imply TPL_SERIAL_SUPPORT imply TPL_LIBCOMMON_SUPPORT imply TPL_LIBGENERIC_SUPPORT diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index c7ab72c13b..5cb2c6dcc9 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o -obj-spl-$(CONFIG_ROCKCHIP_RK3399) += rk3399-board-spl.o spl-boot-order.o ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c deleted file mode 100644 index cb481c58ec..0000000000 --- a/arch/arm/mach-rockchip/rk3399-board-spl.c +++ /dev/null @@ -1,117 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2016 Rockchip Electronics Co., Ltd - * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void board_return_to_bootrom(void) -{ - back_to_bootrom(BROM_BOOT_NEXTSTAGE); -} - -__weak const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {}; - -const char *board_spl_was_booted_from(void) -{ - u32 bootdevice_brom_id = readl(BROM_BOOTSOURCE_ID_ADDR); - const char *bootdevice_ofpath = NULL; - - if (bootdevice_brom_id < ARRAY_SIZE(boot_devices)) - bootdevice_ofpath = boot_devices[bootdevice_brom_id]; - - if (bootdevice_ofpath) - debug("%s: brom_bootdevice_id %x maps to '%s'\n", - __func__, bootdevice_brom_id, bootdevice_ofpath); - else - debug("%s: failed to resolve brom_bootdevice_id %x\n", - __func__, bootdevice_brom_id); - - return bootdevice_ofpath; -} - -u32 spl_boot_device(void) -{ - u32 boot_device = BOOT_DEVICE_MMC1; - - if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)) - return BOOT_DEVICE_BOOTROM; - - return boot_device; -} - -__weak void rockchip_stimer_init(void) -{ -} - -__weak int board_early_init_f(void) -{ - return 0; -} - -__weak int arch_cpu_init(void) -{ - return 0; -} - -void board_init_f(ulong dummy) -{ - struct udevice *dev; - int ret; - -#ifdef CONFIG_DEBUG_UART - debug_uart_init(); - - /* - * Debug UART can be used from here if required: - * - * debug_uart_init(); - * printch('a'); - * printhex8(0x1234); - * printascii("string"); - */ - debug("U-Boot SPL board init\n"); -#endif - - board_early_init_f(); - arch_cpu_init(); - - ret = spl_early_init(); - if (ret) { - debug("spl_early_init() failed: %d\n", ret); - hang(); - } - - rockchip_stimer_init(); - - ret = uclass_get_device(UCLASS_RAM, 0, &dev); - if (ret) { - pr_err("DRAM init failed: %d\n", ret); - return; - } - - preloader_console_init(); -} - -#ifdef CONFIG_SPL_LOAD_FIT -int board_fit_config_name_match(const char *name) -{ - /* Just empty function now - can't decide what to choose */ - debug("%s: %s\n", __func__, name); - - return 0; -} -#endif