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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 237C2C433EF for ; Thu, 21 Oct 2021 06:39:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DE3E860F56 for ; Thu, 21 Oct 2021 06:39:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DE3E860F56 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A2ADF833D5; Thu, 21 Oct 2021 08:39:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu 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=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="cCc98ULE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF6C4833E3; Thu, 21 Oct 2021 08:39:47 +0200 (CEST) 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 A59AE802A1 for ; Thu, 21 Oct 2021 08:39:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x532.google.com with SMTP id y12so3521474eda.4 for ; Wed, 20 Oct 2021 23:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=3DuP9FsrsksHqrPpsiabZ4MN1yhARdoy10WQKyjbSm0=; b=cCc98ULEx55b28/KIZ7DtKvIF3W5w/w9v0En6qqGskB2KNMFVHnE+Fu8bLfPjXRGBX 5mGhJNUwEjVsRjjE2L5HHQ6ao7AlQKY8Y0mBn8eLX1yncSKVQuGQ5cvq8seByoeQRgSM eJQ016mcgd7Zep1uAcpIe+z4Dl7C7owDXEqBzejUuHVYa35TkUjdzMjhIJqNS2/K2v72 VWp+g1Y9Pxv+exxAMwU4yDXQ2zVxLNCxHhQdQ2mN2Hs+Pphv1vmHhWOdirTBxUtAaEzn tTCE1vta8XN4R2k7fsGgfSABjFjcImMqEKRZSXekT0ShqKkOdBSsggTJKwfEztqG5VvA LC4w== 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:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=3DuP9FsrsksHqrPpsiabZ4MN1yhARdoy10WQKyjbSm0=; b=V4tHityjN9FaCtHGSfzfStifiBdyo4GETg8W0ZkFGuRSnn0fc2D86AB5xyivYBKoYo WFAWbzuxrwJKN/Yk44OA9U6S/0b9qLHe0z/fgmJ48HN3MPlF2lte5Mrkq4KD9z6Cjh6D a2Jy6wwTru71WsMtOALe/B/uscI7DuCCn72ZYIp0Cm2Jy7/7M1aW0dEO0d9gdZwCxwTJ 6SfKaK0vrbcmncX75Lkg2JL0sYo2jqcKdUsSDJeP2amxOa7ZkjRIFHcJAxE/OsnEAUvb ImujKBV2pMATqdaknGuuwmBa13wNvhKuRU2suATU/RKzbaydhEuLi1qqIFZj20u9YXs8 N5Dg== X-Gm-Message-State: AOAM531sMryEX2x/Hrj9YpG+2y59Hrb7P6srK40UmULjRC85/MPbNm5q WmTK/14Owyb0kmKWTvGxhSFoKbRH3CVKKA== X-Google-Smtp-Source: ABdhPJyf/jSHi85j+hj5KQs4CeEvI3Tjg3cZ4O/iAKsN1jEVzxmxkVNcNikmzB/i80nNkSTSlIW2GQ== X-Received: by 2002:a50:bf0f:: with SMTP id f15mr5063256edk.43.1634798383202; Wed, 20 Oct 2021 23:39:43 -0700 (PDT) Received: from ?IPV6:2a02:768:2307:40d6::45a? ([2a02:768:2307:40d6::45a]) by smtp.gmail.com with ESMTPSA id f22sm2292086edu.26.2021.10.20.23.39.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Oct 2021 23:39:42 -0700 (PDT) Message-ID: Date: Thu, 21 Oct 2021 08:39:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: CRC32 endianess Content-Language: en-US To: Wouter Joris , u-boot@lists.denx.de References: <75ef34e0-bd00-e914-9c9f-288fa41c41d7@intersoft-electronics.com> From: Michal Simek In-Reply-To: <75ef34e0-bd00-e914-9c9f-288fa41c41d7@intersoft-electronics.com> 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.34 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, On 10/20/21 14:40, Wouter Joris wrote: > Dear U-boot maintainers, > > I'm working on an Xilinx Zynqmp project ( Checkout tag xilinx-v2019.1 > ) (ARM > Cortex A53 ) and I'm facing an endianess mix-up. I'm no C-code guru, so > I hope you'll stick here with me for a while. > > In this example I'm performing a random crc check, the result was placed > into memory. > >  * ZynqMP> crc32 0x8000 0x8002 0x7999 >  * crc32 0x8000 0x8002 >  * crc32 for 00008000 ... 00010001 ==> 0c9cf37c > > This is the result of the CRC read-back: > >  * ZynqMP> md 7999 1 >  * 00007999: 7cf39c0c > > Also the itest confirms something is wrong with the result. > >  * ZynqMP> if itest *7999 == 7cf39c0c; then echo true; else echo false; fi >  * true > >  * ZynqMP> if itest *7999 == 0c9cf37c; then echo true; else echo false; fi >  * false > > I know there was an historic bug > > about the crc endianess describing this exact problem but this issue > seems to be addressed in later releases, as far as I know. > > Uboot Xilinx crc32.c L172 > This is upstream mailing list that's why you should be using upstream code not soc vendor tree. That's why only my recommendation is to update your SW to latest and try. If the same problem is still there than it is time to deal with it. Thanks, Michal -- Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs