From owner-svn-src-all@freebsd.org Thu Jun 2 19:03:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2058B65A57 for ; Thu, 2 Jun 2016 19:03:24 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64E7C1111 for ; Thu, 2 Jun 2016 19:03:24 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x22c.google.com with SMTP id k98so40316269lfi.1 for ; Thu, 02 Jun 2016 12:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nqjQzqPMiMOuOu2hKq80bzTTYv9Qq7nFf/AmBs2ZhVc=; b=HoNZzB+Vv78R9MqaBdNcepB21qdCFGUe8Edc/J5BkTvCxiTJYMdA0PHIE0XfWw+5Xv adqvsl4DfHNPmBgLrhkD7B8pGlVt9J1a6oVQXVm5rQLXfqhcsB3P/+qPgiOLEEYK8KE3 HtSiE26XBXLye6qU18zJTFSFSR75JkGGXVQkZKrpj5iYDWW1q6grIA8ISZfrw/HHiI7T wfQ/GbZM1MMLtrxo/gjjdUdtS5Skg8jv8AfoJ0DmnQTZCLY7FRC47IlUmFQw+KDBuKE2 diuzVu16jSHvXixtY1HjFVzM+aNzRSYYNSOXi7W+fiaQ65Kr19VrP5Wf7yDM9IvzjLqx YV6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nqjQzqPMiMOuOu2hKq80bzTTYv9Qq7nFf/AmBs2ZhVc=; b=FLmvwUoTlzCnKGHksxAUolrfExSDC/H3ARLgijrqbcnXTRNuJ6MoC8Wq1ExpDCvF/z m6N0VIdcN/w5GGSFcoDE5zP0KfvqLSnTZTTbyIZhTnHw2X21FpHY/iWSs9t/mj+mromV PxcyFwKoQfWZpmZze/r1Wxryzq+xNCWZ9jDCVHuzPMQYiqAcFYm6/V3Yhigzy/NElen0 9TQStOulAkUHMOHOIpOO2CgixbSMLM6FVMSwK/fGrpQYnEGXYqvs5cWGmZuM/BV+LMvN VxXEhIETHI9FghXYm4cBDwvCQAflbR+/hvntYaGbW1WoUmvbw3WxXUGiX65kB1gJ7nOm rTuQ== X-Gm-Message-State: ALyK8tL9cQDwhOz95UnXbey0jUVWQmXXEWcI8+p4+Bss/VBfGFuWPY1vcmhpibBfpGHGB6QYIPVQke6vQJb0Ow== X-Received: by 10.25.27.196 with SMTP id b187mr3839034lfb.218.1464894202552; Thu, 02 Jun 2016 12:03:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.66 with HTTP; Thu, 2 Jun 2016 12:03:02 -0700 (PDT) In-Reply-To: <1464893290.1204.186.camel@freebsd.org> References: <201606021831.u52IVb1O006883@repo.freebsd.org> <1464893290.1204.186.camel@freebsd.org> From: Zbigniew Bodek Date: Thu, 2 Jun 2016 21:03:02 +0200 Message-ID: Subject: Re: svn commit: r301220 - in head/sys: arm/mv dev/cesa To: Ian Lepore , =?UTF-8?Q?Micha=C5=82_Stanek?= Cc: Zbigniew Bodek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2016 19:03:25 -0000 2016-06-02 20:48 GMT+02:00 Ian Lepore : > On Thu, 2016-06-02 at 18:31 +0000, Zbigniew Bodek wrote: > > Author: zbb > > Date: Thu Jun 2 18:31:36 2016 > > New Revision: 301220 > > URL: https://svnweb.freebsd.org/changeset/base/301220 > > > > Log: > > Map CESA SRAM memory in driver attach for Armada38x > > > > On other platforms with CESA accelerator the SRAM memory is mapped > > in > > early init before driver is attached. This method only works > > correctly > > with mappings no smaller than L1 section size (1MB). There may be > > more > > SRAM blocks and they may have smaller sizes than 1MB as is the case > > for Armada38x. Instead, map SRAM memory with bus_space_map() in > > CESA > > driver attach. Note that we can no longer assume that VA == PA for > > the > > SRAM. > > > > Submitted by: Michal Stanek > Obtained from: Semihalf > > Sponsored by: Stormshield > > Differential revision: https://reviews.freebsd.org/D6215 > > [...] > > - > > + rv = OF_getprop(sram_node, "reg", (void *)sram_reg, > > sizeof(sram_reg)); > > + if (rv <= 0) > > + return (rv); > > + > > + sc->sc_sram_base_pa = fdt32_to_cpu(sram_reg[0]); > > + /* Store SRAM size to be able to unmap in detach() */ > > + sc->sc_sram_size = fdt32_to_cpu(sram_reg[1]); > > + > > OF_getprop() followed by fdt32_to_cpu() calls is properly spelled > OF_getencprop() (with no fdt32_to_cpu calls). > > > +#if defined(SOC_MV_ARMADA38X) > > + /* SRAM memory was not mapped in platform_sram_devmap(), map > > it now */ > > + rv = bus_space_map(fdtbus_bs_tag, sc->sc_sram_base_pa, sc > > ->sc_sram_size, > > + 0, &(sc->sc_sram_base_va)); > > bus_space_map() returns a bus_space_handle_t for use with other > bus_space functions. The handle is not necessarily "just the virtual > address" (although that happens to be the case right now on arm). I > don't see any bus_space_xxxxx() calls using this handle, that means > that probably the correct function to use is pmap_mapdev(), not > bus_space_map(). > > -- Ian > > Thanks Ian, We will fix this ASAP. BTW. It would be better to get this review prior to committing the patch ;-) Phabricator revision didn't attract anyone's attention: https://reviews.freebsd.org/D6215 Kind regards zbb