From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 1F734156C5B for ; Fri, 7 Jun 2024 09:12:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717751558; cv=none; b=lcNq/sIEYO1awNrFN7Ne6ukaOLmLnqc1Pg5jSJyqYHG2aQl17Hh5WKyCF+zjABVFekTOA+kJNpfEvAsM9nIIlCc1WqyCH9yvfxYteRPCRhKdDPbbnjgwAQM5Th50ut0rLFJUYE++mfsMNjTNub+dbh08H+ajsrTf54coyXOjbA8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717751558; c=relaxed/simple; bh=Q2KyKee5qAk5yhcRdV4zkO1fcS4SwRxZde8YLboA1fM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=sYPHdAP9ivkm7yqq80h7dl5oVpbNUQkJmB1PF/rTpGAMtZvxbiHD8j387MUOwiPu+t5taeix6nX8l5T/sdz5aVPoQBr+dCdiYnKORtw2hjboOBguq4RsaIhetkCAW6z92aL8zzkuM3aBy2h6TImqiobuacJ1QSElzu08Krrv4jo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aCl9vHVJ; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aCl9vHVJ" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1f6ab88dfaeso16770045ad.2 for ; Fri, 07 Jun 2024 02:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717751556; x=1718356356; 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=hPveJQ5m/OIT5FdwV6oYgK1mHcEkZsFVv5qp/eyftFQ=; b=aCl9vHVJECUN8oyvlZIZqfL11NXmIXugJjUpD00WAuL0qWZyjotVrVM9Xi5gHljFbp nN5yQZQif0FBMAbhPPGgde8G2+fQ7Z6wrO2usRhLrvtcc4RV7tH76SG13vL83JePM4DS 37Gtg9NpDx9sH1T277jyi2B5VJyHOEy46Y/4M882B/7HSGkD/uMLEWU6HwgergO5+/2+ IMxWiX5uEqRGAgiugWl9UmFZlBwUCrG/UIKd1b4W9H+HAndfAILQScbytqHWskuSR57M iQzcpLXEma/Jpkg6s7QL1yGTBRXF3C2h74hOU75XoUZOTLEbGOAIl2F0DjTAuffvOBUf cHIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717751556; x=1718356356; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hPveJQ5m/OIT5FdwV6oYgK1mHcEkZsFVv5qp/eyftFQ=; b=QDsI9cJoqMx3yfejzUJJA6AgcqZRzim5h/vRSze9jxGafXRJwcMyFdqS8k9pzXOX9o Cg0m9MJHn73J/b8J6zU67HgiW5NOfXc96St2iRwt1I/f92a7cELZO3VylbkSzCxp8T7t Q68wirVuwH6cgrF5PqvjuBhOv9nYjYSH5mHSu7rVQwVSwtan8KkbMD/HGaD1HSPCvEBC YEX4B4VgthzNHyTMvrjnC3pUbKx4Djq3u8QfKG2Khqp/gMGAYeHpVRcMtDc1Cn7aht9k RgDb1j7czMDRifQtdEsgvGRPHKXpbSj9s93R67gclvWU7jjZzhE6lX7it+IEshdoCzzA N+jQ== X-Forwarded-Encrypted: i=1; AJvYcCVVr4BuUGVc+aTvI13ZXcxm25jz1Lwn6K7LKZfgtUtx9NA+MNxSydpMPI/338ti263gPEXALDbH0pQ73mU9q5f6T1DeJaL616KmebRW5lM= X-Gm-Message-State: AOJu0YyV8R6jI+UDwKPTMR8JX4ZD01AKFpH6VKrwRjRt8guzsJJU/K8M 9x1D3LXa6zsFNX70lVnNgvRlMQM+iXVMAWWwY8t+29u2CdzqhZNDQhAXfaxhczg= X-Google-Smtp-Source: AGHT+IETqK0zIIliNwoalKCFWPqaghIKyxJIFCSap/cz1CcyLlXt9SgcECRYv4nhSTpyDxxto+jOcQ== X-Received: by 2002:a17:902:d2ca:b0:1f6:7f0c:6c3e with SMTP id d9443c01a7336-1f6d02d3acamr23916915ad.12.1717751555988; Fri, 07 Jun 2024 02:12:35 -0700 (PDT) Received: from localhost ([122.172.82.13]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd7e3e66sm29238035ad.182.2024.06.07.02.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 02:12:35 -0700 (PDT) From: Viresh Kumar To: "Rafael J. Wysocki" , Miguel Ojeda , Alex Gaynor , Alice Ryhl , Andreas Hindborg , Benno Lossin , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Boqun Feng , Gary Guo , Miguel Ojeda , Viresh Kumar , Wedson Almeida Filho Cc: linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , rust-for-linux@vger.kernel.org, Manos Pitsidianakis , Erik Schilling , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Joakim Bech , Rob Herring , linux-kernel@vger.kernel.org Subject: [RFC PATCH V2 0/8] Rust bindings for cpufreq and OPP core + sample driver Date: Fri, 7 Jun 2024 14:42:15 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hello, This RFC adds initial rust bindings for two subsystems, cpufreq and operating performance points (OPP). The bindings are provided for most of the interface these subsystems expose. This series also provides a sample cpufreq driver rcpufreq-dt, which is a duplicate of the merged cpufreq-dt driver (A generic platform agnostic device tree based cpufreq driver) used on most of the ARM platforms. This is tested with the help of QEMU for now and frequency transitions and configurations work as expected. No performance measurement is done as of now with this. These patches (along with few other dependencies) are pushed here for anyone to give them a try: git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/linux.git rust/cpufreq-dt This depends on basic bindings for few other modules: device/driver, platform driver, OF, clk, and cpumask. I am not looking to upstream a full fledged support for them yet. Based staging/rust-device from the Rust tree (which is based over v6.10-rc1). V1->V2: - Create and use separate bindings for OF, clk, cpumask, etc (not included in this patchset but pushed to the above branch). This helped removing direct calls from the driver. - Fix wrong usage of Pinning + Vec. - Use Token for OPP Config. - Use Opaque, transparent and Aref for few structures. - Broken down into smaller patches to make it easy for reviewers. - Based over staging/rust-device. Thanks. Viresh Kumar (8): rust: Add initial bindings for OPP framework rust: Extend OPP bindings for the OPP table rust: Extend OPP bindings for the configuration options rust: Add initial bindings for cpufreq framework rust: Extend cpufreq bindings for policy and driver ops rust: Extend cpufreq bindings for driver registration rust: Extend OPP bindings with CPU frequency table cpufreq: Add Rust based cpufreq-dt driver drivers/cpufreq/Kconfig | 12 + drivers/cpufreq/Makefile | 1 + drivers/cpufreq/rcpufreq_dt.rs | 229 +++++++ rust/bindings/bindings_helper.h | 2 + rust/helpers.c | 15 + rust/kernel/cpufreq.rs | 1070 +++++++++++++++++++++++++++++++ rust/kernel/lib.rs | 4 + rust/kernel/opp.rs | 886 +++++++++++++++++++++++++ 8 files changed, 2219 insertions(+) create mode 100644 drivers/cpufreq/rcpufreq_dt.rs create mode 100644 rust/kernel/cpufreq.rs create mode 100644 rust/kernel/opp.rs -- 2.31.1.272.g89b43f80a514