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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D3CEC433F5 for ; Fri, 29 Oct 2021 11:49:38 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9C1BD60FC4 for ; Fri, 29 Oct 2021 11:49:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9C1BD60FC4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D3AB38356D; Fri, 29 Oct 2021 13:49:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=walle.cc header.i=@walle.cc header.b="UjtukELM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5D6178321B; Fri, 29 Oct 2021 13:49:28 +0200 (CEST) Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) (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 709048321B for ; Fri, 29 Oct 2021 13:49:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 3D45622221; Fri, 29 Oct 2021 13:49:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1635508161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=epTSf+wSc8VGb5uiEvVljvPmApvmiDG7Oowcez/gH2g=; b=UjtukELMwo//sjHG4LPomzBT3dnY7AFpbVosPEagr1uzfcQ29jxKCNWXo4d1C6fIgnmXPo +yUXEZxHwXgvwGXOzqcYuzoTO84/McdxLei7BpPdSrN/9/F7UVdqZOwFfsY0qoMjkSQGbv m0nTaZeBlxl9nOdTjM0qph/S92/VuAo= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 29 Oct 2021 13:49:21 +0200 From: Michael Walle To: Marc Zyngier Cc: u-boot@lists.denx.de, Vladimir Oltean , Hou Zhiqiang , Bharat Gooty , Rayagonda Kokatanur , Simon Glass , Priyanka Jain , Tom Rini Subject: Re: [PATCH 2/2] Revert "arch: arm: use dt and UCLASS_SYSCON to get gic lpi details" In-Reply-To: <87k0hwua9m.wl-maz@kernel.org> References: <20211027165454.1501398-1-michael@walle.cc> <20211027165454.1501398-3-michael@walle.cc> <87k0hwua9m.wl-maz@kernel.org> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <9ecafe6c05395d5e382a91c292362e0b@walle.cc> X-Sender: michael@walle.cc X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi, thanks for the review, as Tom already mentioned this is just a revert. I'm still unsure wether I should care or not. Actually, NXP or Broadcom should. OTOH it would be nice if the kontron_sl28 can do kexec also with booti (and not just bootefi). Anyway, I still have some remarks. Am 2021-10-28 23:09, schrieb Marc Zyngier: > On Wed, 27 Oct 2021 17:54:54 +0100, > Michael Walle wrote: >> >> Stop using the device tree as a source for ad-hoc information. >> >> This reverts commit 2ae7adc659f7fca9ea65df4318e5bca2b8274310. >> >> Signed-off-by: Michael Walle >> --- >> int ls_gic_rd_tables_init(void *blob) >> { >> + u64 gic_lpi_base; >> int ret; >> >> - ret = gic_lpi_tables_init(); >> + gic_lpi_base = ALIGN(gd->arch.resv_ram - GIC_LPI_SIZE, SZ_64K); >> + ret = fdt_add_resv_mem_gic_rd_tables(blob, gic_lpi_base, >> GIC_LPI_SIZE); >> + if (ret) >> + return ret; >> + >> + ret = gic_lpi_tables_init(gic_lpi_base, cpu_numcores()); > > This really should fetch the number of CPUs from the DT rather then > some SoC specific black magic... Remember that this is the bootloader. There might be a chicken egg problem. I guess, usually the bootloader will fixup the number of cores in the DT. Therefore, if we rely on the DT here, it has to be fixed up before this code is run. Conceptually, I'm unsure if this should actually be a driver (UCLASS_IRQ). It's just setting up the interrupt controller, it doesn't provide any ops. So it might well be called from somewhere else instead of binding as a driver to the gic. If it will be a driver, then the call to gic_lpi_tables_init() should go away. Instead the driver should just set the tables up. If its not a driver, then gic_lpi_tables_init() (maybe renamed to gic_v3_lpi_tables_init()) should work without anything else and it should scan the device tree for the compatible node and fetch all needed information to set up the tables. In any case, all this code should be guarded by a Kconfig option which clearly states *why* this is needed. Thoughts? -- -michael