keyboard stuff
at master 171 lines 7.0 kB view raw view rendered
1# Proprietary Vendor Libraries 2 3QMK Firmware cannot include support for any proprietary vendor libraries that impose additional restrictions beyond those in the GPL. This includes binary-only distributions, hardware-locked libraries, and code with redistribution limitations. This document explains why such libraries are incompatible with the GPL-based QMK Firmware and addresses commonly proposed workarounds. 4 5## Architecture Constraints 6 7Firmware presents unique licensing challenges: 8 9- **Monolithic binary**: All code compiles into a single executable image 10- **No OS isolation**: No operating system provides process or memory separation 11- **Shared resources**: All code shares the same memory space, peripherals, and execution context 12- **Static linking**: Everything is statically linked at compile time 13 14This monolithic nature means any proprietary code becomes inseparable from GPL code, creating immediate license violations. 15 16## Common Vendor Library Restrictions 17 18Proprietary vendor libraries typically impose restrictions incompatible with GPL freedoms: 19 20**Hardware Lock-in:** 21- Library only licensed for specific vendor's chips 22- Cannot port firmware to alternative hardware 23- Examples: Nordic's and ST's chip-only clauses in their respective licenses 24 25**No Source Distribution:** 26- Binary-only libraries without corresponding source 27- Precompiled static libraries (.a/.lib files) 28- No ability to modify or fix bugs 29- Examples: WCH CH582 precompiled libraries, Nordic SoftDevice 30 31**Redistribution Limitations:** 32- Restrictions on who can distribute 33- Limitations on commercial use 34- Required permissions or fees 35 36**Additional Legal Terms:** 37- Patent assertions beyond GPL's scope 38- Indemnification requirements 39- Jurisdiction restrictions 40- Explicit anti-GPL clauses 41 42## Bluetooth Stack Licensing Examples 43 44Both Nordic and ST provide Bluetooth stacks under restrictive licenses: 45 46**Nordic SoftDevice (under Nordic 5-clause license):** 47- Binary-only Bluetooth/radio stack 48- License restricts to Nordic hardware 49- No source code available 50- Communicates via SVC interface (still not GPL-compatible) 51 52**ST's Bluetooth Stack (under SLA0044 license):** 53- Explicitly forbids being subject to "Open Source Terms", specifically mentioning incompatibility with the GPL 54- Restricted to ST microcontrollers only 55- Similar functional role to Nordic's SoftDevice 56 57Both represent the same fundamental problem: critical wireless functionality locked behind proprietary licenses. 58 59## Why the System Library Exception Doesn't Apply 60 61The GPL's System Library exception **cannot** rescue proprietary vendor libraries. 62 63### System Library Requirements 64 65The exception only covers libraries that: 661. Are part of the "normal form of packaging a Major Component" 672. The Major Component is an OS kernel, compiler, or similar system software 683. Are not distributed with the application 694. Are not part of the application itself 70 71### Why Vendor Libraries Fail These Requirements 72 731. **No operating system**: Bare-metal firmware has no OS to provide system libraries 742. **Not Major Components**: Hardware drivers and HALs aren't kernels or compilers 753. **Distributed together**: Vendor code becomes part of the firmware binary 764. **Application-level code**: Peripheral drivers are application functionality 77 78The exception covers things like Windows system DLLs or Linux glibc, not microcontroller vendor libraries or Bluetooth stacks. 79 80## Attempted Workarounds 81 82### Architectural Separation Attempts 83 84**Supervisor Call (SVC) Interfaces:** 85 86Nordic's SoftDevice uses supervisor call based APIs instead of direct linking: 87- Fixed memory regions for proprietary code 88- Communication through CPU exception mechanisms 89- Claims of "no linking" between components 90 91**Why this fails:** The GPL considers functional integration, not just linking methods. In Bluetooth-capable boards, these would require the proprietary component to function, thus they form a single work regardless of the communication mechanism. This applies equally to Nordic's SoftDevice and any similar architecture ST provides. 92 93**Binary-Only Distributions:** 94 95Multiple vendors provide precompiled libraries: 96- WCH: Precompiled BLE stack 97- Nordic: Binary-only SoftDevice library 98- ST: Same solution as Nordic 99 100**Why this fails:** This is classic static linking of proprietary code into GPL code. The inability to modify these libraries violates GPL's fundamental requirements. 101 102### Loader-Based Separation 103 104- Write a GPL bootloader/loader 105- Load proprietary firmware (such as Nordic/ST Bluetooth) from external storage 106- Claim they're separate works 107 108**Problems:** 109- If designed as a system, courts view as single work 110- Distribution patterns matter (shipped together?) 111- Functional interdependence suggests unity 112- Appears designed to circumvent GPL 113 114## Real-World Examples 115 116### Bluetooth/Wireless Stacks 117- **Nordic SoftDevice**: Binary-only, SVC-interface, hardware-locked 118- **ST Bluetooth**: Binary-only, license explicitly GPL-incompatible 119- **WCH CH582**: Precompiled Bluetooth libraries 120 121### HAL and Driver Libraries 122- **ST HAL/LL drivers**: Source available but SLA0044 restricted 123- **Nordic SDK**: Source visible but 5-Clause restricted 124- **Various vendor HALs**: Platform-locked licenses 125 126### Mixed Proprietary/Open 127- Open peripheral drivers with closed protocol stacks 128- Basic HAL with proprietary performance libraries 129- Partially documented systems requiring binary supplements 130 131## Legal and Practical Consequences 132 133Including any proprietary vendor library means: 134 1351. **License Violation**: Immediate GPL non-compliance 1362. **Distribution Ban**: Users cannot legally share modified firmware 1373. **Commercial Risk**: Products using the firmware face legal liability 1384. **Contributor Tainting**: All GPL contributions become legally problematic 1395. **Update Restrictions**: Cannot fix bugs in proprietary components 140 141## Evaluation Criteria for Libraries 142 143Before including any library, QMK needs to verify: 144- Complete source code available 145- GPL-compatible license (GPL, LGPL, MIT, BSD, Apache) 146- No hardware restrictions 147- No redistribution limitations 148- No additional legal terms 149- No anti-GPL clauses 150 151## Policy Implementation 152 153QMK Firmware maintains a strict policy: 154 1551. **No proprietary libraries**: Regardless of technical workarounds 1562. **No binary blobs**: All code must have source available 1573. **No platform restrictions**: Must allow porting to any hardware 1584. **No additional terms**: Only GPL restrictions permitted 159 160## Summary 161 162There is no legally safe way to include proprietary vendor libraries in GPL firmware. This applies whether they're: 163- Bluetooth stacks (Nordic SoftDevice, ST Bluetooth) 164- Precompiled static libraries 165- Binary blobs with SVC interfaces 166- Source code with restrictive licenses 167- Mixed open/closed systems 168 169**Technical architectures cannot overcome license obligations.** 170 171QMK chooses GPL compliance, ensuring users receive all freedoms the GPL promises.