Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp75110imi; Wed, 20 Jul 2022 17:29:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uBkImo2lmkiN0pJ9bG6daQ+JGxOIqLI7icWOTLGNDrWGyljZOymf8pkObZtvTkI/TU0Gx7 X-Received: by 2002:a17:907:2c44:b0:72b:6160:c64c with SMTP id hf4-20020a1709072c4400b0072b6160c64cmr38185869ejc.55.1658363353539; Wed, 20 Jul 2022 17:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658363353; cv=none; d=google.com; s=arc-20160816; b=qZfkcQGzwsz+8H+8f45HSFV2f/WQiAWZKojsGUqN0hMaWw+3XR9V9UaUw+AP24TeQi G4tbm/N0Zb9YDx79omoglLcH8TJSFtDDgcVXhDHBQ3hoI84Xo+Mw77WszlmEi69qu6uV onynxTC5LX+mpa4tuvZutdXzJ/ZnhLxBne6NwK1XPxt7tr3G/cTetPioKxpz9y4viZS7 F9mOfuxzI8waVl27Lo5Aav5O/bMxRpJ9SJOXxQ4jsdctco6R8OGausJhowwsY97JqpJc v3NweHy3ybC8CG7OH/kslVOpw2a6Us3GCk7Z+qbCloPkgTtieGeQPfmQkiIUSuys2QnK C0Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7U1Ho9Tfog4r9e2WK3efCnbYYOpvvooZzQpVkrqOxKk=; b=aCaR6j1blQa6f1JJobSJnsnowv9i6ET40dvIKvHwierO+ocPPpPDggbFT615uB4iOa s8ncdSrVznezhDBIztZSCbPL3uZCI5M1kMa7OQxuwUR9dcDKFqKspP2s72/WT7wZ7Ed8 i1Qae7W7WqX/Bu5Tp836jKcwU1RDv6XqgWhwaZcSEOFiQKsFUMR+zEYyijPE30xCMylk 3473nauvwPLtpeZoA5YAvHkwpXH5PNd/tUoKuP21uLKJ6232+d/l+eKz+SXLb6eYPyIR VSG+UU8roe2bPRFtZiQmH8coKPipF9/kjbHOEhhL8UOvemkXbdqkZaFOk0XjP1iyal+W I4MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JKIgm0i3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd34-20020a17090796a200b006fed9affed0si982611ejc.528.2022.07.20.17.28.49; Wed, 20 Jul 2022 17:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JKIgm0i3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231472AbiGTXnD (ORCPT + 99 others); Wed, 20 Jul 2022 19:43:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiGTXnC (ORCPT ); Wed, 20 Jul 2022 19:43:02 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A45BA4D837 for ; Wed, 20 Jul 2022 16:43:00 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id b26so28198818wrc.2 for ; Wed, 20 Jul 2022 16:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7U1Ho9Tfog4r9e2WK3efCnbYYOpvvooZzQpVkrqOxKk=; b=JKIgm0i3yGFF8SG34FR8bWc1wXlap74X5CibcHsE7Dg5S66YkTsMbRPMCALOuiGofj 6RlOYbRy2rKdPEuzZtOu1OMdc9piXIjiAVa21syqmnc1NdPKwGDJzDa6mzBVeb56PIhd z8GkXa4nUmXE5W8dcg5LEWGAF6v/3mXklUCMg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7U1Ho9Tfog4r9e2WK3efCnbYYOpvvooZzQpVkrqOxKk=; b=A2tm+RnvxwKv2d+XbekfYY0i9277BKspJpMEvkpydXf9EtIS5gFdUJQ/RrBIK0O15N VJ2m//4WYKJLRbRaQBqb43wSMWSunPIf8XIzWJgZ4m9P4fcdgvAugOkRqjhm8IxfRhaQ I3izrdVGp8S4auIwF4FQ1YE5Wmm1NhxV90a254vps3CFet8Lz+pmHuhaG6N14lytuH0m ND2AZ+qPZd/Uo+9qcU9VWn0NH1gySVPFt8rOb9GIEfSBOPiu//xen5WG/WqMxZI5xjdo t2hvU8kQp25UnYfAToi3+XLx5QsURVahvURzULiWfsM3r6SI9ncTswdwBIhfi8oxvp2+ eHbA== X-Gm-Message-State: AJIora9cQIf6NAdIlYDiAaNyHgUG1F/+ZSDon/48l2Gzw81Y0Da2jSAn 2MNB+VwQxb6K7MAeLA29uvUMBohPA3heGBt5+byVEg== X-Received: by 2002:a5d:5985:0:b0:21d:b6aa:23f5 with SMTP id n5-20020a5d5985000000b0021db6aa23f5mr33243023wri.18.1658360578984; Wed, 20 Jul 2022 16:42:58 -0700 (PDT) MIME-Version: 1.0 References: <3bb0ffa0-8091-0848-66af-180a41a68bf7@linaro.org> <8f51aed8-956b-ac09-3baf-2b4572db1352@linaro.org> <628a7302-1409-81f7-f72b-6b1645df9225@linaro.org> <1f3189ef-7d3f-27b3-a691-b9649090b650@linaro.org> In-Reply-To: <1f3189ef-7d3f-27b3-a691-b9649090b650@linaro.org> From: Julius Werner Date: Wed, 20 Jul 2022 16:42:46 -0700 Message-ID: Subject: Re: [RFC] Correct memory layout reporting for "jedec,lpddr2" and related bindings To: Krzysztof Kozlowski Cc: Julius Werner , Krzysztof Kozlowski , Dmitry Osipenko , Jian-Jia Su , Doug Anderson , Rob Herring , LKML , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Nikola Milosavljevic Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry, got distracted from this for a bit. Sounds like we were pretty much on the same page about how the updated binding should look like here, the remaining question was just about the compatible string. > >> Yes, we can. You still would need to generate the compatible according > >> to the current bindings. Whether we can change it I am not sure. I think > >> it depends how much customization is possible per vendor, according to > >> JEDEC spec. If we never ever have to identify specific part, because > >> JEDEC spec and registers tell us everything, then we could skip it, > >> similarly to lpddr2 and jedec,spi-nor. > > > > Shouldn't that be decided per use case? In general LPDDR is a pretty > > rigid set of standards and memory controllers are generally compatible > > with any vendor without hardcoding vendor-specific behavior, so I > > don't anticipate that this would be likely (particularly since there > > is no "real" kernel device driver that needs to initialize the full > > memory controller, after all, these bindings are mostly > > informational). > > If decided per use case understood as "decided depending how to use the > bindings" then answer is rather not. For example Linux implementation is > usually not the best argument to shape the bindings and usually to such > arguments answer is: "implementation does not matter". > > If by "use case" you mean actual hardware or specification > characteristics, then yes, of course. This is why I wrote "it depends". By "use case" I mean our particular platform and firmware requirements -- or rather, the realities of building devices with widely multi-sourced LPDDR parts. One cannot efficiently build firmware that can pass an exact vendor-and-part-specific compatible string to Linux for this binding for every single LPDDR part used on such a platform. And I don't see why that should be needed, either... that's kinda the point of having an interoperability standard, after all, that you can just assume the devices all work according to the same spec and don't need to hardcode details about each specific instance. The existing bindings seem to have clearly been designed for platforms that only ever use a single specific LPDDR part, and in those cases these issues don't come up, so I assume this choice had just been made without much thought. But now I would like to reuse them on platforms where this is a problem, and that's why I would like to either expand or change the binding to (also) allow a generic compatible string to solve it. (Whether that means moving all platforms to only use this generic compatible string, or allowing it side-by-side with the existing part-specific compatible strings is up to you -- I don't want to preclude other platforms from doing what they prefer, I just want to make sure there's some form of workable solution for my platform. But if you would prefer this to be an all-or-nothing thing, we could change everything over to a generic compatible string too if you want.) > > Of course there may always be mistakes and broken > > devices that need custom handling, and if someone has a platform with > > such a case I of course don't want to preclude them from tying special > > behavior to a custom compatible string. But why would that mean we > > need to make this mandatory for all platforms even if it's not > > relevant (and not practically feasible) for them? Why not allow both? > > Depends. If generic compatible is not enough (works only for your case) > then it should have never been added alone. No, I don't think it would work only for my case -- in fact I think it's pretty unlikely that we'll ever find a case where this doesn't work. LPDDR is a very rigid standard that generally needs to be able to interoperate (at the memory controller and firmware training code level) without any vendor-specific software quirks. I was just trying to say that I wouldn't want to stop anybody from adding vendor-specific quirks for a platform if they really needed to -- but I don't know of any such case in practice and I doubt it actually exists. The few existing uses of this binding don't use the compatible string for anything more than to parse out the manufacturer ID, which I think would make much more sense to model as a property.