lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240930121601.172216-2-herve.codina@bootlin.com>
Date: Mon, 30 Sep 2024 14:15:41 +0200
From: Herve Codina <herve.codina@...tlin.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>,
	Andy Shevchenko <andy.shevchenko@...il.com>,
	Simon Horman <horms@...nel.org>,
	Lee Jones <lee@...nel.org>,
	Arnd Bergmann <arnd@...db.de>,
	Derek Kiernan <derek.kiernan@....com>,
	Dragan Cvetic <dragan.cvetic@....com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Herve Codina <herve.codina@...tlin.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Lars Povlsen <lars.povlsen@...rochip.com>,
	Steen Hegelund <Steen.Hegelund@...rochip.com>,
	Daniel Machon <daniel.machon@...rochip.com>,
	UNGLinuxDriver@...rochip.com,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Saravana Kannan <saravanak@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Horatiu Vultur <horatiu.vultur@...rochip.com>,
	Andrew Lunn <andrew@...n.ch>,
	devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org,
	linux-pci@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	Allan Nielsen <allan.nielsen@...rochip.com>,
	Steen Hegelund <steen.hegelund@...rochip.com>,
	Luca Ceresoli <luca.ceresoli@...tlin.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: [PATCH v6 1/7] dt-bindings: reset: microchip,rst: Allow to replace cpu-syscon by an additional reg item

In the LAN966x PCI device use case, syscon cannot be used as syscon
devices do not support removal [1]. A syscon device is a core "system"
device and not a device available in some addon boards and so, it is not
supposed to be removed.

In order to remove the syscon device usage, allow the reset controller
to have a direct access to the address range it needs to use.

Link: https://lore.kernel.org/all/20240923100741.11277439@bootlin.com/ [1]
Signed-off-by: Herve Codina <herve.codina@...tlin.com>
---
 .../bindings/reset/microchip,rst.yaml         | 35 ++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/reset/microchip,rst.yaml b/Documentation/devicetree/bindings/reset/microchip,rst.yaml
index f2da0693b05a..5164239a372c 100644
--- a/Documentation/devicetree/bindings/reset/microchip,rst.yaml
+++ b/Documentation/devicetree/bindings/reset/microchip,rst.yaml
@@ -25,12 +25,16 @@ properties:
       - microchip,lan966x-switch-reset
 
   reg:
+    minItems: 1
     items:
       - description: global control block registers
+      - description: cpu system block registers
 
   reg-names:
+    minItems: 1
     items:
       - const: gcb
+      - const: cpu
 
   "#reset-cells":
     const: 1
@@ -39,12 +43,29 @@ properties:
     $ref: /schemas/types.yaml#/definitions/phandle
     description: syscon used to access CPU reset
 
+allOf:
+  # Allow to use the second reg item instead of cpu-syscon
+  - if:
+      required:
+        - cpu-syscon
+    then:
+      properties:
+        reg:
+          maxItems: 1
+        reg-names:
+          maxItems: 1
+    else:
+      properties:
+        reg:
+          minItems: 2
+        reg-names:
+          minItems: 2
+
 required:
   - compatible
   - reg
   - reg-names
   - "#reset-cells"
-  - cpu-syscon
 
 additionalProperties: false
 
@@ -57,3 +78,15 @@ examples:
         #reset-cells = <1>;
         cpu-syscon = <&cpu_ctrl>;
     };
+
+    /*
+     * The following construction can be used if the cpu-syscon device is not
+     * present. This is the case when the LAN966x is used as a PCI device.
+     */
+    reset-controller@...10008 {
+        compatible = "microchip,lan966x-switch-reset";
+        reg = <0xe200400c 0x4>,
+              <0xe00c0000 0xa8>;
+        reg-names = "gcb", "cpu";
+        #reset-cells = <1>;
+    };
-- 
2.46.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ