From c31070dd3f8b12a577ad36b78066cd84256f1b42 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 13 Nov 2017 01:28:18 -0500 Subject: [PATCH 1/3] add subvendor ids, update olkb boards --- docs/subvendor_ids.md | 30 ++++++++++++++++++++++++++++++ keyboards/atomic/config.h | 8 ++++---- keyboards/planck/config.h | 6 +++--- keyboards/planck/info.json | 2 +- keyboards/preonic/config.h | 6 +++--- keyboards/preonic/info.json | 2 +- subvendor_ids.txt | 1 + util/new_subvendor_id.sh | 35 +++++++++++++++++++++++++++++++++++ 8 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 docs/subvendor_ids.md create mode 100644 subvendor_ids.txt create mode 100644 util/new_subvendor_id.sh diff --git a/docs/subvendor_ids.md b/docs/subvendor_ids.md new file mode 100644 index 0000000000..ad1c56ab10 --- /dev/null +++ b/docs/subvendor_ids.md @@ -0,0 +1,30 @@ +# Vendor, Subvendor, Product, Project IDs in QMK + + #define VENDOR_ID 0x03A8 + ^ + + QMK's self-assigned Vendor ID + + #define PRODUCT_ID 0x0000 + ^ ^ + | + Project ID + + Subvendor ID + +There are many projects using QMK that aren't large enough where it would make sense to obtain a Vendor ID of their own, and [the USB-IF isn't interested in others transferring a VID to communities like ours](http://www.arachnidlabs.com/blog/2013/10/18/usb-if-no-vid-for-open-source/), so QMK uses the unassigned Vendor ID `0x03A8` for all Vendors/Makers/Companies (Subvendors for clarification) that aren't interested in obtaining their own, and maintains a master list (`subvendor_ids.txt`) in the repo to ensure unique values for each project. + +Subvendor IDs in QMK are a bitmask of the `PRODUCT_ID`: `0xFFE0` - this leaves 5 bits for the Project ID (0x001F bitmask), of which each Subvendor can have 32. If the Project ID is larger than 15, add 1 to the Subvendor ID (`0xFA4 -> 0xFA5`) - all Subvendor IDs are even (in hex) to allow this. All Subvendor IDs are randomly generated. + +## Using other values + +It's not recommended using custom Vendor IDs, but some projects may have obtained their own, and are welcome to use them in QMK, but only with permission of the project's creator (the owner of the Vendor ID). + +## Creating a new Subvendor ID + +To generate a new valid, random ID, run this bash script from the root qmk_firmware folder by substituting `` with your company/vendor name (leave the quotes): + + util/new_subvendor_id.sh "" + +This script will output your ID, and automatically append it to the list below as well as the master list (`subvendor_ids.txt`). + +# Currently used Subvendor IDs: + + * 0x5A6: OLKB diff --git a/keyboards/atomic/config.h b/keyboards/atomic/config.h index 9c40f54e78..da7efa2939 100644 --- a/keyboards/atomic/config.h +++ b/keyboards/atomic/config.h @@ -21,11 +21,11 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 +#define VENDOR_ID 0x03A8 +#define PRODUCT_ID 0x5A61 #define DEVICE_VER 0x0001 -#define MANUFACTURER Ortholinear Keyboards -#define PRODUCT The Atomic Keyboard +#define MANUFACTURER OLKB +#define PRODUCT Atomic #define DESCRIPTION A compact ortholinear keyboard /* key matrix size */ diff --git a/keyboards/planck/config.h b/keyboards/planck/config.h index bc7ec031ec..7bcd8cdca8 100644 --- a/keyboards/planck/config.h +++ b/keyboards/planck/config.h @@ -21,10 +21,10 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 +#define VENDOR_ID 0x03A8 +#define PRODUCT_ID 0x5A60 #define MANUFACTURER OLKB -#define PRODUCT The Planck Keyboard +#define PRODUCT Planck #define DESCRIPTION A compact ortholinear keyboard /* key matrix size */ diff --git a/keyboards/planck/info.json b/keyboards/planck/info.json index fd897c2167..2161d46031 100644 --- a/keyboards/planck/info.json +++ b/keyboards/planck/info.json @@ -2,7 +2,7 @@ "keyboard_name": "Planck", "keyboard_folder": "planck", "manufacturer": "OLKB", - "identifier": "FEED:6060:0001", + "identifier": "03A8:5A60:0001", "url": "https://olkb.com/planck", "maintainer": "jackhumbert", "processor": "atmega32u4", diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h index 74db9202d3..b310a90f90 100644 --- a/keyboards/preonic/config.h +++ b/keyboards/preonic/config.h @@ -21,11 +21,11 @@ along with this program. If not, see . #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6061 +#define VENDOR_ID 0x03A8 +#define PRODUCT_ID 0x5A62 #define DEVICE_VER 0x0001 #define MANUFACTURER OLKB -#define PRODUCT The Preonic Keyboard +#define PRODUCT Preonic #define DESCRIPTION A compact ortholinear keyboard /* key matrix size */ diff --git a/keyboards/preonic/info.json b/keyboards/preonic/info.json index a87e5953c4..55cebd9c55 100644 --- a/keyboards/preonic/info.json +++ b/keyboards/preonic/info.json @@ -2,7 +2,7 @@ "keyboard_name": "Preonic", "keyboard_folder": "preonic", "manufacturer": "OLKB", - "identifier": "FEED:6061:0001", + "identifier": "03A8:5A60:0001", "url": "https://olkb.com/preonic", "maintainer": "jackhumbert", "processor": "atmega32u4", diff --git a/subvendor_ids.txt b/subvendor_ids.txt new file mode 100644 index 0000000000..0f559dc16e --- /dev/null +++ b/subvendor_ids.txt @@ -0,0 +1 @@ +0x5A6: OLKB diff --git a/util/new_subvendor_id.sh b/util/new_subvendor_id.sh new file mode 100644 index 0000000000..1a81472cef --- /dev/null +++ b/util/new_subvendor_id.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +if [[ $0 != *"util"* ]]; then + echo "Please run from the root qmk_firmware folder" + exit 1 +fi + +if [ -z "$1" ]; then + echo "Need a subvendor" + echo "usage: $0 " + exit 1 +fi + +function generate_random() { + subvendor_id=`printf '0x%X%X%X' $(( ( RANDOM % 16 ) )) $(( ( RANDOM % 16 ) )) $(( ( RANDOM % 8 ) * 2 ))` +} + +function find_existing() { + existing=`grep "${subvendor_id}" subvendor_ids.txt` +} + +while : ; do + generate_random + find_existing + (( -z "$existing" )) || break +done + +echo ${subvendor_id}: ${1} >> subvendor_ids.txt +echo " * ${subvendor_id}: ${1}" >> docs/subvendor_ids.md +echo "The Subvendor ID ${subvendor_id} is now associated with \"${1}\", and has been added to the list" +echo "Add your Project ID (0x0-0xF) to the end and use it in your config.h:" +echo +echo " #define VENDOR_ID 0x03A8" +echo " #define PRODUCT_ID ${subvendor_id}0" +echo \ No newline at end of file From f2991c639d12570ce065b163805bcd9421815fc4 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 13 Nov 2017 12:07:05 -0500 Subject: [PATCH 2/3] clarfy subvendor ids for diy, etc --- docs/subvendor_ids.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/subvendor_ids.md b/docs/subvendor_ids.md index ad1c56ab10..7f3110a604 100644 --- a/docs/subvendor_ids.md +++ b/docs/subvendor_ids.md @@ -13,6 +13,8 @@ There are many projects using QMK that aren't large enough where it would make s Subvendor IDs in QMK are a bitmask of the `PRODUCT_ID`: `0xFFE0` - this leaves 5 bits for the Project ID (0x001F bitmask), of which each Subvendor can have 32. If the Project ID is larger than 15, add 1 to the Subvendor ID (`0xFA4 -> 0xFA5`) - all Subvendor IDs are even (in hex) to allow this. All Subvendor IDs are randomly generated. +For projects that are heavily DIY in nature, hand-wired, or historical, a Subvendor ID may be established for each. + ## Using other values It's not recommended using custom Vendor IDs, but some projects may have obtained their own, and are welcome to use them in QMK, but only with permission of the project's creator (the owner of the Vendor ID). From 522876dc5aa62a6bc7cd780323ac56ecef040134 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 5 Nov 2019 11:46:43 -0500 Subject: [PATCH 3/3] Update subvendor_ids.md --- docs/subvendor_ids.md | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/docs/subvendor_ids.md b/docs/subvendor_ids.md index 7f3110a604..59282954c7 100644 --- a/docs/subvendor_ids.md +++ b/docs/subvendor_ids.md @@ -1,32 +1,17 @@ -# Vendor, Subvendor, Product, Project IDs in QMK +# Vendor, Product, Project IDs in QMK #define VENDOR_ID 0x03A8 ^ + QMK's self-assigned Vendor ID #define PRODUCT_ID 0x0000 - ^ ^ - | + Project ID - + Subvendor ID + ^ + + Project IDs -There are many projects using QMK that aren't large enough where it would make sense to obtain a Vendor ID of their own, and [the USB-IF isn't interested in others transferring a VID to communities like ours](http://www.arachnidlabs.com/blog/2013/10/18/usb-if-no-vid-for-open-source/), so QMK uses the unassigned Vendor ID `0x03A8` for all Vendors/Makers/Companies (Subvendors for clarification) that aren't interested in obtaining their own, and maintains a master list (`subvendor_ids.txt`) in the repo to ensure unique values for each project. +There are many projects using QMK that aren't large enough where it would make sense to obtain a Vendor ID of their own, and [the USB-IF isn't interested in others transferring a VID to communities like ours](http://www.arachnidlabs.com/blog/2013/10/18/usb-if-no-vid-for-open-source/), so QMK uses the unassigned Vendor ID `0x03A8` for all Vendors/Makers/Companies (Projects for clarification) that aren't interested in obtaining their own, and maintains a master list (`project_ids.txt`) in the repo to ensure unique values for each project. -Subvendor IDs in QMK are a bitmask of the `PRODUCT_ID`: `0xFFE0` - this leaves 5 bits for the Project ID (0x001F bitmask), of which each Subvendor can have 32. If the Project ID is larger than 15, add 1 to the Subvendor ID (`0xFA4 -> 0xFA5`) - all Subvendor IDs are even (in hex) to allow this. All Subvendor IDs are randomly generated. - -For projects that are heavily DIY in nature, hand-wired, or historical, a Subvendor ID may be established for each. +Project IDs are created from the first 4 digits of a SHA-256 hash of the main project location in QMK (e.g. `olkb/planck`), without the revision folder. If that ID exists in the list, the range is shifted down one digit (e.g. it would now selected digits 2 through 5). ## Using other values It's not recommended using custom Vendor IDs, but some projects may have obtained their own, and are welcome to use them in QMK, but only with permission of the project's creator (the owner of the Vendor ID). - -## Creating a new Subvendor ID - -To generate a new valid, random ID, run this bash script from the root qmk_firmware folder by substituting `` with your company/vendor name (leave the quotes): - - util/new_subvendor_id.sh "" - -This script will output your ID, and automatically append it to the list below as well as the master list (`subvendor_ids.txt`). - -# Currently used Subvendor IDs: - - * 0x5A6: OLKB