[{"id":3673827,"web_url":"http://patchwork.ozlabs.org/comment/3673827/","msgid":"<adPqGChmW8FV--tN@google.com>","list_archive_url":null,"date":"2026-04-06T17:15:04","subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(), readl()\n endianness","submitter":{"id":87364,"url":"http://patchwork.ozlabs.org/api/people/87364/","name":"Kuan-Wei Chiu","email":"visitorckw@gmail.com"},"content":"Hi Daniel,\n\nOn Mon, Apr 06, 2026 at 11:24:08PM +0900, Daniel Palmer wrote:\n> In Linux these are meant to read a little-endian value and swap\n> to the CPU endian.\n> \n> In u-boot for m68k this is currently borken and prevents\n> virtio-mmio from functioning.\n> \n> Signed-off-by: Daniel Palmer <daniel@thingy.jp>\n> ---\n>  arch/m68k/include/asm/io.h | 17 +++++------------\n>  1 file changed, 5 insertions(+), 12 deletions(-)\n> \n> diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h\n> index 35ad4a1c0444..f4877b0446cf 100644\n> --- a/arch/m68k/include/asm/io.h\n> +++ b/arch/m68k/include/asm/io.h\n> @@ -24,18 +24,11 @@\n>  #define __raw_writel(l,addr) ((*(volatile u32 *) (addr)) = (l))\n>  \n>  #define readb(addr)\t\tin_8((volatile u8 *)(addr))\n> -#define writeb(b,addr)\t\tout_8((volatile u8 *)(addr), (b))\n> -#if !defined(__BIG_ENDIAN)\n> -#define readw(addr)\t\t(*(volatile u16 *) (addr))\n> -#define readl(addr)\t\t(*(volatile u32 *) (addr))\n> -#define writew(b,addr)\t\t((*(volatile u16 *) (addr)) = (b))\n> -#define writel(b,addr)\t\t((*(volatile u32 *) (addr)) = (b))\n> -#else\n> -#define readw(addr)\t\tin_be16((volatile u16 *)(addr))\n> -#define readl(addr)\t\tin_be32((volatile u32 *)(addr))\n> -#define writew(b,addr)\t\tout_be16((volatile u16 *)(addr),(b))\n> -#define writel(b,addr)\t\tout_be32((volatile u32 *)(addr),(b))\n> -#endif\n> +#define writeb(b, addr)\t\tout_8((volatile u8 *)(addr), (b))\n> +#define readw(addr)\t\tin_le16((volatile u16 *)(addr))\n> +#define readl(addr)\t\tin_le32((volatile u32 *)(addr))\n> +#define writew(b, addr)\t\tout_le16((volatile u16 *)(addr), (b))\n> +#define writel(b, addr)\t\tout_le32((volatile u32 *)(addr), (b))\n\nJust wondering could this global change break some drivers on coldfire?\n\nI originally thought you were planning to split these IO macros between\ncoldfire and classic m68k.\n\nOf course, if you've found that this doesn't actually break coldfire,\nthen this global approach is definitely ideal.\n\nRegards,\nKuan-Wei\n\n>  \n>  /*\n>   * The insw/outsw/insl/outsl macros don't do byte-swapping.\n> -- \n> 2.51.0\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=QteqfVvz;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.b=\"QteqfVvz\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=visitorckw@gmail.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqGDM4Cz6z1yFt\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 03:15:15 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 88CA48406D;\n\tMon,  6 Apr 2026 19:15:13 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 88889840BE; Mon,  6 Apr 2026 19:15:12 +0200 (CEST)","from mail-pf1-x429.google.com (mail-pf1-x429.google.com\n [IPv6:2607:f8b0:4864:20::429])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 2064E840AB\n for <u-boot@lists.denx.de>; Mon,  6 Apr 2026 19:15:09 +0200 (CEST)","by mail-pf1-x429.google.com with SMTP id\n d2e1a72fcca58-82ce49785a0so1715401b3a.2\n for <u-boot@lists.denx.de>; Mon, 06 Apr 2026 10:15:09 -0700 (PDT)","from google.com (61-230-33-2.dynamic-ip.hinet.net. [61.230.33.2])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82cf9b589b8sm14597634b3a.24.2026.04.06.10.15.05\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 06 Apr 2026 10:15:07 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD,FREEMAIL_FROM,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775495708; x=1776100508; darn=lists.denx.de;\n h=in-reply-to:content-disposition:mime-version:references:message-id\n :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;\n bh=qKXp2Lyje8Bx232PR/MQYxcFl8fShI5NCbyWO9ArEow=;\n b=QteqfVvzcjggyuEhlliHNpbmLvTD2683VcvrcR9DOoT7rCLCUfop/KSOEz/tiOg9py\n 0Ok6RfqHlHRiW7IlUzrvHCSf+UXWC5YlLNmCjOkkLlMaAz9goAxAkAavqFU5A8J4Gfj0\n n6LU1dVuXhgydaBIYIt+YJB4BpVFIvQAjFQ0I34itlYI3ve0nTNzYLQF1EYbvhedI8Bs\n fl5XYvp9A3eDQLjI3CXFmJyHeUoJlQZcfYWTAYKhPEJonBuarJkuMUZ2gdhs1iO2g2Ve\n EkAOJ6uqRjUBZJY2kbVvvQEtjNCcPKX8NMtETMtXbgzLAftnkOrMS27bd0F+bgQyPier\n 0k5g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775495708; x=1776100508;\n h=in-reply-to:content-disposition:mime-version:references:message-id\n :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=qKXp2Lyje8Bx232PR/MQYxcFl8fShI5NCbyWO9ArEow=;\n b=BrYUpxGScNodeB45gqjagBA1UfjCkUM75CtlC2CLr8p2EcbE68akJ2B/kgOBG1zHsK\n E+4Mdndj8wztcgSgTgPoQrhiqc47WyoBawJfetIlMDQ1F53s6Er2KGNuwLzx05YU+UUj\n FGTS8ID4zzA3vjJYFEEWkX4nHl/y4eqESrw7pvDg170spxwaNL/ki0nBreEDin9yk+If\n HIpQQ1/6GXl9U3Z/UsH8Ppq5225qVy0Q/bDDepa+PfdWaMaVEFGAcnVdXS0hQj69ZzQ0\n /MxBbIHzLGnuLQGUikXdd+a/EzV8tcZskL8yNqxpzpNsrXJfMMAGjDW07jVpwKyKHoq2\n 8nSQ==","X-Forwarded-Encrypted":"i=1;\n AJvYcCUEpaLevQPXm02eNcJc1GQTa5BkGSAz6ItkdISCrJY9WPk5jz9fcr7Lg42NkuInEL9PiGC1SIo=@lists.denx.de","X-Gm-Message-State":"AOJu0Yy+zXlDhuXXtXX5nJQpA/GhFYEf6Fdi+alNhki/ewjoGGIveB7t\n jIk+t8eqpqrxbI6xlyYvCbulnLed557LBsB+oWJ0w5M9yiIkrGqAOzOj","X-Gm-Gg":"AeBDieuLkhO43BJfB24RMn6MHUJRU7i48ZPULL6JOQxQO3cOPe7XBJQ8NReXOw+Qv9H\n SHvderKcikwe3rztNjEoBHYhdOEVUDsFTXtJhbfk/+7y/9I/di7WoE7T1ZC3oMl+RmUiNrRFYE8\n 01vRHkSnhc/9Jvoy1pY1N5S4wXurVI+tTEqjENEnISjtVHfkMwWJsVHwJAXJ+MWp7FMch8gmsop\n GrfvDVV8hUpKVmmpHLwqe4LGOnGABaVv1LJvsy8xElNoJLzkNLDY7pD+OfRUCLI78qQrNzlBNSB\n qAZPBLRMiWiPqthXspIiuQWuve5XXXI5zssnIRlldAtRcv1pHmWQlKRczl/BsUQ9DsRsusfSdiw\n mQKByBn4ghrlXQh4xmhe/u3MLr+Brwh1DYStXE+AKRGgxhmVVXX2K8L7vqxw9AZMAAK/vd5oblx\n 9Vef4OHxTS1iwsxEcSYoLtFEpOHW3BfEqh7LUGc2KsOvOi8omiR/NOETGr4f8yhwFn","X-Received":"by 2002:a05:6a00:8008:b0:82a:6461:6d1e with SMTP id\n d2e1a72fcca58-82d0dbac6femr12519604b3a.46.1775495707856;\n Mon, 06 Apr 2026 10:15:07 -0700 (PDT)","Date":"Tue, 7 Apr 2026 01:15:04 +0800","From":"Kuan-Wei Chiu <visitorckw@gmail.com>","To":"Daniel Palmer <daniel@thingy.jp>","Cc":"angelo@kernel-space.org, bmeng.cn@gmail.com, u-boot@lists.denx.de","Subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(), readl()\n endianness","Message-ID":"<adPqGChmW8FV--tN@google.com>","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-3-daniel@thingy.jp>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20260406142411.2992618-3-daniel@thingy.jp>","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3673912,"web_url":"http://patchwork.ozlabs.org/comment/3673912/","msgid":"<CAFr9PXnQYjcvHMQQbFGS7_7Rb86Y9cO4oPSfVHiz7t7q7D8ZGQ@mail.gmail.com>","list_archive_url":null,"date":"2026-04-07T00:58:16","subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(),\n readl() endianness","submitter":{"id":85408,"url":"http://patchwork.ozlabs.org/api/people/85408/","name":"Daniel Palmer","email":"daniel@thingy.jp"},"content":"Hi Kuan-Wei,\n\nOn Tue, 7 Apr 2026 at 02:15, Kuan-Wei Chiu <visitorckw@gmail.com> wrote:\n> Just wondering could this global change break some drivers on coldfire?\n\nIt might. Really I'd like Angelo to see if it still works. Hopefully\nit doesn't break anything or it's just one or two things that need to\nbe fixed to make it work again.\nIn Linux the range for the in-chip registers uses the current\nbehaviour and everything else uses the \"correct\" behaviour. I think we\nwant to avoid having that hack if possible.\n\n> I originally thought you were planning to split these IO macros between\n> coldfire and classic m68k.\n\nYeah, but then we have to fix it again if a coldfire virt machine\nhappens. If it breaks coldfire so badly it's difficult to fix I'll\nsplit them.\n\n> Of course, if you've found that this doesn't actually break coldfire,\n> then this global approach is definitely ideal.\n\nYep. I forgot that there is actually a coldfire machine in qemu so I\nwill build and test this on that a bit later.\n\nCheers,\n\nDaniel","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.a=rsa-sha256\n header.s=google header.b=jwBxbagm;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.b=\"jwBxbagm\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de; spf=pass smtp.mailfrom=daniel@0x0f.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqSW34JWnz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 10:58:39 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id BA0DC8352B;\n\tTue,  7 Apr 2026 02:58:35 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 61A3283936; Tue,  7 Apr 2026 02:58:34 +0200 (CEST)","from mail-dl1-x1230.google.com (mail-dl1-x1230.google.com\n [IPv6:2607:f8b0:4864:20::1230])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id D14AA8341A\n for <u-boot@lists.denx.de>; Tue,  7 Apr 2026 02:58:30 +0200 (CEST)","by mail-dl1-x1230.google.com with SMTP id\n a92af1059eb24-12c080efc1eso1318514c88.0\n for <u-boot@lists.denx.de>; Mon, 06 Apr 2026 17:58:30 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1775523509; cv=none;\n d=google.com; s=arc-20240605;\n b=YC1LD9/+UgUuIMvciGgOZnd/XZBRLCYE4wFAnKCOofZV/+6r2rZCQWRoYSe16/kI7G\n C1NPdiEA/BsDoGQNUjCvulpofPaHfSPeQSGpJWBwwk6/xsM8Br5ayKu/Ssf+IbtKF45Q\n fnhUtm3gv4OXsLUBLHl2PvGrKdtAJnyToMYbN1YfhUyPAL3Q9vi/95AcHnr9h8l9dDuY\n 0fh0CPD+iWeQK9aQYnM2+uChPAn51b52kwC2YJm4z+5KdJrJ5t9lGzdMy3D7HxbO0Tt2\n p1rtEwKAXqXRaR0fNIqIK3Lazsj2dziMoX0KAngA2cLp0SMeSgftDNSMw8lE2K1Ou6Si\n OkSg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=TfynBJ7e3A0B5aQKTQM7zix8Z7bf9oSAxCEuui8Y/+U=;\n fh=/fNb4t7ehstWiWWMZLJt9bn3tobqKymLl1vg2gmPNuM=;\n b=dvN9hvnits6cUOtFtQakglUULuDkHrZJfDSkwAuQXaM8mMOs+pskl41bNTFjQT2b1t\n KoDw9xm+hcgCp59FfOH6SIWvUCyUD0jMS39cbtV3tXirRcVapmpZbaJHMGKWHfY+t92G\n B8lSJsEKvALNsBCxgnf7f0SrUKzkj6PLMOuPng6alJBE05pv7zLh7QmCm1DgMI/8xnfE\n VZ0MQxPFPnELrv27Uz6gGgPVVsa8ZQotCu/37WqEpSf5kg288Qvj/n6Zvj5pYrqruUNy\n 7bcdBvE2zJx7o9Lr6mehyHOGt3YGbcDO2rj4mOrNFJ2DPA/JWfy6amTWIBKnjQ3kIayh\n EQyA==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=thingy.jp; s=google; t=1775523509; x=1776128309; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=TfynBJ7e3A0B5aQKTQM7zix8Z7bf9oSAxCEuui8Y/+U=;\n b=jwBxbagmA5uhJMjcOMnQyQGPfjNsb5QRRt/jo4QtlTMoYPN8RbAqa5yV2/r4haaxfQ\n ZE1xpZlfiKYestaqhk0RqfrZB+DH4rqpRLKEb8gybITK0ARAwjU/DIseqNuAzsGrnKtZ\n P3L4P2FFc6aP2dvhuDaSmg7zUaglQgv5iM9h4=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775523509; x=1776128309;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=TfynBJ7e3A0B5aQKTQM7zix8Z7bf9oSAxCEuui8Y/+U=;\n b=HFEbk142WyzI2dx3+IYmnLyNwFdnFVt1aMVYr84Qvb8A1lVYrkG0/gNXWrSD2h/VdL\n 7mAlvnZ/MV3ycswqwu871OzNntAWUlpyvhIXQ+t6J2ZMQCMu/YRjoRoZd8bLSdYgU0BF\n 3sKc65qqxfUBBIcyZsvVylTnHCWw9MnoOMbkBu9tw6HFkzs9gtomNI0sPIBQTMPfDn3F\n Vd2bNIaKBiAUSNwSx1ZYHRzHZ5JGMmX0Ywh6tENleyRWzYCgkApoSS736m6EgKJR6ala\n AW7jxZSy7qaXUqC6YpPsL1TgqHMqFa2/mdYSJ2rEJ6b6yZB+4tisTcv7Tv0HWr73O9G5\n V7sQ==","X-Forwarded-Encrypted":"i=1;\n AJvYcCW8nGcJ4k5/0DWoY5dilFBcDbMeySJggB558CsKbQBt5h1El6f/o8+At+wgo5FpeYvIFFrM2qo=@lists.denx.de","X-Gm-Message-State":"AOJu0YykXGOgaQBy4f2any1eXp3T9tIt1GZcvB0upBXPK77bKhr8Uvdr\n lV+5/Tqn26oa8UdcYLOC2SYpVE2oa2H/NWGYMUMnBU18qZ4Wn3gLMwdzZ5bek2Y0bxQE2xwsIR8\n NN+foL/SpSZLPj1WrIbb3dZXqQeZHeky5t5H1y+jyBr3FGsC9aMh+","X-Gm-Gg":"AeBDiesjq51E4p5D56tWO/qaMAxjUcwrF14An0I0dpPe4UniyXCfjQjFyJzDQ3hVbZX\n 2I2zC2zYbkcZkIqPZo+t4sSAv8rLYZV17WCOCQS+d6oSEPJNulMvUCo4528W6R6KbaIO3zcWX1z\n lFVNHecIs8jzfaABQ92jXPffBnM3PU62KM9rQiSS9CiGnV/V5eSzdZEGXOyYkw6afeQui+hRBlP\n eUxkImI+aGp3ckkPuInMFl9h0xSOsTH5yB65J5kLGk1v13Zo/whq4PNi7M0hm42uiNL9+aw1HJ2\n Eh95","X-Received":"by 2002:a05:7022:b93:b0:12c:11d4:61dd with SMTP id\n a92af1059eb24-12c11d465a9mr1691299c88.18.1775523508904; Mon, 06 Apr 2026\n 17:58:28 -0700 (PDT)","MIME-Version":"1.0","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-3-daniel@thingy.jp>\n <adPqGChmW8FV--tN@google.com>","In-Reply-To":"<adPqGChmW8FV--tN@google.com>","From":"Daniel Palmer <daniel@thingy.jp>","Date":"Tue, 7 Apr 2026 09:58:16 +0900","X-Gm-Features":"AQROBzB58OFQ3V6DQQsfJf5D-x738VA4BBr6tRi9lyHoX7kW_LO_Xpga5q4rZfk","Message-ID":"\n <CAFr9PXnQYjcvHMQQbFGS7_7Rb86Y9cO4oPSfVHiz7t7q7D8ZGQ@mail.gmail.com>","Subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(),\n readl() endianness","To":"Kuan-Wei Chiu <visitorckw@gmail.com>","Cc":"angelo@kernel-space.org, bmeng.cn@gmail.com, u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3674732,"web_url":"http://patchwork.ozlabs.org/comment/3674732/","msgid":"<c300ac4f-f38a-4a0d-bed9-65588b3308d8@kernel-space.org>","list_archive_url":null,"date":"2026-04-08T12:12:11","subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(), readl()\n endianness","submitter":{"id":85702,"url":"http://patchwork.ozlabs.org/api/people/85702/","name":"Angelo Dureghello","email":"angelo@kernel-space.org"},"content":"Hi Daniel,\n\n\nOn 4/6/26 16:24, Daniel Palmer wrote:\n> In Linux these are meant to read a little-endian value and swap\n> to the CPU endian.\n> \n> In u-boot for m68k this is currently borken and prevents\n> virtio-mmio from functioning.\n> \n\nmmm, \"currently broken\" ?\n\nIf you remove bigendian read/write the driver framework will fail\nto work with coldfire/m68k stuff.\n\nI tested the patchset over master in stmark2 board, seems this patch is\nbreaking dspi cs init:\n\nstmark2 $ saveenv\nSaving Environment to SPIFlash... *** Warning - spi_flash_probe_bus_cs() failed, using default environment\n\nFailed (-1)\nstmark2 $ sf probe\nspi_coldfire dspi@fc05c000: Invalid chip select 0:0 (err=-19)\nFailed to initialize SPI flash at 0:0 (error -19)\nstmark2 $ \n\nPlease find a different solution, that may be using \"xxx_le\" stuff directly\nfrom your code.\n\n> Signed-off-by: Daniel Palmer <daniel@thingy.jp>\n> ---\n>  arch/m68k/include/asm/io.h | 17 +++++------------\n>  1 file changed, 5 insertions(+), 12 deletions(-)\n> \n> diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h\n> index 35ad4a1c0444..f4877b0446cf 100644\n> --- a/arch/m68k/include/asm/io.h\n> +++ b/arch/m68k/include/asm/io.h\n> @@ -24,18 +24,11 @@\n>  #define __raw_writel(l,addr) ((*(volatile u32 *) (addr)) = (l))\n>  \n>  #define readb(addr)\t\tin_8((volatile u8 *)(addr))\n> -#define writeb(b,addr)\t\tout_8((volatile u8 *)(addr), (b))\n> -#if !defined(__BIG_ENDIAN)\n> -#define readw(addr)\t\t(*(volatile u16 *) (addr))\n> -#define readl(addr)\t\t(*(volatile u32 *) (addr))\n> -#define writew(b,addr)\t\t((*(volatile u16 *) (addr)) = (b))\n> -#define writel(b,addr)\t\t((*(volatile u32 *) (addr)) = (b))\n> -#else\n> -#define readw(addr)\t\tin_be16((volatile u16 *)(addr))\n> -#define readl(addr)\t\tin_be32((volatile u32 *)(addr))\n> -#define writew(b,addr)\t\tout_be16((volatile u16 *)(addr),(b))\n> -#define writel(b,addr)\t\tout_be32((volatile u32 *)(addr),(b))\n> -#endif\n> +#define writeb(b, addr)\t\tout_8((volatile u8 *)(addr), (b))\n> +#define readw(addr)\t\tin_le16((volatile u16 *)(addr))\n> +#define readl(addr)\t\tin_le32((volatile u32 *)(addr))\n> +#define writew(b, addr)\t\tout_le16((volatile u16 *)(addr), (b))\n> +#define writel(b, addr)\t\tout_le32((volatile u32 *)(addr), (b))\n>  \n>  /*\n>   * The insw/outsw/insl/outsl macros don't do byte-swapping.\n\nRegards,\n\n-- Angelo","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=kernel-space.org header.i=@kernel-space.org\n header.a=rsa-sha256 header.s=s1 header.b=AVFMCJ6U;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=kernel-space.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=kernel-space.org header.i=@kernel-space.org\n header.b=\"AVFMCJ6U\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=reject dis=none)\n header.from=kernel-space.org","phobos.denx.de;\n spf=pass smtp.mailfrom=angelo@kernel-space.org"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frMQ20yCZz1yD6\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 22:12:26 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 3161383D8A;\n\tWed,  8 Apr 2026 14:12:18 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 8A8FD83F98; Wed,  8 Apr 2026 14:12:16 +0200 (CEST)","from mail.kernel-space.org (unknown\n [IPv6:2a03:4000:b:d08:14a9:1bff:fedc:75ad])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 36A9E838BB\n for <u-boot@lists.denx.de>; Wed,  8 Apr 2026 14:12:14 +0200 (CEST)","from [IPV6:2a07:7e81:7daa:0:62cf:84ff:feee:627] (<unknown>\n [2a07:7e81:7daa:0:62cf:84ff:feee:627])\n by oreshnik (OpenSMTPD) with ESMTPSA id c851d75e\n (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO);\n Wed, 8 Apr 2026 12:12:12 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,\n SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-space.org;\n s=s1; t=1775650332;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=tVSV+vjGM/GHD8oQNcxP56eSSbAB/xl6Pl3jvtUaMIA=;\n b=AVFMCJ6UITFwn08LCWoQzHKGrQvDbtEM3hvP9qIoSWXLxYi7a9tKLn31PEub3t7rrGN/CY\n sY8p3HDAgbsN88TUlWwbgFwybU/ouL20/VIblT9G64wF4oqSZuWZqj2yDNJz47DVEm9hlI\n Y7nzXiK9nrpsrHcd2bU/NYx6JSiXdUQ=","Message-ID":"<c300ac4f-f38a-4a0d-bed9-65588b3308d8@kernel-space.org>","Date":"Wed, 8 Apr 2026 14:12:11 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(), readl()\n endianness","To":"Daniel Palmer <daniel@thingy.jp>, visitorckw@gmail.com, bmeng.cn@gmail.com","Cc":"u-boot@lists.denx.de","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-3-daniel@thingy.jp>","Content-Language":"en-US, it","From":"Angelo Dureghello <angelo@kernel-space.org>","In-Reply-To":"<20260406142411.2992618-3-daniel@thingy.jp>","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 <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3674750,"web_url":"http://patchwork.ozlabs.org/comment/3674750/","msgid":"<CAFr9PXk-fJ_kbqd08LHtCdNfid=MVAr8yEj25o_yJghh7qRB=A@mail.gmail.com>","list_archive_url":null,"date":"2026-04-08T12:49:14","subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(),\n readl() endianness","submitter":{"id":85408,"url":"http://patchwork.ozlabs.org/api/people/85408/","name":"Daniel Palmer","email":"daniel@thingy.jp"},"content":"Hi Angelo.\n\nOn Wed, 8 Apr 2026 at 21:12, Angelo Dureghello <angelo@kernel-space.org> wrote:\n> mmm, \"currently broken\" ?\n> If you remove bigendian read/write the driver framework will fail\n> to work with coldfire/m68k stuff.\n\nI'm not sure who/what decided this but in Linux at least these are\nmeant to be read little endian and convert to cpu endian.\nClassic m68k in linux works like that. Coldfire in Linux is currently\nthe same as u-boot on internal registers and but everything else has\nthe \"correct\" behaviour. I think that is so PCI can work.\n\n> I tested the patchset over master in stmark2 board, seems this patch is\n> breaking dspi cs init:\n\nThank you for checking and sorry for the breakage.\n\n> Please find a different solution, that may be using \"xxx_le\" stuff directly\n> from your code.\n\nmmm so I did try that for nommu classic m68k in Linux because it's\nalso \"broken\" there and got told to fix readl() etc.\n\nWould putting this in some #ifdefs so coldfire keeps the current\nbehaviour and classic m68k matches Linux be acceptable?\n\nThanks,\n\nDaniel","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.a=rsa-sha256\n header.s=google header.b=opgIG8dE;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.b=\"opgIG8dE\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de; spf=pass smtp.mailfrom=daniel@0x0f.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frNF338g8z1xv0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 22:49:43 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 38CEB8404A;\n\tWed,  8 Apr 2026 14:49:33 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 80CFE8405F; Wed,  8 Apr 2026 14:49:31 +0200 (CEST)","from mail-dl1-x1235.google.com (mail-dl1-x1235.google.com\n [IPv6:2607:f8b0:4864:20::1235])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 42AF483D8A\n for <u-boot@lists.denx.de>; Wed,  8 Apr 2026 14:49:27 +0200 (CEST)","by mail-dl1-x1235.google.com with SMTP id\n a92af1059eb24-1271257ae53so6767605c88.1\n for <u-boot@lists.denx.de>; Wed, 08 Apr 2026 05:49:27 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1775652566; cv=none;\n d=google.com; s=arc-20240605;\n b=ksH0go5YHlz0Hu5pY3ITv2WaorxTcNCMKyM9se2FF75r0adhVHAeETJZz7ksGMXQwR\n v8+cxNicKCWT4b3qUzxNMceoQqncaEn8OULTBZsSb5OAZtEm69GiI5RzXq7fh4b8ol2s\n FVCkpcWdErwVVooMjZAdzPkUjUjmkLX64ux0QYqOggu6FRK3i223NgWyWdDfLhiwZQbR\n qLNdpfuDWYUfEi/8+wK6fJc9NoVqoWQ83OSpX/9sOqulU0OKCASLOkzoSKUUJhQNhWxl\n TYV7KyeUvUf0sGbUEe9Fd76otI0ufEpk2LKmGOmAcqZpDLFLmOeVawr1z7XGq9/5i0NG\n B0Dg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=SCoGw0DDXydlU7v3nkENRbcafWs3N2ntoEHnai/FUGs=;\n fh=jbRFM7KP5D5iElM46gV8oSZh+zTFFNlTSTHiAqaXMnQ=;\n b=NfIVnKrhSvlSxp2h7zeKGozICFwQoU4KNOxfpIQQxG2beA0Y6UjtNWnitFg4r+ZyDR\n 1dTqTOyRPmZcalarKfR+0RCiM3ATAAXXnMWdZb8phx7XV6E8wN/f3Z2pd3c0ZMtSf6oX\n H2P2ozJxe62i4UICEZPAaVWj5YbvNViANkIUgARlOvwNbwdYwCPD3GT1waRRqGoQwLNk\n o2QGWTqux2w5sjPsYDnnyjpcnutKw0qNRyeaXjm/3JY6YoCvwcGk3fLK9SdZ6/2u6P5K\n d/kO65aaSsQ7Rq0vmEkBaOLYtoy55+v8Req+8sDnYPoiBtR6VqNUpA4KA0fsYs/oys47\n xQBg==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=thingy.jp; s=google; t=1775652566; x=1776257366; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=SCoGw0DDXydlU7v3nkENRbcafWs3N2ntoEHnai/FUGs=;\n b=opgIG8dEKtzT0OcbzHcaryVtLLiR41MsD2wJT2cFzQ+wgY5PDr70ysRsAI+5anFbPQ\n 45pqueu18u6BhxyRAK40rgy+bQRB9NM4txsolEQbmW3TSmB5AGqvNk/WPq/iu9ObeJwl\n j3GB5GRXIpzVGfsXmZ+MyEU9VF4R3WrLQXYRM=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775652566; x=1776257366;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=SCoGw0DDXydlU7v3nkENRbcafWs3N2ntoEHnai/FUGs=;\n b=L4Akiig0jXQn5TMuVAU0eLiVP02EfYDyCidWAGGb1QPCkZfaBcXkaoGMv+AOXWIFqp\n JPcgP6t4NUtLng3xWlb2nyniz3rqObX9oCt5CoH4VlxofWyTo3chUnulx0AF+z9og3ef\n 45zzMOGwpIjQ444pSA94kXGq/cSGecFls993DArDeeNmaQ+RPu6H6CPXgUtI9yGoJiV8\n 43AeWQ+zzRZOPh5z1gHJ7LFdCTjH/6r3wXMfEJui+343hEFXNwJnpyYlxad/C6sKKE14\n 4fQlmoDYD2yzVZq+Xfx8DdgnEUHk6vm3Isw5PI2NSoIwIX2piHpYTGmEIecWvvkmWBHI\n rZUw==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWUwyFSEtIYR2zFg2PJkycQG6OHExHG7/ZQbVi3e+oq+eR6B41RQ4GBrQAMSngWCEYyxPytQA0=@lists.denx.de","X-Gm-Message-State":"AOJu0YzV4axhRc6g6uuHu2MxbkO68qwRwCIiDYZPaJ9qLjBMQsCERWZB\n IUCr28c2u4gof8gmRHBFamLhQwbG+dp3A3M/b6ZUdFsDalgg2Wh9KAT21LWufe7EoPXwOuUIewP\n x9r2f7EdS4+WRRpxPY1lxZoTcSsGsFNUyNTSmSw3DWPf0UjEjwFhG","X-Gm-Gg":"AeBDietYgn7INzww1OqVsvkS2gbiShUxYuJnapzyJ72bVB/DYWOB6EsrPupJADGVuth\n rCG7kol+gB2FKC2y7FaYRXsXTU7EGllMMcucKZTJtZLEAkJnguAbpVk58+VloX68uJUk1snUOk+\n eWCuf2raMjHL7q01fevDv0aGVqhDy/LdoTKT0eNjSh+alJFhWEnFCBMXJ/iqXyzH1p7vOtDhis1\n EUmih65f9/Vo0sOnuXBd3rfwhZX7qFCjDJEXXfpH4vmfBinjkXJVJGApcoQMgDTe2RA6Llxa5lF\n rldf","X-Received":"by 2002:a05:7022:b81:b0:119:e55a:9c03 with SMTP id\n a92af1059eb24-12bfb765d17mr9265257c88.31.1775652566320; Wed, 08 Apr 2026\n 05:49:26 -0700 (PDT)","MIME-Version":"1.0","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-3-daniel@thingy.jp>\n <c300ac4f-f38a-4a0d-bed9-65588b3308d8@kernel-space.org>","In-Reply-To":"<c300ac4f-f38a-4a0d-bed9-65588b3308d8@kernel-space.org>","From":"Daniel Palmer <daniel@thingy.jp>","Date":"Wed, 8 Apr 2026 21:49:14 +0900","X-Gm-Features":"AQROBzCzfRBpGRFGg4APZCRiYAfo1VMK34upR4HtmeaCpsvq7uq_znTLohg7ZL8","Message-ID":"\n <CAFr9PXk-fJ_kbqd08LHtCdNfid=MVAr8yEj25o_yJghh7qRB=A@mail.gmail.com>","Subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(),\n readl() endianness","To":"Angelo Dureghello <angelo@kernel-space.org>","Cc":"visitorckw@gmail.com, bmeng.cn@gmail.com, u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3674765,"web_url":"http://patchwork.ozlabs.org/comment/3674765/","msgid":"<3c748627-9273-4ab2-9d13-56869dcf613b@kernel-space.org>","list_archive_url":null,"date":"2026-04-08T13:26:19","subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(), readl()\n endianness","submitter":{"id":85702,"url":"http://patchwork.ozlabs.org/api/people/85702/","name":"Angelo Dureghello","email":"angelo@kernel-space.org"},"content":"Hi Daniel,\n\nOn 4/8/26 14:49, Daniel Palmer wrote:\n> Hi Angelo.\n> \n> On Wed, 8 Apr 2026 at 21:12, Angelo Dureghello <angelo@kernel-space.org> wrote:\n>> mmm, \"currently broken\" ?\n>> If you remove bigendian read/write the driver framework will fail\n>> to work with coldfire/m68k stuff.\n> \n> I'm not sure who/what decided this but in Linux at least these are\n> meant to be read little endian and convert to cpu endian.\n> Classic m68k in linux works like that. Coldfire in Linux is currently\n> the same as u-boot on internal registers and but everything else has\n> the \"correct\" behaviour. I think that is so PCI can work.\n> \n>> I tested the patchset over master in stmark2 board, seems this patch is\n>> breaking dspi cs init:\n> \n> Thank you for checking and sorry for the breakage.\n> \nno problem.\n\n>> Please find a different solution, that may be using \"xxx_le\" stuff directly\n>> from your code.\n> \n> mmm so I did try that for nommu classic m68k in Linux because it's\n> also \"broken\" there and got told to fix readl() etc.\n> \n> Would putting this in some #ifdefs so coldfire keeps the current\n> behaviour and classic m68k matches Linux be acceptable?\n> \n\nyes, thanks, please try to find a solution protecting coldfire for now.\n\nI will try to understand better why Linux operates differently from u-boot,\ni think pci was involved here but actually i don't remember, need to \nstudy this deeper.\n\n\n> Thanks,\n> \n> Daniel\n\nRegards,\n-- Angelo","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=kernel-space.org header.i=@kernel-space.org\n header.a=rsa-sha256 header.s=s1 header.b=zybm1ysF;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=kernel-space.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=kernel-space.org header.i=@kernel-space.org\n header.b=\"zybm1ysF\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=reject dis=none)\n header.from=kernel-space.org","phobos.denx.de;\n spf=pass smtp.mailfrom=angelo@kernel-space.org"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frP3Y3yfcz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 23:26:33 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 495AE84118;\n\tWed,  8 Apr 2026 15:26:25 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id B8ABA84120; Wed,  8 Apr 2026 15:26:23 +0200 (CEST)","from mail.kernel-space.org (unknown\n [IPv6:2a03:4000:b:d08:14a9:1bff:fedc:75ad])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 5E8B284106\n for <u-boot@lists.denx.de>; Wed,  8 Apr 2026 15:26:21 +0200 (CEST)","from [IPV6:2a07:7e81:7daa:0:62cf:84ff:feee:627] (<unknown>\n [2a07:7e81:7daa:0:62cf:84ff:feee:627])\n by oreshnik (OpenSMTPD) with ESMTPSA id 6cdba40e\n (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO);\n Wed, 8 Apr 2026 13:26:20 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,\n SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-space.org;\n s=s1; t=1775654780;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=llwqSqEU+O6NlHstTY9vQBgELNX17XdljNuRvm+yQcI=;\n b=zybm1ysFzDyn3pidbpCTU3O4XtPFwZ0u/4f7E5XtoVRuS5o5nSIUJvddF17zt1aGzf4LJV\n BtX0MLYyuvEvB+ycPVfcz2AQLkTrZwKIdqte95fZHCbGhStSxtKXQTW4SpIKJ0Ct4AN2r8\n 7cBPrZF57+YhULjjC2y4L6uA/0NtW98=","Message-ID":"<3c748627-9273-4ab2-9d13-56869dcf613b@kernel-space.org>","Date":"Wed, 8 Apr 2026 15:26:19 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(), readl()\n endianness","To":"Daniel Palmer <daniel@thingy.jp>","Cc":"visitorckw@gmail.com, bmeng.cn@gmail.com, u-boot@lists.denx.de","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-3-daniel@thingy.jp>\n <c300ac4f-f38a-4a0d-bed9-65588b3308d8@kernel-space.org>\n <CAFr9PXk-fJ_kbqd08LHtCdNfid=MVAr8yEj25o_yJghh7qRB=A@mail.gmail.com>","Content-Language":"en-US, it","From":"Angelo Dureghello <angelo@kernel-space.org>","In-Reply-To":"\n <CAFr9PXk-fJ_kbqd08LHtCdNfid=MVAr8yEj25o_yJghh7qRB=A@mail.gmail.com>","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 <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3674774,"web_url":"http://patchwork.ozlabs.org/comment/3674774/","msgid":"<CAFr9PXmj2_0g6BkHLAeuNfo8M-CCnjtozfrB6unJ+QvQxYmy3A@mail.gmail.com>","list_archive_url":null,"date":"2026-04-08T13:40:15","subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(),\n readl() endianness","submitter":{"id":85408,"url":"http://patchwork.ozlabs.org/api/people/85408/","name":"Daniel Palmer","email":"daniel@thingy.jp"},"content":"Hi Angelo,\n\nOn Wed, 8 Apr 2026 at 22:26, Angelo Dureghello <angelo@kernel-space.org> wrote:\n> yes, thanks, please try to find a solution protecting coldfire for now.\n\nSo for now I have put #ifdefs in so coldfire retains its current behaviour.\n\n> I will try to understand better why Linux operates differently from u-boot,\n> i think pci was involved here but actually i don't remember, need to\n> study this deeper.\n\nI thought maybe this change in m68k might be recent but in Linux it\nseems to have been there since the import into git 22 years ago.\n\nIn the linux docs (https://docs.kernel.org/driver-api/device-io.html)\nit says this:\n\nNote: On some architectures, the normal readl()/writel() functions\ntraditionally assume that devices are the same endianness as the CPU,\nwhile using a hardware byte-reverse on the PCI bus when running a\nbig-endian kernel. Drivers that use readl()/writel() this way are\ngenerally not portable, but tend to be limited to a particular SoC.\n\nSo I think maybe coldfire got a \"reads native endian, no swap\"\nreadl()/writel() and then when PCI support was added a hack was\nneeded. But somehow normal m68k got it the other way around. <shrug>\n\nAnyhow, sorry again for breaking your board.\n\nCheers,\n\nDaniel","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.a=rsa-sha256\n header.s=google header.b=JhGjoDdY;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.b=\"JhGjoDdY\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de; spf=pass smtp.mailfrom=daniel@0x0f.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frPMm6VC3z1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 23:40:36 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id CAC6184106;\n\tWed,  8 Apr 2026 15:40:32 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 96D2284118; Wed,  8 Apr 2026 15:40:31 +0200 (CEST)","from mail-dl1-x1235.google.com (mail-dl1-x1235.google.com\n [IPv6:2607:f8b0:4864:20::1235])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 466B7838BB\n for <u-boot@lists.denx.de>; Wed,  8 Apr 2026 15:40:28 +0200 (CEST)","by mail-dl1-x1235.google.com with SMTP id\n a92af1059eb24-1274204434bso731053c88.1\n for <u-boot@lists.denx.de>; Wed, 08 Apr 2026 06:40:28 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1775655627; cv=none;\n d=google.com; s=arc-20240605;\n b=DJypa6TfYiKZMiwkOk4yBQWaO4fbuF1izSyfe9CYgJVyo+FWSk6YdKk5ZdBW9XGX8y\n +r1NP3/carv4mzRiciH2obpZIfx/cw6zBMeMW4y4f9oYoinJRyyD6ot/DNtG+bTwbWf+\n yaju08vYW0LoRo8oyDBtpgBkHcGz1og1UwDsQVHUWwMc9bhh1LX6CUxqjq5qQWodZoa/\n /t3LUx6OPQCs4Cprq0YTzYBSIXPCc1s2rZ3OFkw0g5uB7vVMm/dg9gADJDoJYwlVSXt8\n Vy25GA5X4DAh1ViROBUKB43vMJTaX8xBtE9kV+x4VS/LFXT7GuOAMtiJ1DA0ww/bCDHe\n 9P3w==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=ZKUZ2lr4CJKJBZC6pthgerfCcBUdrJdsJbxCS1DhMHQ=;\n fh=zM7ceKIFtjnXb4yy2TjSbP3O+lF6pLNtxqcHtKrRsTI=;\n b=fyL7WD5Iu6oWfP1owySP8OqF6JmxmGlyTTMT7urlIA8D0YafQYBOpakiAnkHRehnrn\n Jb5eQZ4vMyDVocag9lh4gur72nhbWcQGXIw41SKfu1+JF+dLrTEPn2u5L1s+FG/IzJO3\n wbuuXd1hu2OfLbXsbytJ4eOaXm094gHN7k5liuYXqf4BTTzDpg+kmhok4FmN1YgdAehG\n r21BOjuFHYQUVoi9oUFkU4aX8ts3T7FKbo8xgWfrNR9J5oGs9TPiSLhXDgZ9LeVIHWq0\n s9z4KxPOH6yCkja90B5TRU/LLlU8jg2aFgbECbEvAB9MezAb5mD4S1CutMqHfWl6KdKv\n 8xQg==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=thingy.jp; s=google; t=1775655627; x=1776260427; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=ZKUZ2lr4CJKJBZC6pthgerfCcBUdrJdsJbxCS1DhMHQ=;\n b=JhGjoDdY4ilkbgrhp10Glzuya33ZZ/dAeon0FR6ECpqN0xYTVFpu0fNtEsxOG9X8kL\n xuERuJxdx8EYwq0A50nPE5D1fwvknlxlQHqCiwhw08tB2pQYY/TcAAcZA9lkHMv9py/a\n Geqmd+N7Xriu4jejuHp2KCp5RTaehm4Fp4xTA=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775655627; x=1776260427;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=ZKUZ2lr4CJKJBZC6pthgerfCcBUdrJdsJbxCS1DhMHQ=;\n b=MnlhNcZjjp4fF4z+9cFcQnESoFJJY41k0RRgY5EdxMYwf/g5Z+F7/UvoIEApEGemKs\n shzgkpUFUqvcKlP5Uv5Xx8zsh2r7cRbbuSfFaH/kWEozNeATATzg7v5TF9EZ35ePcgVY\n qS4xq7NDA1ZJafHCuULSwYv9Pd8T2WB21xDIFtbxiyzlKZq2HLxJAmucQLCsUHvBFCZZ\n OsypOkTWYXebhgJZZ/PZmVPdIrk8/4U5Cas1qQwrav8GvafYXf8dKG27kVF0WuVRRLJi\n mwa1apUMo1rRFH3qg9YKB+1NnyMJKZDIG6Jv2c8qYLj0FMqy+SlFCjOWF2qIz/+A/OTn\n 1Zbw==","X-Forwarded-Encrypted":"i=1;\n AJvYcCVBdX3RZCyoDkc4bXg52440RFt0dzB73pQCkpTFCsqJoSAV2hCrJq+aGKft8Gr16+UJhKbFwsM=@lists.denx.de","X-Gm-Message-State":"AOJu0YwPpoi76pMjCme1tiHDMcP1Q08jKrO9syrmQBmuTws1WjHfcrKH\n efCsqjhydAla+QBmKRfqOocg3BO0RKjETKYvw7093+vZZUXVq2FDLBpCn1Btd0+geI1NNLq5q7K\n 4CPQ+5XRbNS7DjIEOS+WsC4/fCmmOAtpK6AZKqJbXBA7HVooE7E3SCXY=","X-Gm-Gg":"AeBDieuw0UprLZEXo2DJMy3iV0zptEi4Jg6Sfc+0ScFjVf7JTzfxCtddoRTJmUKGSza\n GkDV2kolY1YCPqpwlajuVjsAUfZXGdoweFLt+lgHd/kLQcx54DitaNprjPvBCwi/nqCBZ5DsSzr\n Jg5UwWXj19iuUnb6wPmy5bKQzZJ9xBaa9lED9rpIguMiIS7kAUPsaSsM2PVOvFVplT+Xe/gcT6u\n oLIvZEyvaCEzznbQPQmjW6t8qbKPCfwuV0T7ry0y1l9k6pQNcKlz0nm0AK0m37jZhCztYW/vXuJ\n kkvV","X-Received":"by 2002:a05:7022:6986:b0:119:e569:f872 with SMTP id\n a92af1059eb24-12bfaf58991mr8943542c88.15.1775655626502; Wed, 08 Apr 2026\n 06:40:26 -0700 (PDT)","MIME-Version":"1.0","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-3-daniel@thingy.jp>\n <c300ac4f-f38a-4a0d-bed9-65588b3308d8@kernel-space.org>\n <CAFr9PXk-fJ_kbqd08LHtCdNfid=MVAr8yEj25o_yJghh7qRB=A@mail.gmail.com>\n <3c748627-9273-4ab2-9d13-56869dcf613b@kernel-space.org>","In-Reply-To":"<3c748627-9273-4ab2-9d13-56869dcf613b@kernel-space.org>","From":"Daniel Palmer <daniel@thingy.jp>","Date":"Wed, 8 Apr 2026 22:40:15 +0900","X-Gm-Features":"AQROBzCE3Yzq6IYWBf1GP03bwlSHfD3Tirc6TvTvxo7d_4vY7CvD8ncOzaYzMl8","Message-ID":"\n <CAFr9PXmj2_0g6BkHLAeuNfo8M-CCnjtozfrB6unJ+QvQxYmy3A@mail.gmail.com>","Subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(),\n readl() endianness","To":"Angelo Dureghello <angelo@kernel-space.org>","Cc":"visitorckw@gmail.com, bmeng.cn@gmail.com, u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3674799,"web_url":"http://patchwork.ozlabs.org/comment/3674799/","msgid":"<949eaa9b-f46b-40d7-a5be-c13450fe754e@kernel-space.org>","list_archive_url":null,"date":"2026-04-08T14:18:35","subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(), readl()\n endianness","submitter":{"id":85702,"url":"http://patchwork.ozlabs.org/api/people/85702/","name":"Angelo Dureghello","email":"angelo@kernel-space.org"},"content":"Hi Daniel,\n\nOn 4/8/26 15:40, Daniel Palmer wrote:\n> Hi Angelo,\n> \n> On Wed, 8 Apr 2026 at 22:26, Angelo Dureghello <angelo@kernel-space.org> wrote:\n>> yes, thanks, please try to find a solution protecting coldfire for now.\n> \n> So for now I have put #ifdefs in so coldfire retains its current behaviour.\n> \n>> I will try to understand better why Linux operates differently from u-boot,\n>> i think pci was involved here but actually i don't remember, need to\n>> study this deeper.\n> \n> I thought maybe this change in m68k might be recent but in Linux it\n> seems to have been there since the import into git 22 years ago.\n> \n> In the linux docs (https://docs.kernel.org/driver-api/device-io.html)\n> it says this:\n> \n> Note: On some architectures, the normal readl()/writel() functions\n> traditionally assume that devices are the same endianness as the CPU,\n> while using a hardware byte-reverse on the PCI bus when running a\n> big-endian kernel. Drivers that use readl()/writel() this way are\n> generally not portable, but tend to be limited to a particular SoC.\n> \n> So I think maybe coldfire got a \"reads native endian, no swap\"\n> readl()/writel() and then when PCI support was added a hack was\n> needed. But somehow normal m68k got it the other way around. <shrug>\n\nmmm, so from a fast look:\n\napart for M5235EVB_defconfig:CONFIG_CMD_PCI=y  \nbut this board has no PCI bus, so it should be some config copy/paste,  \n\nthere is no other board using pci for coldfire, maybe either no pci driver\nworking (NXP driver may work ?) or tested for them, so there was never\nany need for swapping LE for pci. But just an assumption, i can be totally \nwrong since some nxp board has been removed and some coldfire have pci.\n\nSo this part \n\n#if !defined(__BIG_ENDIAN)\n#define readw(addr)\t\t(*(volatile u16 *) (addr))\n#define readl(addr)\t\t(*(volatile u32 *) (addr))\n#define writew(b,addr)\t\t((*(volatile u16 *) (addr)) = (b))\n#define writel(b,addr)\t\t((*(volatile u32 *) (addr)) = (b))\n#else\n\nis probably non functional from a pci driver since still \"be\" r/w. Should\nbe replaced with _le stuff. But should go deeper when i have some time.\n\n> \n> Anyhow, sorry again for breaking your board.\n> \n\nas i said, no problem. We tested it before, that's ok.\n\n\n> Cheers,\n> \n> Daniel\n\nRegards,\n-- Angelo","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=kernel-space.org header.i=@kernel-space.org\n header.a=rsa-sha256 header.s=s1 header.b=kjWrCaDt;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=kernel-space.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=kernel-space.org header.i=@kernel-space.org\n header.b=\"kjWrCaDt\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=reject dis=none)\n header.from=kernel-space.org","phobos.denx.de;\n spf=pass smtp.mailfrom=angelo@kernel-space.org"],"Received":["from phobos.denx.de (unknown\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frQCx32GMz1xv0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 00:18:53 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 1E6A784105;\n\tWed,  8 Apr 2026 16:18:40 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id C787E84105; Wed,  8 Apr 2026 16:18:38 +0200 (CEST)","from mail.kernel-space.org (unknown\n [IPv6:2a03:4000:b:d08:14a9:1bff:fedc:75ad])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 83A3B840AB\n for <u-boot@lists.denx.de>; Wed,  8 Apr 2026 16:18:36 +0200 (CEST)","from [IPV6:2a07:7e81:7daa:0:62cf:84ff:feee:627] (<unknown>\n [2a07:7e81:7daa:0:62cf:84ff:feee:627])\n by oreshnik (OpenSMTPD) with ESMTPSA id 2c7f5ba8\n (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO);\n Wed, 8 Apr 2026 14:18:35 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RDNS_NONE,\n SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-space.org;\n s=s1; t=1775657915;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=xPNVzg1wYJaoSHgbjsUSfONU8f4lAQdOPKjljDO4l7g=;\n b=kjWrCaDt3EWxyR2n+lofRxcBow9LvOdv1IwGhV023f0YCq0yDzYGwy9oslZ+rEAR9TMZ1/\n 8ywDdoL+vmRLHFqMY4EOUseJS1+X3ng8QT5GdSQg8rC4wG1OJc+XaV8xy0WcBjH+Nn4eZx\n W8RL9BbDEZ/HtaI8nQ8eCJG1vZsD6LI=","Message-ID":"<949eaa9b-f46b-40d7-a5be-c13450fe754e@kernel-space.org>","Date":"Wed, 8 Apr 2026 16:18:35 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 2/5] m68k: Fix writew(), writel(), readw(), readl()\n endianness","To":"Daniel Palmer <daniel@thingy.jp>","Cc":"visitorckw@gmail.com, bmeng.cn@gmail.com, u-boot@lists.denx.de","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-3-daniel@thingy.jp>\n <c300ac4f-f38a-4a0d-bed9-65588b3308d8@kernel-space.org>\n <CAFr9PXk-fJ_kbqd08LHtCdNfid=MVAr8yEj25o_yJghh7qRB=A@mail.gmail.com>\n <3c748627-9273-4ab2-9d13-56869dcf613b@kernel-space.org>\n <CAFr9PXmj2_0g6BkHLAeuNfo8M-CCnjtozfrB6unJ+QvQxYmy3A@mail.gmail.com>","Content-Language":"en-US, it","From":"Angelo Dureghello <angelo@kernel-space.org>","In-Reply-To":"\n <CAFr9PXmj2_0g6BkHLAeuNfo8M-CCnjtozfrB6unJ+QvQxYmy3A@mail.gmail.com>","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 <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]