Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1679157imu; Tue, 6 Nov 2018 02:33:07 -0800 (PST) X-Google-Smtp-Source: AJdET5fMItkkmYMGiCFAg4iqPO98hCMQTy9iZbO31i/8CvWdl+Dc9fwlK0Rz8G7qgp3YEZ4xY08z X-Received: by 2002:a17:902:8d94:: with SMTP id v20-v6mr26108596plo.109.1541500387397; Tue, 06 Nov 2018 02:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541500387; cv=none; d=google.com; s=arc-20160816; b=YOQ4rnt9ynq3pgSwDq8k4/jRYjfi5SnXlCRr/PmnTHQzwVKqij/aPBnan39gpePGS1 9EJ5dN0mmXYQyKtJoxhpCTZUbFmT+errOr7Ikc6jryK8woXAODV3kqsykp01Vzm/xAHC Pd0ORxj8rfqnL3Pq65wrSFf7ZBRFK8Q8Nv8wKK92uh4pAy1FQp8jRVqTzDH8Y/cC7Kls rDxRmrsEwdQD/86AqLCBlj5lTDADa+B9mGSnk0pxySA0zdBAcDr+hD8wbGEaQE1iYKZP UKyIL2BU924oOuckIRRtoHIAHvdyUs6ksars2I5AgjVmZTKNI96MDiN1lpiWuHfOLXI4 vdFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:references :in-reply-to:message-id:date:subject:cc:to:from; bh=Gc1JC6+V0xexHr5ZG3B+7N/Lz2batFSI+wdp9IHQpFQ=; b=FAfIPcNdtKMhmKZvvrQHDjH+TY1ebVrWAN8wAvj93pYv4qCAe1wOoWZxt8bzJ46+R8 DAegEILjqQaf4rz3dJzffxHbBzyxSzp+D7KFkBmky3E+/amzd+ESLGQIN6xV/zDrCKyQ OHg7RQiM1DH4hvXR51y0nzo2bCmqkaFj9+Mywqm5Wdyyus4Ql5yfVe+Ntm61nDdHHdDX ffhOkJOudDgiprBhMMNcXNJh80sLrpuVIEDdFRQCvvap7826F/i0UU45hvdhuAk32/y4 kRBzRnLXnJ3h10dh7xLcd9nLFvSU5LW63kvGTn0zjSr+LSx/8Nek+TWv0F0zvabBusYr QElA== 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 h13-v6si54281358plk.130.2018.11.06.02.32.52; Tue, 06 Nov 2018 02:33:07 -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 S2387797AbeKFTaK (ORCPT + 99 others); Tue, 6 Nov 2018 14:30:10 -0500 Received: from mail.thorsis.com ([92.198.35.195]:39838 "EHLO mail.thorsis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387480AbeKFTaK (ORCPT ); Tue, 6 Nov 2018 14:30:10 -0500 X-Greylist: delayed 503 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Nov 2018 14:30:08 EST Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id E5D7D16547 for ; Tue, 6 Nov 2018 10:57:59 +0100 (CET) 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 zYr7tTm2pbHG for ; Tue, 6 Nov 2018 10:57:59 +0100 (CET) Received: by mail.thorsis.com (Postfix, from userid 109) id 3808689C6; Tue, 6 Nov 2018 10:57:58 +0100 (CET) X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,USER_IN_WHITELIST autolearn=unavailable autolearn_force=no version=3.4.0 From: Alexander Dahl To: linux-arm-kernel@lists.infradead.org Cc: Jean-Michel Hautbois , boris.brezillon@bootlin.com, Nicolas Ferre , linux-kernel Subject: Re: sama5d: using the ebi interface from another driver Date: Tue, 06 Nov 2018 10:57:11 +0100 Message-ID: <3857132.MlRd14rs7I@ada> In-Reply-To: References: Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hei hei, Am Freitag, 2. November 2018, 14:35:26 CET schrieb Jean-Michel Hautbois: > Then, after looking into deeper details in the datasheet I understand > it is connected through EBI and it sounds not so easy :D. Did you read docs on that? You'll find the binding docs here: Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt > I would appreciate some help/pointers on this, as there is (at least, > I could find) few documentation on how to use it except for NAND > cases. I use EBI with at91sam9g20 and custom FPGA on CS5 (0x6000000) and CS7 (0x8000000). > I have something like that in my DTS, but not sure this is the correct > way to do it : > > ebi: ebi@10000000 { > pinctrl-0 = <&pinctrl_ebi_nand_addr>; > pinctrl-names = "default"; > status = "okay"; > > dsp0: pef24628@1 { > status = "okay"; > compatible = "intel,pef24628"; > #address-cells = <1>; > #size-cells = <1>; > reg = <0x1 0x0 0x8000>; > pinctrl-0 = <&pinctrl_dsp_cs1>; > }; > > dsp1: pef24628@2 { > status = "okay"; > compatible = "intel,pef24628"; > #address-cells = <1>; > #size-cells = <1>; > reg = <0x2 0x0 0x8000>; > pinctrl-0 = <&pinctrl_dsp_cs2>; > }; I'm not sure about those 'reg' settings. IIRC the first should correspond to the CS line, on at91sam9g20 the 0x40000000 would be CS3 (which is used by NAND, like in the dts snippet you posted) and 0x50000000 would be CS4. Are CS1 (which is used by SD-RAM) and CS2 free to use on sama5d3? Maybe that's different on sama5d3? I would check it again. > The pinctrl for ebi should probably be changed however, I am wondering > how the (platform ?) driver can access the adress ? Should it parse > itself the parent, and find range, etc. Or is there an accessor for it > ? Probably. This is what I have for the at91sam9g20: pinctrl@fffff400 { ebi { pinctrl_ebi_cs5: ebi-cs5-0 { atmel,pins = ; }; pinctrl_ebi_cs7: ebi-cs7-0 { atmel,pins = ; }; pinctrl_ebi_nwait: ebi-nwait-0 { atmel,pins = ; }; }; }; > Maybe can I just manually toggle the CS GPIO, and don't try to make > anything more complex than what it should be ? The driver should not > be atmel dependant... As Ludovic said, you should check the settings and timings for the external memory interface. This could look more or less similar to that: foo_bar: foo-bar@5,0 { status = "okay"; pinctrl-0 = <&pinctrl_ebi_cs5>; pinctrl-names = "default"; reg = <0x5 0x0 0x80000>; atmel,smc-bus-width = <8>; atmel,smc-read-mode = "nrd"; atmel,smc-write-mode = "nwe"; atmel,smc-exnw-mode = "ready"; atmel,smc-ncs-rd-setup-ns = <7>; atmel,smc-nrd-setup-ns = <7>; atmel,smc-ncs-wr-setup-ns = <7>; atmel,smc-nwe-setup-ns = <7>; atmel,smc-ncs-rd-pulse-ns = <56>; atmel,smc-nrd-pulse-ns = <56>; atmel,smc-ncs-wr-pulse-ns = <56>; atmel,smc-nwe-pulse-ns = <56>; atmel,smc-nwe-cycle-ns = <77>; atmel,smc-nrd-cycle-ns = <77>; atmel,smc-tdf-ns = <0>; }; As you can see, quite a lot of settings are made, all depending on how the memory access is supposed to be configured. You should look out for details in the hardware manuals of the SoC and the devices you want to connect. HTH & Greets Alex