From patchwork Tue Jul 21 15:06:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1540 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F1E433F08B for ; Tue, 21 Jul 2020 17:06:23 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id f2sf12694632plt.2 for ; Tue, 21 Jul 2020 08:06:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595343982; cv=pass; d=google.com; s=arc-20160816; b=zTvPk8BUo1ZfcjhtnzD2oULXB/qmFEvM+qlySU7z45B4LzVcRoZd0t0KuK/K0ojd78 SvTeiXP6DyMm3s9GdFWgS0Xk6WNsAf+RstU1dKUHoQffMxCnNeZh6SNl34lf5edJIlfQ KYLkVx4q2QndFmHRuidG4vULwnXiJZy7K+eqX6WiONOJqGhCos1N9dSHDMIGdMvBr/F7 oJrihIwM2DF8bgg9TwCXgVvwe+7nVlzNXJ3tqp9cNUb++ng6raE8Hc4hOUtNuxGLlKRE FQOsZooXY7K51BOruym29dCFJoFDGh0PwvwbdVc64kyFzA2NFv3qsUBtq0qlcwO66dZz q7yQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=lMtBcV35efsH6dLKDE1SmjNAFjUSOS7I1Y0wXB6SvI8=; b=nUV6X2EzpkOVnrofQ/yxLLsUTYCnDkc6LuJT3X2KLHhLysY8ImvXIzdBNJhM79S0zh dO4m+F+s4lRunyMoev6Dz4JlXBCyDcXGrkAcff/ea7Gqo1XMcMondiijtNWjUv4ZEbcU jZcFKSfepLqzTc1cufgczzzWGpagclt7NE3+mMAxtyW+0EIMpHkq+E7o7Oj5KgOgITyf F1a5nK6PiIZD/ZrKZA7Aq6f5zSUP/OKI7riW3ZyS1N4NfU8esO/Bc+26AL8K1i6Kb0PB TxlxKug+MuAVhPU/SwkhX+mtYHRiupBTRUffEp1BxBanfKfQJm1YtBEr88kQkPXWzaBQ 3Mcw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B27W27mq; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=lMtBcV35efsH6dLKDE1SmjNAFjUSOS7I1Y0wXB6SvI8=; b=bEuAmpyD9liXA6NGV7gVxPUzE3kyak862iX6l6vRRvz5+fxkUTvucH8dxjOW7NYbRQ bgmzmFxGxK+iojf60m1BCNLUyixxsGnwR1eBp3sB9WRQ4kQAOOiLYIaKaToyuN6xe6ow tqJ0Br7/lmRBXrwG3yxMelExCGJ4fGNu6TJ6Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=lMtBcV35efsH6dLKDE1SmjNAFjUSOS7I1Y0wXB6SvI8=; b=OREkU8AP/dvYM+v43/ZL/vfpSS8lvBiWybFDD6YB062T4wuiuS++Z7kJ0TGhVwhmeQ Vm/NidbNd8iYoY7IUFCHu4POFwHvoqb1eNLuS3PPnJHA86yopv5DoSq0C96qJ9o+6aSM wHbAy0H7lNVoajTKIGmUgrmNmiPGgCEQN+AuUxQyZR9pVu6imvajaeXxmd+PzaD1wudr XUeRvW8xIrrdgcjJ/DeGMpOpLOVVZb5j51GNF0v3if6tDX6naj9w3DGIb8GRaAhuJBpu /oISQtgu2ODTW2Cr2oa6RM/jfXtQSi/WQ9mhQZSLp5NXxaPWvKGPpk13pnc5PdNjAgNP DlUA== X-Gm-Message-State: AOAM531lylemJ3yqNvCSLqkk+YKATMs6rHqL4GlcwtR0t9PMzHw7NZ1C xoaz68AYFlmpoWpqH9bN5Vk/7e16 X-Google-Smtp-Source: ABdhPJwP8DzkGxFKYfySCdlL4LqhPdz+VHIEkMgXmtmshGePB1VQbjS90YoBRGaYTyYkUcO146SWSQ== X-Received: by 2002:a62:ce83:: with SMTP id y125mr23616304pfg.181.1595343982664; Tue, 21 Jul 2020 08:06:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:7757:: with SMTP id s84ls5901771pfc.9.gmail; Tue, 21 Jul 2020 08:06:22 -0700 (PDT) X-Received: by 2002:a62:d417:: with SMTP id a23mr25709892pfh.56.1595343982132; Tue, 21 Jul 2020 08:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595343982; cv=none; d=google.com; s=arc-20160816; b=kSLr0JqM6ZfKJin+ZKiITLgSRVOzgCE+SGhj9O8+GQ0OWjnnHLMcTOddTeHuL2sGz0 usQk6EyuZK3m0BSRDXZvjFs7P3lUGHOnawE8/oKA8582faG6NYaIRxmcpXnylVLeRwet wYwc4c+hjjTCm/xxMF3EJsuzwi4aZDgBo4y1G+fL+zJGDqZXdt1GRuUmvDbIOoHAgO// 86BFrkvgJGLK6SeXhMJo+pd8YgPt7gYE6B8bhi865JukjrlD7Kco7bI1pzoK33VVMD17 muIO/OkZIFAzczKZQi4PcG5pjKr6RSSOwwjg9+RPOznIMyGA2ZUWWduhTsiI2Mg7Hpl/ JlEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=F9o8IbO7BuI5UkE49nZ1zkI6iT+uS2Mc8/UsqLotu1c=; b=uvBRfWOaohEjYYbmEfQR9BlHCy3ui8NpVo8I634LMuhfwMpPvNmpSpMlkH0gMh9vgc w3AITAw5Led1Qa1jKmFbYyLIlVU4mLBoPBXREqWFFajxUX/2SU1kmUwPD2cBelQ/DpXM 3VusjZZN1aj3/6p3cG27hdX6FD3DzGFwvfcEBC0mLBl3mC9DJiwbzkFaxgblhgF21lSK Cy9IJ2lYNTU9vk3RS4Gdap1jSOeKkF1Pt/r7BMqgRXmSCuRl6MC1OrcLV4duSFjEKhAz TFmFFk66GFvMg4d8F8qbERh+R6VSxm0BJ1ouWgRTRkx7R9Ar3MHBB3z1UdqayUP7tfx/ SHxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B27W27mq; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o94sor3805347pje.28.2020.07.21.08.06.21 for (Google Transport Security); Tue, 21 Jul 2020 08:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:c087:: with SMTP id o7mr5204379pjs.37.1595343980856; Tue, 21 Jul 2020 08:06:20 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:3df7:ef76:b2b5:fa14]) by smtp.gmail.com with ESMTPSA id h9sm20671276pfk.155.2020.07.21.08.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 08:06:20 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v6 1/5] rockchip: rk3399: Add weak led_setup() Date: Tue, 21 Jul 2020 20:36:00 +0530 Message-Id: <20200721150604.35410-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200721150604.35410-1-jagan@amarulasolutions.com> References: <20200721150604.35410-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B27W27mq; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add weak led_setup() so that board which has an uncommon led setup code that can make use of custom implementation. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- Changes for v6: - new patch arch/arm/mach-rockchip/rk3399/rk3399.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index 4fda93b152..c643483971 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -241,8 +241,14 @@ static void rk3399_force_power_on_reset(void) } #endif +void __weak led_setup(void) +{ +} + void spl_board_init(void) { + led_setup(); + #if defined(SPL_GPIO_SUPPORT) struct rockchip_cru *cru = rockchip_get_cru(); From patchwork Tue Jul 21 15:06:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1541 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0F97F3F08B for ; Tue, 21 Jul 2020 17:06:29 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id d67sf15241698pfd.4 for ; Tue, 21 Jul 2020 08:06:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595343987; cv=pass; d=google.com; s=arc-20160816; b=lhpHRLTwOzTAHEky+q/mpaewm0b5KfhL2CYNftCWOFn2nhV5itYgTXj5gsk0MgUFt8 6rOasTp1iDlPLksVoTbC/XFA+kksWtSG+cU/g2Ttq8+uR3PKasy0+WCFkrlC2nU/9day Ox+FB43skooTlaUSs2dl7E0SqAmrGr1VBWJWQ0dNdDfz1Vhf32TS7jBvGae1nR7dr9N7 b7UECsqeMmQk42Fjs/LTh33S77fzAihRMGkgu6zmGa1X3ijtYjkgy8a2p9AB+8+ac4kR 2nhdEZ+Yfj9XAEYR8g5YlZ8d+Cf2HxcQUKZBVV3nrAsDQ0EaTFpM2BR7+w0AYEuDc60T laCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=qaC4co7Jm1O75/aY/97ioBT3iSRZBFgMI0epq3r771M=; b=hfWoo+Q0of6s4ybAInNE0KC4hFEFqY0MCleZdGdgpE+OKQ5KudltkiADLdnY0+0h1Z rjycc9ji0hAZbSPNpXzZX660QKcvEx2vvD9FHTWSjz+YkmBuwb0lT040jjVzeNWEyvWa 4Pv6UuBxtwijmBMaw/zygwksvqEXxZQ7B2X4Ed+ucBpdmRr+qKewGuMiDMw8ocDtAp0q joFg3Tv5k4mIiz3TzCPzA6xq80boKBowzEXwT11D9Gh7q03HRhsJNZC5ZuT7+829+nMb 1LeVeoKYMU0A5FX2A4UDy7R6jZ3Iq4t3gYu1Li9C0WiWWenaoBuHclii73JSPBoWhA+n Sz/w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pZMrB3Jl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=qaC4co7Jm1O75/aY/97ioBT3iSRZBFgMI0epq3r771M=; b=Gsdm8y5zDQCmOj7dyPRGaPRXN16kW+K31d5HyEnPFmDu9+nE92aZL2rJY0wnX9c+gh zEYJOZFNlsl4FRTa5tm6dSi4XfBmWxwB+lskcJyotYZiOw9qllvnIEpNG6OyzJKKuy4D 6oFso0vCwHpGiK7CbvJ3Y1uVbo1/CQr3ro2ss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=qaC4co7Jm1O75/aY/97ioBT3iSRZBFgMI0epq3r771M=; b=oySqjPLOTtW81ZQjaHWksYweVI136Ue9O1Y4tTez9ymK3NQBBPpu3qEhZ3yU4MEFi+ 8q0LF666GDW2Gr6n3bGFKPNoRNOzk+M1RIPtEH7t/HAJNTCB2wOw+2hp+2sWYF3HKds/ lOXIREnhTrfZBgsR3yQzRUFJIENvRZTIu55WabxUEl+gIaUW72/3pIju065SmBMUItBB PX3P2JNTx1hGXCZFfdvH64FZtqxobCrTKt9hjF8WpN66s0dMtyK1M21xeDJ/SuwthISX t33ftes6sQAFN2mBIctNGhKLT3ZfdvrZRfXQmNBaolB7WvUHpZArabOEEDk6n5HHwa09 yntw== X-Gm-Message-State: AOAM533E+3vBdvzkJP3dzj59oPeQFOUESY3A2wbR93RBodYvA6VJTmR2 MMrh/Vqt3rKRH9fN7o3kccvCFoCu X-Google-Smtp-Source: ABdhPJzyWDCYtigbQ9IThF+VD72VPVHEsPKbCEu3YCjkmIybV+vGXLAl45t4aKXKApdRyyf9n7ZrNA== X-Received: by 2002:a17:90a:e007:: with SMTP id u7mr5583487pjy.9.1595343986891; Tue, 21 Jul 2020 08:06:26 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:ea0e:: with SMTP id w14ls1648997pjy.3.canary-gmail; Tue, 21 Jul 2020 08:06:26 -0700 (PDT) X-Received: by 2002:a17:90a:7487:: with SMTP id p7mr5269129pjk.233.1595343986439; Tue, 21 Jul 2020 08:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595343986; cv=none; d=google.com; s=arc-20160816; b=q+n45uBRgV9DwmKRl3ZP3iJ0T1+aBhJg9UgMBt//TM/Y5Nt+O9uFpbgObh7RYeE+5j mt6B+uPMa2q3Wkc5vnNA7/pARL81G+3sf8ZNgYHTTLZ7xmQTFUBzPnWFJPY7MSftbknG 5Ct3rYTg9B80VzEpLmSFwOaSYet67zxZ3WKLSwBOZ5g/jlEMwbR32T44mnD0onicAQJZ mWLT7zWCO+NOzE6BbmNCjGYT8XLQ+Pg/qeQWva6BRhSBfa5wz+Fm2ei+FvfdFTRqabGw TtAGp1bSYSKRc2Y5g2XcXwiaFi59wOy9eyV0lE2aNFnFASfY+j+GfFnho5bJ0tbJ2FD7 59MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=YPQ2RRgdhiGzXq3YpTPg9pfFZFMkIft9XCXrxJGCg6E=; b=Jo8NNphx044eY2afG9HRYKDHUjTh6rEGK+YXFQH0MY+8YLu5K1cSmCjI0LA/gLYGPf 8Gwsv9x7SbqV3tufoCAYk3wYU6L4Ctml+LLQiwRbt50cJrH/CBGrga9RXJUTc+MIRr3r j1doVHVpBsb1AO52tomp4yQwVKwxCv7BZ2YFgK4KflNdNgcwpN9W6C1J7WPc4+1FW4Ta 7gq8RA1EcosdHVNxR2S93sxlopTLAyQR8g+P1GM8M2o7wsyz8iTZTlEAROnQTWlcv1IG rHINnBbK/OLUsLacA23U1MP22mRdpqzx20ZCrfgMumuZ0AyMJKGisueGggNhQ8cbXY3s QO6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pZMrB3Jl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id e20sor14515295pgn.33.2020.07.21.08.06.26 for (Google Transport Security); Tue, 21 Jul 2020 08:06:26 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:c60f:: with SMTP id w15mr23411819pgg.113.1595343985813; Tue, 21 Jul 2020 08:06:25 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:3df7:ef76:b2b5:fa14]) by smtp.gmail.com with ESMTPSA id h9sm20671276pfk.155.2020.07.21.08.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 08:06:24 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v6 2/5] rockchip: roc-rk3399-pc: Add custom led_setup() Date: Tue, 21 Jul 2020 20:36:01 +0530 Message-Id: <20200721150604.35410-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200721150604.35410-1-jagan@amarulasolutions.com> References: <20200721150604.35410-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pZMrB3Jl; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , roc-rk3399-pc has some specific requirements to support LEDS, environment. board detection and etc prior to U-Boot proper. So as of now SPL would be a better stage for these custom board requirements to support unlike TPL. Adding few of these custom requirements like LEDS in TPL would require extra code pulling and also the size of TPL can grow. So, this patch moves the leds code from TPL into SPL Board init led_setup code. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- Changes for v6: - use spl_board_init custom led function arch/arm/mach-rockchip/tpl.c | 7 ------- board/firefly/roc-pc-rk3399/roc-pc-rk3399.c | 10 +++------- configs/roc-pc-mezzanine-rk3399_defconfig | 2 +- configs/roc-pc-rk3399_defconfig | 2 +- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index 88f80b05a9..cc908e1b0e 100644 --- a/arch/arm/mach-rockchip/tpl.c +++ b/arch/arm/mach-rockchip/tpl.c @@ -43,18 +43,11 @@ __weak void rockchip_stimer_init(void) TIMER_CONTROL_REG); } -__weak int board_early_init_f(void) -{ - return 0; -} - void board_init_f(ulong dummy) { struct udevice *dev; int ret; - board_early_init_f(); - #if defined(CONFIG_DEBUG_UART) && defined(CONFIG_TPL_SERIAL_SUPPORT) /* * Debug UART can be used from here if required: diff --git a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c index 7c3a803654..2b447df8aa 100644 --- a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c +++ b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include @@ -30,19 +29,16 @@ int board_early_init_f(void) out: return 0; } -#endif -#if defined(CONFIG_TPL_BUILD) +#else -#define GPIO0_BASE 0xff720000 +#define GPIO0_BASE 0xff720000 -int board_early_init_f(void) +void led_setup(void) { struct rockchip_gpio_regs * const gpio0 = (void *)GPIO0_BASE; /* Turn on red LED, indicating full power mode */ spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1); - - return 0; } #endif diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig index c87a8568fc..15d511741f 100644 --- a/configs/roc-pc-mezzanine-rk3399_defconfig +++ b/configs/roc-pc-mezzanine-rk3399_defconfig @@ -1,6 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x00200000 +CONFIG_SPL_GPIO_SUPPORT=y CONFIG_ENV_SIZE=0x8000 CONFIG_ENV_OFFSET=0x3F8000 CONFIG_ENV_SECT_SIZE=0x1000 @@ -21,7 +22,6 @@ CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 CONFIG_SPL_SPI_LOAD=y CONFIG_TPL=y -CONFIG_TPL_GPIO_SUPPORT=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig index 601f5c6ae1..2a6d0d22c8 100644 --- a/configs/roc-pc-rk3399_defconfig +++ b/configs/roc-pc-rk3399_defconfig @@ -1,6 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x00200000 +CONFIG_SPL_GPIO_SUPPORT=y CONFIG_ENV_SIZE=0x8000 CONFIG_ENV_OFFSET=0x3F8000 CONFIG_ENV_SECT_SIZE=0x1000 @@ -21,7 +22,6 @@ CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 CONFIG_SPL_SPI_LOAD=y CONFIG_TPL=y -CONFIG_TPL_GPIO_SUPPORT=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y From patchwork Tue Jul 21 15:06:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1542 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 216C23F08B for ; Tue, 21 Jul 2020 17:06:32 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id s1sf16423248pge.16 for ; Tue, 21 Jul 2020 08:06:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595343991; cv=pass; d=google.com; s=arc-20160816; b=WBhVZsbDFCiJwwLciie9psf9frL4VxXiiA8e4Pr6GfvFyQWTw5RvNjunAO3rbrpPqT /WyC4H3Kpg66iP4eCMBm54TBmXdpuIj5zigOEOco5x7LwOMkZ3u/0mHwPSA2QAa1/Rs2 L8lwx+d8MojQ+aPi59Y347IwpKeVfN5oy2KcVmu4gtDpKhYjPO2vG5HPz0HNYTk+MWql 9raYJM2pnl/TmlvaNZigyCpAZW0dTO9+AJZA4eKmYjQknqcsh9QtquIx3OSJ/dFijeZq 2n/DCryi3veYlHNYU5Ym+XMzF3XeNabFWpimdU4JR84oCeuvHDYRDN/b6courcA5ZE8J NOgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=FEKDw28baidsI6FqQrivi0p/UrIsjX2cyiOzO358Ud4=; b=JNTXz1D+BCp6pbEFB2CCqLez2wOBuSjPFGSHEL8VOnbcfZxIUE7XlWTfWtAMzkDSAI uv6g09Zjlc3aUjI59hTYoS/iWhboG8XmkIh+K4RppKqrHPO1Bt+d7PH1qtWDiGhsnTsQ MxyvFWywzGo7SERPzrVYlVs49T1Vkw/f5Ajq/jWnBi4abtqoM2faP8bvPlE1m3iYCaLR x2qu4Io6wgHrxGEq3WRzzjjIj4eqrAzq7L1M8l/5BT899U2R95eVjB4d2XvhmsBPMC6s U6XOe12IB4BO4P9gKQc2tSPyQ6wToGrNd3AULbLlWy2UGfToQGH1xXn3vez3IQGxXEAA 9yzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JgwqoZa9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=FEKDw28baidsI6FqQrivi0p/UrIsjX2cyiOzO358Ud4=; b=AgXu3qS6adblrvumyjrfhYntqEUkRk9fXVIAbiDyi2atoWU6bokaCFU0KOJJWNJStj Odapz42QuDE2Xp9E8XFFI+LdgX0oiQFTm3jh7+5HPBAW3RCHyKPn/coIJ01Xw/72+nfb E47+oqqxKMdO8GRMbfjQQZrTMH6k9TsmIgj/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=FEKDw28baidsI6FqQrivi0p/UrIsjX2cyiOzO358Ud4=; b=L2mws37RRkCoWUkP7c6vV8KOw2chm0cTMutfu/iXejHPNshiEwZ616arLMvTT5nmdz cI3lpxlhmLZRAhN57A7cG7S8ADZk3Kc2z7PK7vAFM7NWaJ43DabYDIa9jjUPKM3a5rmT +P9+qR3t81SXu4LPRfy2xQxiT6e+Fknjg4qlz580WAL4sssHEBJZoG0o7R4ioX8e/1W8 KYCG489h1MvY43J3ML9U7gRcuMAJzmVF4TPwXFJ55b7lE6WOfok1wRwPL534gRZlI8ss K2jpAPHLkSx051f+A5fJ3YkCtEm3Ewgk0J3BR6gERCiCfnM+FEEzQllnt92Q2rytppiN fu7Q== X-Gm-Message-State: AOAM531Z+r+4yKF9nI+Sf16ZVLjG7gQOHwEeBq59/H27I+GhBtzehC1o /XbHx4JNLhP/3OPbjdXVvzVweQ2L X-Google-Smtp-Source: ABdhPJxqI97ZpFJAlpR0soieephl7MudaQVbjUCZ34h4kaaLrwtwbmtHq9xDCxsJsc2pw19VYfQIQA== X-Received: by 2002:a17:90b:4ac3:: with SMTP id mh3mr5569999pjb.0.1595343990719; Tue, 21 Jul 2020 08:06:30 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:9f8f:: with SMTP id g15ls4169998plq.6.gmail; Tue, 21 Jul 2020 08:06:30 -0700 (PDT) X-Received: by 2002:a17:902:7807:: with SMTP id p7mr23224338pll.242.1595343990238; Tue, 21 Jul 2020 08:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595343990; cv=none; d=google.com; s=arc-20160816; b=aFNmJmB7Y3YmJruvfafqxIwc4z45jygn9ujqJafUFrudm8NC4NRDl02SVKWmJ0TY01 FOdtS4q44WhYm6iMWhoW3vemJNnz8yRgghyNHuDZy/bPYiwDRzD3ImyHgYNbSsYnhPtH gBizy63hmfE5kVdUr/6KIbMvdOJS1HfvXHOdXaD1pFn1BGfxeZPG0m4dCE4CtN4/FAjS Ad0pB2yTcfii90m5tVXUEJV/N/3THiqNfxGGeHObkgmbWfvSmZSgHF/etyPP3c+lt9Mz rqQiczhyY/hYKJ1rrLVTb+bnEWULCkm5edCxQHi6jw2sNuCfaEg4FRbJH9xiDjvpeLKS AZnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=0ew9QjlJbRnQZOLGXciV0S5gezg4N5qJ+NOPGABB76Q=; b=ZDBMepK0Fzi7GG8Sd4eKltozk1PAwleR8wImsRRUs9VhP9r4v3c0HXnzD7op5ADtGH ozYlNlMBY9wPAB3tnMNzWgEjVakgRyoUdPamkyklwVG4E5iktMh01lPkQg95+iYox329 n+2kgG5fosLalk423Gwzi3y11PaS9knkxjYF8Q/tD1cyCQZKcsJsFar2N36MjR2K15Di 2uR4CZN1uD/TFT1176XV17p6qMHpZqvGdv4QGizO/5GCyO3bXE2TMxTubIaMjQ87toXq zH+UkA46zG1LupkTO3ETwds+Fa0oaH6X/VLrdKqSbqpfEJ+oY0LOk12APzNuPKk2XmcJ 9xyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JgwqoZa9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id s70sor24305076pgc.74.2020.07.21.08.06.30 for (Google Transport Security); Tue, 21 Jul 2020 08:06:30 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:2c96:: with SMTP id s144mr22498750pgs.359.1595343989880; Tue, 21 Jul 2020 08:06:29 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:3df7:ef76:b2b5:fa14]) by smtp.gmail.com with ESMTPSA id h9sm20671276pfk.155.2020.07.21.08.06.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 08:06:29 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v6 3/5] rockchip: Don't clear the reset status reg Date: Tue, 21 Jul 2020 20:36:02 +0530 Message-Id: <20200721150604.35410-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200721150604.35410-1-jagan@amarulasolutions.com> References: <20200721150604.35410-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JgwqoZa9; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , reset reason can be used several stages of U-Boot bootloader like SPL, U-Boot proper based on the requirements. Clearing the status register end of get_reset_cause will end up showing the wrong reset cause when it read the second time. For example, if board resets, SPL reads the reset status as RST whereas U-Boot proper reads the status as POR. However, based on the latest testing clearing reset status won't be required for determine the last reset cause or following resets. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- Changes for v6: - collect Kever r-b arch/arm/include/asm/arch-rockchip/cru.h | 1 - arch/arm/mach-rockchip/cpu-info.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/cru.h b/arch/arm/include/asm/arch-rockchip/cru.h index 5eb17f9d55..d2057cb738 100644 --- a/arch/arm/include/asm/arch-rockchip/cru.h +++ b/arch/arm/include/asm/arch-rockchip/cru.h @@ -26,7 +26,6 @@ enum { SND_GLB_TSADC_RST_ST = BIT(3), FST_GLB_WDT_RST_ST = BIT(4), SND_GLB_WDT_RST_ST = BIT(5), - GLB_RST_ST_MASK = GENMASK(5, 0), }; #define MHz 1000000 diff --git a/arch/arm/mach-rockchip/cpu-info.c b/arch/arm/mach-rockchip/cpu-info.c index 21ca9dedce..bb5a198039 100644 --- a/arch/arm/mach-rockchip/cpu-info.c +++ b/arch/arm/mach-rockchip/cpu-info.c @@ -47,12 +47,6 @@ static char *get_reset_cause(void) */ env_set("reset_reason", cause); - /* - * Clear glb_rst_st, so we can determine the last reset cause - * for following resets. - */ - rk_clrreg(&cru->glb_rst_st, GLB_RST_ST_MASK); - return cause; } From patchwork Tue Jul 21 15:06:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1543 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 977403F08B for ; Tue, 21 Jul 2020 17:06:36 +0200 (CEST) Received: by mail-pj1-f71.google.com with SMTP id a19sf2347362pjq.9 for ; Tue, 21 Jul 2020 08:06:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595343995; cv=pass; d=google.com; s=arc-20160816; b=V9NWkFARQ621PpdID4NkDsB6pqIegpnoMNp1z9D64ox1TvEQ7xJHIyZ2jLW/FNDjEB ZlI5WO2J7/PDQ1O2TcV8UYjUemWSJoelMEzwK0gOqK26Ceu5s2hh8+F5yz9/z4zLrwMG W8Mgy7oWVP3pcHex0t0UBn4s9azBbThpkvO4IjA0rtTvLDAfcecAOMoKie4ZS1ygMurJ VAOuapMdyIP7HfbvD4pJA1KzbL2BZSrFGsGMMuJ2k4zkE6gHSdW3B68qCSR+9e7U8S76 98DJAVwgZQBvGcPn1GnaIufW4H4KwKlUUeRnSqqaDkUYPRVkWmS0Ilrk1tCQrKVJk+xM qQRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PhE4W2Hhn/4CCPQo2cH2jtR0e5CVcW5NChNl2EbXLpc=; b=xGCRTyVIp3uDQ4jKkvJ2xnK9vhl/wiHvyhlVEa2CQwh5MAuvhCB4fi6+9CR8U9BdtH WNdtnNxbZ/g7PKpfUnmyAkaDb2LkZdTfkzyhWu/ql4aD2KnqcXJ2WNtFZz9p11VDgLpu jBsAEcEqw50hKmd+VyfGQZrHurUi9ZT7aZ4Z3TtoO0YD8af8qz1h2IjcXUtqhriV21Fd E7aW92QBOqJHv6VXDUVZJAXJDGU81tP9XC4rcymiDGdpO3RrYCuVxo/Z9B5HGhJHacwc JU6uwIIA6HSwA+M74O0ddVpl1IzDR55zzWoya8kRDNgeWxM4WLIl17AsgZ+bLLLUguUB BW8w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vrw6fIY7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=PhE4W2Hhn/4CCPQo2cH2jtR0e5CVcW5NChNl2EbXLpc=; b=pvpNGWnFdj1Kn4/qjrC3q622qWqON8NZ78tpUEEGWq4nKBhrCh7R/9b7es1N+Zq38x mQdTU/RyZMuM4yyVCc2+gHcq3fBtpQ0Sb9hU1fnPfYzZOYtXWtM8FYIfVfi42P1V661A 25wkRxD+uORPpbFXiwjzwV5+FSCLypVc6MMUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=PhE4W2Hhn/4CCPQo2cH2jtR0e5CVcW5NChNl2EbXLpc=; b=odk6tGcR/WWTkj3JyPcJQdpXjgieIdJUp+5prvrJpSpL/U3t0b29C2QFVfn9iM+Z5z inEvam2gJK5dDehuqANW+Q+qUOyVShrd3EuS+34W3Fo2XpBlyh0l+4u0uvJxUEflI/vt S+T0pZDRoAjYp9+KI+nHG/E6JHnGtbrrviUt0j3ph2vwWWgGXdT9MwjlXfb7vsFwYnmV QME0BVSmUIDef///Z7rpBVMNcQc89Us2k+/KIWlvnawhFiOpux+8WK8jUPWUZqOM7RpV 8qHxWUEOLuGvX+qvUCqx3X28J3xMCy9jy296J6Rh1aojMtf3FsUHgJnH4AORDsABJ6Ta crEg== X-Gm-Message-State: AOAM531ovf2uivzdDBIhNNHRJvDUL0vF9F33YJ4UxGlwtvQ+PnzZMSur qWLE864iVVLn4UoFWA/yFr7OW/l6 X-Google-Smtp-Source: ABdhPJzas2aZXqCkEsM3Q33T/F/2ikTEEYYU1aOlogjLALlu0ahg+0tXqiM1usbjOISfAXiHig2SKg== X-Received: by 2002:a17:90b:1296:: with SMTP id fw22mr5337000pjb.20.1595343995332; Tue, 21 Jul 2020 08:06:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:be15:: with SMTP id r21ls2893503pls.11.gmail; Tue, 21 Jul 2020 08:06:35 -0700 (PDT) X-Received: by 2002:a17:90a:d56:: with SMTP id 22mr4691678pju.58.1595343994773; Tue, 21 Jul 2020 08:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595343994; cv=none; d=google.com; s=arc-20160816; b=BSdpQL+OsyCBR00+wxrBKAzyUI1q9CV2J1tns9BVX90cCZC6QmYFL1P9RKC7wKgijd +sWzfiMAC23Y7+B+cpdtV3jBwSuAHXEiOdCOsLuQkyoMcPElqJgLtPnr8DN+XQ/rRDRq Y8auMmefpFz5sejGohVugpAG1EXNJc2DqDpvM+DhXklRaOWA4n2rX5cCh5XktiRgp00I niy/LN27L+r52d9SH3xbUevTe50vemw2r3b69YLaSRJ6eokGDVkERC0fDewWs8Io2/ly p3CX+7gqd0lNoMDNp9ZjTrMN3PrTeBT9yAcv1l98TTaiQ2v+fWSLveIXaeAmxLt0ZcSB BuFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=kJTvxFddUezOXB+bSIzZegS7m7D3F2NiD9ttg+cfFJc=; b=IU4YlQuW1UVQ5oxBwCOG+h3NLb7Z7/74kFXtSSLBZXqU/nzu75o7STKdgIwrt3RuuR WG2/wq2pvk2w0RCo++5bvD2KMDEX+/ad5HSuu29wIBrpvhY13yKvw5HgD7IP//vOny3c M2Egb+SIpLr8KreNUHEpSSG3B6jr/BHZhYFBebSWUWTjWzcW9+QaM9M3bbGZXuZM21aI IH0emqLwhhZkfniJU3d4xWObIz/lHeaC9zdFAGDvFjMERIilEotQr41L9zswELfLYZm8 VkZUF+5OYCY9Xugw4/pQkDC2U29UGKpKCpHR2F0zFCHPQd2cZ63N/IeIm6P+SCiQLarP XE9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vrw6fIY7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x10sor25921748plb.9.2020.07.21.08.06.34 for (Google Transport Security); Tue, 21 Jul 2020 08:06:34 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:988b:: with SMTP id s11mr21597336plp.229.1595343994295; Tue, 21 Jul 2020 08:06:34 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:3df7:ef76:b2b5:fa14]) by smtp.gmail.com with ESMTPSA id h9sm20671276pfk.155.2020.07.21.08.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 08:06:33 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v6 4/5] rockchip: Separate the reset cause from display cpuinfo Date: Tue, 21 Jul 2020 20:36:03 +0530 Message-Id: <20200721150604.35410-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200721150604.35410-1-jagan@amarulasolutions.com> References: <20200721150604.35410-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Vrw6fIY7; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , reset cause is a generic functionality based on the soc cru registers in rockchip. This can be used for printing the cause of reset in cpuinfo or some other place where reset cause is needed.  Other than cpuinfo, reset cause can also be using during bootcount for checking the specific reset cause and glow the led based on the reset cause. So, let's separate the reset cause code from cpuinfo, and add a check to build it for rk3399, rk3288 since these two soc are supporting reset cause as of now. Tested-by: Suniel Mahesh Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- Changes for v6: - collect Kever r-b arch/arm/include/asm/arch-rockchip/cru.h | 2 ++ arch/arm/mach-rockchip/Makefile | 5 ++++- arch/arm/mach-rockchip/cpu-info.c | 20 ++++++++++++-------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/cru.h b/arch/arm/include/asm/arch-rockchip/cru.h index d2057cb738..13ea4aba8e 100644 --- a/arch/arm/include/asm/arch-rockchip/cru.h +++ b/arch/arm/include/asm/arch-rockchip/cru.h @@ -30,4 +30,6 @@ enum { #define MHz 1000000 +char *get_reset_cause(void); + #endif /* _ROCKCHIP_CLOCK_H */ diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 5b38526fe0..121f23a563 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -22,11 +22,14 @@ ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) # we can have the preprocessor correctly recognise both 0x0 and 0 # meaning "turn it off". obj-y += boot_mode.o -obj-$(CONFIG_DISPLAY_CPUINFO) += cpu-info.o obj-$(CONFIG_ROCKCHIP_COMMON_BOARD) += board.o obj-$(CONFIG_MISC_INIT_R) += misc.o endif +ifeq ($(CONFIG_TPL_BUILD),) +obj-$(CONFIG_DISPLAY_CPUINFO) += cpu-info.o +endif + obj-$(CONFIG_$(SPL_TPL_)RAM) += sdram.o obj-$(CONFIG_ROCKCHIP_PX30) += px30/ diff --git a/arch/arm/mach-rockchip/cpu-info.c b/arch/arm/mach-rockchip/cpu-info.c index bb5a198039..d0f030109f 100644 --- a/arch/arm/mach-rockchip/cpu-info.c +++ b/arch/arm/mach-rockchip/cpu-info.c @@ -13,7 +13,7 @@ #include #include -static char *get_reset_cause(void) +char *get_reset_cause(void) { struct rockchip_cru *cru = rockchip_get_cru(); char *cause = NULL; @@ -41,21 +41,25 @@ static char *get_reset_cause(void) cause = "unknown reset"; } - /** - * reset_reason env is used by rk3288, due to special use case - * to figure it the boot behavior. so keep this as it is. - */ - env_set("reset_reason", cause); - return cause; } +#if CONFIG_IS_ENABLED(DISPLAY_CPUINFO) int print_cpuinfo(void) { + char *cause = get_reset_cause(); + printf("SoC: Rockchip %s\n", CONFIG_SYS_SOC); - printf("Reset cause: %s\n", get_reset_cause()); + printf("Reset cause: %s\n", cause); + + /** + * reset_reason env is used by rk3288, due to special use case + * to figure it the boot behavior. so keep this as it is. + */ + env_set("reset_reason", cause); /* TODO print operating temparature and clock */ return 0; } +#endif From patchwork Tue Jul 21 15:06:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1544 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 39BB43F08B for ; Tue, 21 Jul 2020 17:06:40 +0200 (CEST) Received: by mail-pj1-f71.google.com with SMTP id lk11sf2386251pjb.0 for ; Tue, 21 Jul 2020 08:06:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1595343999; cv=pass; d=google.com; s=arc-20160816; b=L+Jk6Vx9PSSZFNbclTK9d0gLP0d7iejQ3Wl0wxSvzf8h/31UufWQ/uk4BxyDrM/Pl5 pupvMm+9xuM+XgCCPd12ietN4fIj5LbplO4UHKjdS5wjDT78cAcdwcFDlRe+gu2xcAQK jfipPde0BRG4bp+0NjM2mHH12yYo33dnKvUMzgJqJlezFTF0uWh+IQTe9jlcYATJnEj7 fAy7lFJUecAYX/WBV9Q+hXkItueNn1hB78oM8n4eNb3rxh00s9v9GjuyBBE1EAuuaIKT ETGgW+sBx50qn1zv+OhFkG1DB6EKMQOaDc6FMsYXtnLGB6oMAq2/6kaMdTlnZH7DVPqP p+Ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=dze7JBoTIBFa2x9IS275HbrELqYklRjOFH2WwftMpcA=; b=cakiC++W6q8N816jLtrCqqk3cutg1s0oe4UKTmLtuErRTPJUtMuPf4gFGGmc2t+JY2 Ls/WJNWa6tOYNNfoZcu5t7nSDFNM3pJlz8i6UcgBuBAohkEpO2uedZ4EBYWyGpeFOISj o46rkD5Fo2ZW14eKPhtBUlmAgtR38t1nbWKA1/aOHKJMY0AL6++r4Cff9Z/79EcTpO2L MWFavKO5bn7TrTY3sc710xKQckB0X+uE1Go/q/naFzIEtM9YWVidt6WtSWrrkMSQ3buj jVjXYyEK3m2a7fc664/0cbVsgXTLsvfu8k11DLu8m9UuPNPlMlSbXR+a+wSEFhMz5cER Drng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lrHeAS1B; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=dze7JBoTIBFa2x9IS275HbrELqYklRjOFH2WwftMpcA=; b=S1DNBayZFuiJbyl7cnM8zM93JmKGCmKXOhd2UztV0M42iW6a93Jp1uS41DJhdI06BA OyN/49KY51474bQpLdyB+dJT72DvD9n0vE+mprQj6S0s1TrNRpIKrmMTT73CYw7IhbYM s5uSUzCCqiTNcvUfjQOgS6PWEjeeJ/a3nTKo4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=dze7JBoTIBFa2x9IS275HbrELqYklRjOFH2WwftMpcA=; b=tXbod49D45Km4gLM4x7ulaXDeAFHKos4WxfeGCLJ+B0JF+tSh5hKfvFxUwz4viRFdF jyQo5m4ZOYovqY7kG591wOqLFRWW9PNFLFCosLsq4cauFBEd5/AsVxb40SipSZtHsozl L5iIEk7JB1tjzLcFVh1M2tGmxDJzOTi6C1RFOCyJ1K7tFXawmJGzcI1irTXDQNm6yRnz krvIYAhsaEDTNCX9IepjkMd4ftohWq6kfARfcsEH5prw2FrolvSabWSpCL3pEccu+XHj 4WpXqx4J3X1/R4Vj/4AGmKSxOlkuJG+dO5GKskt2EVhtGx2zJgUxq8YX09UOp3MVmsAs 0A2Q== X-Gm-Message-State: AOAM530bMh72zIPRxh/zdQVFzsx32qPTjXOplC4gnXpe4yeZf1u7FQGM vWsqP6QagDsKLTbdBt4JvwUGDxTi X-Google-Smtp-Source: ABdhPJzd/tVuhB06Lb6talEi/w/NjALBdC1kct+MDCOO4nW8iHJU3ao7bavsjP13CsDadYiMtLXMcQ== X-Received: by 2002:a17:902:8a88:: with SMTP id p8mr3341317plo.184.1595343998982; Tue, 21 Jul 2020 08:06:38 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:384c:: with SMTP id nl12ls1651281pjb.2.canary-gmail; Tue, 21 Jul 2020 08:06:38 -0700 (PDT) X-Received: by 2002:a17:90a:ea0f:: with SMTP id w15mr5553692pjy.138.1595343998488; Tue, 21 Jul 2020 08:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595343998; cv=none; d=google.com; s=arc-20160816; b=tMjrNFF0thvWwOfq8tfQd6WLQz0UC5C+bEQZpWmKUpQ3kwYZNS72MVR+SVukRwtJWa nfTV9NsAF+Igj4sH9BrsoR5fAD10+JeQR0LaZI69PIuBsPx+55bU925pJDjPrVW60l5I xIxKLrRoVOGFDF3SoHK7+2lIU0IXvXnhiqglZfU8YatsoIKbXYlsf6sO5K05xJftYLbt HE4NiydPviO/dLHV6gM1x0SPUSfBexNVtII3HLc90en0gYEyqqMiidbbZfqSwqZxhY5c YL1JgWdWZe1N04i+aZAFJpb60MDuA96upzcOEhQDIoGgsWcC/JFJVCRbTaqYkuJ/Cqhr jdfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7Q7wRiQL57N/Sj3itjNjKceEfA3By+RqUulDOxV3jgg=; b=d5r6YY38bGU0INBNODs+Y5Z72COEdilAZ/VMu6sKVrooRWJyHeooljxQemoWK4HV4i Cl2NV+viXmLPK642xC/m8LWjk+mkgwK/WvTxGy9uFutYxIwvOYfFXiOC2YHCv9+31qkY P9Vh0+SzBWmVndvULTIrzgKTxf2JI1Hb5eNPKfIER0+FkufZe6tN4CzWgTWTkUsR1IE9 VDj3ur/NGfUypnGlbLaM9hiTc08ND8kW/lmjhW8u//Y6me+jB92Sx3iqGgyRufhX1xJU 1AjRyLkCugit7hjD3PC2VUb1ezRTu4bK5BwXr47OSc9qBnBX+kZLkBM9jkBFFpU/Vu5J aWSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lrHeAS1B; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id y8sor25819736plr.62.2020.07.21.08.06.38 for (Google Transport Security); Tue, 21 Jul 2020 08:06:38 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:d352:: with SMTP id l18mr23187099plk.267.1595343998116; Tue, 21 Jul 2020 08:06:38 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:3df7:ef76:b2b5:fa14]) by smtp.gmail.com with ESMTPSA id h9sm20671276pfk.155.2020.07.21.08.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 08:06:37 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: Suniel Mahesh , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v6 5/5] rockchip: roc-rk3399-pc: Set LED only during POR and pwr_key=y Date: Tue, 21 Jul 2020 20:36:04 +0530 Message-Id: <20200721150604.35410-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200721150604.35410-1-jagan@amarulasolutions.com> References: <20200721150604.35410-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lrHeAS1B; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , ROC-RK3399-PC has specific set of configurations for on-board led setup. Due to easiness for user to know the state of the board roc-rk339-pc board code will setup the low power led on/off, and waiting for user to press power key and then glow full power led. All this needs to happen only during power-on-reset not for soft reset or WDT. Also, it is not a proper usage to ask the user to press the Power key if the board connected remotely, so add the environment variable 'pwr_key' to check as well. So, user need to press Power key only - during POR - pwr_key=y Tested-by: Suniel Mahesh Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- Changes for v6: - increase SPL _R malloc board/firefly/roc-pc-rk3399/roc-pc-rk3399.c | 38 +++++++++++++++++++-- configs/roc-pc-mezzanine-rk3399_defconfig | 4 ++- configs/roc-pc-rk3399_defconfig | 4 ++- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c index 2b447df8aa..93e7d776fb 100644 --- a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c +++ b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c @@ -5,11 +5,15 @@ #include #include +#include #include -#include #include #include +#include + +#include #include +#include #ifndef CONFIG_SPL_BUILD int board_early_init_f(void) @@ -32,13 +36,43 @@ out: #else +#define PMUGRF_BASE 0xff320000 #define GPIO0_BASE 0xff720000 +/** + * LED setup for roc-rk3399-pc + * + * 1. Set the low power leds (only during POR, pwr_key env is 'y') + * glow yellow LED, termed as low power + * poll for on board power key press + * once powe key pressed, turn off yellow + * 2. Turn on red LED, indicating full power mode + */ void led_setup(void) { struct rockchip_gpio_regs * const gpio0 = (void *)GPIO0_BASE; + struct rk3399_pmugrf_regs * const pmugrf = (void *)PMUGRF_BASE; + bool press_pwr_key = false; + + if (IS_ENABLED(CONFIG_SPL_ENV_SUPPORT)) { + env_init(); + env_load(); + if (env_get_yesno("pwr_key") == 1) + press_pwr_key = true; + } + + if (press_pwr_key && !strcmp(get_reset_cause(), "POR")) { + spl_gpio_output(gpio0, GPIO(BANK_A, 2), 1); + + spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_A, 5), + GPIO_PULL_NORMAL); + while (readl(&gpio0->ext_port) & 0x20) + ; + + spl_gpio_output(gpio0, GPIO(BANK_A, 2), 0); + } - /* Turn on red LED, indicating full power mode */ spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1); } + #endif diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig index 15d511741f..9a01de454f 100644 --- a/configs/roc-pc-mezzanine-rk3399_defconfig +++ b/configs/roc-pc-mezzanine-rk3399_defconfig @@ -19,7 +19,8 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc-mezzanine.dtb" CONFIG_DISPLAY_BOARDINFO_LATE=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y -CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x20000 +CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_SPI_LOAD=y CONFIG_TPL=y CONFIG_CMD_BOOTZ=y @@ -34,6 +35,7 @@ CONFIG_DEFAULT_DEVICE_TREE="rk3399-roc-pc-mezzanine" CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MISC=y diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig index 2a6d0d22c8..6181da763d 100644 --- a/configs/roc-pc-rk3399_defconfig +++ b/configs/roc-pc-rk3399_defconfig @@ -19,7 +19,8 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc.dtb" CONFIG_DISPLAY_BOARDINFO_LATE=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y -CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x20000 +CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_SPI_LOAD=y CONFIG_TPL=y CONFIG_CMD_BOOTZ=y @@ -33,6 +34,7 @@ CONFIG_DEFAULT_DEVICE_TREE="rk3399-roc-pc" CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y CONFIG_MISC=y