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=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 54369C432C3 for ; Tue, 3 Dec 2019 20:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30AEE20862 for ; Tue, 3 Dec 2019 20:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727188AbfLCUjf (ORCPT ); Tue, 3 Dec 2019 15:39:35 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:36479 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbfLCUjf (ORCPT ); Tue, 3 Dec 2019 15:39:35 -0500 Received: by mail-oi1-f193.google.com with SMTP id c16so4668947oic.3; Tue, 03 Dec 2019 12:39:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7TJGagGqHxNoULtw7v87VE6OdMI1b/hQDl/thVQTZzE=; b=mXZNd9wueQ/bvxQnKYAaFyPD7JG6xAauHIPa7uwffzqesrXHX+fjer4ypRn3Iau/Jp 0EsEYlsI4HuFxK/OOfvsUCoXUf0BxKbrfN6f38HR1qJ6DWq9ia39MTQ3vPhmjMngf/v0 Sw9A9AaoeU6s62sSVVvWQFhjKg/rbSH8AMQh8uHgH/4FVoLWjlf7CQhdB9x5hYs0RC9f b9d+IEWmV1ilnViMzppjgbcMgcsFNnUGlOxf1xijcRWVu0luP0mESJmZWIu2GbPpK/Vr 7q2Vgk7r16DA2xONMSdjlz76SICx1O6k6nWY4ql8Nb4qBINT+XNi/+lj4TuDjtu3YKOn fpVw== X-Gm-Message-State: APjAAAV8Wgj3wvVgpmaaACwmPIcAiJVE9dDtoiIASODse3N8g8FbLAZY +HonW6fPDKbjWmpMQEEhXbHFsVaGTk8Z/rCU6Dw= X-Google-Smtp-Source: APXvYqwZ1H+FSI71SvLv8qVzU410pqxDRtaMhvXAgAYXxZztaKCwV3k8ytvgAZtuF6dGF8AymZsIk6ZPj8IfDOHH+Js= X-Received: by 2002:aca:3a86:: with SMTP id h128mr5200706oia.131.1575405573989; Tue, 03 Dec 2019 12:39:33 -0800 (PST) MIME-Version: 1.0 References: <20191203034519.5640-1-chris.brandt@renesas.com> <20191203034519.5640-7-chris.brandt@renesas.com> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 3 Dec 2019 21:39:22 +0100 Message-ID: Subject: Re: [PATCH 6/6] dt-bindings: spi: Document Renesas SPIBSC bindings To: Chris Brandt Cc: Mark Brown , Rob Herring , Mark Rutland , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , linux-spi , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-Renesas , linux-clk , Mason Yang , Sergei Shtylyov Content-Type: text/plain; charset="UTF-8" Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Hi Chris, On Tue, Dec 3, 2019 at 7:57 PM Geert Uytterhoeven wrote: > On Tue, Dec 3, 2019 at 4:47 AM Chris Brandt wrote: > > Document the bindings used by the Renesas SPI bus space controller. > > > > Signed-off-by: Chris Brandt > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/spi/spi-renesas-spibsc.txt > > @@ -0,0 +1,48 @@ > > +Renesas SPI Bus Space Controller (SPIBSC) Device Tree Bindings > > + > > +Otherwise referred to as the "SPI Multi I/O Bus Controller" in SoC hardware > > +manuals. This controller was designed specifically for accessing SPI flash > > +devices. > > + > > +Required properties: > > +- compatible: should be an SoC-specific compatible value, followed by > > + "renesas,spibsc" as a fallback. > > + supported SoC-specific values are: > > + "renesas,r7s72100-spibsc" (RZ/A1) > > + "renesas,r7s9210-spibsc" (RZ/A2) > > Is the fallback valid for RZ/A1, which has its own special match entry > in the driver? > Will it be valid for R-Car Gen3? > If not, you may want to drop it completely. > > > +- reg: should contain three register areas: > > + first for the base address of SPIBSC registers, > > + second for the direct mapping read mode > > +- clocks: should contain the clock phandle/specifier pair for the module clock. > > +- power-domains: should contain the power domain phandle/specifier pair. > > +- #address-cells: should be 1 > > +- #size-cells: should be 0 > > +- flash: should be represented by a subnode of the SPIBSC node, > > + its "compatible" property contains "jedec,spi-nor" if SPI is used. > > What about the "mtd-rom" use for e.g. XIP? I gave this some more thought. Basically there are two modes: SPI FLASH and direct mapped emulation (HyperFLASH could be a third mode). The bindings described above are for the SPI FLASH use-case. For the direct mapped use-case, you need different bindings: 1. Append "simple-pm-bus" to the list of compatible values, 2. Add a "ranges" property, 3. The flash subnode becomes directly mapped, and must be compatible with "mtd-rom", cfr. the CFI FLASH on ape6evm: arch/arm/boot/dts/r8a73a4.dtsi:bus@fec10000 and arch/arm/boot/dts/r8a73a4-ape6evm.dts:flash@0. On the driver side, if your spibsc driver does not find a flash subnode that is compatible with "jedec,spi-nor", it should return -ENODEV, so drivers/bus/simple-pm-bus.c can take over for the second mode, if needed. Once you have added basic Runtime PM support to drivers/mtd/maps/physmap-core.c:physmap_flash_probe(), the module clock should be kept enabled through the clock domain when using direct mapped mode (hmm, as the driver currently lacks this, it means the FLASH on ape6evm must rely on the bsc module clock being kept enabled through the Ethernet controller connected to the same bsc module?). Does this make sense? Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds