From 9aca824a0a21f9d4fa4790e38394ace6b076cee7 Mon Sep 17 00:00:00 2001 From: vhaudiquet Date: Sun, 30 Aug 2026 19:29:35 +0200 Subject: [PATCH] krane: enable USB xHCI, T-PHY and USB keyboard for the pogo keyboard The pogo keyboard is a USB HID device behind the GL610 hub on usb@11200000. Enable the USB stack (USB, DM_USB, USB_XHCI_HCD, USB_XHCI_MTK, USB_STORAGE, CMD_USB), the MTK T-PHY (PHY_MTK_TPHY), USB_KEYBOARD and CONFIG_USE_PREBOOT (preboot defaults to "usb start" with USB_KEYBOARD) so the bus is enumerated before the prompt. The upstream mt8183.dtsi models the SSUSB block for the Linux mtu3 dual-role driver: the IPPC register space and the phys live on the parent mtu3 node while the xhci child has only its "mac" register. U-Boot binds the "mediatek,mtk-xhci" child directly and expects mac+ippc and a phys list on that node, so add a board -u-boot.dtsi overlay (auto-included after the upstream dts) that supplies them. No upstream DT files are modified. stdin=serial,usbkbd routes the prompt through the USB keyboard once the usb_kbd stdio device is registered. --- .../dts/mt8183-kukui-krane-sku176-u-boot.dtsi | 23 +++++++++++++++++++ board/mediatek/mt8183/krane.env | 2 +- configs/mt8183_kukui_krane_defconfig | 10 ++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/mt8183-kukui-krane-sku176-u-boot.dtsi diff --git a/arch/arm/dts/mt8183-kukui-krane-sku176-u-boot.dtsi b/arch/arm/dts/mt8183-kukui-krane-sku176-u-boot.dtsi new file mode 100644 index 00000000000..e7605659b10 --- /dev/null +++ b/arch/arm/dts/mt8183-kukui-krane-sku176-u-boot.dtsi @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) +/* + * U-Boot-only additions for the MT8183 Kukui (krane) boards. + * + * The upstream mt8183.dtsi models the SSUSB block for the Linux mtu3 + * dual-role driver: the IPPC register space and the phys are declared + * on the parent "mediatek,mtu3" node (ssusb@11201000), and the host + * child (usb@11200000) carries only its "mac" register. + * + * U-Boot has no mtu3 driver; it binds the "mediatek,mtk-xhci" child + * directly with drivers/usb/host/xhci-mtk.c, which expects the "mac" + * and "ippc" register names and a phys list on the xHCI node itself. + * Add the missing ippc address (taken from the ssusb node's "ippc" + * reg entry) and the port phys there. + */ + +&usb_host { + reg = <0x0 0x11200000 0x0 0x1000>, + <0x0 0x11203e00 0x0 0x0100>; + reg-names = "mac", "ippc"; + phys = <&u2port0 PHY_TYPE_USB2>, + <&u3port0 PHY_TYPE_USB3>; +}; diff --git a/board/mediatek/mt8183/krane.env b/board/mediatek/mt8183/krane.env index 8ab8cf69179..e9e8bd4ecbe 100644 --- a/board/mediatek/mt8183/krane.env +++ b/board/mediatek/mt8183/krane.env @@ -1,3 +1,3 @@ -stdin=serial +stdin=serial,usbkbd stdout=serial,vidconsole stderr=serial,vidconsole diff --git a/configs/mt8183_kukui_krane_defconfig b/configs/mt8183_kukui_krane_defconfig index a3643fa1d73..10838f79c90 100644 --- a/configs/mt8183_kukui_krane_defconfig +++ b/configs/mt8183_kukui_krane_defconfig @@ -35,6 +35,7 @@ CONFIG_HUSH_PARSER=y # CONFIG_CMD_GO is not set # CONFIG_CMD_IMI is not set CONFIG_BOOTDELAY=-1 +CONFIG_USE_PREBOOT=y CONFIG_BOARD_EARLY_INIT_F=y CONFIG_BOARD_EARLY_INIT_R=y CONFIG_MISC_INIT_R=y @@ -60,6 +61,7 @@ CONFIG_CMD_SYSBOOT=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_USB=y # CONFIG_DOS_PARTITION is not set CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_SOURCE_FILE="krane" @@ -70,6 +72,14 @@ CONFIG_VIDEO_MT8183_SCANOUT=y # CONFIG_INPUT is not set # CONFIG_MMC_QUIRKS is not set CONFIG_MMC_MTK=y +CONFIG_PHY=y +CONFIG_PHY_MTK_TPHY=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_MTK=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_STORAGE=y # CONFIG_POWER is not set CONFIG_BAUDRATE=921600 CONFIG_DM_SERIAL=y