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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73863C61DA4 for ; Mon, 13 Mar 2023 13:26:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DD4CD860F3; Mon, 13 Mar 2023 14:26:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=metanate.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=metanate.com header.i=@metanate.com header.b="EXAf6c/e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C3363860F3; Mon, 13 Mar 2023 14:26:21 +0100 (CET) Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4210E85CF9 for ; Mon, 13 Mar 2023 14:26:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=metanate.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=john@metanate.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=In-Reply-To:Content-Type:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=HaarjdOGuWuKuhPguFodtOo4qvcr+EAzxmlUOidNLg8=; b=EXAf6 c/e09GAzOqq78tW7d9PrQhPlxR+XR6U6oXDg+iEn7T+ZtVIUeYNNz9GaGnk/OtY7qwRTQRriBRcoC lWuj4xGr6XOkytVZBJQXo8ae0nv/oaKPljcbaZglL7UKZQ90FkAXEn/WkU+bhN13S7ljHvkgvDWJN FU/QE/7j9Jq8ln1MYOP6Vj0h5BTZUYZ9S5EFTKfP8+cAswGFXjC5xxZWmmx/658gQo8X12AXzY2jD UhUH44vDjogMfaWYt6SlslCHe2ZxQAmXHyzmbfvnPegIw0msJPMSxyzFnbNT0nAKdUPu7vs7BV3e+ OutYKvEUKq0AdZasOcEg5I3f6mf/Q==; Received: from [81.174.171.191] (helo=donbot) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pbiBl-00082S-Ed; Mon, 13 Mar 2023 13:26:09 +0000 Date: Mon, 13 Mar 2023 13:26:07 +0000 From: John Keeping To: Johan Jonker Cc: dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, sjg@chromium.org, philipp.tomsich@vrull.eu, kever.yang@rock-chips.com, u-boot@lists.denx.de, yifeng.zhao@rock-chips.com Subject: Re: [PATCH v8 13/24] rockchip: rk3288: syscon_rk3288: store syscon platdata in regmap Message-ID: References: <6e68b95b-bf55-647d-df5e-cbbce20257f0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e68b95b-bf55-647d-df5e-cbbce20257f0@gmail.com> X-Authenticated: YES X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On Mon, Mar 13, 2023 at 01:30:57AM +0100, Johan Jonker wrote: > The Rockchip SoC rk3288 has 2 types of device trees floating around. > A 64bit reg size when synced from Linux and a 32bit for U-boot. > A pre-probe function in the syscon class driver assumes only 32bit. > For other odd reg structures the regmap must be defined in the individual > syscon driver. Store rk3288 platdata in a regmap before pre-probe > during bind. > > Signed-off-by: Johan Jonker > --- What is special about the rk3288 syscon that means the driver needs this handling? Isn't this a general problem for DTs with 64-bit addresses on 32-bit systems that could be solved in syscon-uclass.c? I suspect it's difficult to handle the general case since #memory-cells may be difference for difference syscons so a global constant doesn't work, but the approach in this patch seems incredibly verbose for something that is likely to be needed for many platforms. Could we use driver flags with something like: .flags = of_platdata_reg_size(struct rockchip_rk3288_noc_plat), and this untested macro: #define of_platdata_reg_size(s) \ ((sizeof(((struct rockchip_rk3288_noc_plat *) 0)->reg) == 64) ? \ DM_FLAGS_PLATDATA_REG_64BIT : 0)