From 8ad561c8f091a4baf167ad4d7c90c02383905e38 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 5 Dec 2018 16:55:35 -0800 Subject: Keyboard: handwired/fivethirteen Refactor, Configurator support, and readme cleanup (#4559) * handwired/fivethirteen: refactor - Layout macro KEYMAP renamed to LAYOUT - Default keymap - now uses #include QMK_KEYBOARD_H - Removed redundant KC_TRNS definition - Removed deprecated fn_actions and action_get_macro functions. * handwired/fivethirteen: Configurator support * handwired/fivethirteen: readme cleanup Restructured readme file to be closer to current QMK template. Couldn't find a photo of an assembled fivethirteen, so deleted the reference to the photograph. Renamed to readme.md --- keyboards/handwired/fivethirteen/README.md | 28 -------- keyboards/handwired/fivethirteen/fivethirteen.h | 22 +++---- keyboards/handwired/fivethirteen/info.json | 77 ++++++++++++++++++++++ .../fivethirteen/keymaps/default/keymap.c | 21 ++---- keyboards/handwired/fivethirteen/readme.md | 12 ++++ 5 files changed, 105 insertions(+), 55 deletions(-) delete mode 100644 keyboards/handwired/fivethirteen/README.md create mode 100644 keyboards/handwired/fivethirteen/info.json create mode 100644 keyboards/handwired/fivethirteen/readme.md diff --git a/keyboards/handwired/fivethirteen/README.md b/keyboards/handwired/fivethirteen/README.md deleted file mode 100644 index a965650fc..000000000 --- a/keyboards/handwired/fivethirteen/README.md +++ /dev/null @@ -1,28 +0,0 @@ -fivethirteen keyboard firmware -====================== - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/doc/README.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/handwired/fivethirteen folder. -Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use -the Teensy Loader to program your .hex file. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default - -To build with the default keymap, simply run `make`. - -### Other Keymaps - -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: - -``` -$ make keymap=[default|jack|] -``` - -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/handwired/fivethirteen/fivethirteen.h b/keyboards/handwired/fivethirteen/fivethirteen.h index faa6de737..6d14b7f1c 100644 --- a/keyboards/handwired/fivethirteen/fivethirteen.h +++ b/keyboards/handwired/fivethirteen/fivethirteen.h @@ -3,19 +3,19 @@ #include "quantum.h" -#define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, \ - k40, k41, k42, k43, k44, k46, k47, k48, k49, k410, k411, k412 \ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, \ + k40, k41, k42, k43, k44, k46, k47, k48, k49, k410, k411, k412 \ ) \ { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012 }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112 }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212 }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312 }, \ - { k40, k41, k42, k43, k44, KC_NO, k46, k47, k48, k49, k410, k411, k412 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312 }, \ + { k40, k41, k42, k43, k44, KC_NO, k46, k47, k48, k49, k410, k411, k412 } \ } #endif diff --git a/keyboards/handwired/fivethirteen/info.json b/keyboards/handwired/fivethirteen/info.json new file mode 100644 index 000000000..f95cbbe01 --- /dev/null +++ b/keyboards/handwired/fivethirteen/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "fivethirteen", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"[", "x":11, "y":1}, + {"label":"]", "x":12, "y":1}, + {"label":"Ctrl/Esc", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"Enter", "x":12, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Up", "x":11, "y":3}, + {"label":"\\", "x":12, "y":3}, + {"label":"MO(MOS)", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"GUI", "x":3, "y":4}, + {"label":"MO(HDN)", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4, "w":2}, + {"label":"Shift/Backspace", "x":7, "y":4}, + {"label":"MO(OSY)", "x":8, "y":4}, + {"label":"MO(HDN)", "x":9, "y":4}, + {"label":"Left", "x":10, "y":4}, + {"label":"Down", "x":11, "y":4}, + {"label":"Right", "x":12, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/fivethirteen/keymaps/default/keymap.c b/keyboards/handwired/fivethirteen/keymaps/default/keymap.c index d718510d5..d92f32e35 100644 --- a/keyboards/handwired/fivethirteen/keymaps/default/keymap.c +++ b/keyboards/handwired/fivethirteen/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "fivethirteen.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H #define HDN 1 #define OSY 2 @@ -9,28 +7,28 @@ #define SFT_BSP SFT_T(KC_BSPC) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( +[0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \ CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_BSLS, \ MO(MOS), KC_LCTL, KC_LALT, KC_LGUI, MO(HDN), KC_SPC , SFT_BSP, MO(OSY), MO(HDN), KC_LEFT, KC_DOWN, KC_RGHT \ ), -[HDN] = KEYMAP( +[HDN] = LAYOUT( _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, \ _______, KC_TILD, KC_GRV, KC_BSLS, KC_PIPE, KC_MINS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TILD, KC_GRV, _______, \ _______, _______, _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______, KC_PGUP, _______, \ _______, _______, _______, _______, _______, KC_UNDS , KC_DEL, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), -[OSY] = KEYMAP( +[OSY] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), -[MOS] = KEYMAP( +[MOS] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, _______, \ @@ -38,12 +36,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/handwired/fivethirteen/readme.md b/keyboards/handwired/fivethirteen/readme.md new file mode 100644 index 000000000..1a22fc9b9 --- /dev/null +++ b/keyboards/handwired/fivethirteen/readme.md @@ -0,0 +1,12 @@ +# fivethirteen + +A handwired 5x13 ortholinear keyboard with a 2U space bar. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: fivethirteen handwired + +Make example for this keyboard (after setting up your build environment): + + make handwired/fivethirteen:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). -- cgit v1.2.3 /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
From 2355a6546a053b1c16ebefd6ce1f0cccc00e1da5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Thu, 12 Oct 2017 10:21:25 +0200
Subject: [PATCH] net: phy: broadcom: support new device flag for setting
 master mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Some of Broadcom's PHYs run by default in slave mode with Automatic
Slave/Master configuration disabled. It stops them from working properly
with some devices.

So far it has been verified for BCM54210E and BCM50212E which don't
work well with Intel's I217-LM and I218-LM:
http://ark.intel.com/products/60019/Intel-Ethernet-Connection-I217-LM
http://ark.intel.com/products/71307/Intel-Ethernet-Connection-I218-LM
I was told there is massive ping loss.

This commit adds support for a new flag which can be set by an ethernet
driver to fixup PHY setup.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/phy/broadcom.c | 6 ++++++
 include/linux/brcmphy.h    | 1 +
 2 files changed, 7 insertions(+)

--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -43,6 +43,12 @@ static int bcm54210e_config_init(struct
 	val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
 	bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
 
+	if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
+		val = phy_read(phydev, MII_CTRL1000);
+		val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
+		phy_write(phydev, MII_CTRL1000, val);
+	}
+
 	return 0;
 }
 
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -64,6 +64,7 @@
 #define PHY_BRCM_EXT_IBND_TX_ENABLE	0x00002000
 #define PHY_BRCM_CLEAR_RGMII_MODE	0x00004000
 #define PHY_BRCM_DIS_TXCRXC_NOENRGY	0x00008000
+#define PHY_BRCM_EN_MASTER_MODE		0x00010000
 
 /* Broadcom BCM7xxx specific workarounds */
 #define PHY_BRCM_7XXX_REV(x)		(((x) >> 8) & 0xff)