Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5281134imu; Tue, 13 Nov 2018 04:13:59 -0800 (PST) X-Google-Smtp-Source: AJdET5eMnTvuNk/QqnLFEpcH1bzfyihL6z5MwCkBuEdgUFd/P+5FBza2wzOE7tD9bQQqCR+Shq04 X-Received: by 2002:a17:902:201:: with SMTP id 1-v6mr4887028plc.307.1542111239701; Tue, 13 Nov 2018 04:13:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542111239; cv=none; d=google.com; s=arc-20160816; b=lOMT2vmc1sqiXncUBQOe6b3yBrc90z6HrMjw4HoHlLYfcfwrXbL7VzZR0VJVjsYwwU WUfy/SU1xI594OKewClm08pDJGBTZDrhxMnHfrQRFiCkFUmYGUBmSsgoTGwLaMw8dmQu 0T7ni024njiLvMN/oKZwYhaicIwmjzancyHK6Gh3MMIDOwZUrqHjFND6tNIszkkcGtqf NGti0jdcHSa9wIm2ZZNXAkKiEi4Au5QmgnNjUCLbD3vIbToFh2H7hQgcmP12NhS1OnOk rg54rKRfKwk10VMChNLEuyrpUve3BdJw/ll8IdTNL293VhFGyBkg5AVbv+7ygxx/Ir0v N5kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=QXVxtjtRR9q4tIxX5fGFr01sDJ9eWKp1+N5yDsS8DHc=; b=gCUx8kw5PEasyAtI9qVBFVgaJvl5Uci+6ys/G8P61F1ztZFrfcVkOk42GETsUN1aI5 bSi1Kr0eSlbrWkP5BlZBugDNmRVp8AgfR4v90l5upCG/lMsFuolc6iuI3d2ZLP5BzrNH OEQZru7u2HzIvgX8q3mbDBfVxZCz6M1zJFGH90JW7AaXZZyK5NVYMBQLADe/a45aOBT4 upScN7XGWYOXbcDkIzQYBJ+5cndpeR9csJ7ZIpZlYBq1Vcy+Cf3POiFAbdi74YprGI6x odUaA/2QblD6Lz/5dQM4C1/TpDtQcc/LStDNEXV2fG/dN2xlZv8C9gqQTb8sj+1ef7Zl ucSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61-v6si21727563plr.72.2018.11.13.04.13.26; Tue, 13 Nov 2018 04:13:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732767AbeKMWKc (ORCPT + 99 others); Tue, 13 Nov 2018 17:10:32 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:45265 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732565AbeKMWKb (ORCPT ); Tue, 13 Nov 2018 17:10:31 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 42vRMn3dnYz1qxQJ; Tue, 13 Nov 2018 13:12:37 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 42vRMn1qmCz1qqkb; Tue, 13 Nov 2018 13:12:37 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id huRONACpOkaa; Tue, 13 Nov 2018 13:12:35 +0100 (CET) X-Auth-Info: R6XyVSsqWD7gnt4bau0atOGbviHh6AlYBmU1XBBADI0= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 13 Nov 2018 13:12:35 +0100 (CET) From: Lukasz Majewski To: Shawn Guo , Rob Herring , Mark Rutland Cc: Sascha Hauer , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Pengutronix Kernel Team , Stefan Agner , Fabio Estevam , Fabio Estevam , Lukasz Majewski Subject: [PATCH] ARM: dts: Provide support for reading ID code from MVB device (BK4) Date: Tue, 13 Nov 2018 13:12:13 +0100 Message-Id: <20181113121213.14296-1-lukma@denx.de> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The procedure to read this ID value is as follows: rmmod spi_fsl_dspi insmod spi-gpio.ko echo 504 > /sys/class/gpio/export cat /sys/class/gpio/gpio504/value ... echo 511 > /sys/class/gpio/export cat /sys/class/gpio/gpio511/value rmmod spi-gpio.ko insmod spi_fsl_dspi Signed-off-by: Lukasz Majewski --- arch/arm/boot/dts/vf610-bk4.dts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/boot/dts/vf610-bk4.dts b/arch/arm/boot/dts/vf610-bk4.dts index cab95714c058..f01c735807ae 100644 --- a/arch/arm/boot/dts/vf610-bk4.dts +++ b/arch/arm/boot/dts/vf610-bk4.dts @@ -59,6 +59,29 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; }; + + spi_gpio { + compatible = "spi-gpio"; + pinctrl-0 = <&pinctrl_gpio_spi>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + /* PTD12 ->RPIO[91] */ + sck-gpios = <&gpio2 27 GPIO_ACTIVE_LOW>; + /* PTD10 ->RPIO[89] */ + miso-gpios = <&gpio2 25 GPIO_ACTIVE_HIGH>; + num-chipselects = <0>; + + 72xx165@0 { + compatible = "pisosr-gpio"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + /* PTB18 -> RGPIO[40] */ + load-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + spi-max-frequency = <100000>; + }; + }; }; &adc0 { @@ -430,6 +453,14 @@ >; }; + pinctrl_gpio_spi: pinctrl-gpio-spi { + fsl,pins = < + VF610_PAD_PTB18__GPIO_40 0x1183 + VF610_PAD_PTD10__GPIO_89 0x1183 + VF610_PAD_PTD12__GPIO_91 0x1183 + >; + }; + pinctrl_i2c2: i2c2grp { fsl,pins = < VF610_PAD_PTA22__I2C2_SCL 0x34df -- 2.11.0