From patchwork Mon Sep 3 15:07:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgii Staroselskii X-Patchwork-Id: 965604 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=emlid.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4243492jvzz9ryn for ; Tue, 4 Sep 2018 07:28:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 28564C21ED6; Mon, 3 Sep 2018 16:37:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2E2D2C21EB4; Mon, 3 Sep 2018 16:37:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0AFA4C21E0B; Mon, 3 Sep 2018 15:07:32 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.denx.de (Postfix) with ESMTPS id A8382C21DF9 for ; Mon, 3 Sep 2018 15:07:32 +0000 (UTC) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 3AF4E4086018; Mon, 3 Sep 2018 18:07:31 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback3g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id sY2R9AYQ5H-7UougmDj; Mon, 03 Sep 2018 18:07:31 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YGw7y69Okf-7TKe8aJd; Mon, 03 Sep 2018 18:07:29 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Georgii Staroselskii To: u-boot@lists.denx.de Date: Mon, 3 Sep 2018 18:07:08 +0300 Message-Id: <1535987232-5588-1-git-send-email-georgii.staroselskii@emlid.com> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Mon, 03 Sep 2018 16:37:53 +0000 Cc: andriy.shevchenko@linux.intel.com, fntoth@gmail.com Subject: [U-Boot] [PATCH 0/4] Add a pinctrl driver for Merrifield to pinmux I2C#6 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" We have lacked the support for any pinmuxing in U-Boot for Merrifield. A need for pinmuxing some pins has arisen from the fact the I2C#6 is shared with I2C#8 on Merrifield. The latter is not easily accessible because it's a part of a separate MCU we don't have easy access to. I2C#6 can be and should be made use of in Linux but couldn't because it was blocked by the SCU. The proposed change is to implement a minimalistic pinctrl driver that reads the configuration off a device tree blob and configures the pins accordingly. The driver needs some changes to SCU API and thus the addition of scu_ipc_raw_command(). Andy Shevchenko has been helping me by making a prior review and made a lot of suggestions about the general approach that should be taken. He should also be given credit for the initial kernel code that I have taken as a reference. The code has been tested on 5 different Edisons on Intel Edison Breakout board and a couple of custom Emlid PCBs by booting a kernel and issuing a i2cdetect -r -y 6 and then loading a driver that made use of the bus. I also created a Gist on Github with a lot of relevant information like - output of `acpidump -o tables.dat` - dmesg - output of `grep -H 15 /sys/bus/acpi/devices/*/status` - cat /sys/kernel/debug/gpio - cat /sys/kernel/debug/pinctrl/INTC1002\:00/pins - output of `i2cdetect -y -r 6` w/ and w/o external device on the bus Here it is: https://gist.github.com/staroselskii/097808e05fd609dbafd4fe5ebd618708 Georgii Staroselskii (4): x86: cpu: introduce scu_ipc_raw_command() x86: tangier: pinmux: add API to configure protected pins x86: dts: edison: configure I2C#6 pins x86: tangier: acpi: add I2C6 node arch/x86/cpu/tangier/Makefile | 2 +- arch/x86/cpu/tangier/pinmux.c | 188 +++++++++++++++++++++ arch/x86/dts/edison.dts | 22 +++ .../include/asm/arch-tangier/acpi/southcluster.asl | 10 ++ arch/x86/include/asm/scu.h | 4 + arch/x86/lib/scu.c | 35 ++++ 6 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 arch/x86/cpu/tangier/pinmux.c Reviewed-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Bin Meng