Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
81e6536
wip: MT6589 USB bringup
akku1139 Jan 11, 2026
d1c5a65
arm: defconfig: lenovo-blade: add usb related configs
akku1139 Jan 11, 2026
5a9c458
arm: dts: mediatek: lenovo-blade-b8000-f: add usb pio note
akku1139 Jan 12, 2026
cde6c23
arm: dts: mediatek: mt6589: fix pinctrl reg
akku1139 Jan 12, 2026
1b1d0dd
arm: dts: mt6589: restore usb clocks
akku1139 Jan 12, 2026
c1fd146
wip: usb
akku1139 Jan 12, 2026
12db921
arm: dts: mediatek: mt6589-lenovo-blade-b8000-f: fix gpio pin
akku1139 Jan 18, 2026
e57c729
Merge branch 'blade/v6.16' into dev/v6.16/mt6589-usb
akku1139 Jan 18, 2026
fe967ea
arm: configs: lenovo-blade_defconfig: enable debugfs
akku1139 Jan 18, 2026
7fa57ea
wip: wip
akku1139 Jan 18, 2026
f2c9aa1
wip: mt6589 pinctrl-v2
akku1139 Jan 25, 2026
3c4cc40
pinctrl: mediatek: common-v2: add DRV_GRP5 in enum
akku1139 Feb 26, 2026
004391f
pinctrl: mediatek: common-v2: add DRV_GRP5 def
akku1139 Feb 26, 2026
01b5f6f
wip: todo
akku1139 Feb 26, 2026
aea071b
pinctrl: mediatek: mt6589: fix drive
akku1139 Feb 26, 2026
ea5a903
pinctrl: mediatek: mt6589: fix fix
akku1139 Feb 26, 2026
0854556
REVERT: pinctrl: mediatek: common-v1: introduce per-function
akku1139 Mar 2, 2026
b6969bf
dt-bindings: mfd: syscon: remove mediatek,mt6589-pctl-[ab]-syscfg
akku1139 Mar 2, 2026
67219cf
dt-bindings: pinctrl: mediatek: remove mediatek,mt6589-pinctrl
akku1139 Mar 2, 2026
8372fbc
pinctrl: mediatek: mt6589: wip wip
akku1139 Mar 2, 2026
b2a1643
pinctrl: mediatek: mt6589: add R0
akku1139 Mar 2, 2026
7847327
pinctrl: mediatek: mt6589: cleanup
akku1139 Mar 2, 2026
48679c1
arm: dts: mediatek: mt6589: change pio to v2
akku1139 Mar 2, 2026
9f74dcf
arm: dts: mediatek: mt6589: DRV+SR
akku1139 Mar 2, 2026
676a820
arm: dts: mediatek: mt6589: reduce lines
akku1139 Mar 2, 2026
a50aafc
pinctrl: mediatek: mt6589: reduce more lines
akku1139 Mar 2, 2026
9afe5bf
pinctrl: mediatek: mt6589: note
akku1139 Mar 2, 2026
b2feb53
dt-bindings: pinctrl: mediatek: add mt6589 pinctrl (wip)
akku1139 Mar 2, 2026
e51be8b
pinctrl: mediatek: mt6589: remove tdsel/rdsel
akku1139 Mar 2, 2026
b0edaf6
pinctrl: mediatek: mt6589: clean
akku1139 Mar 2, 2026
36f10e6
pinctrl: mediatek: mt6589: cleanup header
akku1139 Mar 2, 2026
f0fee11
pinctrl: mediatek: mt6589: add funcs
akku1139 Mar 2, 2026
b3a8531
clk: mediatek: mt6589: reindex clock ids
akku1139 Mar 3, 2026
6d26bc1
pinctrl: mediatek: mt6589: fix
akku1139 Mar 3, 2026
39506e8
Merge branch 'dev/v6.16/mt6589-pinctrl-v2' into dev/v6.16/mt6589-usb
akku1139 Mar 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Documentation/devicetree/bindings/mfd/syscon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ select:
- mediatek,mt2701-pctl-a-syscfg
- mediatek,mt2712-pctl-a-syscfg
- mediatek,mt6397-pctl-pmic-syscfg
- mediatek,mt6589-pctl-a-syscfg
- mediatek,mt6589-pctl-b-syscfg
- mediatek,mt7988-topmisc
- mediatek,mt8135-pctl-a-syscfg
- mediatek,mt8135-pctl-b-syscfg
Expand Down Expand Up @@ -192,8 +190,6 @@ properties:
- mediatek,mt2701-pctl-a-syscfg
- mediatek,mt2712-pctl-a-syscfg
- mediatek,mt6397-pctl-pmic-syscfg
- mediatek,mt6589-pctl-a-syscfg
- mediatek,mt6589-pctl-b-syscfg
- mediatek,mt7988-topmisc
- mediatek,mt8135-pctl-a-syscfg
- mediatek,mt8135-pctl-b-syscfg
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ properties:
- items:
- enum:
- mediatek,mt2701-tphy
- mediatek,mt6589-tphy
- mediatek,mt7623-tphy
- mediatek,mt7622-tphy
- mediatek,mt8516-tphy
Expand Down
148 changes: 148 additions & 0 deletions Documentation/devicetree/bindings/pinctrl/mediatek,mt6589-pinctrl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/mediatek,mt6589-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT6589 Pin Controller

maintainers:
- Akari Tsuyukusa <akkun11.open@gmail.com>

description:
The MediaTek pin controller on MT6589 is used to control pin functions, pull
up/down resistance and drive strength options.

properties:
compatible:
enum:
- mediatek,mt6589-pinctrl

reg:
minItems: 3
maxItems: 3
description: Physical addresses for GPIO base(s) and EINT registers.

reg-names:
items:
- const: gpio
- const: gpio1
- const: eint

gpio-controller: true

"#gpio-cells":
const: 2
description:
Number of cells in GPIO specifier. Since the generic GPIO binding is used,
the amount of cells must be specified as 2. See the below mentioned gpio
binding representation for description of particular cells.

gpio-ranges:
minItems: 1
maxItems: 5
description:
GPIO valid number range.

interrupt-controller: true

interrupts:
maxItems: 1
description:
Specifies the summary IRQ.

"#interrupt-cells":
const: 2

required:
- compatible
- reg
- reg-names
- gpio-controller
- "#gpio-cells"
- interrupts
- interrupt-controller
- "#interrupt-cells"

patternProperties:
'-[0-9]*$':
type: object
additionalProperties: false

patternProperties:
'-pins*$':
type: object
description:
A pinctrl node should contain at least one subnodes representing the
pinctrl groups available on the machine. Each subnode will list the
pins it needs, and how they should be configured, with regard to muxer
configuration, pullups, drive strength, input enable/disable and input
schmitt.
$ref: /schemas/pinctrl/pincfg-node.yaml

properties:
pinmux:
description:
Integer array, represents gpio pin number and mux setting.
Supported pin number and mux varies for different SoCs, and are
defined as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly.

bias-disable: true

bias-pull-up: true

bias-pull-down: true

input-enable: true

input-disable: true

output-low: true

output-high: true

input-schmitt-enable: true

input-schmitt-disable: true

drive-strength:
enum: [2, 4, 8, 10, 12, 14, 16, 20, 24, 28, 32]

slew-rate:
enum: [0, 1]

# TODO
mediatek,pull-up-adv:
description: |
Pull up settings for 2 pull resistors, R0 and R1. User can
configure those special pins. Valid arguments are described as
below:
0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]

mediatek,pull-down-adv:
description: |
Pull down settings for 2 pull resistors, R0 and R1. User can
configure those special pins. Valid arguments are described as
below:
0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]

required:
- pinmux

additionalProperties: false

additionalProperties: false

examples:
- |
TODO
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ properties:
- mediatek,mt2701-pinctrl
- mediatek,mt2712-pinctrl
- mediatek,mt6397-pinctrl
- mediatek,mt6589-pinctrl
- mediatek,mt7623-pinctrl
- mediatek,mt8127-pinctrl
- mediatek,mt8135-pinctrl
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/usb/mediatek,musb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ properties:
- enum:
- mediatek,mt8516-musb
- mediatek,mt2701-musb
- mediatek,mt6589-musb
- mediatek,mt7623-musb
- const: mediatek,mtk-musb

Expand Down
47 changes: 47 additions & 0 deletions arch/arm/boot/dts/mediatek/mt6589-lenovo-blade-b8000-f.dts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,56 @@
* Copyright (c) 2025 akku <akkun11.open@gmail.com>
*/

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/mt6589-pinfunc.h>

#include "mt6589-lenovo-blade.dtsi"

/ {
model = "Lenovo YOGA Tablet 10 (Wi-Fi)";
compatible = "lenovo,blade-b8000-f", "lenovo,blade", "mediatek,mt6589";

usb_vbus: regulator-usb {
compatible = "regulator-fixed";
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
// gpio = <&pio 130 GPIO_ACTIVE_HIGH>;
enable-active-high;

// testing
regulator-boot-on;
regulator-always-on;
};
};

&pio {
usb_pins: usb-pins {
pins_iddig {
pinmux = <MT6589_PIN_57_GPIO57__FUNC_EINT34>;
input-enable;
bias-pull-up;
};
};
};

&usb0 {
status = "okay";
// usb-role-switch;
// dr_mode = "otg";
dr_mode = "peripheral";

// testing
//vbus-supply = <&usb_vbus>;
/*
connector {
compatible = "gpio-usb-b-connector", "usb-b-connector";
type = "micro";
id-gpios = <&pio 57 GPIO_ACTIVE_HIGH>;
vbus-supply = <&usb_vbus>;

pinctrl-names = "default";
pinctrl-0 = <&usb_pins>;
};
*/
};
72 changes: 66 additions & 6 deletions arch/arm/boot/dts/mediatek/mt6589.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/mt6589-clk.h>
#include <dt-bindings/phy/phy.h>

/ {
#address-cells = <1>;
Expand Down Expand Up @@ -143,17 +144,17 @@
#clock-cells = <1>;
};

/*
* EINT registers: 0x1000b000
* GPIO base: 0x10005000, GPIO1 base 0x1020c000
*/
pio: pinctrl@10005000 {
compatible = "mediatek,mt6589-pinctrl";
reg = <0x1000b000 0x1000>;
mediatek,pctl-regmap = <&syscfg_pctl_a &syscfg_pctl_b>;
reg = <0x10005000 0x1000>,
<0x1020c000 0x1000>,
<0x1000b000 0x1000>;
reg-names = "gpio", "gpio1", "eint";
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&pio 0 0 232>;
interrupt-controller;
interrupt-parent = <&gic>;
#interrupt-cells = <2>;
interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
Expand Down Expand Up @@ -261,5 +262,64 @@
clock-names = "baud", "bus";
status = "disabled";
};

/* USB 2.0 */
usb0: usb@11200000 {
compatible = "mediatek,mt6589-musb",
"mediatek,mtk-musb";
reg = <0x11200000 0x1000>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "mc";
phys = <&usb_port0 PHY_TYPE_USB2>;
dr_mode = "otg";
/* FIXME: clocks */
clocks = <&pericfg CLK_PERI0_USB0>,
<&clk26m>,
<&topckgen CLK_TOP_UNIVPLL_D26>;
clock-names = "main", "mcu", "univpll";
status = "disabled";
};

/* USB 1.1 */
usb1: usb@11210000 {
compatible = "mediatek,mt6589-musb",
"mediatek,mtk-musb";
reg = <0x11210000 0x1000>;
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_LOW>;
interrupt-names = "mc";
phys = <&usb_port1 PHY_TYPE_USB2>;
dr_mode = "otg";
clocks = <&pericfg CLK_PERI0_USB1>,
<&clk26m>,
<&topckgen CLK_TOP_UNIVPLL_D26>;
clock-names = "main", "mcu", "univpll";
status = "disabled";
};

u2phy0: t-phy@11220000 {
compatible = "mediatek,mt6589-tphy",
"mediatek,generic-tphy-v1";
reg = <0x11220000 0x0800>;
ranges;
status = "okay";
#address-cells = <1>;
#size-cells = <1>;

usb_port0: usb-phy@11220800 {
reg = <0x11220800 0x0100>;
clocks = <&topckgen CLK_TOP_UNIVPLL_D26>;
clock-names = "ref";
#phy-cells = <1>;
status = "okay";
};

usb_port1: usb-phy@11220900 {
reg = <0x11220900 0x0100>;
clocks = <&topckgen CLK_TOP_UNIVPLL_D26>;
clock-names = "ref";
#phy-cells = <1>;
status = "okay";
};
};
};
};
18 changes: 16 additions & 2 deletions arch/arm/configs/lenovo-blade_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,19 @@ CONFIG_PINCTRL_MT6589=y
#CONFIG_DMADEVICES=y

## USB
CONFIG_USB=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_GADGET=y
CONFIG_USB=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_MEDIATEK=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_SERIAL=y
#CONFIG_PHY_MTK_TPHY=y # is needed?
CONFIG_PHY_MTK_TPHY=y
# FIXME: DEBUG
CONFIG_MUSB_PIO_ONLY=y
CONFIG_USB_CONN_GPIO=y
CONFIG_USB_GPIO_VBUS=y

## MMC (eMMC/SD)
CONFIG_MMC=y
Expand All @@ -113,6 +118,10 @@ CONFIG_MMC_MTK=y
## Reset
#CONFIG_RESET_CONTROLLER

## Regulator
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y

## Battery

## Audio
Expand All @@ -122,6 +131,10 @@ CONFIG_MMC_MTK=y
## GPU
#CONFIG_SGX=y # not ported

## Networking
CONFIG_NET=y
CONFIG_USB_ETH=y

## Wi-Fi / Bluetooth

## Thermal
Expand Down Expand Up @@ -149,6 +162,7 @@ CONFIG_BLK_DEV_LOOP=y

### FS
CONFIG_UNICODE=y
CONFIG_DEBUG_FS=y
CONFIG_EXT4_FS=y
CONFIG_VFAT_FS=y
# VFAT
Expand Down
Loading