Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp38652lqh; Fri, 3 May 2024 12:35:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRnU2B9BIoTVcolPZmlEUwGkClU2sAPytnNVwu9CYk34ItKDcn/y5799k6aqVz/QDOvw6b3iHcsYCvZyvTptD3rayUx4+i4ya5Ugq+5A== X-Google-Smtp-Source: AGHT+IHseUP7hDKeJZJbL2LHKn7zWPgT8HWvPRGknAA6lCKo9YefaBAe9S3t/hAXwC8JyrCQJHFw X-Received: by 2002:a17:902:eac4:b0:1ec:b6e2:da89 with SMTP id p4-20020a170902eac400b001ecb6e2da89mr4005469pld.61.1714764957264; Fri, 03 May 2024 12:35:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714764957; cv=pass; d=google.com; s=arc-20160816; b=fYDVgtGN4JI6nwqX4GvxfWYD3tuyjDUBpJ2+XCG7hAb+hnFTdqs3Wl27UAN/1jlXl5 YNGTvkQMnFUF+qSUYzOyExJb/UCYCjCvZJK7F0Q/1/1xbiCwxbnEVkxYrNbhCUxbJFSp chnQHdNtiijNtiFE2IlncyGbCUBKIGLQCHTWRL+7BUi6JVyu6+dWdThKJg2vRI5FzSxh DAura38aTIgThuWdAzzleW8/IBbZqGgDvHRf/lO7JfBJgL5LyTkxFRNO6f+m4O3lUF59 ULrlJg9vB/C49CKIrO+kRMhdX5qT0YewiMmwGGnz/yUi8fLZfXTW7CO5UO3GIQD0em+g 6QJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:subject:cc:to:from :date:message-id:dkim-signature; bh=U0mqsADwP2HKMLmT/kWuFaaNyNjoyU0vnELezZHXEzQ=; fh=NPFhqiaUdFsrWt2rLgDTLog8O1pBHAHljhlZYhIGhgU=; b=n2f4Zk55brHr2p9DKaSjXIrk1BugxP/+QW/FhpqvcvWAMKlNN9F3LMp1Kdvj5jaztA iXlpDPxGHJImMymNdEM3Xu63WtzoEh1Zn0RV7DGjx9W1ZF3kI0yF2XBubxmYum0MZYY+ riXtHo0p3JfXxjg9upN5Oajj1S936zAh/20j5G9zoUadmGG9WVVOMAaqhga7o0hLxvch HhfI15/BPdtxjHycyPt/1n7uAolvQJ17uX/UQ9IZzJdMCj1az8N2C2fRXk8KSdGpMaLc YHp5r1Z6v5p4dfYmXtsFmwKYvcBLEtvjcvX6gnu8rE+iGoBLXkqaY86Q8rhmY65+rPLT WO6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Eo5QI00p; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168141-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168141-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ix18-20020a170902f81200b001eb6e2ea9ffsi3387960plb.279.2024.05.03.12.35.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 12:35:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168141-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Eo5QI00p; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168141-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168141-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AA1B92814BF for ; Fri, 3 May 2024 19:35:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9FBA158A11; Fri, 3 May 2024 19:35:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Eo5QI00p" Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50A0E2206E; Fri, 3 May 2024 19:35:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714764950; cv=none; b=p8r4sblhTg9Pkq68IxpQDeu3kttXJ3nusMSGt0+cFSdO3HWCe1LcYI/OXFj8ZeyP7frkfO4rabooUbvIDqSsM5zSLFaNDdTCfenyQO4rfC0FlzKJtRr35uDOW8n1DOLTycix9Sc+BsoUnxH/HWO1j8g7TRj16xvs6Z5B22ReYV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714764950; c=relaxed/simple; bh=OhK3E+a940tahvBPeiK0xswt7avRqyafDuFtSYMIobs=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N3SZTZSndJSn2TfTLHN5xPsWmep7VAaBh2rgbT5g3x6z+GM9yyKlHfyGtMsME2DzkfX0+63EkL4QaV8x2nuT+4MLijNGbzS2U+0ZIZRy9et5lzzuMu+73f+AqQ4a86PWinGqAWatZtISODIDROafQj9cXaGcBmy6BScut8KzKNo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Eo5QI00p; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-34d96054375so5978f8f.2; Fri, 03 May 2024 12:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714764948; x=1715369748; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=U0mqsADwP2HKMLmT/kWuFaaNyNjoyU0vnELezZHXEzQ=; b=Eo5QI00p1NBIHgNKBOAYzVrJ9Y1VfFACJQ3IMblkIOeSiQJ4B1niWy8QPcMWgQMOuL FZtc2pANoDkooo5iKlv0rn53DPu/Pn7QSDZbtaT6NNQs7cSD4EsNbNUJNWNm/avgSmBZ ap5ry83Bt9wLh672e6YfmVsDMJoY85G0oTC++AuqmXuLGfFXfn3If2jyLdWlp6Fuk8hV 5ZNEZZf+DeIKY9aYccVhN8Uucawb5RTngqgtEJQqeVcwYdcLkZE9/jINnAAHXm5GE8Dp hrx/fGogEk8puCDj/VssnRM2LAxbREtgA53j+tyzqk8zIUCosxnF5ifeRcy9hTeY2W7X FS+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714764948; x=1715369748; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=U0mqsADwP2HKMLmT/kWuFaaNyNjoyU0vnELezZHXEzQ=; b=Xq3EuHbR83BxT6+UasNrlbTHrnuS/4EMi/3Oyj8/5pUi/33ibp72S3z1N1zfO86B28 3GuUg+yCIh//r4Yc54apkayB2S855rWm/Sf5iSHyqHAnOssuovQzAjkIQlHLIUEdaQQ6 s6MRvx4L7A9ALqYh8rt1OC/CsIBput/BULC4k0LLKD7Ay0s0Sloue9owfmlopoILrgRg OF/wUWS8CtGwSKNHPhgqa9RfaxSsWkjQwpIhFLGqcxV2sBVghx9IgeZ5eDVRNIZa3TTP xB0HSuq68vzMN9ECopSjGJZQhzQB1JR/2WvdervH8NyUPwbQ7fDa/5u/JuHwnroT7P9y 32CA== X-Forwarded-Encrypted: i=1; AJvYcCU5Qy6jzRIRE7Ila8VWzb7W6tZYK3Sk77HTIyTmBzd3ttZz5Ni7HStQJxvq6Azr9Us9pCgx6ZWfXjLaihsxbOvoDPuTmFMcYR30ISL5U62EJQIFFd5/Q/9eObcw6Mna1AojBq5Vh9h4T2PyWXvY7HlqwRRaLS3kV9kl9VGgVq94k4s24Zk= X-Gm-Message-State: AOJu0YyyYOqFzyKRCLUIT2lKyCZ5dLwbAi4nM5o3vdpo45JRr7N3iTWU LkVPtvTxE2q6o+cW4EbLVxxOav+NFpF/KZMbneJ5KyJb4mzd59yF X-Received: by 2002:a5d:558e:0:b0:34d:b605:ec68 with SMTP id i14-20020a5d558e000000b0034db605ec68mr2531426wrv.17.1714764946919; Fri, 03 May 2024 12:35:46 -0700 (PDT) Received: from Ansuel-XPS. (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.gmail.com with ESMTPSA id s11-20020a05600c45cb00b00419f572671dsm6673868wmo.20.2024.05.03.12.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 12:35:46 -0700 (PDT) Message-ID: <66353c92.050a0220.fd42f.7cfb@mx.google.com> X-Google-Original-Message-ID: Date: Fri, 3 May 2024 21:35:44 +0200 From: Christian Marangi To: Florian Fainelli Cc: Hauke Mehrtens , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Thomas Bogendoerfer , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Broadcom internal kernel review list , =?iso-8859-1?Q?=C1lvaro_Fern=E1ndez?= Rojas , linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel =?iso-8859-1?Q?Gonz=E1lez?= Cabanelas Subject: Re: [PATCH 4/6] mips: bmips: setup: make CBR address configurable References: <20240503135455.966-1-ansuelsmth@gmail.com> <20240503135455.966-5-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, May 03, 2024 at 12:09:02PM -0700, Florian Fainelli wrote: > On 5/3/24 06:54, Christian Marangi wrote: > > Add support to provide CBR address from DT to handle broken > > SoC/Bootloader that doesn't correctly init it. This permits to use the > > RAC flush even in these condition. > > > > To provide a CBR address from DT, the property "mips-cbr-reg" needs to > > be set in the "cpus" node. On DT init, this property presence will be > > checked and will set the bmips_cbr_addr value accordingly. Also > > bmips_rac_flush_disable will be set to false as RAC flush can be > > correctly supported. > > > > The CBR address from DT will be applied only if the CBR address from the > > registers is 0, if the CBR address from the registers is not 0 and > > is not equal to the one set in DT (if provided) a WARN is printed. > > > > To ALWAYS overwrite the CBR address the additional property > > "mips-broken-cbr-reg" needs to be set. > > > > Signed-off-by: Christian Marangi > > --- > > arch/mips/bmips/setup.c | 30 +++++++++++++++++++++++++++--- > > 1 file changed, 27 insertions(+), 3 deletions(-) > > > > diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c > > index 18561d426f89..bef84677248e 100644 > > --- a/arch/mips/bmips/setup.c > > +++ b/arch/mips/bmips/setup.c > > @@ -34,7 +34,11 @@ > > #define REG_BCM6328_OTP ((void __iomem *)CKSEG1ADDR(0x1000062c)) > > #define BCM6328_TP1_DISABLED BIT(9) > > -/* CBR addr doesn't change and we can cache it */ > > +/* > > + * CBR addr doesn't change and we can cache it. > > + * For broken SoC/Bootloader CBR addr might also be provided via DT > > + * with "mips-cbr-reg" in the "cpus" node. > > + */ > > void __iomem *bmips_cbr_addr; > > extern bool bmips_rac_flush_disable; > > @@ -212,8 +216,28 @@ void __init device_tree_init(void) > > /* Disable SMP boot unless both CPUs are listed in DT and !disabled */ > > np = of_find_node_by_name(NULL, "cpus"); > > - if (np && of_get_available_child_count(np) <= 1) > > - bmips_smp_enabled = 0; > > + if (np) { > > Please reduce the indentation with early return/gotos. There might also be a > need to do some validation that the CBR is at least outside of the DRAM > window, that is we cannot blindly trust the DT to have gotten the CBR right > IMHO. Do you have any hint on how to do the check if we are outside DRAM? -- Ansuel