Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751961AbaK1PfG (ORCPT ); Fri, 28 Nov 2014 10:35:06 -0500 Received: from mail-ig0-f182.google.com ([209.85.213.182]:64804 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142AbaK1PfE (ORCPT ); Fri, 28 Nov 2014 10:35:04 -0500 MIME-Version: 1.0 In-Reply-To: <857cab03bd6445c59cc345349a00f67c@BL2FFO11FD010.protection.gbl> References: <6741d995fbec801d795c5db481e39425bd912f8a.1415962281.git.michal.simek@xilinx.com> <857cab03bd6445c59cc345349a00f67c@BL2FFO11FD010.protection.gbl> Date: Fri, 28 Nov 2014 16:35:03 +0100 Message-ID: Subject: Re: [PATCH v4 5/6] ARM: zynq: Add OCM controller driver From: Linus Walleij To: Michal Simek Cc: "linux-arm-kernel@lists.infradead.org" , Soren Brinkmann , Olof Johansson , Arnd Bergmann , Michal Simek , Josh Cartwright , Steffen Trumtrar , Rob Herring , Peter Crosthwaite , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Grant Likely , Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Joe Perches , Mauro Carvalho Chehab , Antti Palosaari , Jingoo Han , Sandeep Nair , Santosh Shilimkar , Andy Gross , Thierry Reding , Peter De Schrijver , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 27, 2014 at 2:57 PM, Michal Simek wrote: > On 11/27/2014 02:20 PM, Linus Walleij wrote: >> On Fri, Nov 14, 2014 at 11:52 AM, Michal Simek wrote: >> (...) >>> + zynq_ocmc->pool = devm_gen_pool_create(&pdev->dev, >>> + ilog2(ZYNQ_OCMC_GRANULARITY), >>> + -1); >> >> Do this: >> >> #include >> >> zynq_ocmc->pool = devm_gen_pool_create(&pdev->dev, >> ilog2(SZ_64K), >> -1); >> >> And get rid of the #define for ZYNQ_OCMC_GRANULARITY > > ilog2 from 32 is different to ilog2 from ilog2 from 0x10000. Bah I misread the code, forget this comment. Maybe it's more like I wanted +#define ZYNQ_OCMC_BLOCK_SIZE 0x10000 To be replaced with SZ_64K But it's a petty detail anyway. > Do you have any opinion regarding calling zynq_slcr_get_ocm_config()? > > Is it better to expose slcr this interface to drivers? > Or use regmap and read this value directly? Depends on what provides that call. The pattern I usually follow is to expose the mixed-registers range as a syscon device using drivers/mfd/syscon.c and then use one of the methods from to look up a reference to the regmap and use it to access misc registers. > Also I do read for CONFIG_SMP case jump trampoline size - maybe > you can have better idea how this can be done. No I have no clue about that... :( Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/