From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0E03C4332F for ; Wed, 4 Jan 2023 13:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234736AbjADNnr (ORCPT ); Wed, 4 Jan 2023 08:43:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234548AbjADNnn (ORCPT ); Wed, 4 Jan 2023 08:43:43 -0500 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48DEAE49; Wed, 4 Jan 2023 05:43:42 -0800 (PST) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 304BAqBq011073; Wed, 4 Jan 2023 14:43:15 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=psqHx1vT2HFJTECjY9O2vZFaO8wI85+sUomLSZP6rQ8=; b=P4zl3EGXsKjALmT2k1ez04aDT/P1XhnZ48WE/roce7CQNDQhQm2iKEn8kMgn8KxFxfBP 8BdKleMA6md8mFC73le/mj02oSfqndRNh4+irlmFf3iKL6QjcPAFH4KnrOqgyUN/1ZDu d9aDJJKsdZO48WpVuEhKsk3qPXdczl0MVnZklFQ1STJUhgWBoC2uIlc9eajoFefwseOn xbjkWrZUGDW/UKZrU+rcYCJTbxfJfd3K+kYF0L3fw8AsZ0aCKoX818siF/4w0bFHYd9u yfOXPdrsvZMUOcZrNzsG8+lvlZlN7GLXZfLZAllieKbu98HxE97rj0dy61S/UPEJ32UH 2Q== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3mtbcq36u2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Jan 2023 14:43:15 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DE5CE100034; Wed, 4 Jan 2023 14:43:13 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id B8A9821F14B; Wed, 4 Jan 2023 14:43:13 +0100 (CET) Received: from [10.201.21.177] (10.201.21.177) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Wed, 4 Jan 2023 14:43:13 +0100 Message-ID: <8f022dc8-d728-ba91-35ed-8a4006855f0d@foss.st.com> Date: Wed, 4 Jan 2023 14:43:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [RFC PATCH 3/7] dt-bindings: bus: add STM32MP15 ETZPC firewall bus bindings To: Krzysztof Kozlowski , , , , , CC: , , , , , , References: <20221221173055.11719-1-gatien.chevallier@foss.st.com> <20221221173055.11719-4-gatien.chevallier@foss.st.com> <879325d2-4b2d-bc1d-310c-ece4c449ad8f@kernel.org> <8357d887-c8ab-39bc-4ef0-62e9225fb2a6@foss.st.com> <118e7f0c-bf5d-4bda-ee70-92eb2b71649c@kernel.org> Content-Language: en-US From: Gatien CHEVALLIER In-Reply-To: <118e7f0c-bf5d-4bda-ee70-92eb2b71649c@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.201.21.177] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-04_07,2023-01-04_02,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Krzysztof, On 12/22/22 14:57, Krzysztof Kozlowski wrote: > On 22/12/2022 14:51, Gatien CHEVALLIER wrote: >> Hello, >> >> On 12/22/22 11:26, Krzysztof Kozlowski wrote: >>> On 21/12/2022 18:30, Gatien Chevallier wrote: >>>> Adds the list of peripherals IDs under firewall bus on STM32MP15. >>>> >>>> Signed-off-by: Gatien Chevallier >>>> --- >>>> include/dt-bindings/bus/stm32mp15_sys_bus.h | 98 +++++++++++++++++++++ >>>> 1 file changed, 98 insertions(+) >>>> create mode 100644 include/dt-bindings/bus/stm32mp15_sys_bus.h >>>> >>>> diff --git a/include/dt-bindings/bus/stm32mp15_sys_bus.h b/include/dt-bindings/bus/stm32mp15_sys_bus.h >>>> new file mode 100644 >>>> index 000000000000..97eacc7b5f16 >>>> --- /dev/null >>>> +++ b/include/dt-bindings/bus/stm32mp15_sys_bus.h >>> >>> That's wrong in multiple ways: >>> 1. No underscores >>> 2. Missing vendor prefix >>> 3. Name not matching compatible. >> >> Sure, will comply in V3. >> >>> >>>> @@ -0,0 +1,98 @@ >>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ >>>> +/* >>>> + * Copyright (C) STMicroelectronics 2022 - All Rights Reserved >>>> + */ >>>> +#ifndef _DT_BINDINGS_BUS_STM32MP15_SYS_BUS_H >>>> +#define _DT_BINDINGS_BUS_STM32MP15_SYS_BUS_H >>>> + >>>> +/* ETZPC IDs */ >>>> +#define STM32MP1_ETZPC_STGENC_ID 0 >>>> +#define STM32MP1_ETZPC_BKPSRAM_ID 1 >>>> +#define STM32MP1_ETZPC_IWDG1_ID 2 >>>> +#define STM32MP1_ETZPC_USART1_ID 3 >>>> +#define STM32MP1_ETZPC_SPI6_ID 4 >>>> +#define STM32MP1_ETZPC_I2C4_ID 5 >>>> +/* ID 6 reserved */ >>> >>> Reserved why? These are IDs so they start from 0 and go by 0. Don't >>> hard-code some register offsets. >> >> Here, I do define IDs. Some appear as reserved based on what I've seen >> in the SoC datasheet that states these as "indexes" >> >> Please see the table 94 in chapter 15.6 (ETZPC) of the STM32MP157 >> Reference manual: >> [1] https://www.st.com/resource/en/reference_manual/DM00327659-.pdf > > Then why do you define them in bindings? Use raw numbers. Do you see > anywhere in arm/arm64 bindings for GIC_SPI interrupt numbers? > What would you think of simply removing the comments that state that IDs are reserved, mimicking the way it is for qcom bindings? Fundamentally, they are indeed only IDs and could be raw numbers. IMO, this makes reading the device tree harder. Because you'd have to look what the raw number corresponds to. To take an example, it has already been done for SCMI clocks and I find it eases comprehension. Best regards, Gatien > Best regards, > Krzysztof >