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