From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.groups.io with SMTP id smtpd.web12.10794.1617709693542674723 for ; Tue, 06 Apr 2021 04:48:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=sT+a+PqR; spf=pass (domain: akeo.ie, ip: 209.85.221.54, mailfrom: pete@akeo.ie) Received: by mail-wr1-f54.google.com with SMTP id a12so4116835wrq.13 for ; Tue, 06 Apr 2021 04:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=k80OTYfXDdYmycbGzq0HEzKmW+2qfJseWLKMxlJHWF4=; b=sT+a+PqRnQ2KTne+88TOcBs2y0JmrqT39eSzbZLpNSG636o5qKhy0ZhuCI1ofeHUa8 ZWvW+k2CaaOSt4yGukby/pxs3BEITjkz+654S5IH9Uz17G17D/z49X9fEYbn2G6rZeIm hQHpJWqJmt0MFkAzhUpiK/e4wapEryuXgcByTfg0hsP5xd1/ifIQ9ItHhDUcP8wDDNUR qkfGjwkMf3X+NyZLfEITUfKmTMYBm4JjYMTs8lypPv7OV3ycdIobDARLyHU1YA6ubmRV PIByuZyFHQIjshpKEDbUDIbcjoYLu0FhB0JA1VYGrF2OD7Y2E28HBdSy+Jy3FTz9OP3a dLjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=k80OTYfXDdYmycbGzq0HEzKmW+2qfJseWLKMxlJHWF4=; b=gm6TemsUHrIyT1SFhGRxt5bi09nTxcWuycbtxAGxxWKpJ1BzKe2GPvbHBpggnUQPip bHUrq4NvlXeHAzDDYNTCpumnAdKX/VmrxivrCVmkictxRkBSaE677ORuU+5F0clAL1ay 2+Aaut7IG2ZH/7XIodoxd7l8IBJdUZ6/Hwj7XknePC0ZZI9/0zbgC3RpkqjLQKPHaOFn 3hlccwHWr7MKWkgqbO3CIrbvq8Rv0oAlSZSyakvvaEhNByy+ux32NpkF/9tCKq7bRru/ 1HEs8HQl4+uQlzvNZx2Lm7nrihcAQyGobtlaGf5InLRPT4KoRtgECA3Xpd4iCyBIeqmo rp7g== X-Gm-Message-State: AOAM530J1H4yEPt/FXD2uHYYtt4NmPNIo/bc+bgPhETRJSI7cMZFmdmw lwMM08MDRnqYSdkRsRJ+YCP1T7952YJ1MA== X-Google-Smtp-Source: ABdhPJwrM7sJEUXRtXa+YC/dWbHJwOOrxnnlXiE45+UvoQK3LFq+PVYEDkkvnzY5jVktBEFOnxkCgw== X-Received: by 2002:a5d:5141:: with SMTP id u1mr34793984wrt.31.1617709692140; Tue, 06 Apr 2021 04:48:12 -0700 (PDT) Return-Path: Received: from [10.0.0.122] ([84.203.60.64]) by smtp.googlemail.com with ESMTPSA id a6sm2887812wmm.0.2021.04.06.04.48.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Apr 2021 04:48:11 -0700 (PDT) Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/1] Platform/RaspberryPi: Fix mini UART baud divisor calculation To: =?UTF-8?B?TWFyaW8gQsSDbMSDbmljxIM=?= , devel@edk2.groups.io References: <60eb0e3a-7c4b-a860-6e06-ac086c58b2dc@akeo.ie> <31669.1617489948158034796@groups.io> From: "Pete Batard" Message-ID: <684c555d-9c43-38d5-188d-1abb360029ec@akeo.ie> Date: Tue, 6 Apr 2021 12:48:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <31669.1617489948158034796@groups.io> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Hi Mario, Please re-send a v2 with a commit message that explains the issue that is being fixed. Thanks. For the record, I ran some tests that show that the divisor was changed from 1 to 2 with the latest Pi Foundation firmware (which is confirmed by the fact that if you switch your baudrate from 115200 to 57600, you'll get the expected output). I'm not sure what game the Pi Foundation are playing at this stage, coz they sure don't seem to be following any official logic with how they actually set the serial clock, and our attempts at second guessing that logic are no longer working. So I guess the best we can do is go with whatever gets us output for the latest firmware, and hope they're not going to break that anytime soon (which is still better than the TF-A approach, where they got so fed up with this cat and mouse game that they dropped UART initialization altogether [1]) Regards, /Pete [1] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/plat/rpi?h=v2.3&id=0eda713b9bd65222155900aacf3a67805351f88f On 2021.04.03 23:45, Mario Bălănică wrote: > Okay, I've tested the patch with the firmware from the commit mentioned > above and it doesn't work. The VPU clock divisor bit needs > PcdSerialClockRate to be set to 1 GHz (so that the quotient becomes > equal to the core clock). > > The mailbox on the other hand always returns 200 MHz for the core clock. > This is definitely a bug, which got fixed it in a later commit. > > There isn't any reliable way to support the firmwares with a broken > mailbox interface as well in this case, and I really doubt anyone would > want to use them with the UEFI in the first place. Your build scripts > always include the latest version. > > I can resend the patch with a more detailed commit message if you wish.