Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3197121rwb; Mon, 16 Jan 2023 05:08:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXtrXIkvHbewUq+L8KptocnGug7nomqIlzb6j9nZ5/d45zInph3FMNfzYBSs5ufW1AuBcI/X X-Received: by 2002:a17:906:7747:b0:7c1:1804:a0c7 with SMTP id o7-20020a170906774700b007c11804a0c7mr75427743ejn.75.1673874533485; Mon, 16 Jan 2023 05:08:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673874533; cv=none; d=google.com; s=arc-20160816; b=Rhnl8BQqHMRdm58yzauheVq710a8K/lzaN1jQnuQouIP3ZW13Ex6AkRumUdBAPAQJD sAp0hrzOSa2KKJPlZVcxJmXza7v4zdc4Ap7tR7f4z/HtWE0oaTWR09FbS1iaqCteptoB GiMVAN5nQ9URDRpW3l2TMJ8Aninrqu1piDWA1+JoOa0SutIMrgkqnXrt8WTv8xUbSvTl EOICCk9rqkAOvYH9Sp77AH/4oY3IDbgi69Uxd3WiP4EFl7r7OMhKq7ynMsY9tZxAh0ce +oPxXWyOs0UPS59KWijhaKRJcViuDvb/v1ZkesRrQStUJl7g/HsLrDDzLUmdAKsDUzFE Vvew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id; bh=y8Dxys9AoacXCH/DiehPRlg6DVdrK6gcNl8LTnChdKY=; b=ZeaOeqRcx3WNVGrYqnLV6WBV8BRvy6ZNjhQpefXVnTU0jlpBsXh7U2OYFy5y0o27KQ tzk00aZKR1UZf024N2+/IzYpzqTgD4YkdmgwhCR8SJsr/w09khtC+4NCfM58/CImEjyO zsjpJCj+FHcZ4d5YlB9ZGJE6vmOhFtsFdwqetXKaQl3nPpnjYRzJDCTxxjk3/3GOSC4A y8xq8dZhFHIOtUv5/uS1gPwcxrif+xAbVDUExjuOfVZbnjUwnBP2yxOug+E2VdjqXQyF 3MQLqgFk7vcp26JOE3cU7SIM0YU4aPa1p3zVZcdzyq15uG4IQxr9WDDd1wtsulvJwr7q 6QuQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v30-20020a50d59e000000b0048eaa959ebfsi31508214edi.161.2023.01.16.05.08.40; Mon, 16 Jan 2023 05:08:53 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230132AbjAPLyA (ORCPT + 51 others); Mon, 16 Jan 2023 06:54:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbjAPLx4 (ORCPT ); Mon, 16 Jan 2023 06:53:56 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 681571ABED for ; Mon, 16 Jan 2023 03:53:55 -0800 (PST) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pHO3d-0006DK-Kq; Mon, 16 Jan 2023 12:53:45 +0100 Message-ID: <0ac8e221-e88c-a05d-bc6f-9465783be866@pengutronix.de> Date: Mon, 16 Jan 2023 12:53:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 From: Ahmad Fatoum Subject: Re: [PATCH 2/2] ARM: dts: imx6qdl: support child mfd cells for the reset controller To: Krzysztof Kozlowski , Bastian Krause , Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230113-syscon-child-mfd-v1-0-0dd31b7de373@pengutronix.de> <20230113-syscon-child-mfd-v1-2-0dd31b7de373@pengutronix.de> <392f6e9d-b7c2-37df-2067-f7d967a20f10@linaro.org> <12080bf5-2cc4-e215-555e-5438ed1bd851@pengutronix.de> <1b5613ad-6d0d-0979-ddd0-4677ade7beb9@linaro.org> <7cffc639-3b61-1479-115c-34dffdfd8cc9@linaro.org> Content-Language: en-US In-Reply-To: <7cffc639-3b61-1479-115c-34dffdfd8cc9@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Hello Krzysztof, On 16.01.23 11:15, Krzysztof Kozlowski wrote: >>>> It's about syscon-reboot-mode, not syscon-reboot. Such modes are board- >>>> not soc-specific. >>> >>> syscon-reboot-mode is also mostly SoC specific. What exactly would >>> differ on different boards? Register offsets of SoC component? Register >>> values used by SoC power management unit? >> >> The modes supported. Let's say you want a bootloader mode that drops >> the board's bootloader into a fastboot gadget mode. You'd add a >> syscon-reboot-mode pointing at one of the non-volatile registers and >> you would define a magic value to indicate fastboot, both in the >> bootloader and Linux. > > Bootloader and other firmware (e.g. ATF) is tightly tied to SoC, not to > board. There might be differences between firmware used and OS (e.g. > ChromeOS uses their own bootloader, different than Linux and Android on > the same SoC), but again this is not board specific. The bootloader probes from a board device tree and it also implements initialization, update, boot and fallback logic specific to the board and part of that is what reboot modes are supported. E.g. ST had particular reboot modes in mind (e.g. reboot into eMMC as usb mass storage gadget), but that's just a convention they chose for the platform, not something inherent to the SoC. >> In theory, the reboot mode could also talk to the bootrom[1] to change >> the bootsource. This is also not board-agnostic, because it may not >> make sense to have a spinor reboot mode if your board doesn't have one. >> >> We have this scheme for STM32MP1 already and that's why I suggested >> Bastian to do it likewise for i.MX as he needs this functionality: >> https://lore.kernel.org/all/20201021102855.18026-1-a.fatoum@pengutronix.de/ > > I don't understand why you use clearly wrong patches as examples. Bad > patterns and bugs are not reason to use same approach. I am trying to give you some context. It may be evident to you what's so clearly wrong about them, but for me it worked and I am trying to understand where you see a problem. > The binding is wrong - you do not allow syscon-reboot-mode and if you > ever tested your patches, you would see the errors. I did indeed not dump the device tree after the bootloader fixed it up and run into through the DT bindings checker. >> https://elixir.bootlin.com/barebox/latest/source/arch/arm/dts/stm32mp151.dtsi#L44 > > Whether this part is correct, tricky to say. Why these offsets are not > valid for other board? The offsets are valid, it may just not work. Also the user may choose to place the reboot mode somewhere else within the syscon if the register is unused otherwise. Still we could probably add a reboot-mode child node to the device tree with no extra modes and leave it disabled. That way boards can fill in the modes they support, enable it and use it. Does this work for you? Thanks, Ahmad > > > Best regards, > Krzysztof > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |