From nobody Sat Nov 30 03:41:13 2024 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) (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 667C919E973 for ; Wed, 11 Sep 2024 14:27:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064877; cv=none; b=i1+MjlJ4GrPxq/NoBMEy16VXo/REuxPA4WZQPg9+dQhweeikPUtGpOxTyNEQX/ivHQs7Ya/CQ2qedeWfirPC5OENKYGZ3Kut5HQ+LcKACo8vCsew5WlZFu+RrKCMcYoRfC2n6wrTVY6MxCevpn8vZwC8+FEG6NsGFG1lb4IJRE0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064877; c=relaxed/simple; bh=lKm/kwthrWk+of54TAxNb7rE2mtE7ZvfrrXhQMNpFmY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CshnavFBG714IAx0yZS8qT6Aa0rZ/7sASQRWifXyjHvK6aHYQ7K9BZKxUx5r12Dwm81rgiS/qhTJLpF7IIO888fb5B8+s3v4blZ8T5jz6ACrkmxIXjzPopXCRrUzwOml6nVzgYyOlcqbVGthkVCejgAFGqPlh34GAjdfnMt214s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=xAQcDEpZ; arc=none smtp.client-ip=209.85.216.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="xAQcDEpZ" Received: by mail-pj1-f68.google.com with SMTP id 98e67ed59e1d1-2d89229ac81so5392063a91.0 for ; Wed, 11 Sep 2024 07:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064875; x=1726669675; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YOaH7wUDUVg3jrdLcJDpY4x/GyOxkGNywptNXtNYkIM=; b=xAQcDEpZfPCJIskIYUbFYT0Y0Ahj3NehbB2eQsJR/wbTvfcyMEKIsrF8SXS5aJxjZl 1gHkTww9T1rr7wFNGBz6nO8gRcv7iE4hS8qmvdePYy1LFbAEVqGM1D/kC8cwrkqv5ksb eLtNxaeWgbDn+d03IbXuAMNP0MDBZAJ5u0tGrrIi0x+ywX+Pqd2fenn4hbi0ROv3r3De ZOlb2GxxKUFoNNTKVF2RDz4GRT4I7sr+zsX+Pub4H9EOuHI6qWeesx5nNL9jio+xfF2Z aBwQRCh3JM06VYOGNhZBG4G+ba8lp/esvsdaftY2XjUqredHSh1WGiswgxprg51nEg9w bXoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064875; x=1726669675; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YOaH7wUDUVg3jrdLcJDpY4x/GyOxkGNywptNXtNYkIM=; b=C3ZIeX8dao3icAdep+5zelZuuZinzlPGylDUsr+eQqC+xPi2vR5rOBTuNvwMPM19YU yXhiu9tKLIikiCcdXi+gAJjsoJd9MrcMDwXEPGScddNhfvTVeA/hOBnQXy7nuRWxmSbY 8QwZ9XP0NbsHqTwGpFiBAAMOKEe5xBBRF3Bmzm2DM7luiXOSSXrFvSn2zZRz/DAVnr0e tBRGwRf3zno1Mg1BQI/qsBR0dlujaVosg024u3lz6QvySiDuXwntNuCLqF5PGixJkIhT FWGYia+fjxW1af+5h2Rk8hfdXG63FyX3EC/MKajTDouSfquySHAI+QhIgJqix+hF10fO 9Nug== X-Gm-Message-State: AOJu0YwUbXMn3QIdVU6P8lTOtVaG7Kg8CVcoM8sXgwTAr3iAjFGVI8e4 7WkhiRvzo4CD6M5yT6glbezvPYjdGZ1OJ78KtcCNVmoAc7LBey9B8FY1HSCglA== X-Google-Smtp-Source: AGHT+IETD8NcWXEwrzRI7PfUQkX1aQcbeJI3Z+n8OukCsjjngyEPaWbX125rUDAAT6JvWnPjmRzDnw== X-Received: by 2002:a17:90a:8a15:b0:2d8:99c4:3cd9 with SMTP id 98e67ed59e1d1-2dad4de1392mr20248004a91.3.1726064874446; Wed, 11 Sep 2024 07:27:54 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.27.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:27:54 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:18 +0530 Subject: [PATCH 1/8] rust: kernel: Add Platform device and driver abstractions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240911-mikrobus-dt-v1-1-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=14880; i=ayush@beagleboard.org; h=from:subject:message-id; bh=zkzVPkQfS9LodBPXtJMr2bHYTVhX/BFEg3r5ta8DpxE=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajV037slacrW67oDDENCopdqoaSn9E7y3hl3 pM9wPh0T8KJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1QAKCRAFzvXHieVa dOYHD/wN0sTYbOCHvDxME4ZMoLGPRMqCTb20jASqA7kv2/98kyksK6fRt57d8xDjMebjJEMTP2o zSUbg2hJ+S1vJVaMOMR23MciQnzUZ46EBrYvobIUEsjnmXp2luajua1SbR99DuYEI7Gh99byLhX CUE4z6eqjEVsjp9LPaJjFlRKPm1dG77PJQMGBWh1RRUT6xEwDN5kcPjjfPQCVV2mo+KAMPXeLDp bHYVYpcmt+Vk89jH0Qq9hD4/knDp9Eoid/hmz6/0lsP1Ia6IVScDsJP1CQNb9x9yPHG7BNkxef6 0tdPDnETf636G4efv0UuuoFpfq4lm7txZBWJgnqdvmQmYLQjmVrdr0TRA22sNX6htvIB2jhPLn1 niVYpkJjvpRlHw1F8oWzrVExalYu5tbVwlQdo4JVjnQO7Lywl2pDrL3CDxr06C2Sw4ZOXMnscdc SP9jBNLq2fHQUxGSuK6lXEdNfuHQ3nWc3T6/MYIL6NOviYOMZjPc+kHRl8nv48DpYha/Uy/ISBx A2Y92b5KeXXXtOcU4ElbvLOTLxWU7PoKRka6xzF/0OVmIj2sNPZSkIIajHjEAcYmel6/XjDW3PR ovh7Qj2JLU05teSMqCNe8yb2W7H4zmlTf31BvjMfjJ4mwcNX8zfRf3XQ86XGNbM+wdP3eEhIWww re7PSfNtMph7Esw== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 From: Fabien Parent Ports Platform device and driver abstractions from Fabien's tree [0]. These abstractions do not depend on any generic driver registration and id table. Instead, the minimal abstractions have been implemented specifically for platform subsystem taking heavy inspiration from the existing phy device and driver abstractions. [0]: https://github.com/Fabo/linux/commits/fparent/rust-platform Signed-off-by: Fabien Parent Signed-off-by: Ayush Singh --- rust/bindings/bindings_helper.h | 1 + rust/kernel/lib.rs | 1 + rust/kernel/platform.rs | 380 ++++++++++++++++++++++++++++++++++++= ++++ 3 files changed, 382 insertions(+) diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index ae82e9c941af..10cbcdd74089 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index b5f4b3ce6b48..b3a318fde46c 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -42,6 +42,7 @@ #[cfg(CONFIG_NET)] pub mod net; pub mod page; +pub mod platform; pub mod prelude; pub mod print; pub mod rbtree; diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs new file mode 100644 index 000000000000..de28429f5551 --- /dev/null +++ b/rust/kernel/platform.rs @@ -0,0 +1,380 @@ +// SPDX-License-Identifier: GPL-2.0 + +//! Platform devices and drivers. +//! +//! Also called `platformdev`, `pdev`. +//! +//! C header: [`include/linux/platform_device.h`](../../../../include/linu= x/platform_device.h) + +use core::{marker::PhantomData, pin::Pin, ptr::addr_of_mut}; + +use macros::vtable; + +use crate::{ + bindings, device, + error::{from_result, Result}, + str::CStr, + types::Opaque, +}; + +/// A platform device. +/// +/// # Invariants +/// +/// The field `ptr` is non-null and valid for the lifetime of the object. +#[repr(transparent)] +pub struct Device(Opaque); + +impl Device { + /// Creates a new [`Device`] instance from a raw pointer. + /// + /// # Safety + /// + /// For the duration of `'a`, + /// - the pointer must point at a valid `platform_device`, and the cal= ler + /// must be in a context where all methods defined on this struct + /// are safe to call. + unsafe fn from_raw<'a>(ptr: *mut bindings::platform_device) -> &'a mut= Self { + // CAST: `Self` is a `repr(transparent)` wrapper around `bindings:= :platform_device`. + let ptr =3D ptr.cast::(); + // SAFETY: by the function requirements the pointer is valid and w= e have unique access for + // the duration of `'a`. + unsafe { &mut *ptr } + } + + /// Returns id of the platform device. + pub fn id(&self) -> i32 { + let platformdev =3D self.0.get(); + // SAFETY: By the type invariants, we know that `self.ptr` is non-= null and valid. + unsafe { (*platformdev).id } + } +} + +impl AsRef for Device { + fn as_ref(&self) -> &device::Device { + let platformdev =3D self.0.get(); + // SAFETY: By the type invariants, we know that `self.ptr` is non-= null and valid. + unsafe { device::Device::as_ref(addr_of_mut!((*platformdev).dev)) } + } +} + +/// An adapter for the registration of a Platform driver. +struct Adapter { + _p: PhantomData, +} + +impl Adapter { + /// # Safety + /// + /// `pdev` must be passed by the corresponding callback in `platform_d= river`. + unsafe extern "C" fn probe_callback(pdev: *mut bindings::platform_devi= ce) -> core::ffi::c_int { + from_result(|| { + // SAFETY: This callback is called only in contexts + // where we can exclusively access `platform_device` because + // it's not published yet, so the accessors on `Device` are ok= ay + // to call. + let dev =3D unsafe { Device::from_raw(pdev) }; + T::probe(dev)?; + Ok(0) + }) + } + + /// # Safety + /// + /// `pdev` must be passed by the corresponding callback in `platform_d= river`. + unsafe extern "C" fn remove_callback(pdev: *mut bindings::platform_dev= ice) { + // SAFETY: This callback is called only in contexts + // where we can exclusively access `platform_device` because + // it's not published yet, so the accessors on `Device` are okay + // to call. + let dev =3D unsafe { Device::from_raw(pdev) }; + T::remove(dev); + } +} + +/// Driver structure for a particular Platform driver. +/// +/// Wraps the kernel's [`struct platform_driver`]. +/// This is used to register a driver for a particular PHY type with the k= ernel. +/// +/// # Invariants +/// +/// `self.0` is always in a valid state. +/// +/// [`struct platform_driver`]: srctree/include/linux/platform.h +#[repr(transparent)] +pub struct DriverVTable(Opaque); + +// SAFETY: `DriverVTable` doesn't expose any &self method to access intern= al data, so it's safe to +// share `&DriverVTable` across execution context boundaries. +unsafe impl Sync for DriverVTable {} + +impl DriverVTable { + /// Creates a [`DriverVTable`] instance from [`Driver`]. + /// + /// This is used by [`module_platform_driver`] macro to create a stati= c array of `phy_driver`. + /// + /// [`module_platform_driver`]: crate::module_platform_driver + pub const fn new(match_tbl: &'static Device= IdTable) -> Self { + let drv =3D Opaque::new(bindings::platform_driver { + probe: if T::HAS_PROBE { + Some(Adapter::::probe_callback) + } else { + None + }, + __bindgen_anon_1: bindings::platform_driver__bindgen_ty_1 { + remove: if T::HAS_REMOVE { + Some(Adapter::::remove_callback) + } else { + None + }, + }, + driver: create_device_driver::(match_tbl), + // SAFETY: The rest is zeroed out to initialize `struct platfo= rm_driver`. + ..unsafe { core::mem::MaybeUninit::= ::zeroed().assume_init() } + }); + + DriverVTable(drv) + } +} + +const fn create_device_driver( + match_tbl: &'static DeviceIdTable, +) -> bindings::device_driver { + bindings::device_driver { + name: T::NAME.as_char_ptr(), + of_match_table: match_tbl.get(), + // SAFETY: The rest is zeroed out to initialize `struct device_dri= ver`. + ..unsafe { core::mem::MaybeUninit::::zero= ed().assume_init() } + } +} + +/// A platform driver. +#[vtable] +pub trait Driver { + /// The friendly name + const NAME: &'static CStr; + + /// Sets up device-specific structures during discovery. + fn probe(_dev: &mut Device) -> Result; + + /// Clean up device-specific structures during removal. + fn remove(_dev: &mut Device); +} + +/// Registration structure for Platform driver. +/// +/// Registers [`DriverVTable`] instance with the kernel. It will be unregi= stered when dropped. +/// +/// # Invariants +/// +/// The `driver` is currently registered to the kernel via `__platform_dri= ver_register`. +pub struct Registration(Pin<&'static DriverVTable>); + +// SAFETY: The only action allowed in a `Registration` instance is droppin= g it, which is safe to do +// from any thread because `platform_drivers_unregister` can be called fro= m any thread context. +unsafe impl Send for Registration {} + +impl Registration { + /// Registers a Platform driver. + pub fn new(drv: Pin<&'static DriverVTable>, m: &'static crate::ThisMod= ule) -> Registration { + unsafe { + bindings::__platform_driver_register(drv.0.get(), m.0); + } + + Self(drv) + } +} + +impl Drop for Registration { + fn drop(&mut self) { + unsafe { bindings::platform_driver_unregister(self.0 .0.get()) } + } +} + +/// An identifier for Platform devices. +/// +/// Represents the kernel's [`struct of_device_id`]. This is used to find = an appropriate +/// Platform driver. +/// +/// [`struct of_device_id`]: srctree/include/linux/mod_devicetable.h +pub struct DeviceId(&'static CStr); + +impl DeviceId { + /// A zeroed [`struct of_device_id`] used to signify end of of_device_= id array. + /// + /// [`struct of_device_id`]: srctree/include/linux/mod_devicetable.h + pub const ZERO: bindings::of_device_id =3D bindings::of_device_id { + // SAFETY: The rest is zeroed out to initialize `struct of_device_= id`. + ..unsafe { core::mem::MaybeUninit::::zeroe= d().assume_init() } + }; + + /// Create new instance + pub const fn new(s: &'static CStr) -> Self { + Self(s) + } + + const fn compatible(&self) -> [i8; 128] { + let compatible =3D self.0.as_bytes_with_nul(); + let mut comp =3D [0i8; 128]; + let mut i =3D 0; + + while i < compatible.len() { + comp[i] =3D compatible[i] as _; + i +=3D 1; + } + + comp + } + + // macro use only + #[doc(hidden)] + pub const fn to_rawid(&self) -> bindings::of_device_id { + let comp =3D self.compatible(); + + bindings::of_device_id { + compatible: comp, + // SAFETY: The rest is zeroed out to initialize `struct of_dev= ice_id`. + ..unsafe { core::mem::MaybeUninit::::z= eroed().assume_init() } + } + } +} + +/// An array of identifiers for platform driver +#[repr(transparent)] +pub struct DeviceIdTable([bindings::of_device_id; C]); + +impl DeviceIdTable { + /// Create a new instance + pub const fn new(ids: [bindings::of_device_id; C]) -> Self { + Self(ids) + } + + /// Returns a raw pointer to static table. + pub const fn get(&'static self) -> *const bindings::of_device_id { + self.0.as_ptr() + } +} + +// SAFETY: `DeviceIdTable` is only used in C side behind a *const pointer,= and thus remains +// immutable and thus can be shared across execution context boundaries. +unsafe impl Sync for DeviceIdTable {} + +/// Declares a kernel module for Platform drivers. +/// +/// This creates a static [`struct platform_driver`] and registers it. It = also creates an array of +/// [`struct of_device_id`] for matching the driver to devicetree device. +/// +/// [`struct platform_driver`]: srctree/include/linux/platform.h +/// [`struct of_device_id`]: srctree/include/linux/mod_devicetable.h +/// +/// # Examples +/// +/// ``` +/// # mod module_platform_driver_sample { +/// use kernel::c_str; +/// use kernel::platform::{self, DeviceId}; +/// use kernel::prelude::*; +/// +/// kernel::module_platform_driver! { +/// driver: PlatformSimple, +/// of_table: [DeviceId::new(c_str!("platform-simple"))], +/// name: "rust_sample_platform", +/// author: "Rust for Linux Contributors", +/// description: "Rust sample Platform driver", +/// license: "GPL", +/// } +/// +/// struct PlatformSimple; +/// +/// #[vtable] +/// impl platform::Driver for PlatformSimple { +/// const NAME: &'static CStr =3D c_str!("PlatformSimple"); +/// } +/// # } +/// ``` +/// +/// This expands to the following code: +/// +/// ```ignore +/// use kernel::c_str; +/// use kernel::platform::{self, DeviceId}; +/// use kernel::prelude::*; +/// +/// +/// struct Module { +/// _reg: $crate::platform::Registration, +/// } +/// +/// module! { +/// type: Module, +/// name: "rust_sample_platform", +/// author: "Rust for Linux Contributors", +/// description: "Rust sample Platform driver", +/// license: "GPL", +/// } +/// +/// const _: () =3D { +/// static OF_TABLE: $crate::platform::DeviceIdTable =3D $crate::platf= orm::DeviceIdTable<2>([ +/// (DeviceId::new(c_str!("platform-simple"))).to_rawid(), +/// $crate::platform::DeviceId::ZERO, +/// ]); +/// static DRIVER: $crate::platform::DriverVTable =3D +/// $crate::platform::DriverVTable::new::(&OF_T= ABLE); +/// impl $crate::Module for Module { +/// fn init(module: &'static ThisModule) -> Result { +/// let reg =3D +/// $crate::platform::Registration::new( +/// ::core::pin::Pin::static_ref(&DRIVER), module); +/// Ok(Module { _reg: reg }) +/// } +/// } +/// } +/// +/// struct PlatformSimple; +/// +/// #[vtable] +/// impl platform::Driver for PlatformSimple { +/// const NAME: &'static CStr =3D c_str!("PlatformSimple"); +/// } +/// ``` +#[macro_export] +macro_rules! module_platform_driver { + (@replace_expr $_t:tt $sub:expr) =3D> {$sub}; + + (@count_devices $($x:expr),*) =3D> { + 0usize $(+ $crate::module_platform_driver!(@replace_expr $x 1usize= ))* + }; + + (driver: $driver:ident, of_table: [$($of_id:expr),+ $(,)?], $($f:tt)*)= =3D> { + struct Module { + _reg: $crate::platform::Registration, + } + + $crate::prelude::module! { + type: Module, + $($f)* + } + + const _: () =3D { + // SAFETY: C will not read off the end of this constant since = the last element is zero. + static OF_TABLE: $crate::platform::DeviceIdTable< + {$crate::module_platform_driver!(@count_devices $($of_id),= +) + 1} > =3D + $crate::platform::DeviceIdTable::new( + [$($of_id.to_rawid()),*, $crate::platform::DeviceId::Z= ERO]); + + static DRIVER: $crate::platform::DriverVTable =3D + $crate::platform::DriverVTable::new::< + $driver, {$crate::module_platform_driver!(@count_devic= es $($of_id),+) + 1} + >(&OF_TABLE); + + impl $crate::Module for Module { + fn init(module: &'static ThisModule) -> Result { + let reg =3D $crate::platform::Registration::new( + ::core::pin::Pin::static_ref(&DRIVER), module); + Ok(Module { _reg: reg }) + } + } + }; + }; +} --=20 2.46.0 From nobody Sat Nov 30 03:41:13 2024 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) (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 21C7819E973 for ; Wed, 11 Sep 2024 14:28:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064886; cv=none; b=FB523NlCXfDtvgcC/gTEayZA6kssr629WdY6ltHyyVvZRSk0Pmu4JimsYvgd2/KBxJ6t2/bkxvVQ7mmknVONnjIOErfkwUDk8GdCTN6GzgufA+649vreQxciwSNTdLC/PxzAtNTwQtPXHO4il4iY6LCaFaw0IgMizys6giaA6+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064886; c=relaxed/simple; bh=bvB7UmeHkRb7yfH1nDvmOVlGFumWUUvfkn5d5HzsWdc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S4lEQ8GGOI6r5eHkZaIbTOk6svQlKQxbLi1LQ+d7XVN6GXEStaYXh7sfpMLD2DjB8f3vamwZllWR9KGQWwyB6dji1erbestsCvwJECKey6zr555YmmYJszc4KTWyGpK4/Hq0tQz3jynw2p9mBLga+86CLR6KyvmeI0zPH+cFW+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=MQVWXSeO; arc=none smtp.client-ip=209.85.215.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="MQVWXSeO" Received: by mail-pg1-f194.google.com with SMTP id 41be03b00d2f7-6bce380eb96so4178304a12.0 for ; Wed, 11 Sep 2024 07:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064884; x=1726669684; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pHzBg2St8KC9MTBvt8ke8cxG8WKshDc3eLooksnIRmE=; b=MQVWXSeOT9AiyD/ELIoVgfFucdYinm+P3mjoF8gwpmpfHm9RiS+TRyR53UNSAeJI6e /v7XNFNs1PQq/Ab+Jy1Qd3OgCQcuhn3nQyNrOKa9CXZTXukRqYIJNs2JDgJnAR2H+LjM LdcwbG27mVm6o7xI6ygnDpMJr9tjYjzgtsc+x9xC/KQd3dLsEImgTekzcX9x/AH5JX3X YM4PyVk7p8M+yZXh4Y3RLFhYXAqiJ6XxOTZICDpDtDCsUMHPukBDwYwV128GGizAFsSK +jITWG2nOF3cw/lpKat71e/B8CSZI78ZqtcA9opuk0zf61i3aFzNH5BggYv+EWFBdRWN I95g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064884; x=1726669684; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pHzBg2St8KC9MTBvt8ke8cxG8WKshDc3eLooksnIRmE=; b=S06+kUfsKVWN5Qxjr+9/zOcTNCVokumrZFGxt85Z3qEnKL21IkIEBYoOifUf7QgzOh CUMTrBqM9n/kB/bYB1bBGyG1spbf6fsKaYVnjZb/gr/kcl+6fnHsrUZVFAHelJWEepgp 0CFDCrHuojFX490KM+k++Qhh9/WjBufG1l//bD/fkVUfJRfR09IwXzVsow70cr+8DozJ 2yZxtE0bvwUQ3yuvMs191FdaSqZP0Ujz8CLxO7wnhyVRz1qyhEf3O2UPYuJZHivUTVNG mrgSpL4oofRRGquZDQNXR20QdaxS/Fo8APv3CjLeFMgJNoSIiA3IjZzzIuACClsHSA2c Mapw== X-Gm-Message-State: AOJu0Yyo/Os9dL2HHD26GbSSVdY+0naySd1QA14o1zQkhikisWM+Rmph 0I224XbYe37b6bd1VfgXY8DWZxFJPBuCtFBOiZlEi5N4Ejy78bTLAitfRTEZvg== X-Google-Smtp-Source: AGHT+IHrUIfQbv5AN7Xe8j4SPuyNBG/fmpYAyLy0qzTADvtIG9r/hxpLBd4G7kq++lMyZOfVqXoYCw== X-Received: by 2002:a05:6a21:a24c:b0:1c6:a65f:299 with SMTP id adf61e73a8af0-1cf5e0b0f15mr6316863637.21.1726064884284; Wed, 11 Sep 2024 07:28:04 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:28:04 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:19 +0530 Subject: [PATCH 2/8] dt-bindings: connector: Add MikorBUS connector Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240911-mikrobus-dt-v1-2-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2947; i=ayush@beagleboard.org; h=from:subject:message-id; bh=bvB7UmeHkRb7yfH1nDvmOVlGFumWUUvfkn5d5HzsWdc=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajVf1aUzhSg3g8lMTcWQQvps+sHJjBBiD7Xs SrIX/+QkiiJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1QAKCRAFzvXHieVa dHEkD/kBcosApl+NDTha5IyXyoMZ2/VMJYYb9jHEMuIeh0sCz4/R99nJGGDh1QqObyzxtd5TjNZ sg7kEiloFxGZillTwOFtnKYZ0M+6+lMmKerv0eM0efboEmZ8AgGzlmRfsGQ3tWN80BWa1Lk35BI aS8JZ4PU2OG6/eSuWgP4Ma1Jc6YjWaGM++dXij1XvDv+WEQdBVrKW000lbVH0gWzzvdlZyzVV+I l9BbIpHSr+AThn5Ct78dRkKpqjpzMGfFI5JVfz17yhHQKv0JnTq7XkyC/Sdd1X9GIv3Ultsom9Q l3ESMf3rJl2Ys6f7xGy7VCXJbcZdjP1xKnwLNPCz7DrcuGZt76AzJra2Ji9JD8HCMzwcdL7Izsg vXKagN2tnyHM54Mjs815DpfzHGnQqRJ5c1+oU2kEbDbyH4mF9tAWoFYaTkUTU/hgOap8g1Rb2Uk i0H0HztxWVxUvpbEofXHGeee14TxETeS4fsJSgRV0P8GmsoLnAFmWI8KrDvIfMH7hnMlfdNv0pB yoM7SbVpDpbvkkC7Q3HaWThv9HSZX4klCgPk6RDanF+w/gFh6x9GrpKtBhascCz6Wcz6NbB8kAb KEKPAO77QpY6/XEQKCd3TK0S4jSDxsfrpgm/J2SnLebG3ASfy+pGcrb7CMVK6NNkjMTZDbrTp8P rEL5KP6r4Dc3g0g== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 Add DT bindings for mikroBUS interface. MikroBUS [0] is an open standard developed by MikroElektronika for connecting add-on boards to microcontrollers or microprocessors. MikroBUS connector node will optionally act as nexus nodes for routing GPIOs and PWM. For GPIOs, the following pin numbering should be followed: 0: PWM 1: INT 2: RX 3: TX 4: SCL 5: SDA 6: MOSI 7: MISO 8: SCK 9: CS 10: RST 11: AN For PWM, the PWM pin should be on channel 0. I am not quite sure how to deal with the nexus node properties (#gpio-cells, gpio-map, gpio-map-mask, gpio-map-pass-thru) since they seem to conflict with upstream gpio schema (gpio-controller is a dependency of #gpio-cells). [0]: https://www.mikroe.com/ Signed-off-by: Ayush Singh --- .../bindings/connector/mikrobus-connector.yaml | 40 ++++++++++++++++++= ++++ MAINTAINERS | 5 +++ 2 files changed, 45 insertions(+) diff --git a/Documentation/devicetree/bindings/connector/mikrobus-connector= .yaml b/Documentation/devicetree/bindings/connector/mikrobus-connector.yaml new file mode 100644 index 000000000000..603e4627076c --- /dev/null +++ b/Documentation/devicetree/bindings/connector/mikrobus-connector.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +# +# Copyright (c) Ayush Singh +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/connector/mikrobus-connector.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: mikroBUS add-on board socket + +maintainers: + - Ayush Singh + +properties: + compatible: + const: mikrobus-connector + +required: + - compatible + +additionalProperties: true + +examples: + - | + mikrobus_connector0: mikrobus-connector0 { + status =3D "okay"; + compatible =3D "mikrobus-connector"; + + #gpio-cells =3D <2>; + gpio-map =3D + <0 0 &main_gpio1 11 0>, <1 0 &main_gpio1 9 0>, + <2 0 &main_gpio1 24 0>, <3 0 &main_gpio1 25 0>, + <4 0 &main_gpio1 22 0>, <5 0 &main_gpio1 23 0>, + <6 0 &main_gpio1 7 0>, <7 0 &main_gpio1 8 0>, + <8 0 &main_gpio1 14 0>, <9 0 &main_gpio1 13 0>, + <10 0 &main_gpio1 12 0>, <11 0 &main_gpio1 10 0>; + gpio-map-mask =3D <0xf 0x0>; + gpio-map-pass-thru =3D <0x0 0x1>; + }; + diff --git a/MAINTAINERS b/MAINTAINERS index 0a3d9e17295a..0cc27446b18a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15429,6 +15429,11 @@ M: Oliver Neukum S: Maintained F: drivers/usb/image/microtek.* =20 +MIKROBUS CONNECTOR +M: Ayush Singh +S: Maintained +F: Documentation/devicetree/bindings/connector/mikrobus-connector.yaml + MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT M: Luka Kovacic M: Luka Perkov --=20 2.46.0 From nobody Sat Nov 30 03:41:13 2024 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) (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 E0B0219E999 for ; Wed, 11 Sep 2024 14:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064896; cv=none; b=VnbJrNbNtIzydFfOlK6QFs4Hnuvlk07Mt20DXPTYkRwvJbJCt4U8naT0GJNShesRMaC5zpfP8SpSoXYsBIqBt2o3yd3r+LbHECIlydHmIFU298nldES8+IoXE1sEmEh94eQAVjsktEUtMjNEuhV0f0Z8YRKrM+0PMldd7M/YAsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064896; c=relaxed/simple; bh=aIC1K2aHkAKySeXczfO9TX+qUogWDRqxMHBmhbZrBWs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WCwgz/ZgTHgc1stiM5XSAaC/XBhzwBvd5oaYkyybay7CHXZsHT5kAPkFiucxOBQM02B+6l3s+bN5Nvej3kSvqyU3pw26aWCaTgP4MiIUaRjIaDxYqFZg0v0ZZDnxumNAMGuH/UDaNye2Pmy2E6jJW4wDOp3M05l1lqvnisKAc0s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=qaU6KKEV; arc=none smtp.client-ip=209.85.215.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="qaU6KKEV" Received: by mail-pg1-f194.google.com with SMTP id 41be03b00d2f7-7d4f8a1626cso5372898a12.3 for ; Wed, 11 Sep 2024 07:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064894; x=1726669694; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=oJxb1Dd/nqjN3jOGEzjCvMjgouASIZ/qDf2nqdmTCpQ=; b=qaU6KKEV3gORa25JaQg99csgvb85OgGk/ntEVTML+L6tTpn+hsPsfItlR1/5+mpW69 ty6IWbfoCkf3XoBVxjks8XoDsB6M/O1RlRZJD+J+fewMxevUTiUB+JjNnDovQJ+hF2qm awFR4JNxTqD7uN1CHJXOVbUiq0ZA98WAqsYYEj/kpMIkRCtxANnwBFVfkxfTCh2utkhY JOhwLl7CjBFJvj4u7jB2M5NxcT6q4fkyMzL7JoKoguhJs4EbuFT22Hb2xtnlmi/hd/Gq aenhfO/oiNfACPVFr6K5iA688iwqBfQWUR7VRnR9W3ruFlreoV2pY7Dc8XWIvQ4eXgoY 6VKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064894; x=1726669694; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oJxb1Dd/nqjN3jOGEzjCvMjgouASIZ/qDf2nqdmTCpQ=; b=J9AOMdB0CjB1ZVsw5/PeoxzI88xzpQQlBQYgtk3oR8XaZ/bSOv3Vc6UHlAaqcQ88oR cZfZHBGeb6/5A833ftjAKABiBQTjv7EpKjMVuquNsa17w3iqp2YP7NSACNHudCnEBMvf tT5kHMdi0cgA9SWoT20QSL2OwjKlp599ODdz6rqcQC0SS7Q7xO+r/hQMs3obW2sTaqQs EW3u3hBqIb4EHk1jPJ7hBhdwcqG3Eu58/AJ8NJZqHdd/eTucIKyYTdzkVtELh0BxACL6 6PvezJlp+69xwOcWk2Qv7GjqkFu4krvSvyko7TaeFjWqlDKwyTPMZ0/V2dlBVXn0przT rNHA== X-Gm-Message-State: AOJu0Yy4zCZayixJt2AgqkC8lZn6n6O7ByZWMiBicaGh4rIKswFTUwz8 DSIcp0xcdvEIkN0WrF1QFj1qGx0pPk3Hvuk/lOY1WDyQqZbMnfkSrVeyFaLUaA== X-Google-Smtp-Source: AGHT+IHE/LplC/CkwydHVCAYEN6XSx/BzJK9oOj9hYZByiPJ0HRu5OTmb9W9Vhmyyzp/B1ZaF4eEjQ== X-Received: by 2002:a05:6a21:2d84:b0:1cf:506f:9d3a with SMTP id adf61e73a8af0-1cf5e1d0c8fmr6113767637.46.1726064893948; Wed, 11 Sep 2024 07:28:13 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:28:13 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:20 +0530 Subject: [PATCH 3/8] mikrobus: Add mikrobus driver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240911-mikrobus-dt-v1-3-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3469; i=ayush@beagleboard.org; h=from:subject:message-id; bh=aIC1K2aHkAKySeXczfO9TX+qUogWDRqxMHBmhbZrBWs=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajWa7wjGCZ2pwHW97n8mcSyzAy8uGIDEWwCe PlMnb28cjuJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1gAKCRAFzvXHieVa dGtwD/wK0GDxUstHZk9/X3B2dO3mcSFAHK2I87pzLlM/z9OLe1Oh9Bvxa7pIm/b34irjEaCKPZB 0weGY8nzbMXoshz0VVrhsDP2cgDhQ2+jnn5bhrLdW5fSpjwmncQCiE6SY9UhC7+YSPotD0/Wgvu oe91TYvLZ7hBpbJceOOXCCnQI5bLGsuO1wVGXUmnXLdhfA/7/+Uaa7LG2uiHpziq2blWQLxgWpe NfNfzXIBZ6WxeyIG7es4PMSHV7cNxOeAqvI+N451kdxz4/0lXFQeTP6tuSxiL0GbFC/TUSFchas 3w7XuaEgSQebABxomUtx67jw9V3TRhg31f2Vwp2yr9SaGyL7dzhFQnpy78D0KNitbhicVlpCvxP 4OpAqS+KDs1+6McuHpMavxF1XIoctnOuBgUi4Vd0oIwhxMQkS6EOnbHuhNVo6Mul2A5LW47SVIt 3BC/4tbB/+pglWxsY9H5XkYmU4cAsFp3f5Wk7XbgQLUj0RrkOParX2gY3Yd8Bi/QlsH9lgKE9jr 7Iun31RsKGi/Fv6/yrUUZpIeGjUvzRVXkG0qqCEYpW3wqT5+VkVb6lF6XEhP3zyFxg/VGA995sP +byFalejshGQE4aYErw2Owqwah7UzhA0cTC0TOq9Pk5yK+uve4o2yqDNAdK9Eo30G60g968rdY4 sniJ3PiTe5qhtUg== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 A simple platform driver for now that does nothing. This is required because without a platform driver, the mikrobus_gpio0 nexus node cannot be used. In future, this driver will also allow for dynamic board detection using 1-wire eeprom in new mikrobus boards. Signed-off-by: Ayush Singh --- MAINTAINERS | 1 + drivers/misc/Kconfig | 17 +++++++++++++++++ drivers/misc/Makefile | 1 + drivers/misc/mikrobus.rs | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0cc27446b18a..d0c18bd7b558 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15433,6 +15433,7 @@ MIKROBUS CONNECTOR M: Ayush Singh S: Maintained F: Documentation/devicetree/bindings/connector/mikrobus-connector.yaml +F: drivers/misc/mikrobus.rs =20 MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT M: Luka Kovacic diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 3fe7e2a9bd29..30defb522e98 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -610,6 +610,23 @@ config MARVELL_CN10K_DPI To compile this driver as a module, choose M here: the module will be called mrvl_cn10k_dpi. =20 +menuconfig MIKROBUS + tristate "Module for instantiating devices on mikroBUS ports" + help + This option enables the mikroBUS driver. mikroBUS is an add-on + board socket standard that offers maximum expandability with + the smallest number of pins. The mikroBUS driver instantiates + devices on a mikroBUS port described by identifying data present + in an add-on board resident EEPROM, more details on the mikroBUS + driver support and discussion can be found in this eLinux wiki : + elinux.org/Mikrobus + + + Say Y here to enable support for this driver. + + To compile this code as a module, chose M here: the module + will be called mikrobus.ko + source "drivers/misc/c2port/Kconfig" source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index a9f94525e181..86ea188e3cf9 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -72,3 +72,4 @@ obj-$(CONFIG_TPS6594_PFSM) +=3D tps6594-pfsm.o obj-$(CONFIG_NSM) +=3D nsm.o obj-$(CONFIG_MARVELL_CN10K_DPI) +=3D mrvl_cn10k_dpi.o obj-y +=3D keba/ +obj-$(CONFIG_MIKROBUS) +=3D mikrobus.o diff --git a/drivers/misc/mikrobus.rs b/drivers/misc/mikrobus.rs new file mode 100644 index 000000000000..a52268efd71b --- /dev/null +++ b/drivers/misc/mikrobus.rs @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0 + +//! MikroBUS driver + +use kernel::c_str; +use kernel::platform::{self, DeviceId}; +use kernel::prelude::*; + +kernel::module_platform_driver! { + driver: MikrobusDriver, + of_table: [DeviceId::new(c_str!("mikrobus-connector"))], + name: "mikrobus", + author: "Ayush Singh ", + description: "MikroBUS connector Driver", + license: "GPL", +} + +struct MikrobusDriver; + +#[vtable] +impl platform::Driver for MikrobusDriver { + const NAME: &'static CStr =3D c_str!("MikroBUS"); + + fn probe(_dev: &mut platform::Device) -> Result { + pr_debug!("Mikrobus Driver (probe)\n"); + Ok(()) + } + + fn remove(_dev: &mut platform::Device) { + pr_debug!("Mikrobus Driver (remove)\n"); + } +} --=20 2.46.0 From nobody Sat Nov 30 03:41:13 2024 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (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 8B60C19F104 for ; Wed, 11 Sep 2024 14:28:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064906; cv=none; b=p6wAuTJ4co0wU5cohbreynWIjkzw7qUf/SWXalRlKpWAUx/yGwEQ/uH9DJ0VJ3etsmjVTC+OV/brn9C0Vopel9xaXAux/OeRlbmtNZxYwYw7QROJLcSd0rERxCCobonddbh1M9PZjV9EX/xxt4/OSKDsnxEKC4mmyHrr7lsKhGo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064906; c=relaxed/simple; bh=HWiHF2WJQe2aKVEi4bYz2zUblPTZngMcMUJTSZsaE0Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mub7IlRMtEtYhNHgAVN/B52jT0ej7HcRZli0WSS2K4yn4TZrzXmHCi3eLF+rwyhUEgmIhj/v5B0a8PWNAMoqY2XEzSi5KTv/76woD2sY1jlw5jP1xC2pzr6DAuUJobC2twSIVgUYzTnKW4zy9+DrWwsPk5qAhfONjoV5sN4SFr0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=vn0v9lkK; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="vn0v9lkK" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-6bce380eb96so4178525a12.0 for ; Wed, 11 Sep 2024 07:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064904; x=1726669704; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=A/s/yZ/fu2RctQDsUCSBTBJSbx0ktmemPNhPcRZ3o84=; b=vn0v9lkKxmnPgdwpQBYwQXDtO8Vk54POEe75A0+cDkVKqpdDLSGjSVq5IfC/5OeRga 5arMILcAp7xZcO7dZ+kPyNS/mqz6ShmzqXUcZIU7bEF6b/LCLrQNcO6xaN9BeGPLtS/S VU3Ny/ojEvBIO7/1UQgehK9A7h5+KsLAtNlJc8RLHslIEZmVjY0hSLDFb5XWYQ2pfTPC HGfaJz4Vo3SnAoR1mQwgU/Kslr6yC6AeBoJvndvBotV78cO82QoTMnYOK3Evy1TFDPZ8 koJQFv/XiQ0IcA+CDgIEZiadepThPP/94hPaFC+GSsrgVQAEBC/5eI7Ol6qCvIUoPwkA hNEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064904; x=1726669704; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A/s/yZ/fu2RctQDsUCSBTBJSbx0ktmemPNhPcRZ3o84=; b=gTOx1VUjrys7WEc64RDRKhMtmHf1cyjujMux9vMSs3wwt9giDee2dPwqZWgujEJqwG 2w4G3UB0/z+NusKgdOriL2jJdFiD0AME8YuqHEtWzUskPe/WTykaLGmNhAOAogl8BJNO pc4LrHx69pGOdr/PUIJa9Fqe37VH9ugoXSp3vmZpBv7MvoeT5q/rN6n8evO+7hGzERMG djcwbCA4isUVr4BuJ9Do9BjpUIj2mSKA0nc/okPa3nvgvQhJ5QfSK/PUsKqW3sheBE2c XWDUTS7m/Cf+lDNMht9rBJFCX/VXRSlnIqGfQaTB8zD/1pGRQOWgY/cQ7Sdm8XY1+BkL /HCA== X-Gm-Message-State: AOJu0YwqvKeukCAm2F9tFgIEaz8Wvk1pMGPBEwMBadh+f50NDR6HPdQB BWiUim9FO8QVGW5SIVYM4Reys3v1H61/OE30x83iPSrY0QWemX9IpedRc3pp4nSiIpnPK6TKjoG VOA== X-Google-Smtp-Source: AGHT+IHqbcVmiVTlA06ObWdR+F5XvbTWf7muQ3N8Ww5HkEnHAHU/xiG/nzHYw5l3NU9MDeCyRLMFog== X-Received: by 2002:a05:6a21:392:b0:1cf:5b31:313a with SMTP id adf61e73a8af0-1cf5e0307abmr6964576637.1.1726064903886; Wed, 11 Sep 2024 07:28:23 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:28:23 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:21 +0530 Subject: [PATCH 4/8] dts: ti: k3-am625-beagleplay: Enable mikroBUS connector Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240911-mikrobus-dt-v1-4-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3276; i=ayush@beagleboard.org; h=from:subject:message-id; bh=HWiHF2WJQe2aKVEi4bYz2zUblPTZngMcMUJTSZsaE0Q=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajWkpgjyK7LlSpg2LopLy7iLx8obVKJNlLKZ dqK5lpf5bCJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1gAKCRAFzvXHieVa dArQD/0cse1NKul+tL5kOruOFAWZtNGBnbuu+u6HIMhf3idPcHz4n+624u4dth5lMwH+LVbonM9 MKxD0IofozpkpcwyrQc4DZmNfBChTUC+jZnLLX/x2o7exEzKztzjdRQjsgZ4IyRcQWjQgPs2NSY zCKDpadPvWuglY0yebGCXcbnKOw7K8wA2wdYRkCW+NpD9CVakgLJM/NUg05GEpf7or5Ib7iUyf5 KCO+F68jDmUydpfuHgBV1+KfQFWITIHGIXjZcFTGvbA9jUDZ5A7m+kGian3NjLe26nydRlEVz1t pRwNNiS2ntjL5KkUsEYixV0njFr+Fw//KUifbsahi+pqTd4lekZUgJd9P9zep1oWJuDJwERr+zJ 5iSMCIPd0JE/eW95LMlv3FFxuKae+ve4E2yvNQnV9i0MJNWCzrZ8fmXjRxDyImBN8xPo2SvUNzi bIEhmNg45+aepELQJlpPFV91NebGxPhRDmJLyYL/OqtqHySSIC7RWuToNfwQgr51YtwIyooPi8e 4ZLXaoTyc6OLH0qExlcQtKV4i7CdchkszcBpe2vLSHksT80h+kqYQFNoEvbMFzL1WMcK5Q52XQs uM/dUEsgIojcEUmRYvxV2xDd43+qrG3coLEITTl8zM3Xrcx5lMqijI5WU/God4DqY4Oy6t7mfkw fZS+H0hdlS2SjJg== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 Add mikroBUS connector support for Beagleplay. Acts as a nexus node for gpios. Allows defining GPIOS relative to the connector. The pin numbering is as follows: 0: PWM 1: INT 2: RX 3: TX 4: SCL 5: SDA 6: MOSI 7: MISO 8: SCK 9: CS 10: RST 11: AN Signed-off-by: Ayush Singh --- arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts | 53 ++++++++++++++++++++++= +--- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts b/arch/arm64/bo= ot/dts/ti/k3-am625-beagleplay.dts index 70de288d728e..628bcfcc4651 100644 --- a/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts +++ b/arch/arm64/boot/dts/ti/k3-am625-beagleplay.dts @@ -227,6 +227,21 @@ simple-audio-card,codec { }; }; =20 + mikrobus_connector0: mikrobus-connector0 { + status =3D "disabled"; + compatible =3D "mikrobus-connector"; + + #gpio-cells =3D <2>; + gpio-map =3D + <0 0 &main_gpio1 11 0>, <1 0 &main_gpio1 9 0>, + <2 0 &main_gpio1 24 0>, <3 0 &main_gpio1 25 0>, + <4 0 &main_gpio1 22 0>, <5 0 &main_gpio1 23 0>, + <6 0 &main_gpio1 7 0>, <7 0 &main_gpio1 8 0>, + <8 0 &main_gpio1 14 0>, <9 0 &main_gpio1 13 0>, + <10 0 &main_gpio1 12 0>, <11 0 &main_gpio1 10 0>; + gpio-map-mask =3D <0xf 0x0>; + gpio-map-pass-thru =3D <0x0 0x1>; + }; }; =20 &main_pmx0 { @@ -394,6 +409,25 @@ AM62X_IOPAD(0x01d4, PIN_INPUT_PULLUP, 2) /* (B15) UART= 0_RTSn.I2C3_SDA */ >; }; =20 + mikrobus_i2c_pins_gpio: mikrobus-i2c-gpio-pins { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x01d0, PIN_INPUT, 7) /* (A15) UART0_CTSn.GPIO1_22 */ + AM62X_IOPAD(0x01d4, PIN_INPUT, 7) /* (B15) UART0_RTSn.GPIO1_23 */ + >; + }; + + mikrobus_pwm_pins_default: mikrobus-pwm-default-pins { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x01a4, PIN_INPUT, 2) /* (B20) MCASP0_ACLKX.ECAP2_IN_APWM_O= UT */ + >; + }; + + mikrobus_pwm_pins_gpio: mikrobus-pwm-gpio-pins { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x01a4, PIN_INPUT, 7) /* (B20) MCASP0_ACLKX.GPIO1_11 */ + >; + }; + mikrobus_uart_pins_default: mikrobus-uart-default-pins { pinctrl-single,pins =3D < AM62X_IOPAD(0x01d8, PIN_INPUT, 1) /* (C15) MCAN0_TX.UART5_RXD */ @@ -401,6 +435,13 @@ AM62X_IOPAD(0x01dc, PIN_OUTPUT, 1) /* (E15) MCAN0_RX.U= ART5_TXD */ >; }; =20 + mikrobus_uart_pins_gpio: mikrobus-uart-gpio-pins { + pinctrl-single,pins =3D < + AM62X_IOPAD(0x01d8, PIN_INPUT, 7) /* (C15) MCAN0_TX.GPIO1_24 */ + AM62X_IOPAD(0x01dc, PIN_INPUT, 7) /* (E15) MCAN0_RX.GPIO1_25 */ + >; + }; + mikrobus_spi_pins_default: mikrobus-spi-default-pins { pinctrl-single,pins =3D < AM62X_IOPAD(0x01b0, PIN_INPUT, 1) /* (A20) MCASP0_ACLKR.SPI2_CLK */ @@ -804,10 +845,8 @@ it66121_out: endpoint { }; =20 &main_i2c3 { - pinctrl-names =3D "default"; - pinctrl-0 =3D <&mikrobus_i2c_pins_default>; clock-frequency =3D <400000>; - status =3D "okay"; + status =3D "disabled"; }; =20 &main_spi2 { @@ -876,9 +915,7 @@ &main_uart1 { }; =20 &main_uart5 { - pinctrl-names =3D "default"; - pinctrl-0 =3D <&mikrobus_uart_pins_default>; - status =3D "okay"; + status =3D "disabled"; }; =20 &main_uart6 { @@ -925,3 +962,7 @@ &mcasp1 { 0 0 0 0 >; }; + +&ecap2 { + status =3D "okay"; +}; --=20 2.46.0 From nobody Sat Nov 30 03:41:13 2024 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) (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 BABB519E965 for ; Wed, 11 Sep 2024 14:28:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064915; cv=none; b=lks79yOY3lPAGZb1+ZOF8opf9DyF0JycdKOeA2fY4suS9f6Ru+yxL5uP6n6SNYTGeH1ySW29Bkpyzus1OVOxAUqn5F0flCtpg4j38DvTELYKsoSpGH+dC6oc8jvmqgGdyORxAdNGcXB8UuJ0D1E/AYpcXhH1Id+PGCAH7rW0J0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064915; c=relaxed/simple; bh=IcBXeYkgbGJ84tFNH0R4kvTUzdaSViwAKRjIOvyTAgE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OHDrgGObmjNFl5G1ZErsUW40zarGDRi7KBC4Gm9XlDKmI/eWRZF3XFwKVW/0/M3WR6KlcsiAae1EuQ9DLfYf4h2lURNtBLoUW/9bpWIaQelEjHu/5yNAtAypkVXAmBI39vidZI73qeq6OdkA/0Fskp6pOQKl5LfeQXYKFqb4Hnk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=qt+D+nLo; arc=none smtp.client-ip=209.85.216.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="qt+D+nLo" Received: by mail-pj1-f68.google.com with SMTP id 98e67ed59e1d1-2d88c0f8e79so5376833a91.3 for ; Wed, 11 Sep 2024 07:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064913; x=1726669713; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JlMR806TYOVdOaLq5xGwhlKGdGKzP0R1k8RJuGsmWvQ=; b=qt+D+nLoFkmadQRrN+VcsumEieD2u4hbLa+bgbvMDEhird84e1iXhd72EXVZXKHSTs VCLurdI72FJXsAYzuuZ/Y+YbO3aQy0571LkW1CZJEwQPU+ySr23MO5cWfi/IYoFSiact Ixe6psINDPMbDzSqQ1xguu46oVO8sMWwSfzy15zYiAwiAtDrcNAVK2vHhyp9HLBtRV/k E1mD4QP36aVmunI01tKe1ZLQm8fHS7qD8qMDiZ33v3mo98GCpgSuzJHW/EO4znyKdEkk Glmwex6vYgSR1gyH9trpVwrJjCKx8CoBSiao8iz5eeFm+WqO7dz2B2b1ESCwKPmK4P1F 7I1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064913; x=1726669713; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JlMR806TYOVdOaLq5xGwhlKGdGKzP0R1k8RJuGsmWvQ=; b=t6qJfJy9OG4Krp/11D01f8pQ9fgLt4Frtt/rb8WwLsIYNwY8a2PcUa2CBi1ZBiuRkk xT9af1bQ55f/+LgFu0IJgBe6Es87XoB1y7B1R7s2tgJKZDhp8HDdFpJWTrGdYveFPapJ RQElwy7Qe2W8H5dh4SHQHQmHPeYIc7DSrMV1l9QzMHPnJtOQBUlNcPgS/3M8OYwVsOXf brfwB07HGXtkIt5LBGbT/qX3viY7s9NyUUckxyitU1N1EqvD2gsDUqJylRqR1kPZAooD sVjp6VMyCWVbo97953AbjdBX5a3yCqE4BTXhuG081C9CsfYfwKAHgKzOZ9yH2JrKXU3F tcjw== X-Gm-Message-State: AOJu0YwQ28VikE40LgA4hm4C7OxQ1JC0Rvlk/xuZ5v/N8DL+N3buE71B Nqf2dJudNY+HoMhBSC8Uh5nmY32K95/FncuMDviwFvZpvJN6P/iF3GJyDkQ29g== X-Google-Smtp-Source: AGHT+IHRrdqyQFRaRmsKjM6oktmwEYz8v7brNVgKFqMiIsYA0fFkZWGIxkp8KhBcAVk9BeIUsCTqIw== X-Received: by 2002:a17:90a:8a15:b0:2d8:99c4:3cd9 with SMTP id 98e67ed59e1d1-2dad4de1392mr20249725a91.3.1726064913104; Wed, 11 Sep 2024 07:28:33 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.28.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:28:32 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:22 +0530 Subject: [PATCH 5/8] dts: ti: beagleplay: Add mikrobus connector symbols Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240911-mikrobus-dt-v1-5-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3949; i=ayush@beagleboard.org; h=from:subject:message-id; bh=IcBXeYkgbGJ84tFNH0R4kvTUzdaSViwAKRjIOvyTAgE=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajWghgpKd00BK2WrYHEfO2v34WYsJS/sPbi3 Ri3U7ObHMGJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1gAKCRAFzvXHieVa dIdcD/4stLzHpCelSOc5jWiixqKiBrSIgY7aRw86NzyMO2AxyJUyY00HFjV8qPobGSydzuu24lW kUYGiYHiTLliPqp4yWG2+OrxVOA4NshkkMDZ3spo65xWAkzisKaD4PlGK/AsyFiBVF68VwKbCHt B9DukvzmiV5v5iGrZfrWgNLWuUFfexKp4m2PoBVxZLp2KTEF8xSbkyih/X5hNFkgHMritjVHpjo CDP12rRdn7Qu0JcRNRAxQtywDTQSbUU0TrHllh/C00M9Pxc8tCNRsHGpu7uTfwWkOYpAie/kQMX TqUVTk9Cbcp52BqzNGKZFZeU5l9FLTM3bf0PAqGtq6XzA/rnPbyGorUfUX92bagqz81TnilSLil zh8f04hJlO755Nm1H5OyJd5DEfVv+M5Y3hqDz7DzC27WD3GWHWd+JoPqOz8/fM6goS/b/GqLEV1 euVT7nF5iQqmd8hc8fFxWTjfRCpwPOp3W6zaryE67FMESzrOBOTRMYMVWLMdD7rneobzFOcJ90I 3v+Mk7cdxbDbfokJ5VEfiH/9HjL8cOSQgWDeBC1fdlKKPftFR2q4QWNPhMXLq5KkKJEJW4XC0q8 G895xHNXsA3yI7mGnLAD7uesXYMrQJlA3KStcRO3KhTfFXXgSH5J6IskouY7ncg8mtPN30rxPzG AYsAQ2R/6InpZ7A== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 - I2C, UART, PWM symbols - MIKROBUS_GPIO defines a gpio-controller that defines the pins in the following order: 0: PWM 1: INT 2: RX 3: TX 4: SCL 5: SDA 6: MOSI 7: MISO 8: SCK 9: CS 10: RST 11: AN - PWM should always use channel 0. Use nexus node for routing Signed-off-by: Ayush Singh --- MAINTAINERS | 1 + arch/arm64/boot/dts/ti/Makefile | 1 + .../k3-am625-beagleplay-mikrobus-connector0.dtso | 49 ++++++++++++++++++= ++++ 3 files changed, 51 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d0c18bd7b558..95f228c85a40 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15432,6 +15432,7 @@ F: drivers/usb/image/microtek.* MIKROBUS CONNECTOR M: Ayush Singh S: Maintained +F: arch/arm64/boot/dts/ti/k3-am625-beagleplay-mikrobus-connector0.dtso F: Documentation/devicetree/bindings/connector/mikrobus-connector.yaml F: drivers/misc/mikrobus.rs =20 diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makef= ile index bcd392c3206e..c628954a357b 100644 --- a/arch/arm64/boot/dts/ti/Makefile +++ b/arch/arm64/boot/dts/ti/Makefile @@ -12,6 +12,7 @@ dtb-$(CONFIG_ARCH_K3) +=3D k3-am625-beagleplay.dtb dtb-$(CONFIG_ARCH_K3) +=3D k3-am625-beagleplay-csi2-ov5640.dtbo dtb-$(CONFIG_ARCH_K3) +=3D k3-am625-beagleplay-csi2-tevi-ov5640.dtbo +dtb-$(CONFIG_ARCH_K3) +=3D k3-am625-beagleplay-mikrobus-connector0.dtbo dtb-$(CONFIG_ARCH_K3) +=3D k3-am625-phyboard-lyra-rdk.dtb dtb-$(CONFIG_ARCH_K3) +=3D k3-am625-sk.dtb dtb-$(CONFIG_ARCH_K3) +=3D k3-am625-verdin-nonwifi-dahlia.dtb diff --git a/arch/arm64/boot/dts/ti/k3-am625-beagleplay-mikrobus-connector0= .dtso b/arch/arm64/boot/dts/ti/k3-am625-beagleplay-mikrobus-connector0.dtso new file mode 100644 index 000000000000..81d370249f64 --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am625-beagleplay-mikrobus-connector0.dtso @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/** + * MikroBUS Overlay for BeaglePlay MikroBUS Connector 0 + * + * Copyright (C) 2024 Ayush Singh + */ + +/dts-v1/; +/plugin/; + +&{/} { + __symbols__ { + MIKROBUS_CONNECTOR =3D "/mikrobus-connector0"; + + /* GPIO controller for all pins */ + MIKROBUS_ALL_GPIO =3D "/mikrobus-connector0"; + + /* MikroBUS connector 0 SCL Pin options */ + MIKROBUS_SCL_MUX_I2C_SCL =3D "/bus@f0000/pinctrl@f4000/mikrobus-i2c-defa= ult-pins"; + MIKROBUS_SCL_MUX_DIGITAL =3D "/bus@f0000/pinctrl@f4000/mikrobus-i2c-gpio= -pins"; + + /* MikroBUS connector 0 SDA Pin options */ + MIKROBUS_SDA_MUX_I2C_SDA =3D "/bus@f0000/pinctrl@f4000/mikrobus-i2c-defa= ult-pins"; + MIKROBUS_SDA_MUX_DIGITAL =3D "/bus@f0000/pinctrl@f4000/mikrobus-i2c-gpio= -pins"; + + /* MikroBUS connector 0 UART_TX Pin options */ + MIKROBUS_TX_MUX_UART_TX =3D "/bus@f0000/pinctrl@f4000/mikrobus-uart-defa= ult-pins"; + MIKROBUS_TX_MUX_DIGITAL =3D "/bus@f0000/pinctrl@f4000/mikrobus-uart-gpio= -pins"; + + /* MikroBUS connector 0 UART_RX Pin options */ + MIKROBUS_RX_MUX_UART_RX =3D "/bus@f0000/pinctrl@f4000/mikrobus-uart-defa= ult-pins"; + MIKROBUS_RX_MUX_DIGITAL =3D "/bus@f0000/pinctrl@f4000/mikrobus-uart-gpio= -pins"; + + /* MikroBUS connector 0 PWM Pin options */ + MIKROBUS_PWM_MUX_PWM =3D "/bus@f0000/pinctrl@f4000/mikrobus-pwm-default-= pins"; + MIKROBUS_PWM_MUX_DIGITAL =3D "/bus@f0000/pinctrl@f4000/mikrobus-pwm-gpio= -pins"; + + /* MikroBUS connector 0 uses main_i2c3 for I2C on BeaglePlay */ + MIKROBUS_SCL_I2C =3D "/bus@f0000/i2c@20030000"; + MIKROBUS_SDA_I2C =3D "/bus@f0000/i2c@20030000"; + + /* MikroBUS connector 0 uses main_uart5 for UART on BeaglePlay */ + MIKROBUS_TX_UART =3D "/bus@f0000/serial@2850000"; + MIKROBUS_RX_UART =3D "/bus@f0000/serial@2850000"; + + /* MikroBUS connector 0 uses ecap2 for PWM on BeaglePlay */ + MIKROBUS_PWM_PWM =3D "/bus@f0000/pwm@23120000"; + }; +}; --=20 2.46.0 From nobody Sat Nov 30 03:41:13 2024 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) (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 985D019E965 for ; Wed, 11 Sep 2024 14:28:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064925; cv=none; b=cp1qSmOseovkym8JNrbSxFRlYWI6eVz+RByws6Sxf99sH0zOfX+Ap76Yg1/eWFo5VAMrxDa7XOgCbO69huHDQ2rTEpnejnLNs5rvvFV6sa7ht7b42CwPuNiVvzaPGazE0b0csYhpibz/Z42A6CHrw4Anq/D2KXQqCWDV2tLohgM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064925; c=relaxed/simple; bh=fvn5dpE2XyvTj0U03uUcIoDMSvkgRzCWJgdVKHBGt+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ChyOxQDyGtRbpj8IX5LkNxkwaqjp7lF7UxP7B9tyaeBXMm8s6Z5dV8ugoh10QEOLEUStXKobdbY/rkQx7wFkHQNn7NGso8w0guvoXdcFVkynR8lyZK+YMPseH7y4phUPDrGtNAIJxbrSrVZxKCIDtJ47IeQJw2JjlD6rMGi6DJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=XDETgUYE; arc=none smtp.client-ip=209.85.216.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="XDETgUYE" Received: by mail-pj1-f68.google.com with SMTP id 98e67ed59e1d1-2d8815ef6d2so1556115a91.0 for ; Wed, 11 Sep 2024 07:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064923; x=1726669723; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=OTZXIs4uk1Xc7bmq3sRcTypL0+dX/QazKSXr67dxE0M=; b=XDETgUYEHXcYpoWVkeummhH3hmtGzz/b5qNY1y62RnPqzHCTQhHQGelTLOT7zgXNN5 gyVdfkcoa+A11xpfX8rSHmzpOhusFrsBZ2FHBhW0Ib1FkH4pkjwjyoyZ7QwwpNUzmgcC XKAJ2Uvm60WbBHC8lc1B7HyImskkZ1e+056kQbprQjMzlV7VCVEcELVWOS7ROQLofJi+ 9qO6+m2q5MIQy5XfSvlXl3zKEi3bpFfYExWPNocx+eOHiuoh6D4t2SmnVDfaEGrIGXMW 7DZ29BVEd/YqCJx/FPR7uaKCDRxfC5mly6mMQBu5AvSiW1UjO3Vg/KF8cfDygrUFNML8 2RPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064923; x=1726669723; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OTZXIs4uk1Xc7bmq3sRcTypL0+dX/QazKSXr67dxE0M=; b=H4KXJ6bnAtjq2yVbrreQnLwtyStP7aQZuhmrYuNjqpWIAwTcpkBLNPmX+fdNdkbBaV aJHTK6UIUJLFiB+qrSxeSu3XwJGQUQGOi+wQGn65GP6QUTK9YT3x8+gkZzA3kuJ08y/n CfPo7QdTlT70eHWajTMjaxRnphl8NinGt8Ypk5205/wM7MYsIAevezf7iTF38IPRoe4V lc2Aur3DQAEsz/QEi6U2uaGjKO8g0EAT1F+sdRqC3UfrI4LS6574wZLmkovESMv8l8my PqMbiM5kAqzUqqiOu1xsS6YJ+DrXd9QZUQ3oE0atT5cc4F0jQglZ10F8YvbTOpyITnHr xSjA== X-Gm-Message-State: AOJu0YzmLXl69BtLmssaAZXurG6rbAtzjG8eaRloLt6m0ELZEQ8/kygr Wjr7Fh8JMB1wCKrf7kjROfFmZiJB22IiLVFbnRpVeyS/tAlbxHl0jblsIE4Jx3YaCHs3j6eHDyr 4zELu X-Google-Smtp-Source: AGHT+IF++BogjcP4oyy+DBrKCYr5bb8gz+HUGRerT0bhZx+7Lc/6JJaHgIpOtNWMJNsPpzmw/R8LWA== X-Received: by 2002:a17:90b:1e4c:b0:2d8:d098:4f31 with SMTP id 98e67ed59e1d1-2db82fe9fd4mr3821301a91.17.1726064922953; Wed, 11 Sep 2024 07:28:42 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.28.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:28:42 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:23 +0530 Subject: [PATCH 6/8] addon_boards: Add addon_boards plumbing Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240911-mikrobus-dt-v1-6-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2645; i=ayush@beagleboard.org; h=from:subject:message-id; bh=fvn5dpE2XyvTj0U03uUcIoDMSvkgRzCWJgdVKHBGt+M=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajW3lj4TagmQ2l11Yz9eXm8I+My2lBntIytD qsFIZFBHp+JAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1gAKCRAFzvXHieVa dD7hD/9Dh5cX/zgWb0ImhB3R//a2DVBC9/xamAtVS4AbOSg5czQb4pQ71uEpoYwkMLI/76nQAwo IznhuYiB1NivpVD/r6xayr9afiar7AoVfMGwXxOL4qdxx1UvWeuhMu7RE1rW8su3VtxVqN162fS c0em/ySb2wnxpKh0Ku7yyDfZwk7tuQ0XIBA0ysPbyEuKZxXxcCmdVdITr5WPXhsuUmY88ISzjkX CZejxuAMldlcHCYX2MBKgHPJhsjMX5CCAYKjANMIhsRyYCC1FQRva3ZkzKJmt7Eo050MW7DEfgP 21m/nGriy3Ps0ru8+AQlcx+zcfytxjVyPRcS5Fn4Tk+6h94CdDEHG4ug6+enMWWYe4t7fCuZeqA 2NodmWtzcivV1QShnpfXjXUL8YgEvUjiDEm9qHRwar0hno3NQp2GjTZYha96Q2uFJPeRbOwnLv7 ze5KWxyoWD6kN9+kKnNWbrIQusdm1f8moFEEt7NGLd6VjqytwYf4yQgCuEcMiQqX33zxgfB54Ve YX4UelJTyCRCLp2C5uNWDyermCLf4HN0GgJgZayTIedZjWsqEBfYd8qg4SynbR+G8JkKasqS0N7 Cuf09oC6oJNSL/HoG0XHANtLJfpu24X2RxKwgIccIhYtel+ME1FZO1/mB5L3iKh/W32xgVXm96V I1eRlTEYdHwR6RA== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 A directory to store and build addon_board overlays like mikroBUS, Groove, etc. The overlays present here should be completely independent of the underlying connector. Signed-off-by: Ayush Singh --- Kbuild | 1 + Kconfig | 2 ++ MAINTAINERS | 1 + addon_boards/Kconfig | 16 ++++++++++++++++ addon_boards/Makefile | 3 +++ addon_boards/mikrobus/Makefile | 1 + 6 files changed, 24 insertions(+) diff --git a/Kbuild b/Kbuild index 464b34a08f51..9c897397f55f 100644 --- a/Kbuild +++ b/Kbuild @@ -97,3 +97,4 @@ obj-$(CONFIG_SAMPLES) +=3D samples/ obj-$(CONFIG_NET) +=3D net/ obj-y +=3D virt/ obj-y +=3D $(ARCH_DRIVERS) +obj-y +=3D addon_boards/ diff --git a/Kconfig b/Kconfig index 745bc773f567..49880d4e91e9 100644 --- a/Kconfig +++ b/Kconfig @@ -30,3 +30,5 @@ source "lib/Kconfig" source "lib/Kconfig.debug" =20 source "Documentation/Kconfig" + +source "addon_boards/Kconfig" diff --git a/MAINTAINERS b/MAINTAINERS index 95f228c85a40..8e2e0f8d16be 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15432,6 +15432,7 @@ F: drivers/usb/image/microtek.* MIKROBUS CONNECTOR M: Ayush Singh S: Maintained +F: addon_boards/mikrobus/*.dtso F: arch/arm64/boot/dts/ti/k3-am625-beagleplay-mikrobus-connector0.dtso F: Documentation/devicetree/bindings/connector/mikrobus-connector.yaml F: drivers/misc/mikrobus.rs diff --git a/addon_boards/Kconfig b/addon_boards/Kconfig new file mode 100644 index 000000000000..01766ab28848 --- /dev/null +++ b/addon_boards/Kconfig @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "Addon Board Overlays" + +config MIKROBUS_BOARD_OVERLAYS + bool "mikroBUS board overlays" + depends on OF_OVERLAY + depends on MIKROBUS + help + This option enables the mikroBUS addon board overlays. mikroBUS is an + add-on board socket standard that offers maximum expandability with + the smallest number of pins. + + Say Y here to enable overlays for MikroBUS addon boards. + +endmenu diff --git a/addon_boards/Makefile b/addon_boards/Makefile new file mode 100644 index 000000000000..38275c3ff4c1 --- /dev/null +++ b/addon_boards/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +subdir-$(CONFIG_MIKROBUS_BOARD_OVERLAYS) +=3D mikrobus diff --git a/addon_boards/mikrobus/Makefile b/addon_boards/mikrobus/Makefile new file mode 100644 index 000000000000..f66554cd5c45 --- /dev/null +++ b/addon_boards/mikrobus/Makefile @@ -0,0 +1 @@ +# SPDX-License-Identifier: GPL-2.0 --=20 2.46.0 From nobody Sat Nov 30 03:41:13 2024 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) (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 3C3091A38F0 for ; Wed, 11 Sep 2024 14:28:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064934; cv=none; b=ihv79zHrUrml4VV3EMz5nqEH1ffyjxqnQ9d7j8b6+kHtT/VuylphDh7cCUsPFDhG1kPB84tGDi239w49KO8dLRBehcg1sqvpZLfiR7+tWsxW8qrpMGROf5TuNm014Wkjm9vyZR7xMbJDZ5qN3R3bxID9XVJeYxb8Kp8ObNjKDkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064934; c=relaxed/simple; bh=6ykOJfpeTHedYDARjIqLwnX8MngyM5nQD4/lHx8a04o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PUCLkWKNHS8xPgarYbOHj6x5SLPfNuHVLW3MrH2A6qcBaKeX32QSwhjT00dRSBqYkym9jWowI29+pknpJIYf03Ejn11pCxw6zH42ylAf0xaFKIeyqtclGeVmsl/elCMDtHhsd2ID2gp0r+AcybvWNtCqYXE+FWFevo507bUOgcQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=j8yIS7IQ; arc=none smtp.client-ip=209.85.216.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="j8yIS7IQ" Received: by mail-pj1-f66.google.com with SMTP id 98e67ed59e1d1-2d8fa2ca5b1so4993866a91.3 for ; Wed, 11 Sep 2024 07:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064932; x=1726669732; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bUJux209baesVSAFFfQq0X1RKUEyIgNPRXttfQkrVp4=; b=j8yIS7IQ0toma1FJP9a/+UsYGF4x2LHB2tK2jz/KFTkvI+KjynPkaQeIRoUEyeHoTE m5EsDWffw4HhCuyQKWttqy2q+mmNYaR+wONzkSfeE5r/OuqmXkUaPBud3Ns4UpddFI8d kpM0HL2in+/+CTOo1lL8mCSD3VBCfCT7/dQifl1eOW7bfrJ4A9DQEYsER3LnKOyCsHEE CS4hY/ctO3APP25Dn0bm1i7lsH6Yaj0kfbjPp3PHklmxpWTTdgXczZ4Y+geM9y+9wnIr 3eDX5oUpRppN936DPbSARxT/V3tBJkJEmjj4qNYhq2DpDqm3DKNvGDrUSh7CfF0S0a4c IxjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064932; x=1726669732; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bUJux209baesVSAFFfQq0X1RKUEyIgNPRXttfQkrVp4=; b=jDl7LsZ0tvRYUQYg6qk8fPsmPJbdvEgIOPkdMC/Kf8uL2Fr1hfiTkHE4tFamF1qZWw VrzFQMaI7xYKKjdYlypZfp8Ln27rvTIOceeHvz89sgRaX2umA4/TpGaW4yoa8ckfVXxM bcPruRzoQP6qECxU/QFODIa9tEdTZdlGDmFe/f4+vUb6zlJThhLm2LwYdQFrykJouBy9 e5uXJc3b73ZWsPzAAk+pULPwlpbe3pP51dDMhgOHYavQ9m58sf8aOlIuUxIFYVR6+rml grXqEuOhayQ/YHvU7ZdDsx2HDJGVyaDnVRnB/19AuhCmUZSf8FBrcNWG0jlOF+9A5kFX aoEQ== X-Gm-Message-State: AOJu0YxV2O3b9VoxH2si457gKWEp7RIpPsk8NnzugTDeC3rxNgrlMlRY VPGm1V2JlxiSl1TQs3qvPxiJFF/BK87cFVQMtRlYMRTgDb+7Hq7Bw7xfFLHPFA== X-Google-Smtp-Source: AGHT+IFVqR77ZETMOL3Ycph5fasQwi8N19Yt6tsRUByhDMgLOhcuLftvCvaT9AZPOu3f6sAF/CSzHQ== X-Received: by 2002:a17:90a:ee91:b0:2d8:7182:8704 with SMTP id 98e67ed59e1d1-2dad50cb7e9mr19402868a91.31.1726064932543; Wed, 11 Sep 2024 07:28:52 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:28:52 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:24 +0530 Subject: [PATCH 7/8] addon_boards: mikrobus: Add Weather Click Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240911-mikrobus-dt-v1-7-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1489; i=ayush@beagleboard.org; h=from:subject:message-id; bh=6ykOJfpeTHedYDARjIqLwnX8MngyM5nQD4/lHx8a04o=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajWFp0VSRIR7zV/zdAtrA/0zb8cZC/VMz1D0 h+qmzLqTbSJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1gAKCRAFzvXHieVa dHc+EADEx6fwsxyM8cZ/VtliN6O/gG4ACga6aqpNaebLkblrTWKjIQogsAXkI6nxDlnn7AjYw4R cSTPGP+e2cK+Lv7lkIEK43rZVjkUOlk5UM4cBNm6bX7MtX2JurOi8piKbuu0Nw84H85RwheosaU OS+PP1wSvk4idx7eFwY8Jot5gBEhpdJTNbpnrtQpRUb2z/j7MDa6Z7sVv5uiCPjvZolD9BUXhp/ mnWagHJGD1nYN9pQRARaZ2orDnEJmuXKgMahZLZec64kSfir9cVj2WbkEMdhgChs4Ii6syY3XdX KYcGu8jIhmeKtURXqIt8iI0sPggjGpwRdmXLAfW1O95wNYwITRmwZBA5oTMgrobnaJ1GXiNFg16 9SHsQEEqerVxJ1z2A7mvVDbBR/F6ewD37goj/kqn90Rx0tSF75nGzYY+9X9TBue6nn/O/GnYRQw xb4Iaat/s4YFTcEKSAkvN2o5bdy/AZkHnkF2AfvVFfpVbJPV0hKRmzPtms4J+I/F08c/yoVdxP1 besqOz7JBuWVAhwxEBZKi9iy2RgJSuSGwntPKsd7Ve1t/VI3cQ07DEMMFi8FbL8GTLvVmlggbXP wKXrDc8Xm9L8fq7EuABI7Ddk39zEowS9RBeKzUJvERkw3E49oUo5eGksxwXmh7SFOy26WvTHeqS QJ7SBrMKwv1vQjw== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 An I2C MikroBUS addon board containing BME280 sensor. The same board also optionally supports SPI. Hence the i2c suffix. Link: https://www.mikroe.com/weather-click Weather Click Signed-off-by: Ayush Singh --- addon_boards/mikrobus/Makefile | 2 ++ addon_boards/mikrobus/mikroe-5761-i2c.dtso | 28 ++++++++++++++++++++++++++= ++ 2 files changed, 30 insertions(+) diff --git a/addon_boards/mikrobus/Makefile b/addon_boards/mikrobus/Makefile index f66554cd5c45..4c7a68ea9504 100644 --- a/addon_boards/mikrobus/Makefile +++ b/addon_boards/mikrobus/Makefile @@ -1 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 + +dtb-y +=3D mikroe-5761-i2c.dtbo diff --git a/addon_boards/mikrobus/mikroe-5761-i2c.dtso b/addon_boards/mikr= obus/mikroe-5761-i2c.dtso new file mode 100644 index 000000000000..1111d3f7147f --- /dev/null +++ b/addon_boards/mikrobus/mikroe-5761-i2c.dtso @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/** + * MikroBUS - Weather Click I2C + * + * https://www.mikroe.com/weather-click + * + * Copyright (C) 2024 Ayush Singh + */ + +/dts-v1/; +/plugin/; + +&MIKROBUS_CONNECTOR { + status =3D "okay"; +}; + +&MIKROBUS_SCL_I2C { + status =3D "okay"; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&MIKROBUS_SDA_MUX_I2C_SDA>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + bme280@76 { + compatible =3D "bosch,bme280"; + reg =3D <0x76>; + }; +}; --=20 2.46.0 From nobody Sat Nov 30 03:41:13 2024 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) (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 3613219F122 for ; Wed, 11 Sep 2024 14:29:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064945; cv=none; b=Xtzit6wUkDR4KsdMz26Ze7q3My11SxQG1rbxHF/Q2eNrsgR/HsLBJkVX9GIbmh7qLjU8wpS+dH9tQQz5F43VAgGQLeKDEeRRng8jc2eDPqOb+qZALLPFeNdHjK4J/8M4IPRlpLMtwu8uDmYg31hArr2JwGEYmnKvb7aSambT8A0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726064945; c=relaxed/simple; bh=8QEuGIvQLbpjRaTFhH2ZFgvXVrDeGK7gSc8y+imv6Tg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MW+R0rdDPWxKh47XvkNAJCanWwv6x81t5Gop/zKiTAMqfWcrlulSZhjb8t4PF0opE56yILgSVkN9DmJZhXhe2qXNSPRRvzxqfrIGCXmr+gqOzRO2K5sxls92B9v2ofd9v4pdAfK6H7s3ZP/HxSTQRiy7sZ7rUztdHE8Znmvu5wQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=qjJPoobB; arc=none smtp.client-ip=209.85.216.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="qjJPoobB" Received: by mail-pj1-f67.google.com with SMTP id 98e67ed59e1d1-2d89dbb60bdso4597306a91.1 for ; Wed, 11 Sep 2024 07:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1726064942; x=1726669742; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=P5J0U9Nr2VJWT4UwLDZSs/klCxJAz9CderPyv0geGrk=; b=qjJPoobBsOwywpeei7kzIeKsEzkrEoNl2gNgSdPdYbQkoRK0efTx95jMT7MlWOcowN un7InA1eOsCMSAslLwJqcKhyOGMci8KvzR4GQhazcW7W30UuAWiVfugFIBOGmGPXwTmd UmZnhNyjKcIFce3GKJZZjuAKpuN8phRqIkEahZHgGFhTGebcw0e6Q+X+9kNmoOa6h+q5 IdEQQOIPfBIWShAeTAVpmt2pKj4m9LzfmC2Ug4vmP65Gnj8j5P+bEaxBAwUwymJ/4EV8 xkh5OVWqVjcCu3VbxDLU8WDi9AoSidA5g8PGfaqeNMjXj4YF1joL91/dj0YzcvTG3j8G ndzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726064942; x=1726669742; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P5J0U9Nr2VJWT4UwLDZSs/klCxJAz9CderPyv0geGrk=; b=raxWxXLOvcktSEj0u8jbvFzqfKiif0KZtzy3TPR13I03+aZ5uo4K2ZE4wR0tfAGSHg B/Tw64EjlfGUkzaefSc0Istpf/V3qBlqqORzYb3AckkW63wee3QBu5KHm3lj2oiVD30L H7b9/NMcgWHxMfGoDQ9zYlqNvhX4wVyQ8n/i2tJYlfEJ95ObheZyyCs4nrcZz7a4Jo55 QX+qyUf8eH9ONyA7Ceqq2MK+MkfhUg3zQIqmyuEj3U3B7CMX6AzoF+BtLj41Gb8KREAz uVQFqC90J1Rkr7XNgmKenTK7QDajUd/bGROpikWv69g9GYkWjOwi+LqcontwleMVzLky rfzg== X-Gm-Message-State: AOJu0YzVqcVH9OzfwnpXIlXoRL9zgZ11MtyS3ZeVuHQ/aRW7shYfxi5A zrkfsdcCaVjQrXQ41KT959uvaz4zK3Iv0QXZym92lJzpkjoLOMawQUdnTZ0B7Q== X-Google-Smtp-Source: AGHT+IFGDayOTdMe5/yDVHYyC7ZbsU8VPfRxdyEq2dpfA1fEpxwlc2wdxNYQ01Lri1PLU0mE/Fh6Jw== X-Received: by 2002:a17:90b:1187:b0:2c9:5ecd:e3c5 with SMTP id 98e67ed59e1d1-2daffd0bf4dmr18926938a91.33.1726064942586; Wed, 11 Sep 2024 07:29:02 -0700 (PDT) Received: from [172.16.118.100] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dadbfe46c9sm10639116a91.11.2024.09.11.07.28.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 07:29:02 -0700 (PDT) From: Ayush Singh Date: Wed, 11 Sep 2024 19:57:25 +0530 Subject: [PATCH 8/8] addon_boards: mikrobus: Add GPS3 Click Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240911-mikrobus-dt-v1-8-3ded4dc879e7@beagleboard.org> References: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> In-Reply-To: <20240911-mikrobus-dt-v1-0-3ded4dc879e7@beagleboard.org> To: fabien.parent@linaro.org, d-gole@ti.com, lorforlinux@beagleboard.org, jkridner@beagleboard.org, robertcnelson@beagleboard.org, Andrew Davis , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ayush Singh X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1426; i=ayush@beagleboard.org; h=from:subject:message-id; bh=8QEuGIvQLbpjRaTFhH2ZFgvXVrDeGK7gSc8y+imv6Tg=; b=owEBbQKS/ZANAwAIAQXO9ceJ5Vp0AcsmYgBm4ajWfF8HnWfBpRhubrg4fXSooUmChhIDDWBYX YkeSu2grEuJAjMEAAEIAB0WIQTfzBMe8k8tZW+lBNYFzvXHieVadAUCZuGo1gAKCRAFzvXHieVa dPDnD/9VKgXwMYmbYiNZDn0qIW01JVcxnkYswlcqt3J9IFXKxgf95CvBhUm2GOHf3upxhxWOrof PucLmzSRCO5K5GN/kNAKGNR2WUMe0p+fmhzC4tzgUZYfANMK9yVrwJSX0ot4UoqzPQGUFTSVeUy DFot/tuROMVehuPsXnJ6Ku/R/FYuVD8fpHuj3c2QLVnr852mqmt2eOrLNxiqsYFlYly4iAulXS0 AiyJXCLB/g6hPa/na+7Ko3HmDG7Bkkp8Uw0KMC2sQ/goQM0evweTnBoRl5ulz9ADgGJXfJxsaxW XidaFPyzj6z3HD4XKlxYGd2YbM6AJJSVVvbxiyvyoK+1O5/Im41irPY0tWtzaCqS3JPirTIN/ew ADTPsLbnFTYajl5eB+kfEEoQ151Gy0Ug6AcmsfPwpP9LzvrqSGoCnWUxFpGu1LwyRddrTD/d0iH ySln21m+xMwlWNt5EpvYk9Ds2ZBy5MfnGb7qCNaEZPQ1lpsNKU8U2PZimGlQOJqjHzWcg82t/i4 1LvwZh1Xj0KuSTfsVIbM00G1zmnZbFFuceiWNQ4sBtanORq+CAwQdZV/nKLgo+g97gEvmyQjfC3 s/5KC/kK6UecXIphGeKG8z9NYVLJM5CFhQhLQD5jo4i2PtNfwe6ixQbInLrIPEfdnxLKLxkavTg H6stu8WIX4LLbGA== X-Developer-Key: i=ayush@beagleboard.org; a=openpgp; fpr=DFCC131EF24F2D656FA504D605CEF5C789E55A74 - GPS3 Click is a UART MikroBUS addon Board Link: https://www.mikroe.com/gps-3-click Signed-off-by: Ayush Singh --- addon_boards/mikrobus/Makefile | 1 + addon_boards/mikrobus/mikroe-1714.dtso | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/addon_boards/mikrobus/Makefile b/addon_boards/mikrobus/Makefile index 4c7a68ea9504..e4b3d1aa7001 100644 --- a/addon_boards/mikrobus/Makefile +++ b/addon_boards/mikrobus/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 =20 dtb-y +=3D mikroe-5761-i2c.dtbo +dtb-y +=3D mikroe-1714.dtbo diff --git a/addon_boards/mikrobus/mikroe-1714.dtso b/addon_boards/mikrobus= /mikroe-1714.dtso new file mode 100644 index 000000000000..c8a0872ba954 --- /dev/null +++ b/addon_boards/mikrobus/mikroe-1714.dtso @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/** + * MikroBUS - Weather Click + * + * https://www.mikroe.com/weather-click + * + * Copyright (C) 2024 Ayush Singh + */ + +/dts-v1/; +/plugin/; + +#include + +&MIKROBUS_CONNECTOR { + status =3D "okay"; +}; + +&MIKROBUS_TX_UART { + status =3D "okay"; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&MIKROBUS_TX_MUX_UART_TX>; + + gnss { + compatible =3D "u-blox,neo-8"; + reset-gpios =3D <&MIKROBUS_ALL_GPIO 10 GPIO_ACTIVE_LOW>; + }; +}; --=20 2.46.0