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 8C8B8C433EF for ; Wed, 2 Mar 2022 21:06:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 640298390C; Wed, 2 Mar 2022 22:06:43 +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="L0o1sqL5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9F3E5837E2; Wed, 2 Mar 2022 22:06:41 +0100 (CET) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 B3065837E2 for ; Wed, 2 Mar 2022 22:06:38 +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=krjdev@gmail.com Received: by mail-wr1-x42a.google.com with SMTP id u1so4698852wrg.11 for ; Wed, 02 Mar 2022 13:06:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:to:from :subject:content-transfer-encoding; bh=+PaD8uh1GYytCE75UkPeNUVIHIY6dy4kHlOhaWsxNIo=; b=L0o1sqL5pbftISfe2gc40NMaudh2VAxZOqQsu6cEaZePm/wI3qDYGcj8Z81asin188 995qDg21ofO5DCmPGN7dghOcUy/asMo7EXhpfNVLm5CY15JTFqY5BJ87papjxgTi8KUd poWacSWrhdFmg5LuBGUABFwJ3VChdQeGcg5UQ6wE1l29Y086xgRTsfxsgDW1ixzZffmz ESkof29T/tQpJT1o4s+UfY1BHAcLafoNtr20DlfHhOdBRQ04ELhgnf6qgC6bNyaH6RQq eb/twf79HrDBpOryKeZG1hedni8d53GYDrSr5ZCA6fPO0FObTKpiOlzEP2b//mSdDLpz Oypw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject:content-transfer-encoding; bh=+PaD8uh1GYytCE75UkPeNUVIHIY6dy4kHlOhaWsxNIo=; b=ubwshsP3ZIPGHT4bzXxAqAMTQfLdkdfeRKccB7pD55oFmQmfSYO4e7yN/Fl6Tf4vi7 u/2tZskfJlGSxPNCPS8Z/x439lLWSN/ePgD8VQJvYa/42p/A52/rmAdLljh7GafaQNhp E++cJXX0Yb++XQRQ8FquNu3WbfTI07Y5g1yfvyZkBCybKO1BhVEzLP/BSOeiIsvcjhZa +cDmecHt1x+I0/fjDCtoARzFrnwscEPWZyx5nuPDGCCLAfMSVAdvP3fs7WGgW6IsF2Jm wEIhGk2rKzUBzNNKYHX8hqbt2167mnPFUw1iGmFYbdaCC3uXRvKxXcO/JzxBs8xo2bgZ opjQ== X-Gm-Message-State: AOAM532QIRKUMPmmBr27LF1zpKqZyNvzRjXs4Xiwi2JNKMM7Bnwr+d/r FyzR35HDRkaBu35Bb6kC4ij2v+RtT80= X-Google-Smtp-Source: ABdhPJzhVKlvZJamypthmk2KNTy0sWlJbSQWmsgJvr50WAlfTZagcZIyoN8b1S/BDqakCTaeZrY9Bg== X-Received: by 2002:a5d:678b:0:b0:1ed:9f21:d36 with SMTP id v11-20020a5d678b000000b001ed9f210d36mr24864516wru.550.1646255198078; Wed, 02 Mar 2022 13:06:38 -0800 (PST) Received: from [10.42.42.166] (212-197-176-189.adsl.highway.telekom.at. [212.197.176.189]) by smtp.gmail.com with ESMTPSA id c4-20020adfef44000000b001ef93c7bbb8sm106580wrp.30.2022.03.02.13.06.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Mar 2022 13:06:37 -0800 (PST) Message-ID: <8e193a06-593c-8ff5-a8ac-4020ac7baf8b@gmail.com> Date: Wed, 2 Mar 2022 22:06:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: u-boot@lists.denx.de From: "Johannes (krjdev) Krottmayer" Subject: arm: Simple delay function because of an chicken and egg problem Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean Hi, I'm running into an chicken and egg problem when modifying (fixing) some drivers for STMicroelectronics SoC's. The problem, I will implement a timeout, when accessing some registers. Unfortunately I cannot use the basic mdelay() or higher level functions, which use this function, because there on these SoC's there isn't setup and enabled the timer before. Also the ARMv7-M SysTick timer will not be used. I could write a simple delay loop which counts down at the frequency from the processor speed. But I think, this is not a good idea. Any suggestion, what I can do? I'm still new in U-Boot, so I don't know if there a simple delay function exists. Thanks in advance! Johannes K.