From mboxrd@z Thu Jan 1 00:00:00 1970 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 EFEACC4332F for ; Fri, 9 Dec 2022 18:26:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2889885277; Fri, 9 Dec 2022 19:26:02 +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="nREPjm+U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A3C9985279; Fri, 9 Dec 2022 19:26:00 +0100 (CET) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 BDAAD851AF for ; Fri, 9 Dec 2022 19:25:57 +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=daniel.schwierzeck@gmail.com Received: by mail-ed1-x532.google.com with SMTP id c66so4229788edf.5 for ; Fri, 09 Dec 2022 10:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=CkwuYBRiTteVnGcTy5jHyxHrkqj8PQTEhFUK70OM1W4=; b=nREPjm+UTK+s/9vWOxr70RKGwQOx0/IDD/WoduGJwOp/rACs/8+2LFEe7EKD7OKwXy XlZH1BKodGW55kboadqm07dfO183J0Zj9Y5LQbk8CPsFNy6JWg0Sjvi3Iy4/DpWS4OWf iyp6ZsA+30CL4BZTuNUI+WFys+YAqz/nkbFgNbWKvwjP0iOZggfczU3cjw8o2zZV4Mcm OhYHPPs6lLPKS0ogmFrS200+JG5kp+3iNgJJxmvryHP0lUAVhjd2vPyZeXdMIVeCMou2 x/NWHvplMnxv1g0IizTpdnoh3+J1Lff0hRDwPcv+gQMXC24RAUx0icNgSGnSvO4zQIx9 1oCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CkwuYBRiTteVnGcTy5jHyxHrkqj8PQTEhFUK70OM1W4=; b=plIx9JI+sfoHPdLMsDjS2T8UVvHSFjMH87ZfM5893QxHtECKPT00d7QSFI7mV9uPRc TcmrweiKU+Zn5bOcwIL58rRTuzQHPQ3aMIGQalHxarP1kdyY1B1W6AthjgGkickNC7N1 dyC7Vx4XFI9yJghLQXYIDdXT/ZdaFvhMXb24D2uudjojDIJSA4+qkvtBSoeiXkfBikdN LMm1qto9zEEcyFIWm9ZwKLjxdwk+vRa3DJ3f2L2fjXmZWCHzDM3L7fLbL88J/qmMutVu zvcjICeecx5J3beypouXbtgBR99yLgXD1HeqY6DIEvohd9niCsCc96CvlTqUnkUT8Xy4 73SQ== X-Gm-Message-State: ANoB5plqITqFIp6E3zhgs7nl1OkTmvbwbYH1uVzaeqyNsvZo3Zd/JXom sJBR6OIdaUq6MvpbqwzS09o= X-Google-Smtp-Source: AA0mqf5BN/lIsVXcDuWSzfY1Tfl5wFLs7YeHhvx1Pf5wq8NMYHlVVvLTNaFAlh+20DQhQST6+EUxLw== X-Received: by 2002:a05:6402:702:b0:46f:68d0:76 with SMTP id w2-20020a056402070200b0046f68d00076mr1403218edx.34.1670610357170; Fri, 09 Dec 2022 10:25:57 -0800 (PST) Received: from [192.168.10.30] (63-6-142-46.pool.kielnet.net. [46.142.6.63]) by smtp.gmail.com with ESMTPSA id x5-20020aa7dac5000000b004610899742asm913464eds.13.2022.12.09.10.25.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Dec 2022 10:25:56 -0800 (PST) Message-ID: Date: Fri, 9 Dec 2022 19:25:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: DDR timing for vendor board To: Rob Kramer , Jack Mitchell Cc: u-boot@lists.denx.de References: Content-Language: en-US From: Daniel Schwierzeck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean Hi Rob, On 12/9/22 12:10, Rob Kramer wrote: > Hi Jack, > > Thanks for your suggestion, I hadn't thought of using just the rkbin ddr file together with u-boot SPL. My biggest objection was the rkbin miniloader that makes assumptions on partition layout. > > It seems to work, but now I'm in for some DT pain :) I don't know anything about Rockchip but from experience with other SoC's and DDR2/3 controllers I would say that the reason for this closed-source loader is likely some proprietary dynamic tuning algorithm for some memory controller parameters (e.g. DQS) to adapt to manufacturing tolerances of the board. If that's the case, the static setting of memory size and timings via DT won't be enough to run the board stable and Jack's approach would be more reliable. > > Cheers, > >     Rob > > 9 Dec 2022 00:49:30 Jack Mitchell : > >> On 08/12/2022 04:01, Rob Kramer wrote: >>> Hi all, >>> >>> I have a RK3288 board from a Chinese display vendor that came with the >>> usual giant Rockchip tarball that they patched here and there to make >>> the board work. It seems to be based on a rk3288-evb, since that is what >>> they patched in the kernel. The kernel is a 4.4 kernel with Android >>> stuff in it (i.e. fiq-debugger) and a large amount of Rockchip patches, >>> u-boot is 2017.09, with rk patches. >>> >>> It turns out that u-boot TPL/SPL won't boot because the DDR timings are >>> incorrect, and the Chinese vendor uses the Rockchip >>> rk3288_ddr_400MHz_v1.09.bin loader. I'm using u-boot 2022.01 for now, >>> and I've tried to naively modify the timing in >>> arch/arm/dts/rk3288-evb.dts, but it doesn't work at all, with varying >>> errors on boot. >>> >>> The Rockchip loader provides the following info when booting: >>> >>>   In >>>   Channel a: DDR3 400MHz >>>   Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB >>>   Memory OK >>>   OUT >>>   Boot1 Release Time: Apr 11 2018 10:32:58, version: 2.36 >>>   ChipType = 0x8, 232 >>> >>> I've tried various DDR3 (not LPDDR3) settings from other boards, for >>> example for a Firefly (666 MHz DDR3): >>> >>>   U-Boot TPL 2022.01 (Jan 10 2022 - 18:46:34) >>>   Col detect error >>>   DRAM init failed! >>>   ### ERROR ### Please RESET the board ### >>> >>> It was expected that 666MHz doesn't work, but if I just change the >>> frequency in the dts, that also fails (error -22). >>> >>> How can I support the DDR for this board? I can't even see what the ID >>> on the chips is, because the heatsink is blocking sight and seems to be >>> attached with some sort of thermal glue. >>> >>> Is there a way to read back the DDR timings (phy-timing, sdram-params) >>> from the kernel/SoC on a board that is booted using the proprietary loader? >>> >>> Cheers! >>> >>>     Rob >>> >> >> Hi Rob, >> >> You could be in for a world of hurt here as Rockchip are very poor at >> supporting different DDR init configurations in u-boot. In the past with >> awkward boards I've used the Rockchip DDR init blob as the TPL binary >> for u-boot then skip the DRAM init in the u-boot SPL. >> >> From my travels in this area I've found that single channel RAM boards >> are particularly difficult to get working as the majority if not all >> mainlined board use dual channel RAM. >> >> Sorry I can't be more help, but trying to use the DDR blob is a good >> starting point to get you going on mainline. >> >> Good Luck! >> >> -- >> Jack Mitchell, Consultant >> https://www.tuxable.co.uk -- - Daniel