I’ve always believed that sustainability begins at home—not just in how we recycle or conserve energy, but in the very structures we live in. For years, I dreamed of building a zero-waste neighborhood where every house functions like a living ecosystem: solar-powered, water-wise, and crowned with rooftop greenhouses that feed families and filter air. It wasn’t just architecture—it was my vision for a quieter, cleaner future. To make it real, I turned to Bitcoin. Not as a speculative bet, but as a long-term store of value aligned with my values—decentralized, transparent, and independent of broken systems. Over seven years, I poured savings, side income, and relentless discipline into building a $680,000 crypto portfolio. Every coin had a purpose: permits, materials, and community partnerships. My dream had a balance sheet. Then, in one exhausted, distracted moment, it all collapsed. It was November 2025. I was juggling contractor delays, city inspections, and endless design revisions. My nerves were frayed, my coffee pot never empty. When a “Ledger Live Update” notification popped up, I didn’t think twice. The interface looked identical—same logo, same layout. I entered my credentials… and within seconds, the app disappeared. My wallet balance dropped to zero. I sat frozen. My stomach dropped. All that work—years of sacrifice—gone in a blink. The days that followed were dark. I scoured forums, filed reports, and replayed my mistake on loop. Guilt ate at me. How could I have been so careless? My greenhouse renderings sat untouched. My dream felt like a cruel joke. Just when I was ready to walk away, I stumbled upon a newsletter about green innovation. Tucked between articles on carbon-neutral cities and next-gen solar panels was a short feature on *Digital Light Solution*—a specialized team that helps victims of crypto theft recover stolen assets. Skeptical but desperate, I reached out. What followed wasn’t magic—but it was close to it. Their team treated my case with urgency and compassion. They traced the transaction trail, identified the laundering path, and worked with exchanges to freeze what they could. Within weeks, they’d recovered a significant portion of my funds—enough to restart. Today, I’m not just rebuilding my portfolio—I’m breaking ground on my prototype greenhouse. And every beam, every pane of glass, carries the lesson I learned: that even in our most vulnerable moments, there’s still light to be found.
Email:support@digitallightsolution.com
Telegram ——digitallightsolution
website https://digitallightsolution.com/
WhatsApp https://wa.link/989vlf
Hi,
This patchset brings support for Silicon Labs' CPC protocol as transport
layer for Greybus. CPC stands for Co-Processor Communication and
currently exists as a userspace daemon [1] that enables multiple
applications on a coprocessor to share a single physical link to a Linux
host, using a protocol loosely based on HDLC [2].
While the userspace implementations serves its purpose, it has some
redundancies with Greybus that makes it not very suitable for kernel
integration as-is, and so the protocol has been modified to better fit
with Greybus. Even though kernel and userspace implementations share the
same name, they are not the same protocol and are not compatible. The
kernel integration with Greybus is intended to superseed the userspace
implementation.
CPC is introduced as a module that sits between Greybus and CPC Host
Device Drivers implementations, like SDIO or SPI. This patchset includes
SDIO as physical layer but the protocol is not final and might change,
it's mostly there to showcase all the elements.
+----------------------------------------------------+
| Greybus |
+----------------------------------------------------+
/|\
|
\|/
+----------------------------------------------------+
| CPC |
+----------------------------------------------------+
/|\ /|\ /|\
| | |
\|/ \|/ \|/
+----------+ +---------+ +-----------+
| SDIO | | SPI | | Others |
+----------+ +---------+ +-----------+
CPC implements some of the features of Unipro that Greybus relies upon,
like reliable transmission. CPC takes care of detecting transmission
errors and retransmit frames if necessary, but that feature is not part
of the RFC to keep it concise. There's also a flow-control
feature, preventing sending messages to already full cports.
In order to implement these features, a 4-byte header is prepended to
Greybus messages, making the whole header 12 bytes (Greybus header is 8
bytes).
This RFC starts by implementing a shim layer between physical bus
drivers (like SDIO and SPI) and Greybus, and progressively add more
elements to it to make it useful in its own right. Finally, an SDIO
driver is added to enable the communication with a remote device.
[1] https://github.com/SiliconLabs/cpc-daemon
[2] https://en.wikipedia.org/wiki/High-Level_Data_Link_Control
Changes in v3:
- addressed Jerome's review comments, mostly for SDIO driver
- rewrote cover letter and commit messages across the series
Changes in v2:
- addressed review comments and errors reported by kernel bot
- for SDIO driver, remove padding between headers and payloads when
aggregating packets together
Damien Riégel (13):
greybus: cpc: add minimal CPC Host Device infrastructure
greybus: cpc: introduce CPC cport structure
greybus: cpc: use socket buffers instead of gb_message in TX path
greybus: cpc: pack cport ID in Greybus header
greybus: cpc: switch RX path to socket buffers
greybus: cpc: introduce CPC header structure
greybus: cpc: account for CPC header size in RX and TX path
greybus: cpc: add and validate sequence numbers
greybus: cpc: acknowledge all incoming messages
greybus: cpc: use holding queue instead of sending out immediately
greybus: cpc: honour remote's RX window
greybus: cpc: let host device drivers dequeue TX frames
greybus: cpc: add private data pointer in CPC Host Device
Gabriel Beaulieu (1):
greybus: cpc: add CPC SDIO host driver
MAINTAINERS | 6 +
drivers/greybus/Kconfig | 2 +
drivers/greybus/Makefile | 2 +
drivers/greybus/cpc/Kconfig | 24 ++
drivers/greybus/cpc/Makefile | 9 +
drivers/greybus/cpc/cpc.h | 75 ++++++
drivers/greybus/cpc/cport.c | 112 ++++++++
drivers/greybus/cpc/header.c | 136 ++++++++++
drivers/greybus/cpc/header.h | 52 ++++
drivers/greybus/cpc/host.c | 319 ++++++++++++++++++++++
drivers/greybus/cpc/host.h | 63 +++++
drivers/greybus/cpc/protocol.c | 170 ++++++++++++
drivers/greybus/cpc/sdio.c | 480 +++++++++++++++++++++++++++++++++
13 files changed, 1450 insertions(+)
create mode 100644 drivers/greybus/cpc/Kconfig
create mode 100644 drivers/greybus/cpc/Makefile
create mode 100644 drivers/greybus/cpc/cpc.h
create mode 100644 drivers/greybus/cpc/cport.c
create mode 100644 drivers/greybus/cpc/header.c
create mode 100644 drivers/greybus/cpc/header.h
create mode 100644 drivers/greybus/cpc/host.c
create mode 100644 drivers/greybus/cpc/host.h
create mode 100644 drivers/greybus/cpc/protocol.c
create mode 100644 drivers/greybus/cpc/sdio.c
--
2.52.0
The Greybus specification defines the Vendor Specific bundle
class[1]. Using this class allows vendors to avoid defining a
custom generic class, simplifying driver development. Currently,
drivers can register to either match on a bundle class or a
Vendor & Product ID with `GREYBUS_CLASS` and `GREYBUS_DEVICE`
respectively.
However, when matching to a vendor specific driver, the current
implementation does not check the bundle's class. This has the
effect of matching the vendor specific driver to ANY bundle found
in the device's manifest, regardless of its class. This is
incorrect as only vendor class bundles should be considered.
For instance, a driver registered for `GREYBUS_DEVICE(0xCAFE, 0xBABE)`
would be matched to a Camera class bundle found on that device.
Instead, only a `GREYBUS_CLASS_VENDOR` class bundle should get
matched to the driver.
[1] https://github.com/projectara/greybus-spec/blob/149aa4a8f4422533475e0193ece…
Signed-off-by: Yacin Belmihoub-Martel <yacin.belmihoubmartel(a)gmail.com>
---
drivers/greybus/core.c | 12 ++++--------
include/linux/greybus.h | 10 +++-------
include/linux/greybus/greybus_id.h | 6 ------
3 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/drivers/greybus/core.c b/drivers/greybus/core.c
index 313eb65cf..4cd218d29 100644
--- a/drivers/greybus/core.c
+++ b/drivers/greybus/core.c
@@ -60,16 +60,12 @@ static int is_gb_svc(const struct device *dev)
static bool greybus_match_one_id(struct gb_bundle *bundle,
const struct greybus_bundle_id *id)
{
- if ((id->match_flags & GREYBUS_ID_MATCH_VENDOR) &&
- (id->vendor != bundle->intf->vendor_id))
+ if (id->class != bundle->class)
return false;
- if ((id->match_flags & GREYBUS_ID_MATCH_PRODUCT) &&
- (id->product != bundle->intf->product_id))
- return false;
-
- if ((id->match_flags & GREYBUS_ID_MATCH_CLASS) &&
- (id->class != bundle->class))
+ if ((id->class == GREYBUS_CLASS_VENDOR) &&
+ (id->vendor != bundle->intf->vendor_id ||
+ id->product != bundle->intf->product_id))
return false;
return true;
diff --git a/include/linux/greybus.h b/include/linux/greybus.h
index 4d58e27ce..1f1b3cb5c 100644
--- a/include/linux/greybus.h
+++ b/include/linux/greybus.h
@@ -37,18 +37,14 @@
#define GREYBUS_VERSION_MAJOR 0x00
#define GREYBUS_VERSION_MINOR 0x01
-#define GREYBUS_ID_MATCH_DEVICE \
- (GREYBUS_ID_MATCH_VENDOR | GREYBUS_ID_MATCH_PRODUCT)
+#define GREYBUS_DEVICE_CLASS(c) \
+ .class = (c),
#define GREYBUS_DEVICE(v, p) \
- .match_flags = GREYBUS_ID_MATCH_DEVICE, \
+ GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_VENDOR)\
.vendor = (v), \
.product = (p),
-#define GREYBUS_DEVICE_CLASS(c) \
- .match_flags = GREYBUS_ID_MATCH_CLASS, \
- .class = (c),
-
/* Maximum number of CPorts */
#define CPORT_ID_MAX 4095 /* UniPro max id is 4095 */
#define CPORT_ID_BAD U16_MAX
diff --git a/include/linux/greybus/greybus_id.h b/include/linux/greybus/greybus_id.h
index f4c844009..e33ed0061 100644
--- a/include/linux/greybus/greybus_id.h
+++ b/include/linux/greybus/greybus_id.h
@@ -11,7 +11,6 @@
struct greybus_bundle_id {
- __u16 match_flags;
__u32 vendor;
__u32 product;
__u8 class;
@@ -19,9 +18,4 @@ struct greybus_bundle_id {
kernel_ulong_t driver_info __aligned(sizeof(kernel_ulong_t));
};
-/* Used to match the greybus_bundle_id */
-#define GREYBUS_ID_MATCH_VENDOR BIT(0)
-#define GREYBUS_ID_MATCH_PRODUCT BIT(1)
-#define GREYBUS_ID_MATCH_CLASS BIT(2)
-
#endif /* __LINUX_GREYBUS_ID_H */
--
2.52.0
Replace sprintf() with sysfs_emit() in the protocol_id_show() sysfs
attribute function. This code is safe as-is, but replace
sprintf() with sysfs_emit() because we are trying to get rid of calls
to sprintf() as part of kernel hardening; sysfs_emit() is more
appropriate in this context.
Signed-off-by: Neel Bullywon <neelb2403(a)gmail.com>
---
This was compile-tested only (no VM/hardware used)
Changes in v2:
- Subject: change to imperative "Replace" (was "Replaced").
- Wording and line breaks adjusted in the commit body for clarity.
Changes in v3:
- Clarify what "safe" means (buffer is PAGE_SIZE) per Dan Carpenter's
suggestion.
- Reflow lines to avoid awkward breaks.
---
drivers/staging/greybus/gbphy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/greybus/gbphy.c b/drivers/staging/greybus/gbphy.c
index 60cf09a302a7..55f132b09cee 100644
--- a/drivers/staging/greybus/gbphy.c
+++ b/drivers/staging/greybus/gbphy.c
@@ -31,7 +31,7 @@ static ssize_t protocol_id_show(struct device *dev,
{
struct gbphy_device *gbphy_dev = to_gbphy_dev(dev);
- return sprintf(buf, "0x%02x\n", gbphy_dev->cport_desc->protocol_id);
+ return sysfs_emit(buf, "0x%02x\n", gbphy_dev->cport_desc->protocol_id);
}
static DEVICE_ATTR_RO(protocol_id);
base-commit: de0674d9bc69699c497477d45172493393ae9007
--
2.44.0