From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC8A23ECBC2 for ; Wed, 17 Jun 2026 11:44:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781696692; cv=none; b=eJNeHBXP/c7phVYXBCyYm5R2c1bAhnhZsZdDjaVpe7f3XIYK+sVDeMzMi1UeNklOiLM134Cd0beKWhA5h95EA6Hat7ySpyZmw7SmJhl94fhEqoAfpWIkZHG5WZn/d8wN7lxC0bI4Bw4biBsSRwr/bX+UoBaz1S+ZWB6A6ZgeGY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781696692; c=relaxed/simple; bh=6PRiza3LXnOI5sh399qO0oBWFGp2+hOMtX90PkVi46A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FQ80tIVPILO6APYwxlBxMCp3Fh54WX9BLPgHLAFAaJ/ERuw3T18MduUMmMkS7hp6Ux64QNkwWB74Y8v2+sEoDzsB90TCipoO6lUY5o46zpjMmqeu2ydPWxMlPouzRPe029XZ84CuEwg6BCJ3/3yWaEIDkberzetSW8nCngoADP0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OuOuDUPA; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OuOuDUPA" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4629051c9d1so508202f8f.2 for ; Wed, 17 Jun 2026 04:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781696688; x=1782301488; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HPDJtP52p5BOP+sKi7OFUfIBErlWFolQCAuHzVeCjRo=; b=OuOuDUPAR4dq8V67wlZu7BAr9/kD1BFa8qxQw1eYgvS3cMky6B2m+oj4ev2J45pFHl ohkYTCy65X0vyrT2yaIHC6Eqb1/cfcHm+4j0NhWjvaWQ3/aqiVkIlrVEfj6SHofeDoX6 mgCfsTyvXB4lpPOspsx8ihJ0RG8gdf/TWqlVkPuzGgsUd47OioRCLnLflVKAlZ/beRFp 2CwwOJkg8hgXgbsGyaSvoxACJ+9tkftqjENEcK7gOyoBFaehk3/fFC514Bqp2UpYv7Pe 06YqDMd7t3Hz/ik+8AOxX5ORR3PVIwJXvBknn99T+Y23HCnYqByfj/G0nOE/pqoLB+xr rzjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781696688; x=1782301488; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HPDJtP52p5BOP+sKi7OFUfIBErlWFolQCAuHzVeCjRo=; b=EhCuN+JMMrB0TD53KEzxlK6IESGctpPuG8/IE7Ix/WX1C2QNqgyLgoSyn1+4bfS8vM Qymam3PJs3IKSwIh4Ft7dgF82CGpPu5h3I2/m72aaMxV2h5zFElHx8BXvr4c4KD+fKq7 Xi5AzbxCxhINu+NoEwcfnuJE1hR93H6z05EkEB6PErFCeYrYcIlWQ1OGzb0qiMcK2fao 3bRuqEJLvA4OdQTRn4UKboVmDoDAXDrG/NivxkDhxw5yRW9Pe2TCTiQaLscJ3P9or22p pZwnMHGLDV0PNAyxGihNRv+oW1J5Ln6BNYboE6YtOG5L71CR0aEGhXXXrQ3DbCu5Wkln 02FQ== X-Forwarded-Encrypted: i=1; AFNElJ9hpXpE7UIsw6COwRZbKhP697l6Q8XFfF9tFwlg883R3YGYZ90a14lvlJGFi7JuNpz0h+FkDg3wfZMSG5M=@vger.kernel.org X-Gm-Message-State: AOJu0YwVFgwwcLafbVeCUYbj4RyKCHC70RR8e8rumPfLPke9rjmwOLR+ hWQZ9Bw0WOzI39akio2avLF+6d7R5jgJJ0dUl840W/mA2RreLaUnKNtI X-Gm-Gg: AfdE7clK737Tg3FxZ9AqJIWuzL99G+CUAVZdmjoTFjuuR089TUON8MfV3uuoJdwFlHg jKf/fohkpjp9PTLrsRVcdRj1FNUBkngUhXIN8NVKh0VJ0/NiwYdxsYQ9b9eLT6uwhlMGMZggJHS 7NddVeFw5BwgSFgJ0yo9ZK+Wo9k1R2Vx7jjcpS2japhB30KdSMBZ3IrhkdARMqH8/QV6xTXr/x3 c/XybqtPCfoVkvy3W06MHNoGdaBCHReOn945siF7F0DVVuC1aMt7bsqdRSI/ea8eMteFNQLgSno zWtVLaD3WN2l3aDsWs1vnEFZJIyMSAxfj1Uezm2Y5f/7ztrIRX+3Cro4AxG6jYEGNklFzM4LIxa Her0VwpAY6AHkkt2IltNkW/oSGaPUZkmLYwY8MRZd6KSozGvJ7ek5xHYQzO2bE4QK/gfaGk4Pjg 5qfrbKDcQTV2fhoN8bjYKcsKsJWuKanR/8bYIRnKeL56Q50PX+bcvCDlT3phogIEA= X-Received: by 2002:a5d:6109:0:b0:460:e00:121c with SMTP id ffacd0b85a97d-46237b7179emr4214957f8f.28.1781696687715; Wed, 17 Jun 2026 04:44:47 -0700 (PDT) Received: from fedora ([196.77.26.11]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4606f2c4240sm48998658f8f.27.2026.06.17.04.44.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2026 04:44:47 -0700 (PDT) From: Jad Keskes To: Krzysztof Kozlowski Cc: Olivia Mackall , Herbert Xu , Rob Herring , Conor Dooley , Alexander Clouter , linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jad Keskes Subject: [PATCH v4 1/2] dt-bindings: rng: timeriomem_rng: add reg-io-width and mask properties Date: Wed, 17 Jun 2026 12:44:35 +0100 Message-ID: <20260617114436.1909659-1-inasj268@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add optional reg-io-width (1, 2, or 4 bytes) and mask properties to the binding. reg-io-width selects the bus access size, mask is ANDed with the raw register value to allow only the entropy-bearing bits through. Update the example to show a typical 1-byte configuration. Update SPDX to dual license to match kernel convention. Drop the misleading '32-bit aligned' constraint from the reg description since alignment now depends on the configured width. Signed-off-by: Jad Keskes --- .../bindings/rng/timeriomem_rng.yaml | 48 +++++++++++++++---- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/rng/timeriomem_rng.yaml b/Documentation/devicetree/bindings/rng/timeriomem_rng.yaml index 4754174e9849..740bc52bf474 100644 --- a/Documentation/devicetree/bindings/rng/timeriomem_rng.yaml +++ b/Documentation/devicetree/bindings/rng/timeriomem_rng.yaml @@ -1,10 +1,16 @@ -# SPDX-License-Identifier: GPL-2.0-only +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2 --- $id: http://devicetree.org/schemas/rng/timeriomem_rng.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: TimerIO Random Number Generator +title: Timer IOMEM Hardware Random Number Generator + +description: | + This binding covers platforms that have a single IO memory address which + provides periodic random data. The driver reads from the address at a + fixed interval, returning a configurable-width value masked to the desired + bits. maintainers: - Krzysztof Kozlowski @@ -13,9 +19,17 @@ properties: compatible: const: timeriomem_rng + reg: + maxItems: 1 + description: + Base address to sample from. Must be aligned to the configured access + width (1, 2, or 4 bytes) and at least that wide. + period: $ref: /schemas/types.yaml#/definitions/uint32 - description: wait time in microseconds to use between samples + description: + Interval in microseconds between reads. New random data is expected to + be available at this rate. quality: $ref: /schemas/types.yaml#/definitions/uint32 @@ -26,16 +40,26 @@ properties: instead. Note that the default quality is usually zero which disables using this rng to automatically fill the kernel's entropy pool. - reg: - maxItems: 1 + reg-io-width: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 4 + enum: [1, 2, 4] description: - Base address to sample from. Currently 'reg' must be at least four bytes - wide and 32-bit aligned. + Access width in bytes. Determines whether the read is performed as + an 8-bit, 16-bit, or 32-bit bus access. + + mask: + $ref: /schemas/types.yaml#/definitions/uint32 + default: 0xFFFFFFFF + description: + Mask applied to the value read from the register. Bits set to 0 in + the mask are cleared in the output data. Default (no mask) passes + all bits through. required: - compatible - - period - reg + - period additionalProperties: false @@ -46,3 +70,11 @@ examples: reg = <0x44 0x04>; period = <1000000>; }; + + rng@64 { + compatible = "timeriomem_rng"; + reg = <0x64 0x01>; + period = <50000>; + reg-io-width = <1>; + mask = <0xFF>; + }; -- 2.54.0