From nobody Thu Oct 2 16:29:30 2025 Received: from azure-sdnproxy.icoremail.net (azure-sdnproxy.icoremail.net [13.75.44.102]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBE6D3093CA; Mon, 15 Sep 2025 13:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.75.44.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757941321; cv=none; b=t52YLujWXyhTMzUyDNKCYl+iAVCxtoICapeIsacXjLeC8UHockfdA5d/KfHjhjw8p116iu3Z6y7L1VFZgdrr4IFxlvRPenG1GHy2tw3dB4dr91VqVwUE1W91AITaKeTg/sb/TUfaff2fA5ac1W+sUEsKBn13dp2xoa6GKT+SB5E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757941321; c=relaxed/simple; bh=R2Lk1cyFg0GsUHawE+a2oIwMUZYd71/kIsct6YqEqRg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=m2q+7Iz/3G9kIIOZ3jfWVyfbtIrxuSMkLTxiMCUdJMKHy6ed5EtNfFWium0m1pW9/18gZBlIvJUyUioUNzbHLbPlxKsia6H+i9hZXH6ccZGuvJKkWuibG3kOXooSeVlhzrKO+6EUjVUTfoQWLAwQNii/PL3R4des0rWLAPkDgss= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=eswincomputing.com; spf=pass smtp.mailfrom=eswincomputing.com; arc=none smtp.client-ip=13.75.44.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=eswincomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=eswincomputing.com Received: from E0006800LT.eswin.cn (unknown [10.12.96.77]) by app1 (Coremail) with SMTP id TAJkCgC32xExDshoTnHRAA--.2751S2; Mon, 15 Sep 2025 21:01:39 +0800 (CST) From: Yulin Lu To: dlemoal@kernel.org, cassel@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, linux-ide@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, vkoul@kernel.org, kishon@kernel.org, linux-phy@lists.infradead.org Cc: ningyu@eswincomputing.com, zhengyu@eswincomputing.com, linmin@eswincomputing.com, huangyifeng@eswincomputing.com, fenglin@eswincomputing.com, lianghujun@eswincomputing.com, Yulin Lu Subject: [PATCH v4 1/3] Document the EIC7700 SoC sata ahci Date: Mon, 15 Sep 2025 21:01:35 +0800 Message-Id: <20250915130135.1497-1-luyulin@eswincomputing.com> X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: <20250915125902.375-1-luyulin@eswincomputing.com> References: <20250915125902.375-1-luyulin@eswincomputing.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: TAJkCgC32xExDshoTnHRAA--.2751S2 X-Coremail-Antispam: 1UD129KBjvJXoWxZw4fGF4xAFyDWr4xGrW3Jrb_yoW5Aw1rpF s7GrZrJFs2qryxXayxJF10kF1S9ws3CFyYkr1xt3W7JrZ8Wa4vqrsIy3W5Ga47Jr1xX34a gFy3K3yjya12vrJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9l14x267AKxVW5JVWrJwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j 6r4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628v n2kIc2xKxwCY1x0262kKe7AKxVW8ZVWrXwCY02Avz4vE-syl42xK82IYc2Ij64vIr41l4I 8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AK xVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcV AFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8I cIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r 4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTRRBT5DUUUU X-CM-SenderInfo: pox13z1lq6v25zlqu0xpsx3x1qjou0bp/ Content-Type: text/plain; charset="utf-8" Document the SATA AHCI controller on the EIC7700 SoC platform, including descriptions of its hardware configurations. Retains the "ports-implemented" property in the DTS, because removing it and relying only on the firmware register causes problems. If the property is not present and we remove the module using `rmmod`, a reset is triggered that clears the register. As a result, inserting module again using `insmod` will lead to errors. The detailed reasons are that the ports-implemented register is configured by the firmware (U-Boot on the HiFive Premier P550 board) before kernel entry and correctly set to 0x1. During probe, ahci_platform_enable_resources() -> ahci_platform_deassert_rsts() is called, and when the driver is removed, ahci_platform_disable_resources() -> ahci_platform_assert_rsts() is called. This reset clears the register, which is defined by the IP databook to reset to 0. Signed-off-by: Yulin Lu --- .../bindings/ata/eswin,eic7700-ahci.yaml | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/ata/eswin,eic7700-ahc= i.yaml diff --git a/Documentation/devicetree/bindings/ata/eswin,eic7700-ahci.yaml = b/Documentation/devicetree/bindings/ata/eswin,eic7700-ahci.yaml new file mode 100644 index 000000000000..40c44f0705ba --- /dev/null +++ b/Documentation/devicetree/bindings/ata/eswin,eic7700-ahci.yaml @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/ata/eswin,eic7700-ahci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Eswin EIC7700 SoC SATA Controller + +maintainers: + - Yulin Lu + - Huan He + +description: + AHCI SATA controller embedded into the EIC7700 SoC + is based on the DWC AHCI SATA v5.00a IP core. + +select: + properties: + compatible: + const: eswin,eic7700-ahci + required: + - compatible + +allOf: + - $ref: snps,dwc-ahci-common.yaml# + +properties: + compatible: + items: + - const: eswin,eic7700-ahci + - const: snps,dwc-ahci + + clocks: + minItems: 2 + maxItems: 2 + + clock-names: + items: + - const: pclk + - const: aclk + + resets: + maxItems: 1 + + reset-names: + const: arst + + ports-implemented: + const: 1 + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - resets + - reset-names + - phys + - phy-names + - ports-implemented + +unevaluatedProperties: false + +examples: + - | + sata@50420000 { + compatible =3D "eswin,eic7700-ahci", "snps,dwc-ahci"; + reg =3D <0x50420000 0x10000>; + interrupt-parent =3D <&plic>; + interrupts =3D <58>; + clocks =3D <&clock 171>, <&clock 186>; + clock-names =3D "pclk", "aclk"; + phys =3D <&sata_phy>; + phy-names =3D "sata-phy"; + ports-implemented =3D <0x1>; + resets =3D <&reset 96>; + reset-names =3D "arst"; + }; --=20 2.25.1