From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E50DC4320A for ; Mon, 23 Aug 2021 09:29:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61999613A2 for ; Mon, 23 Aug 2021 09:29:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235759AbhHWJa0 (ORCPT ); Mon, 23 Aug 2021 05:30:26 -0400 Received: from mail.thorsis.com ([92.198.35.195]:49180 "EHLO mail.thorsis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbhHWJaY (ORCPT ); Mon, 23 Aug 2021 05:30:24 -0400 X-Greylist: delayed 303 seconds by postgrey-1.27 at vger.kernel.org; Mon, 23 Aug 2021 05:30:24 EDT Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id EFC3C2985; Mon, 23 Aug 2021 11:24:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.thorsis.com Received: from mail.thorsis.com ([127.0.0.1]) by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OJWpy4L88Gne; Mon, 23 Aug 2021 11:24:38 +0200 (CEST) Received: by mail.thorsis.com (Postfix, from userid 109) id CE46B29CF; Mon, 23 Aug 2021 11:24:38 +0200 (CEST) From: Alexander Dahl To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rca@thorsis.com Subject: Enable HSIC Host Port on Atmel/Microchip SAMA5D2 Date: Mon, 23 Aug 2021 11:24:35 +0200 Message-ID: <2869763.XZdSvA6Ref@ada> Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, for a new embedded board featuring a Microchip SAMA5D2 SoC (64 MiB SiP variant SAMA5D27C-D5M) we connected the third USB host port (HSIC only) with an USB3503 hub chip. This doesn't work out of the box with the Linux kernel currently, because neither the SoC nor the kernel does enable the HSIC interface by default. That SoC has three USB host ports, from the SAMA5D2 Series Datasheet [1] I learned there's a flag in an EHCI register, which has to be set to enable the HSIC interface on port C, the third port. (Section "41.7.14 EHCI: REG08 - HSIC Enable/Disable" of the datasheet.) I suppose that register is vendor specific. The register definitions in '/include/linux/usb/ehci_def.h' do not contain that register. Where would I add that register definition and set that flag in the kernel then? I suppose in the vendor specific ehci driver? That would be 'drivers/usb/host/ehci-atmel.c' right? Since that feature is optional (other boards don't need to turn on hsic on that port), some driver specific new device tree binding would be necessary, right? I suppose that would have to be documented in 'Documentation/ devicetree/bindings/usb/atmel-usb.txt' right? (Or that would have to be converted to yaml first?) Is this the right track? If yes, I'm going to develop patches for this. Otherwise any hint into the right direction are highly appreciated. FWIW, I'm not the first one struggling [2] with this problem. ;-) Greets Alex [1] https://www.microchip.com/en-us/product/ATSAMA5D27C-D5M#document-table [2] https://community.atmel.com/forum/sama5d2-using-hsic-under-linux From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66722C4338F for ; Mon, 23 Aug 2021 09:36:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3603261186 for ; Mon, 23 Aug 2021 09:36:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3603261186 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=thorsis.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-ID:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BGxiY9OVi0AU589o+PfDGUJ64QSIV4ZApAi39ijgyRI=; b=x7A4MZuyZHqgen 1Nu8CNdgFAr6mG9qftOu9woR59KTLx/BVp/POXGiwGEOMKXujnLaptkLFAUU9C3I9aL6n++GPmBGw mZ6stb2XCLUJANO5htCl4dqREqEFi1kSpSfekz5fOEgOF/JN625lqjI6tUjJLU3oKTeTVn1za8iHO OPQQyWyQD689fYl+Kf0x3hYPeTBXQr0xFVRnDuYQw3o6TkFRhd4KEGXK2XEufU1MlJAZ8s0HG3M92 AO9c08WigCrjbF+b9I0Co0HroMkDEqlfzTM9XwLLRNngdXNG15YQ8vQGPc9US4jxsvzTTs9YekEgJ k50AKaHWTqRESmgUvcTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mI6M2-00G9ck-V2; Mon, 23 Aug 2021 09:34:55 +0000 Received: from mail.thorsis.com ([92.198.35.195]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mI6Lv-00G9aS-7y for linux-arm-kernel@lists.infradead.org; Mon, 23 Aug 2021 09:34:51 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id B5C7D4EE for ; Mon, 23 Aug 2021 11:24:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.thorsis.com Received: from mail.thorsis.com ([127.0.0.1]) by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PRIZINN_EAfH for ; Mon, 23 Aug 2021 11:24:39 +0200 (CEST) Received: by mail.thorsis.com (Postfix, from userid 109) id 8ECD729CF; Mon, 23 Aug 2021 11:24:39 +0200 (CEST) From: Alexander Dahl To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rca@thorsis.com Subject: Enable HSIC Host Port on Atmel/Microchip SAMA5D2 Date: Mon, 23 Aug 2021 11:24:35 +0200 Message-ID: <2869763.XZdSvA6Ref@ada> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210823_023447_502126_5793355B X-CRM114-Status: GOOD ( 16.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, for a new embedded board featuring a Microchip SAMA5D2 SoC (64 MiB SiP variant SAMA5D27C-D5M) we connected the third USB host port (HSIC only) with an USB3503 hub chip. This doesn't work out of the box with the Linux kernel currently, because neither the SoC nor the kernel does enable the HSIC interface by default. That SoC has three USB host ports, from the SAMA5D2 Series Datasheet [1] I learned there's a flag in an EHCI register, which has to be set to enable the HSIC interface on port C, the third port. (Section "41.7.14 EHCI: REG08 - HSIC Enable/Disable" of the datasheet.) I suppose that register is vendor specific. The register definitions in '/include/linux/usb/ehci_def.h' do not contain that register. Where would I add that register definition and set that flag in the kernel then? I suppose in the vendor specific ehci driver? That would be 'drivers/usb/host/ehci-atmel.c' right? Since that feature is optional (other boards don't need to turn on hsic on that port), some driver specific new device tree binding would be necessary, right? I suppose that would have to be documented in 'Documentation/ devicetree/bindings/usb/atmel-usb.txt' right? (Or that would have to be converted to yaml first?) Is this the right track? If yes, I'm going to develop patches for this. Otherwise any hint into the right direction are highly appreciated. FWIW, I'm not the first one struggling [2] with this problem. ;-) Greets Alex [1] https://www.microchip.com/en-us/product/ATSAMA5D27C-D5M#document-table [2] https://community.atmel.com/forum/sama5d2-using-hsic-under-linux _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel