Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8E4B7C433F5 for ; Wed, 5 Jan 2022 16:40:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5576680FDA; Wed, 5 Jan 2022 17:40:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kgw+IDqV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E5073804C8; Wed, 5 Jan 2022 17:40:13 +0100 (CET) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09EEA811DE for ; Wed, 5 Jan 2022 17:40:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ed1-x52d.google.com with SMTP id m21so165533343edc.0 for ; Wed, 05 Jan 2022 08:40:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MHaaUJnjLMcY2Aik29k26/oZgJZqN7VEBW8SH3wqijg=; b=kgw+IDqVhHwDfBeghz+hKQr6xNj81Ogm5Ok43eDzKS5Ngvb7l6o2Vrj/wzNFAzFirN uCTveolAUCdNTMj8IaymPCfCpyM8R+XC5yU7G3XSfpkNQYcGmGhKmpOBAK/ExV8/ClUl x0E3TbYdpAAzDDISnwKE1KjFqyZpN3K4RMNXsI/5z15x7tb1Glcsow1GgAyRqv4F0nSj nBFPa/7B9EMUVlW2iVxahtGcjslLZlt/kFvGffk5rp05Vh+uJ95tFe9p/c5JA4FaQQ/N menkmvY8zGXEnWUXUw7hmSKUmsIxPCIYPs1koAq4KK2mgLu6KDwt3esjiX6kO5yQCaZE rcSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MHaaUJnjLMcY2Aik29k26/oZgJZqN7VEBW8SH3wqijg=; b=5BKxq/DYOCBlJ2XW10B9UIjGV4UvxZrIByu2ofj2ZLkQsj/XYVyLA9uoq48ZNUCsEY DKLGkpEJ88t5bgFCvZYT7bQnlDJ170nmvA0CaFF9JHsNevGG+0xr3IraYs0qp/FY2XvG p/ARnChD2ofEeT3RAvgC2F03Gla0Cz9Y0P94QLcz+EDQ6wFUb65gjpan6tP/HGXeCL3d s/pPAvSAxp8onsPXz27I5CYHo2Gcwj+LsDDQ1kwLdeLV6yCF5Fb9/OOnyrGs7REIP/ge eDnxuzYSj0cw61IQ4qaPjJyWbHRb87akNksEVSBbZEAT9hLX+fZn9RU0nEoqSIsmbzn9 oxXg== X-Gm-Message-State: AOAM531ivu5+gKtCMcYLgbuWDvZI39CANm3EfEMQgODWy+R4YtHUldG2 M8QcsjZFLBbAGsBlGxGj7Dz0U9bjlUeKqg== X-Google-Smtp-Source: ABdhPJyblQTvG59f4sSPSjS676zv3nXVa+Jo+m9b7QFUpAER2rPqwz6qVi6rZDevaPvdKwesB29i4A== X-Received: by 2002:a17:906:fb0a:: with SMTP id lz10mr44492781ejb.494.1641400810390; Wed, 05 Jan 2022 08:40:10 -0800 (PST) Received: from [192.168.2.2] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id r3sm12401621ejr.79.2022.01.05.08.40.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Jan 2022 08:40:10 -0800 (PST) Subject: Re: [PATCH v2] rockchip: timer: add OF_PLATDATA support for dw-apb-timer To: Simon Glass Cc: Kever Yang , Philipp Tomsich , Marek Vasut , U-Boot Mailing List References: <20220105021533.21838-1-jbx6244@gmail.com> From: Johan Jonker Message-ID: Date: Wed, 5 Jan 2022 17:40:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Simon, Thanks you for your comments. Shown below are the objdump results of the full U-boot binary dw_apb_timer_of_to_plat() function. Same goes for the dw_apb_timer_probe() function. With if (IS_ENABLED(OF_REAL)) I don't get a useful timer result (boot hangs after timer probe, because in full U-boot the reg value isn't correct defined. Part of the init probe is missing. Could you try it yourself? Please advise what options we have. Kind regards, Johan Jonker ========================================================================== Patch version 1 with if (IS_ENABLED(OF_REAL)) {}: arm-linux-gnueabihf-objdump -d drivers/timer/dw-apb-timer.o > ../dw-apb-timer-20220105-v1.asm 00000000 : 0: 2000 movs r0, #0 2: 4770 bx lr arm-linux-gnueabihf-objdump -d spl/drivers/timer/dw-apb-timer.o > ../dw-apb-timer-20220105-spl-v1.asm arm-linux-gnueabihf-objdump -d tpl/drivers/timer/dw-apb-timer.o > ../dw-apb-timer-20220105-tpl-v1.asm ========================================================================== patch version 2 with #if CONFIG_IS_ENABLED(OF_REAL): arm-linux-gnueabihf-objdump -d drivers/timer/dw-apb-timer.o > ../dw-apb- timer-20220105-v2.asm 00000000 : 0: b538 push {r3, r4, r5, lr} 2: 4605 mov r5, r0 4: f7ff fffe bl 0 8: 4604 mov r4, r0 a: 4628 mov r0, r5 c: f7ff fffe bl 0 10: 6020 str r0, [r4, #0] 12: 2000 movs r0, #0 14: bd38 pop {r3, r4, r5, pc} arm-linux-gnueabihf-objdump -d spl/drivers/timer/dw-apb-timer.o > ../dw-apb-timer-20220105-spl-v2.asm arm-linux-gnueabihf-objdump -d tpl/drivers/timer/dw-apb-timer.o > ../dw-apb-timer-20220105-tpl-v2.asm =========================================================================== On 1/5/22 3:03 PM, Simon Glass wrote: > Hi Johan, > > On Tue, 4 Jan 2022 at 19:15, Johan Jonker wrote: >> >> The Rockchip rk3066 SoC has 3 dw-apb-timer nodes. >> U-boot is compiled with OF_PLATDATA TPL/SPL options, >> so add OF_PLATDATA support for the dw-apb-timer. >> Also change driver name to be able to compile with >> U-boot scripts. No reset OF_PLATDATA support was added, >> because the rk3066 nodes don't need/have them. >> >> Signed-off-by: Johan Jonker >> --- >> >> Changed V2: >> replace if (IS_ENABLED(OF_REAL)) by #if CONFIG_IS_ENABLED(OF_REAL) >> --- >> drivers/timer/dw-apb-timer.c | 30 +++++++++++++++++++++++++----- >> 1 file changed, 25 insertions(+), 5 deletions(-) >> > > This seems OK but you have included unrelated changes (whitespace) > which should go in a separate patch. OK With whitespace did you mean this or something else? - .of_to_plat = dw_apb_timer_of_to_plat, + .of_to_plat = dw_apb_timer_of_to_plat, > > Can you use if() instead of #if for the CONFIG_IS_ENABLED(OF_REAL) ? See comments above. Currently not it seems. > > Regards, > Simon >