From patchwork Thu Nov 23 15:26:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168981 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp525541vqx; Thu, 23 Nov 2023 07:27:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+bXfUXmWUxHrvPHLKGqQPNdAHgRWMa4+BYja1JF+hWP/abpdjrZXj0308E6NDRho9Bd8R X-Received: by 2002:a17:90b:1809:b0:285:7f4b:2a6e with SMTP id lw9-20020a17090b180900b002857f4b2a6emr468883pjb.30.1700753240587; Thu, 23 Nov 2023 07:27:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753240; cv=none; d=google.com; s=arc-20160816; b=S9MkAyodd9eG3fPnm0d/pAABNCEiFTq7sJNrfdMA6kOzaxFTvi2cagdbwhraIG5Ixk /ry4OGKTPdhKXaIyZHAnv7M76b95eVEjPrBYGoXZ1/Eh55LvEpH8x/Xu2Otgk1FNELRm QQFlgYAh4RWFZicm0rixlj+yWM16GpCuDKk0GGcuiDg0yjkduVVOoTYp2mPsQK+SRHhc jGtc8fYpOO51LxDWP7ie4K0Iw7lzSEh3LX4Y5ExywIVy6RZK5Z3+L0VRd8+hZUN2b4/9 7xDgKzAocHfRMHn2juhLdH206GoNL3vXgX0cLo99GtcUA3e9S+wxnPxX2ymQ4BoJJXx0 r19w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F1EYqlVYF1fJ33cC2a0Mertg3uhTJJ/NIkImZDHepJg=; fh=RBP3N/z2dRF20CQ37qwMigTrhQ/jDE9ZZ/B9XmmkgnU=; b=NBop9vvCRT6S9/BzV31xKy1vpRE+tfE13Qiz4kAwatTFe2ERNUwrnRNYN1FzwDQM4Z ypGVu2zpCkbnMisPug97q+EFhGC2rxpatBRHBb/1OJqz/A4vqy9t3lEXSP00sfUCX3d/ Hn9Q3N9/CVidVenKU0+NyGnD/De7CuhtPODrFCPXuTcOuKE4uLdefmCnqyvbMuELm3Te ibB8Ugc04OxLjT7/GmT8DHtcD1yb64D/RDFP8rQa6lzLiRTT7RQMg1wMFV2eiwFRYBto Xs1BwYoaTfMaYzvw5dYuTitLsw8olquG1hlrpye2tg9wKCWFK9ja1n8g36fRCknykoCm bGDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Qa0TaAX3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b3-20020a17090a9bc300b00280c9b49738si1520651pjw.84.2023.11.23.07.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:27:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Qa0TaAX3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id BB6A28087CBF; Thu, 23 Nov 2023 07:27:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346074AbjKWP0t (ORCPT + 99 others); Thu, 23 Nov 2023 10:26:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346059AbjKWP0r (ORCPT ); Thu, 23 Nov 2023 10:26:47 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A2C3D5A; Thu, 23 Nov 2023 07:26:52 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B949424000C; Thu, 23 Nov 2023 15:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753211; 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=F1EYqlVYF1fJ33cC2a0Mertg3uhTJJ/NIkImZDHepJg=; b=Qa0TaAX35przqfse0Y7pj19YS8keDDV1tZXDJA74SmXNXAAw+P/mEhobnbrAHkicEhQX7P IylTzzUBtrXI3qMH6FqGegR7P9u8iB3YhnGTyAc2wFcm4yeLqw9a8oPJsTm5D0k6PF7m7N m9WgwgEDDPnPNVkMAqZjnVagYxNfKsqjTrNNZ2e71Nf0hWcGA7ZfX/vd+THXdVEPovQFnq f8WyYJKBKThZBAic8j3xqrrbKtNaOQ1qtSVQ1RNJryMKGvdYOOoluMOa6Vts7VRgH7mPiQ mpJkztcNxwRKn7NnWd+p+2035Q0Xw8Im/92jbjxFVg95QZI8hJDCFac6SKHh3Q== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Florian Fainelli Subject: [PATCH v2 01/21] MIPS: compressed: Use correct instruction for 64 bit code Date: Thu, 23 Nov 2023 16:26:18 +0100 Message-ID: <20231123152639.561231-2-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369029508414287 X-GMAIL-MSGID: 1783369029508414287 The code clearing BSS already use macro or use correct instruction depending if the CPU is 32 bits or 64 bits. However, a few instructions remained 32 bits only. By using the accurate MACRO, it is now possible to deal with memory address beyond 32 bits. As a side effect, when using 64bits processor, it also divides the loop number needed to clear the BSS by 2. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Florian Fainelli Signed-off-by: Gregory CLEMENT --- arch/mips/boot/compressed/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/boot/compressed/head.S b/arch/mips/boot/compressed/head.S index 5795d0af1e1b2..d237a834b85ee 100644 --- a/arch/mips/boot/compressed/head.S +++ b/arch/mips/boot/compressed/head.S @@ -25,8 +25,8 @@ /* Clear BSS */ PTR_LA a0, _edata PTR_LA a2, _end -1: sw zero, 0(a0) - addiu a0, a0, 4 +1: PTR_S zero, 0(a0) + PTR_ADDIU a0, a0, PTRSIZE bne a2, a0, 1b PTR_LA a0, (.heap) /* heap address */ From patchwork Thu Nov 23 15:26:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168988 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526112vqx; Thu, 23 Nov 2023 07:28:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAfPQeFfzOwIqWZiI2+GT4cJOQ5RGN+RCpIbTWSUBakPkBiTpXEvMpzLU99pigAcMX8tH0 X-Received: by 2002:a05:6a21:33a7:b0:18a:d7a8:5e65 with SMTP id yy39-20020a056a2133a700b0018ad7a85e65mr6898120pzb.0.1700753297579; Thu, 23 Nov 2023 07:28:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753297; cv=none; d=google.com; s=arc-20160816; b=Q7ABHVBBfkWh7SOWzqGvRQAvTFyqv55TvXWmlOLbyiJc1IjjGseOmY5nM0tnNxGB8O V1VFyutg/RyBclF0zF9SQ0JG/ILvsRSe8vUOX/oW2zaFHUFOR1B2IKlkOXm4xbUqBdKW x5vs+WB15PI2P6r0blMJMlBympvofj/E6QYS08QmsNJUI9jjf7fyUpKPJVB9DXG5NcmL w3NyoSx3u9T3YnojIWXRKobDDrGv+BdLkHe6Oz/Cky/Q8x1g3GdfxYfbYyXyzgDjT+o2 7my4dCPos0uvifIDRdgBTMTRNokfre86CL8pgDgNS5pnmONhawSZ0eA8GRMFiAIg8FJP Tsmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1f+FndhwKpT84ogIpFFowDtfhlo7ZPzn2H3k9c4MjvQ=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=vOP7hWdi5y+KPWOb39Y9Bqp4dJklmrQbrNPjBy7XjlDrGcVuWiM74yXDLThckPgUma 1M5UoUnsCraLAgTkN1DQRy02GAiEk+XI/qlhP+V+IjIc0nesqeaTO3UIgWFHVzyuoIb0 RcELzVm71edGHj9mJPQngR4ZY1KE/BXEWz86oPWdqcdFjAl1JzGyANU9F4ubeCmoEDhZ 0bDfpUg5bQODlwWZr/KESrfUoJSPtKyaxmGscVRPgh3LYLS8dLLZggZlUNaKRcIZj8jh 9A2DF/+KIAHKieT3KrvAB12fq9SaOomVXf5W1PHTXaviBbPvld8U8Co0LHiu+iV+vFHC Ef2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=N9vbZ3sa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id r24-20020a635d18000000b005bdfdf1c44dsi1558312pgb.126.2023.11.23.07.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=N9vbZ3sa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 65AF981D7A5D; Thu, 23 Nov 2023 07:27:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346088AbjKWP0w (ORCPT + 99 others); Thu, 23 Nov 2023 10:26:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346077AbjKWP0t (ORCPT ); Thu, 23 Nov 2023 10:26:49 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF395D47; Thu, 23 Nov 2023 07:26:54 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id AB54E1C0007; Thu, 23 Nov 2023 15:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1f+FndhwKpT84ogIpFFowDtfhlo7ZPzn2H3k9c4MjvQ=; b=N9vbZ3sagg3yKsh3rO2aHdke9mhNbfLP8cQOn1mlqF1SIhHBH5gAB10dqgaIuiyilVo3Zt m97/8KOqOKCWioiU+maCRhzi2OXJaNoAbR/BXml23wmHte+AoYKoLbiE5hDFMF+k0BSmc7 G83MRAq7RZbogq2QriPCJQzpkUxB6cZ4Q1UtphWA43kJcsLtq0lQipxIjyYEyPKwVrjIdK A7Cczls0Dww3Mt0+gi8a9saGDD14rwwIt9/y7djk0UrfL8F3wK/luVl1mFIz2NAYoMYVY3 Y16zpQwyUNOvNNs+GWNgeHAdeKJsRj9bJ9DGslUozby2oTiAweI/pYVkJjLnXA== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v2 02/21] MIPS: Export higher/highest relocation functions in uasm Date: Thu, 23 Nov 2023 16:26:19 +0100 Message-ID: <20231123152639.561231-3-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:08 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369090094680758 X-GMAIL-MSGID: 1783369090094680758 From: Jiaxun Yang Export uasm_rel_{higher,highest} functions. Those functions can be helpful in dealing with 64bit immediates. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/uasm.h | 2 ++ arch/mips/mm/uasm.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/uasm.h b/arch/mips/include/asm/uasm.h index 296bcf31abb57..12db6d2fca070 100644 --- a/arch/mips/include/asm/uasm.h +++ b/arch/mips/include/asm/uasm.h @@ -196,6 +196,8 @@ void uasm_build_label(struct uasm_label **lab, u32 *addr, #ifdef CONFIG_64BIT int uasm_in_compat_space_p(long addr); #endif +int uasm_rel_highest(long val); +int uasm_rel_higher(long val); int uasm_rel_hi(long val); int uasm_rel_lo(long val); void UASM_i_LA_mostly(u32 **buf, unsigned int rs, long addr); diff --git a/arch/mips/mm/uasm.c b/arch/mips/mm/uasm.c index 125140979d62c..6846bf2084c5e 100644 --- a/arch/mips/mm/uasm.c +++ b/arch/mips/mm/uasm.c @@ -425,7 +425,7 @@ int uasm_in_compat_space_p(long addr) } UASM_EXPORT_SYMBOL(uasm_in_compat_space_p); -static int uasm_rel_highest(long val) +int uasm_rel_highest(long val) { #ifdef CONFIG_64BIT return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000; @@ -433,8 +433,9 @@ static int uasm_rel_highest(long val) return 0; #endif } +UASM_EXPORT_SYMBOL(uasm_rel_highest); -static int uasm_rel_higher(long val) +int uasm_rel_higher(long val) { #ifdef CONFIG_64BIT return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000; @@ -442,6 +443,7 @@ static int uasm_rel_higher(long val) return 0; #endif } +UASM_EXPORT_SYMBOL(uasm_rel_higher); int uasm_rel_hi(long val) { From patchwork Thu Nov 23 15:26:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168991 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526172vqx; Thu, 23 Nov 2023 07:28:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTu7n2IykCldh1zZnqRxHRwsYgApFEI4Uv40HwSBfdtoVGquF14m8zHwSIZrNVhqIOxAKw X-Received: by 2002:a05:6e02:1ba5:b0:359:4223:5731 with SMTP id n5-20020a056e021ba500b0035942235731mr5668067ili.30.1700753303270; Thu, 23 Nov 2023 07:28:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753303; cv=none; d=google.com; s=arc-20160816; b=RCeObfD/OUTzlDOJpW760lbg+LU6ZaT8ruEe/X5Pksn79fm2N6nBMaUtgK/nnBKci5 kxEkr6b6Iemjqn9os9goZlnLxSkHLZ1KyICYRYi3Ltq7Ots8Ip6X1A5pIhDQDxiouGth aepGkUvn+7ruRCSGHeNSGe+dNnDBWPRd1x8plOMPavlI+rutmBz/M4ZlFSbFN69mvz2c +b+QLOszHf0WdkBOOWed7B5/rN4CkW7tvfqsLdqaU/YvR+5Tb2PDbxWc0TXrSJXEYde8 G1piU1Kf0cNdwiuEzOMraUGEE8vKuT9jjEgnMfhYyZimwGY+qGgkbYMCoFg+PAgjxK9a OXSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mwMGUZspLb3scKoCxR0kEqf6HvwmvWkmRHeYsxLYvU8=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=EhfXo4l3bLnLFz7KrBsYb3SuiMWcmjvkJW5EZ8ExJM36NuQ2NAtA+e14YxirlU/NFL hHPkJn5GT/EReR4KJ9b861/QprHrkkT3tNSfLDYGJD+EhP1Rxx/7Gh0zIZNCslsDq+dZ BRJhb9rJFkq8vOPQ5bU51SXOa0fVznCB6HVbUyGWhV+CEhnuL5w173e5iPpElm0s4oRx JCXVcnkCT1nWltMXwcN8goLjcwTh2vYHP/MZ1qMdTgFbVCS840+GgWEwurZCAEMAXIkQ qYTubgyWmuPoIdiyJdlItr7q77NkNnhsu6kG/ZN84yK3od5EavLRiGMN7ZW9JvjA1BdZ VXaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=XmFvkkbx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 37-20020a631865000000b005b8ed896e82si1436370pgy.503.2023.11.23.07.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=XmFvkkbx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 420588216909; Thu, 23 Nov 2023 07:27:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346111AbjKWP1C (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346073AbjKWP0u (ORCPT ); Thu, 23 Nov 2023 10:26:50 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BD8FD4A; Thu, 23 Nov 2023 07:26:55 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7E17240006; Thu, 23 Nov 2023 15:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mwMGUZspLb3scKoCxR0kEqf6HvwmvWkmRHeYsxLYvU8=; b=XmFvkkbxbgrkDydlHmr4XJiBqyJc/Ls7wexVp90rJUDjbPvSrd0GPYtDvqocImDFC1XFAw LprUJiKqJ9aGmBKu2YCQnMMaT6aiLfjLpVtNo5IM3JK/79IovoIx/Z0yf0fk3FTDCpLDxm JmTWtumZtgWfjSuBSz730oppUObI4YP1fNjBFqXShxqbHFSfqBgIgkH7erOCD3U2chgXyY aHwb66AXyWVG4M6xkwB0SiZ+NmnI8lfPBE2qksB0O+ISH2cMvivkPwy/edbRZY87W+6qnR dEFOr9sHjedaE0s+rINFhNKNKa5xvzj1yjwbLDkQr+gJr4srSUv3moFBgs21NA== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v2 03/21] MIPS: spaces: Define a couple of handy macros Date: Thu, 23 Nov 2023 16:26:20 +0100 Message-ID: <20231123152639.561231-4-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369095790185962 X-GMAIL-MSGID: 1783369095790185962 From: Jiaxun Yang KSEGX_SIZE is defined to size of each KSEG segment. TO_CAC and TO_UNCAC are brought to 32bit builds as well, TO_PHYS remains to be 64bit only as we want people to use __pa to avoid mixup compat address space. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/addrspace.h | 5 +++++ arch/mips/include/asm/mach-generic/spaces.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h index 59a48c60a065c..03a5e2c8b5dc9 100644 --- a/arch/mips/include/asm/addrspace.h +++ b/arch/mips/include/asm/addrspace.h @@ -47,6 +47,11 @@ */ #define KSEGX(a) ((_ACAST32_(a)) & _ACAST32_(0xe0000000)) +/* + * Gives the size of each kernel segment + */ +#define KSEGX_SIZE 0x20000000 + /* * Returns the physical address of a CKSEGx / XKPHYS address */ diff --git a/arch/mips/include/asm/mach-generic/spaces.h b/arch/mips/include/asm/mach-generic/spaces.h index b247575c5e699..05db19521e817 100644 --- a/arch/mips/include/asm/mach-generic/spaces.h +++ b/arch/mips/include/asm/mach-generic/spaces.h @@ -79,11 +79,12 @@ #endif #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) -#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) -#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) #endif /* CONFIG_64BIT */ +#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) +#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) + /* * This handles the memory map. */ From patchwork Thu Nov 23 15:26:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168993 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526224vqx; Thu, 23 Nov 2023 07:28:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJDWiJFGbpnDgz4y2f9mUPfTQfaoMPXgFcz59Nfj6mAqBHVUVf686kzbYZ/UWI4d2Yj/yW X-Received: by 2002:a05:6a00:23d6:b0:6cb:8c70:47c3 with SMTP id g22-20020a056a0023d600b006cb8c7047c3mr4583564pfc.0.1700753307907; Thu, 23 Nov 2023 07:28:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753307; cv=none; d=google.com; s=arc-20160816; b=v+W6CCcRt+YWNo+PMnDzXr6a5FDeW0DxIw0nvCcpSsElLdsVF+CI9kENAQFHVn+kHb 7v9Ea0mdSs34G5tQs8L6LuCeI3xJhJqCyKgddzekaVY2U+bLBeGyNdqc7SmwUsUYE7sx oRlB9e2v1kPUkH5qGzd1z4MUo0ORBLSBFvdHmD/PSo9YTVC26cTKnDTXyRV+vcYYStCl IzlHdsizvDdZLIub6Udxk4YuIF+BAZcNRqmwmg3vgeUPU8Ws9hVb0/GLEoissjWnXLFV w7MLpJ8pHgx2mMD2oDKdn5ot5SocrLTPj87sD8AqiMvhy5re4kutwqEik/Hv7+d5eygV 6nug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AagYqurduAd05kHY0ow9kHcvI+mUo3FUEEyQW1aeXWI=; fh=MwmhOnPCNEKQUh9CETmL1NjqsCe+66NMqSNy76XJ1mw=; b=cmUQXvBjzG+YCvb+dTywJm3Ayx2XqKSGpEwpjnNY3KdDM/1SEJfmidyMp1JOYFshyK tAMz7xl0I68hY6nuazbQXrqD+yum8pwrJFsg1vheze+IG9ioY9qq5MC1Ovou3KvSfoc4 yUYT7MJ66k2rfciK+x/AWgGxdJP1bbzN5Da72XbqBGz2g5w6f/Du5mABunGvT8aarGSp XW6j61hysrXHUPQFwpRJYECsvFYl0NzfC/A2SwLu7vDlQ9QDRRZQJkua33cvjNFMVjCQ Bp0hngCQ08SlPkihtH19/JwweIYiKHw3CcLE/oGQN9kcck3HEWLoum6T9QpUEYHiN5mT RWiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=prSWGQfY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id p188-20020a6342c5000000b005bdfb8a9048si1498522pga.67.2023.11.23.07.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=prSWGQfY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D44168217EC3; Thu, 23 Nov 2023 07:27:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346158AbjKWP1I (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346068AbjKWP04 (ORCPT ); Thu, 23 Nov 2023 10:26:56 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A41BD5C; Thu, 23 Nov 2023 07:26:57 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 557A9FF80D; Thu, 23 Nov 2023 15:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AagYqurduAd05kHY0ow9kHcvI+mUo3FUEEyQW1aeXWI=; b=prSWGQfYMz84LMzOdC8n3HQ0h1C67XMBzYFbaYdkAeqPYYg9k1XvC7+ZAsa2D9uhrJg86n iSNkGPKzHZjKtPchAt4Bqk/Z+4pWlxp7ihPRE2wAwEjodPrIidxKvauctRNWB0c5V7+TJP fKHi9y08gQZh9uujDmCET2iQR5sMR7GmhurKFtqWgWE1vN/vrWhK857/0kqes7M2l8AkiR /l+t1AfFwe/yEzS0Bv6adEOkR3y4/a2lwSBleYAQKoxcsxbOvvlh2WhHQiHjxxtCN1kBsU 8mJJ+xBlsJBw1xs1GY90snp5e4MW4Wo4VtNSdzq6uGBq3KJCZC7o0d4j/htuOA== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Vladimir Kondratiev , Gregory CLEMENT Subject: [PATCH v2 04/21] MIPS: genex: Fix except_vec_vi for kernel in XKPHYS Date: Thu, 23 Nov 2023 16:26:21 +0100 Message-ID: <20231123152639.561231-5-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:23 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369100718929755 X-GMAIL-MSGID: 1783369100718929755 From: Jiaxun Yang Use {highest, higher, hi, lo} immediate loading sequence to load 64 bit jump address for handler when kernel is loaded to XKPHYS. Co-developed-by: Vladimir Kondratiev Signed-off-by: Vladimir Kondratiev Co-developed-by: Gregory CLEMENT Signed-off-by: Jiaxun Yang Signed-off-by: Gregory CLEMENT --- arch/mips/kernel/genex.S | 19 +++++++++++++++---- arch/mips/kernel/traps.c | 34 ++++++++++++++++++++++++---------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index b6de8e88c1bd4..fd765ad9ecac0 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -272,11 +272,22 @@ NESTED(except_vec_vi, 0, sp) .set push .set noreorder PTR_LA v1, except_vec_vi_handler -FEXPORT(except_vec_vi_lui) - lui v0, 0 /* Patched */ +#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) +FEXPORT(except_vec_vi_hi) + lui v0, 0 /* Patched */ +#else +FEXPORT(except_vec_vi_highest) + lui v0, 0 /* Patched */ +FEXPORT(except_vec_vi_higher) + daddiu v0, 0 /* Patched */ + dsll v0, 16 +FEXPORT(except_vec_vi_hi) + daddiu v0, 0 /* Patched */ + dsll v0, 16 +#endif jr v1 -FEXPORT(except_vec_vi_ori) - ori v0, 0 /* Patched */ +FEXPORT(except_vec_vi_lo) + PTR_ADDIU v0, 0 /* Patched */ .set pop END(except_vec_vi) EXPORT(except_vec_vi_end) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 246c6a6b02614..60c513c51684f 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2091,18 +2091,26 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) * If no shadow set is selected then use the default handler * that does normal register saving and standard interrupt exit */ - extern const u8 except_vec_vi[], except_vec_vi_lui[]; - extern const u8 except_vec_vi_ori[], except_vec_vi_end[]; + extern const u8 except_vec_vi[], except_vec_vi_hi[]; + extern const u8 except_vec_vi_lo[], except_vec_vi_end[]; +#if defined(CONFIG_64BIT) && !defined(KBUILD_64BIT_SYM32) + extern const u8 except_vec_vi_highest[], except_vec_vi_higher[]; +#endif extern const u8 rollback_except_vec_vi[]; const u8 *vec_start = using_rollback_handler() ? rollback_except_vec_vi : except_vec_vi; #if defined(CONFIG_CPU_MICROMIPS) || defined(CONFIG_CPU_BIG_ENDIAN) - const int lui_offset = except_vec_vi_lui - vec_start + 2; - const int ori_offset = except_vec_vi_ori - vec_start + 2; + const int imm_offset = 2; #else - const int lui_offset = except_vec_vi_lui - vec_start; - const int ori_offset = except_vec_vi_ori - vec_start; + const int imm_offset = 0; +#endif +#if defined(CONFIG_64BIT) && !defined(KBUILD_64BIT_SYM32) + const int highest_offset = except_vec_vi_highest - vec_start + imm_offset; + const int higher_offset = except_vec_vi_higher - vec_start + imm_offset; #endif + const int hi_offset = except_vec_vi_hi - vec_start + imm_offset; + const int lo_offset = except_vec_vi_lo - vec_start + imm_offset; + const int handler_len = except_vec_vi_end - vec_start; if (handler_len > VECTORSPACING) { @@ -2119,10 +2127,16 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) #else handler_len); #endif - h = (u16 *)(b + lui_offset); - *h = (handler >> 16) & 0xffff; - h = (u16 *)(b + ori_offset); - *h = (handler & 0xffff); +#if defined(CONFIG_64BIT) && !defined(KBUILD_64BIT_SYM32) + h = (u16 *)(b + highest_offset); + *h = uasm_rel_highest(handler); + h = (u16 *)(b + higher_offset); + *h = uasm_rel_higher(handler); +#endif + h = (u16 *)(b + hi_offset); + *h = uasm_rel_hi(handler); + h = (u16 *)(b + lo_offset); + *h = uasm_rel_lo(handler); local_flush_icache_range((unsigned long)b, (unsigned long)(b+handler_len)); } From patchwork Thu Nov 23 15:26:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168995 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526253vqx; Thu, 23 Nov 2023 07:28:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdNmUmPiOqKUg3r2EskU3heS3A+CzCZtoByKlSRkrDxCmwqvr/gSkaTMF/FzL22hcvaGYu X-Received: by 2002:a17:902:e88f:b0:1cc:58f1:8646 with SMTP id w15-20020a170902e88f00b001cc58f18646mr6497675plg.50.1700753309920; Thu, 23 Nov 2023 07:28:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753309; cv=none; d=google.com; s=arc-20160816; b=PptEENe9zNvngPoT/0TgjRHOhAkQEIDzJG6MB72jtp5AoXRPHUyZTRlbMCOupCTUWT SRM7tIcxYbM4cHHkgTWy8XDNul3Q131p5etZPsAeteDbxUnypAmsi5OiloyuJxgwk2kj k/iMUpWtoqhe51JXwOjPNqHAjXLzcai8tEziPu9EnUvRtPxFp40NUowAmy3FwC5hoxLj at1o878+QIwPb+QSOO0XeR37KwdxNXQtg3M2Jg8Bq1fMFF66HqYAruIzb3+ysEJSitig h8h+XSR0zahyxeOV6177/goukMYmmuZHEkCQ23OKHZ//oK95NkjOULArodvD0zozC5pr osOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p5Y4+QQx6IQCL0sfRkqEobRfltIrsUFlmPw44Fo9wsE=; fh=MwmhOnPCNEKQUh9CETmL1NjqsCe+66NMqSNy76XJ1mw=; b=wWK6xfLplLvEvcY7Jg4NJGZvXnrqiDe4P1zn8/qCbb56WfFiB0oIcQcKR1kJTf7wBq bCgOUxvuhiniUC5exslsFepewA0X4wZUbiEkDk9xjQ03Ay6kfZz0qHTtMPAvtB+9VD/l xHvTPe0Sr+hU65Navex25UQCol85KegcpqxM9sYxux0MjvyuP1hGDH1mcLYS9z7FMWf7 UIRFOrqP21dlHyvHE5nkST3qwzrQS63bpYlLEKUvo7EDNFYSp0BmpKrUqUkuk5DWBm71 D8wlC07CNdROjzagy9AoU9fObkSgDLWsU8couXiG7UDP9HS0oAHsUS7AMnUTHb7PECi9 M1GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZyUeG8Gm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id p19-20020a170902a41300b001bb8f59aca3si1223339plq.583.2023.11.23.07.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZyUeG8Gm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8E37B8218E5E; Thu, 23 Nov 2023 07:27:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346093AbjKWP1F (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346094AbjKWP04 (ORCPT ); Thu, 23 Nov 2023 10:26:56 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B89D5E; Thu, 23 Nov 2023 07:26:57 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 218EC1C000C; Thu, 23 Nov 2023 15:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p5Y4+QQx6IQCL0sfRkqEobRfltIrsUFlmPw44Fo9wsE=; b=ZyUeG8Gm+sMaJnHdGPCXyZewQiTEPz/bVoTucKeHECnCDWfWMnvBBHSoXcEupsTz63mDbC mgv1l9nZz0ysBV9yMeHXBdzl9UcVtA3RyOpIks+mVM/Skpv9E2MDUwSULVDA4P73143q1X RPZsNAU1sMjISDKIX18mQx+QGGxcKUsiPwUH/ZJDXaMcUr9iJvYFlfE0d1/cCSDFWUz+54 YX1FXgRozd2wJljHojVBRzN6o2+IYS3eDYG3nVLZ0nMmPe4IidM+BZWTRx7MJEV8LBAGk1 0mC3s3QPUTiN1sO8oQTJpVCHYkvRysSuSso/qTagPSbIX+8wa9/OL+mTFZqH2w== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Vladimir Kondratiev , Gregory CLEMENT Subject: [PATCH v2 05/21] MIPS: Fix set_uncached_handler for ebase in XKPHYS Date: Thu, 23 Nov 2023 16:26:22 +0100 Message-ID: <20231123152639.561231-6-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:26 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369102842934531 X-GMAIL-MSGID: 1783369102842934531 From: Jiaxun Yang ebase may be in XKPHYS if memblock unable to allocate memory within KSEG0 physical range. To map ebase into uncached space we just convert it back to physical address and then use platform's TO_UNCAC helper to create mapping. Co-developed-by: Vladimir Kondratiev Signed-off-by: Vladimir Kondratiev Co-developed-by: Gregory CLEMENT Signed-off-by: Jiaxun Yang Signed-off-by: Gregory CLEMENT --- arch/mips/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 60c513c51684f..230728d76d11f 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2346,7 +2346,7 @@ static const char panic_null_cerr[] = void set_uncached_handler(unsigned long offset, void *addr, unsigned long size) { - unsigned long uncached_ebase = CKSEG1ADDR(ebase); + unsigned long uncached_ebase = TO_UNCAC(__pa(ebase)); if (!addr) panic(panic_null_cerr); From patchwork Thu Nov 23 15:26:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168990 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526147vqx; Thu, 23 Nov 2023 07:28:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRrmYQBhGcaP60haOkqQ5aQPU6ni3ZKr63loGSp8fau3pxMgfkv9L2rn0Q8+Ht14oB541M X-Received: by 2002:a17:902:e5c3:b0:1cf:7ce5:e6e8 with SMTP id u3-20020a170902e5c300b001cf7ce5e6e8mr4700153plf.12.1700753300458; Thu, 23 Nov 2023 07:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753300; cv=none; d=google.com; s=arc-20160816; b=lHmQfJqFVzXA+0TtmmKkCSU5OQtY7yte3GajkNz9bMSh9bNUq8k6Ws1VT3kN+JxYWP NeQ8Rpmr9WOn2J0C7ZfiHz3Nx8DLnEdklDP6ce0x/PV1VC9UsYC3eZaM8aLAZhDZR6lv T7J/KuCgHlAfv459/w8T9k41QUx98u2CoToIvtn5bvSa4ejeVYobwlv1+RhGC4Swlxn9 hGiewAMfHmiete1HfXqXRAgV0f66UwC2PgPfeZ4ZqAMDoUdQbXCK8O2djuiVxnnS6nMD 5K8P/Z9bPE+rSmB6SfNoOmfwuF9wI+IFFgsLQYC17f+5bRxMaBhw0JI6eBi7XCnNASuH ZmXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f2MzbyPn8rMX/70hHyFKQ1kdGPyPC7EdKYb9ZGPjSt0=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=03FdsVowz6ubsj9xyijgl0ONbHvSoJ0k8NTVIJTQArbEvAliTKUxVrniEyc3D3zDvy yEbDk8NA04dwdV/P0Nr8DCvpX8B/+3mdZphkNeXTcKlRi8uMAauCHL0ofHnAciHt8vYI TWVOLFxD2ykxjLyCJVO333XedzrsMBbChM5zRkELQLJLaFG5cmiOJrSQKlvuvcDpFvSb HtWVwL0YmctC8uN3Hv1pWZj8JWqzgXsEmdLHXck7ll1P2yHVwiRHrygYQKAVOgTJi34a UmNgHKP/y0wrV6e2BiWXDkl5Za+avEGJCLspPkcxP1SVa2T0tnRB327wxaW5vStQH9wB dN1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Mka2Jb4e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 2-20020a170902ee4200b001c613b5e778si1237410plo.557.2023.11.23.07.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Mka2Jb4e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1BF4C8328216; Thu, 23 Nov 2023 07:28:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346202AbjKWP1V (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346101AbjKWP1A (ORCPT ); Thu, 23 Nov 2023 10:27:00 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50128D62; Thu, 23 Nov 2023 07:27:00 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 011BBE000A; Thu, 23 Nov 2023 15:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f2MzbyPn8rMX/70hHyFKQ1kdGPyPC7EdKYb9ZGPjSt0=; b=Mka2Jb4edMBCpnggk6Zr8g8QwhEtzAOdATAvWNcfpYgRbR3fo+lzWiI22fBIkh1o1R1KGH WIcnOxeBHxMmyn8W8cPZWLeiXWohwu3av7585GEg9dbwiWVM50Rywz24qk/pmwr1yEFAbL OnUzEDvIyb6HLxqDZg+iRrRDq6s08HZ5IY2yHpwcGGjHvcRDtn7cX/Prs4WjYjn6zX9NW8 jUMXT6L7PrYlM5MM2fI+WkUykgz2NgBDfatQPX14+suQ5P9rNAnpGtD0Ko9fNkaN7Ls8sN j7X8RCOR6ndr8sDNlZK1yxly+mYgWUH8h1PlVP/BJHT0fB3c5FaMUY69rIO28g== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v2 06/21] MIPS: Refactor mips_cps_core_entry implementation Date: Thu, 23 Nov 2023 16:26:23 +0100 Message-ID: <20231123152639.561231-7-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:13 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369092432230221 X-GMAIL-MSGID: 1783369092432230221 From: Jiaxun Yang Now the exception vector for CPS systems are allocated on-fly with memblock as well. It will try to allocate from KSEG1 first, and then try to allocate in low 4G if possible. The main reset vector is now generated by uasm, to avoid tons of patches to the code. Other vectors are copied to the location later. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/mips-cm.h | 1 + arch/mips/include/asm/smp-cps.h | 4 +- arch/mips/kernel/cps-vec.S | 110 ++++++++------------- arch/mips/kernel/smp-cps.c | 167 +++++++++++++++++++++++++++----- arch/mips/kernel/traps.c | 2 + 5 files changed, 186 insertions(+), 98 deletions(-) diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h index 23c67c0871b17..15d8d69de4550 100644 --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h @@ -311,6 +311,7 @@ GCR_CX_ACCESSOR_RW(32, 0x018, other) /* GCR_Cx_RESET_BASE - Configure where powered up cores will fetch from */ GCR_CX_ACCESSOR_RW(32, 0x020, reset_base) #define CM_GCR_Cx_RESET_BASE_BEVEXCBASE GENMASK(31, 12) +#define CM_GCR_Cx_RESET_BASE_MODE BIT(1) /* GCR_Cx_ID - Identify the current core */ GCR_CX_ACCESSOR_RO(32, 0x028, id) diff --git a/arch/mips/include/asm/smp-cps.h b/arch/mips/include/asm/smp-cps.h index 22a572b70fe31..39a602e5fecc4 100644 --- a/arch/mips/include/asm/smp-cps.h +++ b/arch/mips/include/asm/smp-cps.h @@ -24,7 +24,7 @@ struct core_boot_config { extern struct core_boot_config *mips_cps_core_bootcfg; -extern void mips_cps_core_entry(void); +extern void mips_cps_core_boot(int cca, void __iomem *gcr_base); extern void mips_cps_core_init(void); extern void mips_cps_boot_vpes(struct core_boot_config *cfg, unsigned vpe); @@ -32,8 +32,6 @@ extern void mips_cps_boot_vpes(struct core_boot_config *cfg, unsigned vpe); extern void mips_cps_pm_save(void); extern void mips_cps_pm_restore(void); -extern void *mips_cps_core_entry_patch_end; - #ifdef CONFIG_MIPS_CPS extern bool mips_cps_smp_in_use(void); diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S index 64ecfdac6580b..8870a2dbc35aa 100644 --- a/arch/mips/kernel/cps-vec.S +++ b/arch/mips/kernel/cps-vec.S @@ -4,6 +4,8 @@ * Author: Paul Burton */ +#include + #include #include #include @@ -81,40 +83,48 @@ nop .endm + __INIT +LEAF(excep_tlbfill) + DUMP_EXCEP("TLB Fill") + b . + nop + END(excep_tlbfill) -.balign 0x1000 +LEAF(excep_xtlbfill) + DUMP_EXCEP("XTLB Fill") + b . + nop + END(excep_xtlbfill) -LEAF(mips_cps_core_entry) - /* - * These first several instructions will be patched by cps_smp_setup to load the - * CCA to use into register s0 and GCR base address to register s1. - */ - .rept CPS_ENTRY_PATCH_INSNS - nop - .endr +LEAF(excep_cache) + DUMP_EXCEP("Cache") + b . + nop + END(excep_cache) - .global mips_cps_core_entry_patch_end -mips_cps_core_entry_patch_end: +LEAF(excep_genex) + DUMP_EXCEP("General") + b . + nop + END(excep_genex) - /* Check whether we're here due to an NMI */ - mfc0 k0, CP0_STATUS - and k0, k0, ST0_NMI - beqz k0, not_nmi +LEAF(excep_intex) + DUMP_EXCEP("Interrupt") + b . nop + END(excep_intex) - /* This is an NMI */ - PTR_LA k0, nmi_handler +LEAF(excep_ejtag) + PTR_LA k0, ejtag_debug_handler jr k0 nop + END(excep_ejtag) + __FINIT -not_nmi: - /* Setup Cause */ - li t0, CAUSEF_IV - mtc0 t0, CP0_CAUSE - - /* Setup Status */ - li t0, ST0_CU1 | ST0_CU0 | ST0_BEV | STATUS_BITDEPS - mtc0 t0, CP0_STATUS +LEAF(mips_cps_core_boot) + /* Save CCA and GCR base */ + move s0, a0 + move s1, a1 /* We don't know how to do coherence setup on earlier ISA */ #if MIPS_ISA_REV > 0 @@ -178,49 +188,7 @@ not_nmi: PTR_L sp, VPEBOOTCFG_SP(v1) jr t1 nop - END(mips_cps_core_entry) - -.org 0x200 -LEAF(excep_tlbfill) - DUMP_EXCEP("TLB Fill") - b . - nop - END(excep_tlbfill) - -.org 0x280 -LEAF(excep_xtlbfill) - DUMP_EXCEP("XTLB Fill") - b . - nop - END(excep_xtlbfill) - -.org 0x300 -LEAF(excep_cache) - DUMP_EXCEP("Cache") - b . - nop - END(excep_cache) - -.org 0x380 -LEAF(excep_genex) - DUMP_EXCEP("General") - b . - nop - END(excep_genex) - -.org 0x400 -LEAF(excep_intex) - DUMP_EXCEP("Interrupt") - b . - nop - END(excep_intex) - -.org 0x480 -LEAF(excep_ejtag) - PTR_LA k0, ejtag_debug_handler - jr k0 - nop - END(excep_ejtag) + END(mips_cps_core_boot) LEAF(mips_cps_core_init) #ifdef CONFIG_MIPS_MT_SMP @@ -428,7 +396,7 @@ LEAF(mips_cps_boot_vpes) /* Calculate a pointer to the VPEs struct vpe_boot_config */ li t0, VPEBOOTCFG_SIZE mul t0, t0, ta1 - addu t0, t0, ta3 + PTR_ADDU t0, t0, ta3 /* Set the TC restart PC */ lw t1, VPEBOOTCFG_PC(t0) @@ -603,10 +571,10 @@ dcache_done: lw $1, TI_CPU(gp) sll $1, $1, LONGLOG PTR_LA \dest, __per_cpu_offset - addu $1, $1, \dest + PTR_ADDU $1, $1, \dest lw $1, 0($1) PTR_LA \dest, cps_cpu_state - addu \dest, \dest, $1 + PTR_ADDU \dest, \dest, $1 .set pop .endm diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index dd55d59b88db3..9aad678a32bd7 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -25,7 +26,33 @@ #include #include +#define BEV_VEC_SIZE 0x500 +#define BEV_VEC_ALIGN 0x1000 + +#define A0 4 +#define A1 5 +#define T9 25 +#define K0 26 +#define K1 27 + +#define C0_STATUS 12, 0 +#define C0_CAUSE 13, 0 + +#define ST0_NMI_BIT 19 +#ifdef CONFIG_64BIT +#define ST0_KX_IF_64 ST0_KX +#else +#define ST0_KX_IF_64 0 +#endif + +enum label_id { + label_not_nmi = 1, +}; + +UASM_L_LA(_not_nmi) + static DECLARE_BITMAP(core_power, NR_CPUS); +static uint32_t core_entry_reg; struct core_boot_config *mips_cps_core_bootcfg; @@ -34,10 +61,113 @@ static unsigned __init core_vpe_count(unsigned int cluster, unsigned core) return min(smp_max_threads, mips_cps_numvps(cluster, core)); } +static void __init *mips_cps_build_core_entry(void *addr) +{ + extern void (*nmi_handler)(void); + u32 *p = addr; + u32 val; + struct uasm_label labels[2]; + struct uasm_reloc relocs[2]; + struct uasm_label *l = labels; + struct uasm_reloc *r = relocs; + + memset(labels, 0, sizeof(labels)); + memset(relocs, 0, sizeof(relocs)); + + uasm_i_mfc0(&p, K0, C0_STATUS); + if (cpu_has_mips_r2_r6) + uasm_i_ext(&p, K0, K0, ST0_NMI_BIT, 1); + else { + uasm_i_srl(&p, K0, K0, ST0_NMI_BIT); + uasm_i_andi(&p, K0, K0, 0x1); + } + + uasm_il_bnez(&p, &r, K0, label_not_nmi); + uasm_i_nop(&p); + UASM_i_LA(&p, K0, (long)&nmi_handler); + + uasm_l_not_nmi(&l, p); + + val = CAUSEF_IV; + uasm_i_lui(&p, K0, val >> 16); + uasm_i_ori(&p, K0, K0, val & 0xffff); + uasm_i_mtc0(&p, K0, C0_CAUSE); + val = ST0_CU1 | ST0_CU0 | ST0_BEV | ST0_KX_IF_64; + uasm_i_lui(&p, K0, val >> 16); + uasm_i_ori(&p, K0, K0, val & 0xffff); + uasm_i_mtc0(&p, K0, C0_STATUS); + uasm_i_ehb(&p); + uasm_i_ori(&p, A0, 0, read_c0_config() & CONF_CM_CMASK); + UASM_i_LA(&p, A1, (long)mips_gcr_base); +#if defined(KBUILD_64BIT_SYM32) || defined(CONFIG_32BIT) + UASM_i_LA(&p, T9, CKSEG1ADDR(__pa_symbol(mips_cps_core_boot))); +#else + UASM_i_LA(&p, T9, TO_UNCAC(__pa_symbol(mips_cps_core_boot))); +#endif + uasm_i_jr(&p, T9); + uasm_i_nop(&p); + + uasm_resolve_relocs(relocs, labels); + + return p; +} + +static int __init setup_cps_vecs(void) +{ + extern void excep_tlbfill(void); + extern void excep_xtlbfill(void); + extern void excep_cache(void); + extern void excep_genex(void); + extern void excep_intex(void); + extern void excep_ejtag(void); + phys_addr_t cps_vec_pa; + void *cps_vec; + + /* Try to allocate in KSEG1 first */ + cps_vec_pa = memblock_phys_alloc_range(BEV_VEC_SIZE, BEV_VEC_ALIGN, + 0x0, KSEGX_SIZE - 1); + + if (cps_vec_pa) + core_entry_reg = CKSEG1ADDR(cps_vec_pa) & + CM_GCR_Cx_RESET_BASE_BEVEXCBASE; + + if (!cps_vec_pa && mips_cm_is64) { + cps_vec_pa = memblock_phys_alloc_range(BEV_VEC_SIZE, BEV_VEC_ALIGN, + 0x0, SZ_4G - 1); + if (cps_vec_pa) + core_entry_reg = (cps_vec_pa & CM_GCR_Cx_RESET_BASE_BEVEXCBASE) | + CM_GCR_Cx_RESET_BASE_MODE; + } + + if (!cps_vec_pa) + return -ENOMEM; + + /* We want to ensure cache is clean before writing uncached mem */ + blast_dcache_range(TO_CAC(cps_vec_pa), TO_CAC(cps_vec_pa) + BEV_VEC_SIZE); + bc_wback_inv(TO_CAC(cps_vec_pa), BEV_VEC_SIZE); + __sync(); + + cps_vec = (void *)TO_UNCAC(cps_vec_pa); + mips_cps_build_core_entry(cps_vec); + + memcpy(cps_vec + 0x200, &excep_tlbfill, 0x80); + memcpy(cps_vec + 0x280, &excep_xtlbfill, 0x80); + memcpy(cps_vec + 0x300, &excep_cache, 0x80); + memcpy(cps_vec + 0x380, &excep_genex, 0x80); + memcpy(cps_vec + 0x400, &excep_intex, 0x80); + memcpy(cps_vec + 0x480, &excep_ejtag, 0x80); + + /* Make sure no prefetched data in cache */ + blast_inv_dcache_range(TO_CAC(cps_vec_pa), TO_CAC(cps_vec_pa) + BEV_VEC_SIZE); + bc_inv(TO_CAC(cps_vec_pa), BEV_VEC_SIZE); + __sync(); + + return 0; +} + static void __init cps_smp_setup(void) { unsigned int nclusters, ncores, nvpes, core_vpes; - unsigned long core_entry; int cl, c, v; /* Detect & record VPE topology */ @@ -94,10 +224,11 @@ static void __init cps_smp_setup(void) /* Make core 0 coherent with everything */ write_gcr_cl_coherence(0xff); - if (mips_cm_revision() >= CM_REV_CM3) { - core_entry = CKSEG1ADDR((unsigned long)mips_cps_core_entry); - write_gcr_bev_base(core_entry); - } + if (setup_cps_vecs()) + pr_err("Failed to setup CPS vectors\n"); + + if (core_entry_reg && mips_cm_revision() >= CM_REV_CM3) + write_gcr_bev_base(core_entry_reg); #ifdef CONFIG_MIPS_MT_FPAFF /* If we have an FPU, enroll ourselves in the FPU-full mask */ @@ -110,10 +241,14 @@ static void __init cps_prepare_cpus(unsigned int max_cpus) { unsigned ncores, core_vpes, c, cca; bool cca_unsuitable, cores_limited; - u32 *entry_code; mips_mt_set_cpuoptions(); + if (!core_entry_reg) { + pr_err("core_entry address unsuitable, disabling smp-cps\n"); + goto err_out; + } + /* Detect whether the CCA is unsuited to multi-core SMP */ cca = read_c0_config() & CONF_CM_CMASK; switch (cca) { @@ -145,20 +280,6 @@ static void __init cps_prepare_cpus(unsigned int max_cpus) (cca_unsuitable && cpu_has_dc_aliases) ? " & " : "", cpu_has_dc_aliases ? "dcache aliasing" : ""); - /* - * Patch the start of mips_cps_core_entry to provide: - * - * s0 = kseg0 CCA - */ - entry_code = (u32 *)&mips_cps_core_entry; - uasm_i_addiu(&entry_code, 16, 0, cca); - UASM_i_LA(&entry_code, 17, (long)mips_gcr_base); - BUG_ON((void *)entry_code > (void *)&mips_cps_core_entry_patch_end); - blast_dcache_range((unsigned long)&mips_cps_core_entry, - (unsigned long)entry_code); - bc_wback_inv((unsigned long)&mips_cps_core_entry, - (void *)entry_code - (void *)&mips_cps_core_entry); - __sync(); /* Allocate core boot configuration structs */ ncores = mips_cps_numcores(0); @@ -213,7 +334,7 @@ static void boot_core(unsigned int core, unsigned int vpe_id) mips_cm_lock_other(0, core, 0, CM_GCR_Cx_OTHER_BLOCK_LOCAL); /* Set its reset vector */ - write_gcr_co_reset_base(CKSEG1ADDR((unsigned long)mips_cps_core_entry)); + write_gcr_co_reset_base(core_entry_reg); /* Ensure its coherency is disabled */ write_gcr_co_coherence(0); @@ -290,7 +411,6 @@ static int cps_boot_secondary(int cpu, struct task_struct *idle) unsigned vpe_id = cpu_vpe_id(&cpu_data[cpu]); struct core_boot_config *core_cfg = &mips_cps_core_bootcfg[core]; struct vpe_boot_config *vpe_cfg = &core_cfg->vpe_config[vpe_id]; - unsigned long core_entry; unsigned int remote; int err; @@ -314,8 +434,7 @@ static int cps_boot_secondary(int cpu, struct task_struct *idle) if (cpu_has_vp) { mips_cm_lock_other(0, core, vpe_id, CM_GCR_Cx_OTHER_BLOCK_LOCAL); - core_entry = CKSEG1ADDR((unsigned long)mips_cps_core_entry); - write_gcr_co_reset_base(core_entry); + write_gcr_co_reset_base(core_entry_reg); mips_cm_unlock_other(); } diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 230728d76d11f..ea59d321f713e 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -74,6 +74,8 @@ #include "access-helper.h" +#define MAX(a, b) ((a) >= (b) ? (a) : (b)) + extern void check_wait(void); extern asmlinkage void rollback_handle_int(void); extern asmlinkage void handle_int(void); From patchwork Thu Nov 23 15:26:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168994 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526238vqx; Thu, 23 Nov 2023 07:28:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcnOkpaitQ34aLy+99raTZbzFNevVYuF7EotOZXmn8gVyGgfszD0PNWcSszKNqKKhr3UW5 X-Received: by 2002:a05:6a20:a085:b0:187:d44:59f1 with SMTP id r5-20020a056a20a08500b001870d4459f1mr4111038pzj.31.1700753309039; Thu, 23 Nov 2023 07:28:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753309; cv=none; d=google.com; s=arc-20160816; b=OOE8x8VyMPwXIMvGcDjeAb7SNP8KLp81vESwcEKvlHG1cOCIV+UFmH/wpV0I877Dj3 +RAG9hwDsl/9JQGh02Ra2NOI4MGychCOwQzgChtMv/oWOl0xFkKCygISLVnRkIVYKOej HPzQ5Swzhxr5koXdCVzEkFlRYUZ7zD/+H/V1Tlj0b/54Pt+QhkTdOlxp4SulETJNZWrN qnfxQu6amRsEEFdWKW8ANExQeTjSV0gfR53yzzWo0dRAfP9Iel6gicS4gmXiCzdRGtpy bHAypGW3Nk307M2nhjvakdLcTjJ6SI59UGFXax+U0OCjVAq5WmI4wlREjkeljZy4xsHq wRog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=csnOaxSt7JZQCahT2bN5IGKlGaknLCMr5TUNqVz3qJ8=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=uBJAdU50tk7SK9r8k8P96GLxpE6+E/HVSx8EApejBtzRfuQ7AjvVXOzrNzKHyX00rB aQJXeUPxyvu1mqUIzkU+xBEtjniK6igpoXnctxGRTsyFoW1uPWKPTcrlRybChyqQxwkI aI48sHD+c8QqohNPtyCqpeZKn9HkBampV7Cb0m8NNASlrauwpmKs9DLin/Zvy+WtWc7m 0ZOivi2oTyAKlkj62NPos+WNbVdEhwoJivtD4D0gE9nIyPYJ2FfzzR0FbG47EK1AFp4q PbF+f1OYsw+uKDzvaZT4GNfNnNaHdzBeZnZAQKMff+DWwk77vX21f7/WHIC+mW5Mqqea TbWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pOfMxx3N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bo5-20020a056a02038500b005bdfd3a26a0si1620427pgb.584.2023.11.23.07.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pOfMxx3N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8DCB0821821A; Thu, 23 Nov 2023 07:27:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346162AbjKWP1L (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346069AbjKWP07 (ORCPT ); Thu, 23 Nov 2023 10:26:59 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBAAB10D7; Thu, 23 Nov 2023 07:27:01 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id CE5A9FF80F; Thu, 23 Nov 2023 15:26:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=csnOaxSt7JZQCahT2bN5IGKlGaknLCMr5TUNqVz3qJ8=; b=pOfMxx3NWMw+ymXTyk99AQQZC2qw+0dbwrclPzyxBIS/ElqYrzTfaBygMtnF7i6DkajC1V KcPG9Uf3ZYEw4CkocAKrom1XcTrU0P7cfixXORFspHU6j6qp4w7iXig6//hK2w9p1PUXF2 Wo7zrERFzCXmqYYb4P43I6Bqfvl62Z5WuWoYWmG0hD6G/BM6VCPViDsQoslCn0qXvl/0t7 jwWigZsI8GyRe/2sp3QZCw/bjLJ+LWM82oRIaNYVLXZW8JiCw+m25bGg8tN1kjzcyM1Qp3 kP8Pc8b+kMWhmK+hG0XPY/m3IvYL9acq3TYURnFJENBGKSPQqagv3xVKz/+kEQ== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v2 07/21] MIPS: Fix cache issue with mips_cps_core_entry Date: Thu, 23 Nov 2023 16:26:24 +0100 Message-ID: <20231123152639.561231-8-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:26 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369101885616644 X-GMAIL-MSGID: 1783369101885616644 Split setup_cps_vecs and move back the cache management latter in cps_smp_setup when the cache subsystem had been initialized. Without this the blast_inv_dcache_range() call can lead to a crash. Signed-off-by: Gregory CLEMENT --- arch/mips/kernel/smp-cps.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index 9aad678a32bd7..6cbdff917d147 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -53,6 +53,7 @@ UASM_L_LA(_not_nmi) static DECLARE_BITMAP(core_power, NR_CPUS); static uint32_t core_entry_reg; +static phys_addr_t cps_vec_pa; struct core_boot_config *mips_cps_core_bootcfg; @@ -112,17 +113,8 @@ static void __init *mips_cps_build_core_entry(void *addr) return p; } -static int __init setup_cps_vecs(void) +static int __init allocate_cps_vecs(void) { - extern void excep_tlbfill(void); - extern void excep_xtlbfill(void); - extern void excep_cache(void); - extern void excep_genex(void); - extern void excep_intex(void); - extern void excep_ejtag(void); - phys_addr_t cps_vec_pa; - void *cps_vec; - /* Try to allocate in KSEG1 first */ cps_vec_pa = memblock_phys_alloc_range(BEV_VEC_SIZE, BEV_VEC_ALIGN, 0x0, KSEGX_SIZE - 1); @@ -142,6 +134,19 @@ static int __init setup_cps_vecs(void) if (!cps_vec_pa) return -ENOMEM; + return 0; +} + +static void __init setup_cps_vecs(void) +{ + extern void excep_tlbfill(void); + extern void excep_xtlbfill(void); + extern void excep_cache(void); + extern void excep_genex(void); + extern void excep_intex(void); + extern void excep_ejtag(void); + void *cps_vec; + /* We want to ensure cache is clean before writing uncached mem */ blast_dcache_range(TO_CAC(cps_vec_pa), TO_CAC(cps_vec_pa) + BEV_VEC_SIZE); bc_wback_inv(TO_CAC(cps_vec_pa), BEV_VEC_SIZE); @@ -161,8 +166,6 @@ static int __init setup_cps_vecs(void) blast_inv_dcache_range(TO_CAC(cps_vec_pa), TO_CAC(cps_vec_pa) + BEV_VEC_SIZE); bc_inv(TO_CAC(cps_vec_pa), BEV_VEC_SIZE); __sync(); - - return 0; } static void __init cps_smp_setup(void) @@ -224,8 +227,8 @@ static void __init cps_smp_setup(void) /* Make core 0 coherent with everything */ write_gcr_cl_coherence(0xff); - if (setup_cps_vecs()) - pr_err("Failed to setup CPS vectors\n"); + if (allocate_cps_vecs()) + pr_err("Failed to allocate CPS vectors\n"); if (core_entry_reg && mips_cm_revision() >= CM_REV_CM3) write_gcr_bev_base(core_entry_reg); @@ -280,6 +283,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus) (cca_unsuitable && cpu_has_dc_aliases) ? " & " : "", cpu_has_dc_aliases ? "dcache aliasing" : ""); + setup_cps_vecs(); /* Allocate core boot configuration structs */ ncores = mips_cps_numcores(0); From patchwork Thu Nov 23 15:26:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168982 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp525684vqx; Thu, 23 Nov 2023 07:27:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAsK2OVTd7ZFzdKz4SD/wlahqN/YSbX0U+mnIAa8HHkVcuVIt88DQ/K40dgQnnKrjipHcr X-Received: by 2002:a17:903:2286:b0:1cc:5296:10e4 with SMTP id b6-20020a170903228600b001cc529610e4mr6833591plh.22.1700753256080; Thu, 23 Nov 2023 07:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753256; cv=none; d=google.com; s=arc-20160816; b=LU6RGtmeFnXC5wWSV7stKOsDXJxwf9YFDHd8Jjsz0rFxsJSThBGHIFyo4WrFWd1l+H E7LxkKHQu/6dwZV5z7+9MICGoBiERGDbzTZ+tX3CaUYk6HkXjJHJpQyyZtu8KwFOwaoG 69bVgTLfor+BTkNBmIgC+YhbBP4DW0f3UxTXq+lRLwPt3xB7Ze9CbAP8JZRBU6Aah4IW iXno+jN4OnBt7vVvtra53ejY1BsFJUpwh59gZJrv9p2wP8WNHlw7nw4YJhkhgEohbTIy WHg8ODWjY5fQCQrVmtqX4V/SsLg3GumsqrA0FqiETYn88MMSKtEow2VvXPY/m+/XCLSS TNOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GhAHp/WqUVYuPSI+XZI84BEZNCI93fSEr9ostuA7S3A=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=VK9kGFp6p8029PZoNjilLdXdyuw+oJFM25kPiyklP/r1/PaohEXi1wD8CRQNB83PKY CEIGMoiofdetbGwWn4nf5mwSqZOeqL4LW0w9uD0FNPmsTa4OkRH7PCNxaZhlHBMtIr23 r4FVSP82JIuDskRcxAWUmZAA/6prQYw63ZdOoaIhnujTtA/+Gmyl07McFp+uJx1lDU6i KnrTCvvByxLifTqfBWykSquOLRkVYV06g42nHpYY+4iMCeoZwyXISgRMT9594WX9GI+/ JVXoEwXH8N5h3iuUPQkuyMSQ0+WKTG0YyNCjmvIB7c26Zw9I2Gs64Szg6TkGTQroO5Fq JtRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TueHfQu0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q22-20020a170902789600b001b8a8f359fcsi1270332pll.208.2023.11.23.07.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:27:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TueHfQu0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 94629806D81E; Thu, 23 Nov 2023 07:27:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346085AbjKWP1N (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346120AbjKWP07 (ORCPT ); Thu, 23 Nov 2023 10:26:59 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C1E710DD; Thu, 23 Nov 2023 07:27:02 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7A11740006; Thu, 23 Nov 2023 15:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GhAHp/WqUVYuPSI+XZI84BEZNCI93fSEr9ostuA7S3A=; b=TueHfQu03SEyVHx3lV5K7yzAtdC7P3Mdc6pE3OhcGReI+OOaHzPv81zZDxcAHpR35bRob9 ulF1v9Xl8kC0HHEKppienSZQhoHu0ydwQYwGMHMWWNxxbUJ7Y0xJtrTmlYwfRZdG5sbH5B EgsGN6rX1MlfaaysEzj4v0o93vrik0gOkvGsE0jS9+KKOBB1Qpn35n0uDokZBUGeRPE+bR xMot03qv4MGksrHFJj58zT+D1MfbAEVGkeklyZY1b/sNdkuA103VmVv5gNukC+8V9uavX0 4OGXu0Wbv3nCg8avV3hqcbOwneraRnfvSaHWlo8v1Og51PFPiFEsOfs7FBGe0Q== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v2 08/21] MIPS: Allow kernel base to be set from Kconfig for all platforms Date: Thu, 23 Nov 2023 16:26:25 +0100 Message-ID: <20231123152639.561231-9-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369046168262449 X-GMAIL-MSGID: 1783369046168262449 From: Jiaxun Yang There are some platforms in wild that generic loading address won't work with them due to memory layout. Allow PHYSICAL_START to be override from Kconfig, introduce PHYSICAL_START_BOOL symbol as powerpc did. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 76db82542519c..f7fa4f231c6c6 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -2862,12 +2862,22 @@ config ARCH_SUPPORTS_KEXEC config ARCH_SUPPORTS_CRASH_DUMP def_bool y +config PHYSICAL_START_BOOL + bool "Set physical address where the kernel is loaded" + default y if CRASH_DUMP + help + This gives the CKSEG0, KSEG0 or XKPHYS address where the kernel + is loaded. + + Say N here unless you know what you are doing. + config PHYSICAL_START - hex "Physical address where the kernel is loaded" - default "0xffffffff84000000" - depends on CRASH_DUMP + hex "Physical address where the kernel is loaded" if PHYSICAL_START_BOOL + default "0xffffffff84000000" if CRASH_DUMP + default "0xffffffff80100000" help - This gives the CKSEG0 or KSEG0 address where the kernel is loaded. + This gives the CKSEG0, KSEG0 or XKPHYS address where the kernel + is loaded. If you plan to use kernel for capturing the crash dump change this value to start of the reserved region (the "X" value as specified in the "crashkernel=YM@XM" command line boot parameter From patchwork Thu Nov 23 15:26:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168996 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526316vqx; Thu, 23 Nov 2023 07:28:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHuCWwSu4ED8B88O7javT3Sz4JXViRulXVcJQCRH6Stk8B8pfvJytijG+QqO+wolwcao5GR X-Received: by 2002:a05:6a20:3d11:b0:18b:8861:37d9 with SMTP id y17-20020a056a203d1100b0018b886137d9mr3360535pzi.13.1700753314566; Thu, 23 Nov 2023 07:28:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753314; cv=none; d=google.com; s=arc-20160816; b=tKFUiyj7kC7zm9yJD2sGcy4cDx9Oo1cXrySyfQ3wfhkXSSJyA56rOh/Gn4PmjFDFuD ikjWnFy45tPiHOi27K3CL4cbTuoi6+gxG9P/71q9FFCNG4SQ73gJGytmUujTnRHvx5JG P4oiqUrFmstCqFHLfUzxEd3yC4isQHwvLpH8xTrl+ZL6jQPxZyuxr/vndTNUN99VCEPf tI3LxS8ZZinFH9+748PTEzMLHEYIgbxi09R5/7LKXzt7dwoNf71bjKO3FjeboWH3LJwm SE0C7Z163bE6oEraxzugWMh1bjJgEsXEya/cXaFSANXKxb1KwtY9OIooagEcikbnQw5/ duCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=imSdkuhb1bmbiT2B28YIP5ZVYeyaD1qizr5YYVEXZZM=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=OQ6QBYXrnMmttzb8dPmPuuIY+JuzZPJljkqJPwQZKmvGOK5O+H4EU8GV/Lvvg10kip 6cdrqwF4l39OPQI3ZSEhjYVwZ1e1aCJrN2F/K8yRI1Ow9YeoJSERMxtGQMGoZo9ld1Yn 9O7kDhDZcXOxFCT1Wbz9EsDZoiCyCeQxN/w7WPQI5Ma8S4GDHvbivn59OoebKyAYMk1/ p1LvbMDOyoLKN0kzrxO/gO1+bzG9qDIo8fqbI4JvslEDoYdCG1OE/nybOfuN52gPqyqK fPWN3tAu4Ri0iNq+0HYWPNCjdb7NijoiWxmYl5oZe4TFDF+iX4D7zMp5FTGD+FUplCOJ og5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UDCEufjk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h1-20020a63c001000000b00565db2812a0si1534290pgg.60.2023.11.23.07.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UDCEufjk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1E402822C383; Thu, 23 Nov 2023 07:27:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346069AbjKWP1Z (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346103AbjKWP1A (ORCPT ); Thu, 23 Nov 2023 10:27:00 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04612D69; Thu, 23 Nov 2023 07:27:02 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1B05A1C0007; Thu, 23 Nov 2023 15:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=imSdkuhb1bmbiT2B28YIP5ZVYeyaD1qizr5YYVEXZZM=; b=UDCEufjkJ/1u4nKt134YGyIOwir5VO2QexjErqbHyxiJmbqn6Gdo1GKtpUIj4oWEVeZ1Zm sAm7KjqPgTiKgZauy+fXpIrUKh2R9a/CQyar7yCkAn8ZeWj32RyFinHDbt3pPFfe/eO0Qu DYdOTHu9EUVieAwaeq9haSOwpasU9X5jgrrMQnQwloUdp0bzKfqw907sSv/IUefTFdGUtu NwoIlqNpl6nEj+qTyqiwyvAV0dZHCf7Xw+MZtUyAfWOtOP8j/BvzeFu+FigiSjdxQE1i0y 3+O0m93mha/eZFJUrSMUP1bZVUdK4zVgzLUjsnd40eDPElvWs0TyLknH38Comg== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v2 09/21] MIPS: traps: Handle CPU with non standard vint offset Date: Thu, 23 Nov 2023 16:26:26 +0100 Message-ID: <20231123152639.561231-10-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369107815510096 X-GMAIL-MSGID: 1783369107815510096 From: Jiaxun Yang Some BMIPS cpus has none standard start offset for vector interrupts. Handle those CPUs in vector size calculation and handler setup process. Signed-off-by: Jiaxun Yang --- arch/mips/kernel/traps.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index ea59d321f713e..651c9ec6265a9 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -74,7 +74,6 @@ #include "access-helper.h" -#define MAX(a, b) ((a) >= (b) ? (a) : (b)) extern void check_wait(void); extern asmlinkage void rollback_handle_int(void); @@ -2005,6 +2004,7 @@ void __noreturn nmi_exception_handler(struct pt_regs *regs) unsigned long ebase; EXPORT_SYMBOL_GPL(ebase); unsigned long exception_handlers[32]; +static unsigned long vi_vecbase; unsigned long vi_handlers[64]; void reserve_exception_space(phys_addr_t addr, unsigned long size) @@ -2074,7 +2074,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) handler = (unsigned long) addr; vi_handlers[n] = handler; - b = (unsigned char *)(ebase + 0x200 + n*VECTORSPACING); + b = (unsigned char *)(vi_vecbase + n*VECTORSPACING); if (srs >= srssets) panic("Shadow register set %d not supported", srs); @@ -2370,20 +2370,33 @@ void __init trap_init(void) extern char except_vec3_generic; extern char except_vec4; extern char except_vec3_r4000; - unsigned long i, vec_size; + unsigned long i, vec_size, vi_vec_offset; phys_addr_t ebase_pa; check_wait(); + if (cpu_has_veic || cpu_has_vint) { + switch (current_cpu_type()) { + case CPU_BMIPS3300: + case CPU_BMIPS4380: + vi_vec_offset = 0x400; + break; + case CPU_BMIPS5000: + vi_vec_offset = 0x1000; + break; + default: + vi_vec_offset = 0x200; + break; + } + vec_size = vi_vec_offset + VECTORSPACING*64; + } else { + vec_size = 0x400; + } + if (!cpu_has_mips_r2_r6) { ebase = CAC_BASE; - vec_size = 0x400; } else { - if (cpu_has_veic || cpu_has_vint) - vec_size = 0x200 + VECTORSPACING*64; - else - vec_size = PAGE_SIZE; - + vec_size = max(vec_size, PAGE_SIZE); ebase_pa = memblock_phys_alloc(vec_size, 1 << fls(vec_size)); if (!ebase_pa) panic("%s: Failed to allocate %lu bytes align=0x%x\n", @@ -2450,6 +2463,7 @@ void __init trap_init(void) * Initialise interrupt handlers */ if (cpu_has_veic || cpu_has_vint) { + vi_vecbase = ebase + vi_vec_offset; int nvec = cpu_has_veic ? 64 : 8; for (i = 0; i < nvec; i++) set_vi_handler(i, NULL); From patchwork Thu Nov 23 15:26:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168987 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526090vqx; Thu, 23 Nov 2023 07:28:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+qfK3ttUdW6WnV4KxK1tHsHqGvOCPfzxiKv1K1/OhhYvExD/EAdhDatUMcrVDy+xeDmA0 X-Received: by 2002:a05:6a00:a8c:b0:6be:2e07:5c5c with SMTP id b12-20020a056a000a8c00b006be2e075c5cmr6968961pfl.20.1700753295738; Thu, 23 Nov 2023 07:28:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753295; cv=none; d=google.com; s=arc-20160816; b=TU2TiCleKPoqAbyOAYUEWTr1U133s9PxHxf4f5SRoSEmetJwfxTP0gF9s9XzLjno3c M08da/GdbeXCmCyG83aDKUpsCWo+pLbLwJBbX0Gv3JUzjUVfKaXiEtssKpVPtgAuHvdM xrHBkpbqAHh05XWiWfK/3RWUKMZw790mjbDR/4NxexyeD0rkTqAeabO7ZHTnMOR5GGFB PfVJXjVzerIr76WXXNcCSI1+iAjMrpw+zCI+t+Hgs+KswrzxhmWWA9SJb4ym2B6fpsfd mN/OyXhukCKjFVaNDihoybxF5EWhIPiA1l1bEtlbIUZ0kNyq0DiiWzVG+SwAge/0Xhg5 EGGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ss+D9T5Uh+7fUYrH2xTy2RKRoXOlo2BBLgHNahkRQoc=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=V/H7gMtiqwnTS6lxULKofjz9ciU5pEpzVXRfQr0oMyEciprOjUuvkVQN/Lw3r/UqqK SZ6dCL+lkgXWTSuUIIckvcJR9NU/PM3LKZWhfRjZpseyW6oHX+M+rz1ZjUfx8YH/YA2F Zz9rZEnuRngZUF6U3ik7blZKPmkPs231JxqqXnpLSAfcrioGnFcQrsKMRotdfjDL2CU2 r0FUXGCgQS/Eu3OYa5/t3z82wTDCuycRVonedrey8KSYkAjoXJSWkAn3RqEEW2O2vmZG jX3DC0kMBfkPZvT+WjtQpxBzMcqJAZfo7tOjhJH2qVW9Ufsyt1j8GCctKOj/lQ9GWsej LVYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NlfkxxuY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id q21-20020a056a00151500b0068fa57cc15bsi1473248pfu.124.2023.11.23.07.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NlfkxxuY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 9AD3B806BC2C; Thu, 23 Nov 2023 07:28:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346078AbjKWP1m (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346104AbjKWP1B (ORCPT ); Thu, 23 Nov 2023 10:27:01 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DBF610F8; Thu, 23 Nov 2023 07:27:04 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id DBD20C0012; Thu, 23 Nov 2023 15:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ss+D9T5Uh+7fUYrH2xTy2RKRoXOlo2BBLgHNahkRQoc=; b=NlfkxxuYg4PyrfONOYGM1+jGh758O7pJJT0V9b4t+8qesNsaYyezcz7ap9rIrmS5NtJw+W KryeMPdet0MmvbT1sN8UR8/mbq2GVJeKeDJVXIfOsUsr2G608fRE71xLrGj5rYJUup/fJ7 S4B9BMdbSnbutnOEuSo7/8uBJ9f1cZe6FLG7TwA8I9FkTFHnknBBGSJ/XhKS7C1yagHBuI g5oX5sHt4wNuq3pYDry/klSF1nxC6UmPA+FR0kK6pEOwEQxquHKq+kQ242R2c8DrvfFs94 ULWyES86ZdXgCDAPLG06cp3/VY4kdAiseFIDVPo4Nb5PjiECUqIJdqHgqI0yqA== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v2 10/21] MIPS: Avoid unnecessary reservation of exception space Date: Thu, 23 Nov 2023 16:26:27 +0100 Message-ID: <20231123152639.561231-11-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:07 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369087455913226 X-GMAIL-MSGID: 1783369087455913226 From: Jiaxun Yang Nowadays we allocate exception base from memblock for r2_r6, so we don't need to reverse exception space at the start of the memory for r2_r6 processors. For older processors the reservation is moved to traps_init where we have knowledge of exact size we need. We also add a sanity check to detect possible overlap with kernel. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/traps.h | 1 - arch/mips/kernel/cpu-probe.c | 5 ----- arch/mips/kernel/cpu-r3k-probe.c | 2 -- arch/mips/kernel/traps.c | 12 +++++++----- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/arch/mips/include/asm/traps.h b/arch/mips/include/asm/traps.h index 15cde638b4070..d3dddd1c083a9 100644 --- a/arch/mips/include/asm/traps.h +++ b/arch/mips/include/asm/traps.h @@ -24,7 +24,6 @@ extern void (*board_ebase_setup)(void); extern void (*board_cache_error_setup)(void); extern int register_nmi_notifier(struct notifier_block *nb); -extern void reserve_exception_space(phys_addr_t addr, unsigned long size); extern char except_vec_nmi[]; #define VECTORSPACING 0x100 /* for EI/VI mode */ diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index b406d8bfb15a3..54e8b0fd4a2ab 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -1570,7 +1570,6 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) c->cputype = CPU_BMIPS3300; __cpu_name[cpu] = "Broadcom BMIPS3300"; set_elf_platform(cpu, "bmips3300"); - reserve_exception_space(0x400, VECTORSPACING * 64); break; case PRID_IMP_BMIPS43XX: { int rev = c->processor_id & PRID_REV_MASK; @@ -1581,7 +1580,6 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) __cpu_name[cpu] = "Broadcom BMIPS4380"; set_elf_platform(cpu, "bmips4380"); c->options |= MIPS_CPU_RIXI; - reserve_exception_space(0x400, VECTORSPACING * 64); } else { c->cputype = CPU_BMIPS4350; __cpu_name[cpu] = "Broadcom BMIPS4350"; @@ -1598,7 +1596,6 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) __cpu_name[cpu] = "Broadcom BMIPS5000"; set_elf_platform(cpu, "bmips5000"); c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; - reserve_exception_space(0x1000, VECTORSPACING * 64); break; } } @@ -1996,8 +1993,6 @@ void cpu_probe(void) if (cpu == 0) __ua_limit = ~((1ull << cpu_vmbits) - 1); #endif - - reserve_exception_space(0, 0x1000); } void cpu_report(void) diff --git a/arch/mips/kernel/cpu-r3k-probe.c b/arch/mips/kernel/cpu-r3k-probe.c index be93469c0e0ec..05410b743e571 100644 --- a/arch/mips/kernel/cpu-r3k-probe.c +++ b/arch/mips/kernel/cpu-r3k-probe.c @@ -137,8 +137,6 @@ void cpu_probe(void) cpu_set_fpu_opts(c); else cpu_set_nofpu_opts(c); - - reserve_exception_space(0, 0x400); } void cpu_report(void) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 651c9ec6265a9..b6e94654f6211 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2007,10 +2007,6 @@ unsigned long exception_handlers[32]; static unsigned long vi_vecbase; unsigned long vi_handlers[64]; -void reserve_exception_space(phys_addr_t addr, unsigned long size) -{ - memblock_reserve(addr, size); -} void __init *set_except_vector(int n, void *addr) { @@ -2394,7 +2390,13 @@ void __init trap_init(void) } if (!cpu_has_mips_r2_r6) { - ebase = CAC_BASE; + ebase_pa = 0x0; + ebase = CKSEG0ADDR(ebase_pa); + + if (__pa_symbol(_stext) < (ebase_pa + vec_size)) + pr_err("Insufficient space for exception vectors\n"); + + memblock_reserve(ebase_pa, vec_size); } else { vec_size = max(vec_size, PAGE_SIZE); ebase_pa = memblock_phys_alloc(vec_size, 1 << fls(vec_size)); From patchwork Thu Nov 23 15:26:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168983 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp525976vqx; Thu, 23 Nov 2023 07:28:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyceAy4/55ImlndsoPmF8soLScOVoBsQ2p3Y7x6UnzDnBiYgAY/f7mYsz6/qd4ZO8a/p15 X-Received: by 2002:a17:902:c086:b0:1cf:8c7a:ed20 with SMTP id j6-20020a170902c08600b001cf8c7aed20mr1657925pld.27.1700753283579; Thu, 23 Nov 2023 07:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753283; cv=none; d=google.com; s=arc-20160816; b=paKetwcS8zai4TmZ4xbcuPv1TVkJkQsjn2V4VElovJZSX4vPuQo4wSb0OFqxwRdh7/ lkqjKkQ9lBU8e7STUGN9j0BQrobR6+5OmP2RWg+SAKiw0J7dCtpvKAhHgLne1ivvHySv V5X/QHnHu8k99fYkUIV9Ciz9OGyh6V3lY6t7Gj/x3X2w01nbhJOfcyVNeQzla3cj6Yii 2DlwNJBcqOYgfvRNV5th45W3t1o7if3mbnciMKpypApXXz3sP6DkFsCQTEAZy9mGWKAa tDV/ZVwahHjeCWe+eMs4UlW1WB4uVOtRyV7Xx5zJHGltHWqE2fowDwix9rUZ6E5JZghK FNTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RcHHna0h/IgIzh58pWB4uS96fnTDDQBk114hJ4c/spg=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=GTz1MTfwevQbOjt9Okoe52ly+lCrqQ78/IPrJ1dbKWdDnmEU/4/P0Dc27aEAd/J/ni 9SKixuE/ai52Pets3eiN76spyF1reUHIxadpaeYrr8OIEkRghGXYOEXbTMQLDcjVgeO5 oJPCukwm3Inusrj8OZLbzRVxAkC29B17N8WDYZu+/ZKvVSJRJxuTzkPXdaMis/DoOguh F6B9ZEMwABclEhtdgm8CqLcooZhth383lqpA/6ZlDj00fG+mGLrkuvncqs7V3HYUcMzz ntYjeKu2bhcXlmgLrzq+V/ZrlXSghbXZsJA18ffn2cVVOcwQCSkEDbql6yEcx1oBEGT9 y0Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=E+jrrnH0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t9-20020a170902bc4900b001cf5cd7c402si1314849plz.9.2023.11.23.07.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=E+jrrnH0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 05E52809779E; Thu, 23 Nov 2023 07:27:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346157AbjKWP1e (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346147AbjKWP1C (ORCPT ); Thu, 23 Nov 2023 10:27:02 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A1291B2; Thu, 23 Nov 2023 07:27:05 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9054A20004; Thu, 23 Nov 2023 15:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RcHHna0h/IgIzh58pWB4uS96fnTDDQBk114hJ4c/spg=; b=E+jrrnH0co7LYu4/GnGewYeLa1EUyGx6KlvfCrPmUt1PjaTCw1sLJBlY44E5cHxqYMQTvQ cSpc5252sJDrCfephHLtcbwTVgUd1qJTdCYuQsIlGC/PKrc83eGjKKTYk/31Copsxv+LCK 115+HtMK732jm6aiFTBDGa387GQ0Cu2bc00hT1XVHRzZJXYPnbXOFCeLFJqK8t0HPUxL4+ WPv5Jv+SQBtWf+OZvjeN51sV38ZgjUAvg2STXQc55653nKYzbXUO3L4dq8IeV+/RRgccL/ tphMGs94TvwtZ4ZU9dBIBCMLbe7MxNZJVJIDAIhzJFT32lopeQnw8blt5RuODw== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v2 11/21] MIPS: traps: Enhance memblock ebase allocation process Date: Thu, 23 Nov 2023 16:26:28 +0100 Message-ID: <20231123152639.561231-12-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:54 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369074925893071 X-GMAIL-MSGID: 1783369074925893071 From: Jiaxun Yang We try to allocate from KSEG0 accessible space first, and then if we really can't allocate any memory from KSEG0 and we are sure that we support ebase in higher segment, give it another go without restriction. This can maximize the possibility of having ebase in KSEG0. Signed-off-by: Jiaxun Yang --- arch/mips/kernel/traps.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index b6e94654f6211..68f1dd54cde1c 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2399,7 +2399,12 @@ void __init trap_init(void) memblock_reserve(ebase_pa, vec_size); } else { vec_size = max(vec_size, PAGE_SIZE); - ebase_pa = memblock_phys_alloc(vec_size, 1 << fls(vec_size)); + ebase_pa = memblock_phys_alloc_range(vec_size, 1 << fls(vec_size), + 0x0, KSEGX_SIZE - 1); + + if (!ebase_pa && (IS_ENABLED(CONFIG_EVA) || cpu_has_ebase_wg)) + ebase_pa = memblock_phys_alloc(vec_size, 1 << fls(vec_size)); + if (!ebase_pa) panic("%s: Failed to allocate %lu bytes align=0x%x\n", __func__, vec_size, 1 << fls(vec_size)); From patchwork Thu Nov 23 15:26:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168985 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526057vqx; Thu, 23 Nov 2023 07:28:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5mdWXwKWVHssF7MggNPR8SFuhWSB/lwyaoKdGNisJdXefPmQdv0qIr+8DRaTX4HGPK34P X-Received: by 2002:a17:90b:1b10:b0:285:266f:3e03 with SMTP id nu16-20020a17090b1b1000b00285266f3e03mr6517318pjb.38.1700753292212; Thu, 23 Nov 2023 07:28:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753292; cv=none; d=google.com; s=arc-20160816; b=JsYlMRCF/rky5ElsoJqVWwoFf8q1p/FDLd1zBVFKwnwR/nYGojauKFqOfmEyfbIyhs RYqdpC0l+YDAwF2BoNpaakLJcsUvBERAn1EEpOzciqLyIUVhAcVhYKVAFXdzay+6gFEH FrV/2ZvyE75xrSgWxwcnQs426uJ0llfTzHOLQ0CWGfIwrQThNj1ToJlz7wwSS9RrcNJv OKL1/OV0MwqyP3Lw/k/xAeDOrzb1lTGLPtyBiJPvDEBPCpUjp6F+tTqeRdaQ0DAuO3pN 76bGFggQC5TgP4fBpbPXETfKtSWWdvRIXEoUcJy4OxmB9svr8Rsu5KbBbhn3GR3A+XUX 7pzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=22UkH/VsvM/P25MHxqZG6eZIA2B9fnAMWMn2BJhw7p8=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=WTx4k9C1gf9V31O8d1PDdtAByGzYP5YzI02MFUZR6J0Gt35wwks5Sx6iBrvi9/khLt RUZ/zXYDHv5OXjCkQtUvivbEyl6I4qcxnSTB6BdcjbVrSGrNnZ3utD/BEbYZl7oiSDEr 3Bg4eBp4Q8YQRw42/sDF1PPjSQqse4Hm8eeZxBva6G3OoLTPPuhszKYncFk97wSz5rEl EGOqVaGw8Hk4BRqh/qYRqLKflpW1zLnAb59x97c6tQouoO7TSlafhKs2WrBnwE+A9Gt1 9tFGMqkBz30o8KRnTGFppufhcnMLCGQ5xxBAKB5B2/GINBWkUhjwTSzP/oYHUBjo5xS4 S27Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jLxMMcO6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id lb11-20020a17090b4a4b00b00276df8c5b83si1597881pjb.143.2023.11.23.07.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jLxMMcO6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A0D6E81C9A67; Thu, 23 Nov 2023 07:27:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346142AbjKWP13 (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346148AbjKWP1C (ORCPT ); Thu, 23 Nov 2023 10:27:02 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04DFDD67; Thu, 23 Nov 2023 07:27:05 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 53EE22000E; Thu, 23 Nov 2023 15:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=22UkH/VsvM/P25MHxqZG6eZIA2B9fnAMWMn2BJhw7p8=; b=jLxMMcO6+lQpKEgcBnITR2WLAJfR7Ice2WvgslFwIpzA+Z2Oly+YnElyf7+oo4EDYz7Cmu +y7vxP8J0a3URXBSgWh9uumQDlePvfJ9400tDznsi0K5nIxiPXzwdvKtU6I8cG23OaQc40 ytlR9QoH1ZTm621aERMcb/qq6MMHkXs/PgsnpNm4AMQJZ9sn7PemN1fleuZrW9H87R59p6 msdi7g4309v9m1uxgJQHCGqCg9X/NruM6jtmWYf6YDhnn+Z067SeinReGP1eUyQpdyUcSA o3utQh/Xz5NWXUgZcFUBA09TaJTmE1/bsoRouOzJe9kvpkd4Yq7otYnVlKyD0g== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v2 12/21] MIPS: Get rid of CONFIG_NO_EXCEPT_FILL Date: Thu, 23 Nov 2023 16:26:29 +0100 Message-ID: <20231123152639.561231-13-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:27:43 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369084006395302 X-GMAIL-MSGID: 1783369084006395302 From: Jiaxun Yang NO_EXCEPT_FILL is used to indicate platform that does not need to reserve ebase memory at start of kernel. This is true for all R2+ platform as they allocate ebase memory on fly, and also true for any platform that does not load kernel at start of physical memory. Get rid this Kconfig symbol by use macro to detect conditions above. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 8 -------- arch/mips/kernel/head.S | 7 +++++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index f7fa4f231c6c6..484cd8e926bed 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -149,7 +149,6 @@ config MIPS_GENERIC_KERNEL select MIPS_CPU_SCACHE select MIPS_GIC select MIPS_L1_CACHE_SHIFT_7 - select NO_EXCEPT_FILL select PCI_DRIVERS_GENERIC select SMP_UP if SMP select SWAP_IO_SPACE @@ -243,7 +242,6 @@ config BMIPS_GENERIC select ARCH_HAS_RESET_CONTROLLER select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL select BOOT_RAW - select NO_EXCEPT_FILL select USE_OF select CEVT_R4K select CSRC_R4K @@ -287,7 +285,6 @@ config BCM47XX select HAVE_PCI select IRQ_MIPS_CPU select SYS_HAS_CPU_MIPS32_R1 - select NO_EXCEPT_FILL select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_SUPPORTS_MIPS16 @@ -423,7 +420,6 @@ config LANTIQ select IRQ_MIPS_CPU select CEVT_R4K select CSRC_R4K - select NO_EXCEPT_FILL select SYS_HAS_CPU_MIPS32_R1 select SYS_HAS_CPU_MIPS32_R2 select SYS_SUPPORTS_BIG_ENDIAN @@ -472,7 +468,6 @@ config MACH_LOONGSON64 select ISA select I8259 select IRQ_MIPS_CPU - select NO_EXCEPT_FILL select NR_CPUS_DEFAULT_64 select USE_GENERIC_EARLY_PRINTK_8250 select PCI_DRIVERS_GENERIC @@ -1155,9 +1150,6 @@ config PCI_GT64XXX_PCI0 config PCI_XTALK_BRIDGE bool -config NO_EXCEPT_FILL - bool - config MIPS_SPRAM bool diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index b825ed4476c70..4af53b1628f57 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -59,10 +59,13 @@ #endif .endm -#ifndef CONFIG_NO_EXCEPT_FILL +#if (MIPS_ISA_REV < 2) && \ + ((VMLINUX_LOAD_ADDRESS == KSEG0) || \ + (VMLINUX_LOAD_ADDRESS == CKSEG0)) /* * Reserved space for exception handlers. - * Necessary for machines which link their kernels at KSEG0. + * Necessary for machines which link their kernels at KSEG0 + * and incapable of moving ebase. */ .fill 0x400 #endif From patchwork Thu Nov 23 15:26:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168986 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526068vqx; Thu, 23 Nov 2023 07:28:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMkToA1P4Xo/nnD3eK1vG2gGXbkacB39Qwetf+p24NAtDHiBza/4d/aOuqr0+58R9R019R X-Received: by 2002:a05:6a20:734d:b0:18b:8d6b:e601 with SMTP id v13-20020a056a20734d00b0018b8d6be601mr2557368pzc.7.1700753293103; Thu, 23 Nov 2023 07:28:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753293; cv=none; d=google.com; s=arc-20160816; b=M6vE01JgEa6ZZRWAgepKquRL4KOCHz4A8T9D2lm830LhHq+1LCj/RGGMzztt4KE9mr 5tcTWms1i7QyuZ/1Veq2CLWtev8FCRvYfkTeRu9WdFrJAFIpIVLKTvH1MA5UNyHgvrJa Vov3g48kKucA4ryd3IzeCf/wDv8RF1tLgBX+gVtjEEE1Jb663KvYuc29lS05afGDtTM7 d2wdreLk7XGj8IIBDaeHHFPaw9zWXkZkheUgva++Kmb7v4P3KPFOMCBE/aLE90XjLeWs QxLr3/NOK7kxOT6dqcDrpn1xcmq8akdvhREVZnrMH+Yzkbw7ElFGHULYb+YBfGAQNdfY n0Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RCKptM1WbQckX1/6TWdLw/l+WdnmH/2DKGhPgYFMpg4=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=vOUMQsqzjsHA89ou3WkK81PZPXMn5gU5T1pYeYs9VJvmCgn85CMRxTpGIJ711tfObJ YeTKI/+RWmRwIHdNONZd3dcfPMx8ymQGaO77ypqYKMB4/KICTvVpJWh9dnI5Yfp2Mhlg UeRacx7TScsd2LvFGLCgqF5nLe8YWXu1GDcpJR5HzsAKc0Jyxqrd7yx6iVAvApgWiwFJ p16yneQyObr6Wk2VlfNOPeVKmKsGKm+RDCX2t6YJ4gX1nxCmCK7I5ooKXT8GMAtzVhBv 7y1568yLqxlD8dm96LpoWUPoXNMnfAsc1UkndEfu0jkgxVq5YNORZYRfUPwFaUvKJ16l NQTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ezsiTQk1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id t5-20020a625f05000000b006cb83b233a2si1356186pfb.355.2023.11.23.07.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ezsiTQk1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3DB4682385EA; Thu, 23 Nov 2023 07:28:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346187AbjKWP1v (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346171AbjKWP1T (ORCPT ); Thu, 23 Nov 2023 10:27:19 -0500 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A571F10C0; Thu, 23 Nov 2023 07:27:06 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EB15A40002; Thu, 23 Nov 2023 15:27:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RCKptM1WbQckX1/6TWdLw/l+WdnmH/2DKGhPgYFMpg4=; b=ezsiTQk10iF+9RkJPCisP/IK3Du+KZIUqiD3vB+Ciz7VII/LNStwt40t5Y+EMuH41tc0rB 3DPKQ3b1MCSCAWWE02Q+0E/ARWNp5LcXXvZUSKpBqzC/z4vL5tNPtaF4U7+gygR2rcffDQ ISIxWgqkqz+C0XeYvnyRmnBUg8D/fgUsax+k1L92bfrECNaqNg6Pb1SAeqTKg9WqOyzQtE 7q5lzfNTsvO62erFgaFkWDghjB4ynCTh9YuxA6qR6DCG08oVovdasQ0mRHEMvExOm0hP4S FmMVIvvJpH8lvC0LjrZmHSJpFMm4rlPe2uwotxyZ6SuYY9fSCrOE8FLx2JEtig== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v2 13/21] MIPS: traps: Give more explanations if ebase doesn't belong to KSEG0 Date: Thu, 23 Nov 2023 16:26:30 +0100 Message-ID: <20231123152639.561231-14-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369084966396594 X-GMAIL-MSGID: 1783369084966396594 Now that we support having the kernel in XPHYS and not only in KSEG0, the case where ebase doesn't belong to KSEG0 is more likely to occur. However, in this scenariowe encounter a significant and intimidating stack dump without any explanation. To address this, we should eliminate the uninformative stack dump and replace it with a warning that provides a clear explanation of the issue. Signed-off-by: Gregory CLEMENT --- arch/mips/kernel/traps.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 68f1dd54cde1c..3af2aa82b4408 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2420,10 +2420,13 @@ void __init trap_init(void) * EVA is special though as it allows segments to be rearranged * and to become uncached during cache error handling. */ - if (!IS_ENABLED(CONFIG_EVA) && !WARN_ON(ebase_pa >= 0x20000000)) + if (!IS_ENABLED(CONFIG_EVA) && ebase_pa < 0x20000000) ebase = CKSEG0ADDR(ebase_pa); else ebase = (unsigned long)phys_to_virt(ebase_pa); + if (ebase_pa >= 0x20000000) + pr_warn("ebase(0x%llX) should better be in KSeg0", + ebase_pa); } if (cpu_has_mmips) { From patchwork Thu Nov 23 15:26:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168984 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp525985vqx; Thu, 23 Nov 2023 07:28:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkzX1MjbJRqbopKIsJG4Yqt0uwUkdm75w5dEKc39o4kPEkVrxjkfAG0YNiV3uPhlCXvpnC X-Received: by 2002:a05:6a00:6ca2:b0:6c3:415a:5c05 with SMTP id jc34-20020a056a006ca200b006c3415a5c05mr4136972pfb.14.1700753284514; Thu, 23 Nov 2023 07:28:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753284; cv=none; d=google.com; s=arc-20160816; b=moovUs25PIm5ymSNTCtG5s8qpZB+LMMZrY/l7V97QvyzKgKU3rcx5u5QdshhQYAijE BJ1RF+ynLqWarJvEDkcU7bF+6yMBE954ktCn+qpx3cG9cDY3ASq0QBMoX4KB07vbEVs4 eBE1U6U175swSHzT2Hvr+kcyjkQasXS/QNIO/jfkvsIOMZQ/zwGgYWqHUPx/eoQJ22vH o/8HNVSqndAnTKXKBJJlCPp8Peb9B0a5AsLJMpGjB7bYLcFEU2RVV4fjN8iUD4mZltAO bmfKd2vuYWjeKQ5IfRVc1HbQFPgTtSRW/f4fuEo1nKJb6ARr8BAEJqB/p1pitlYm3Yh3 1gog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gZ7oKcw0eqw6lprpX+dDIOb31hPprI1Sem1ITgrbMiU=; fh=r8HAToUbm7HKgUU40INQMHuP8o6HF7MVZPPWnIX1Hp0=; b=n9UJzeYiDIU87LRrTxzPSzA3z3FvLTs97x4iQmn7lnnAfd7/en59xXy5Tg4V74jK3B uiRm8lxftygOqL1Jb3LGGW62Eq4riSUqmDh9iKs0rLn4MlULJCdDh+F/BOebRTABhDYd ywL9w/EOcYHOzhvFP5CSAXwv8kv0++G2YGwIWRT+VMq3klb+TXnN5xm1eLu8C/RtjTCe 0P4Aod+Cxh1q+LlmI19LRBT2qQCXPdP21syG68g2qdjxjzTw3koSiPu3q396046u34UP YnpNxLBmNW6o+DYQjrBacFCSHPbzrTjMdyHJOZm0pkU7ac2+j3A4Yc4+GpepmqaYHbDJ CGlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Jrz6PfG7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id f18-20020a056a0022d200b0068fe0f46f27si1473149pfj.171.2023.11.23.07.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Jrz6PfG7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C6DF9806BC2E; Thu, 23 Nov 2023 07:28:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346072AbjKWP1i (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346156AbjKWP1I (ORCPT ); Thu, 23 Nov 2023 10:27:08 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9953B10FF; Thu, 23 Nov 2023 07:27:07 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9DFCF240005; Thu, 23 Nov 2023 15:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753226; 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=gZ7oKcw0eqw6lprpX+dDIOb31hPprI1Sem1ITgrbMiU=; b=Jrz6PfG7ALhbkNRvrnNXxKuMXm1EwTpWSQK30WW9tHI5lyF6uA4aut7SngQeWB2840WMcU axLkjHXfRMURkF5oDhbUwvIiCN+LC+aszKHOwp2yI1zvFvlrDOIcJQMM+AjhofxUNUFwu2 oa7NnTTq2iI7BfbP66VO0FvYVodsSmrZBKV5pu+h44BjVTUbsYuwBoJdzkscO3bKj5OBRm phCE7wpA21o4EUMKWNu48Q/Ax+G6RM1MkNmEkf2Sco1pUED4RD2gpfZtNz0SDLjm4bBBDb wetMtTStyAXYjmQmkuWH/DU8N6OxcThiiciOdmYyt+mRX/hMvWSoRFhMdWjIBQ== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Rob Herring Subject: [PATCH v2 14/21] dt-bindings: Add vendor prefix for Mobileye Vision Technologies Ltd. Date: Thu, 23 Nov 2023 16:26:31 +0100 Message-ID: <20231123152639.561231-15-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:01 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369076045340534 X-GMAIL-MSGID: 1783369076045340534 Mobileye Vision Technologies Ltd. is a company developing autonomous driving technologies and advanced driver-assistance systems (ADAS) including cameras, computer chips and software. Reviewed-by: Philippe Mathieu-Daudé Acked-by: Rob Herring Signed-off-by: Gregory CLEMENT --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 309b94c328c84..b45279bc97c14 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -897,6 +897,8 @@ patternProperties: description: Miyoo "^mntre,.*": description: MNT Research GmbH + "^mobileye,.*": + description: Mobileye Vision Technologies Ltd. "^modtronix,.*": description: Modtronix Engineering "^moortec,.*": From patchwork Thu Nov 23 15:26:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168989 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526138vqx; Thu, 23 Nov 2023 07:28:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFuCGQBcHs/JPbjw0N/Nq2wRTgcbv7BbeZKGrr3HNWH2udcjh14+wZMtyiTd0nZV8RF2qt X-Received: by 2002:a05:6a00:418b:b0:6cb:8bb7:dfb5 with SMTP id ca11-20020a056a00418b00b006cb8bb7dfb5mr6744760pfb.25.1700753299671; Thu, 23 Nov 2023 07:28:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753299; cv=none; d=google.com; s=arc-20160816; b=CacNCujAwDIkKYXydWT/QhAEiP0nqx+pcTWxF3k6MnNjxWPNXJ95NLOoWqIgLTv1TD GiBeb00diFAC9S3wOD01hljRDBmAVqWoRVuEcnFktAhhkMcbplZYAJ8zsNxZCmpuG9EV wlg9JbdhvA+OR37UFoDK+BuA6NTLoOLpsX6r0wmNDytEP+qZnmdT1Gvm9O3g42ZjkoDl vBySvEWbtQFxqZR6r4tC8MqoTQ/78YYvmIHV/mhuhDiyLfqV4SKQu/eRrd+r6DUlqGUc y2Ryt/EjQDgB7ScNvyPf3wAnrJHdv77EfeRdzaLOhAm3P8knFORxJTLew1lQYfxBl/eS VJrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YxBQIVfB/3LFTfuDMg1LdYvc5zsihHEyj9Q9WPYYQXw=; fh=fN3SS3YhdNpAHHF3abogJ8btP31gzyRxhXmubSL9TGA=; b=SNCvJF6kmRM3PfnN7sKeF0lgriZMyCKEarTT5iI9J0rHAP6PU9jENZW7MvCdC7xdjh 7rbxLBvu/4CPZvvqJja0JhvxvUBhhTH3zIx1fGUHhaI71Vzg+uVIibZ/fj7grrlyHwfz t+loaZ4YNwb8Q/KyWvHTru/1QDITUMSdxqoPkAAjSaIKQAXhSESbTdo4nhZdBHtURRAR OY+zsswnvAZSoz07xrC6EPLi2Blb/R+4t8bLz3WNEf+la9fpyKeXnG0XCpbgqgtd41Y+ jXCiXCpoD1hwptEw0KVhs/M4mSMXW8UYgw7luR81iqIOur+9QdPrTinmmogWD6H01Jdl jayA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="gH30Q14/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id r26-20020a6560da000000b00564929df8besi1479235pgv.568.2023.11.23.07.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="gH30Q14/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B8BEE8087CBF; Thu, 23 Nov 2023 07:28:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346189AbjKWP1y (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346172AbjKWP1T (ORCPT ); Thu, 23 Nov 2023 10:27:19 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45D371709; Thu, 23 Nov 2023 07:27:08 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5506EE0009; Thu, 23 Nov 2023 15:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753226; 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=YxBQIVfB/3LFTfuDMg1LdYvc5zsihHEyj9Q9WPYYQXw=; b=gH30Q14/dAn5j9eFyOQ0tAHqdE0Gzuml2tm6LhVXJ2e9wGOFzCx6wxy7RTnj+prlaM9EaT 24yA33GHBSM/F1/Jg+b3j6oHzUpCS5JyGHOl8rWfsm1G8JH+itfkMSVEwcyd3bgdS19Y4R PpmUnHlSNFgP5RszIpGcnmcUi4BaYtauK1eroDUC343oGbDZcch+C81fz6FWtFaySa76xU C9NfP7GYbnBXp+gc7jHEuwxxOJgjihDfliBzJcrtDy9AguqyZD6gPCnXzuf7QTbA+nANAU cG/taaNvO2z3HC/rjJZQR852ddQVCGG/ZQixt2i5EwwbJmtkU19owdG4hFnJqA== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT , Arnd Bergmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 15/21] dt-bindings: mips: cpu: Add I-Class I6500 Multiprocessor Core Date: Thu, 23 Nov 2023 16:26:32 +0100 Message-ID: <20231123152639.561231-16-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369092114362409 X-GMAIL-MSGID: 1783369092114362409 The MIPS Warrior I-class I6500 was announced by Imagination Technologies in 2016 and is used in the Mobileye SoC EyeQ5. Acked-by: Arnd Bergmann Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Gregory CLEMENT Reviewed-by: Serge Semin --- Documentation/devicetree/bindings/mips/cpus.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mips/cpus.yaml b/Documentation/devicetree/bindings/mips/cpus.yaml index cf382dea3922c..b5165cf103e94 100644 --- a/Documentation/devicetree/bindings/mips/cpus.yaml +++ b/Documentation/devicetree/bindings/mips/cpus.yaml @@ -39,6 +39,7 @@ properties: - mti,mips24KEc - mti,mips14KEc - mti,mips14Kc + - img,i6500 reg: maxItems: 1 From patchwork Thu Nov 23 15:26:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168997 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526373vqx; Thu, 23 Nov 2023 07:28:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNUwrV/WBrSDkvkFTcNCJtsKCGxOXo8diM5uUtA6GFGkJq3kgdLhiizTX1U37qZs7Fn64Z X-Received: by 2002:aca:1004:0:b0:3ae:12f6:ac51 with SMTP id 4-20020aca1004000000b003ae12f6ac51mr6284276oiq.41.1700753320074; Thu, 23 Nov 2023 07:28:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753320; cv=none; d=google.com; s=arc-20160816; b=FB4JIiSpgAouZyRvk2F13nI/Eirdlo5U8J4ajWmxuaTQ9YSuUa2p7RF3OyBRhPwhr1 9IeIduDnGX6ZhRceSF09XRVQ0bhwUYsL2dyBOc+RxkbnEUm13zfQUwDpPUeaXFMrWDPM QgAPYysIwzyUyZaErrG0+xDYFe8n6uVb/ylWwYq6goQKHoNhCFAQfgbv91SgOdApvfKi ALKEk+qf26zNWC9dCC7rJLhZG9tb9EJs2013jVfeVq2dbpCrYoV7yP5JdzNi3GMCFeew 8drEMrlFf4ccdE7GHJ25VkXvsWSkoCx4pdasyLT8CdZ5fMRTz2KQb7ChWjUY9RFQZ436 zsKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rqcWJwc1AByHKusITSkSLKzXeuC6sREuOa9GwKxdEz4=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=y61ETbT91+7J3MgywxrVaWbREPY3Hm2VeO+/+QuxnBI/96dbbr2LPvxbKLDEh5zPCn aW41768ArR3PkzlMxWtnARLTmoShYMOBAfJxul81tmhMWcl0mTj02L8WHkEv0GdBVgGT L4cd8APmPw4QD1ep1OMQQAvT9cJ7EAdAPQHvpYqZUvtXVAEfZFzgsQ07xi+guRtbmj+A vAxgTkrfU+lS9vEZp1o46om1pjYEFZdBHCULxoxuleIsn3kICKOetns7mWmuj5T2+2Y0 QQJbBtUj5RAMU183Du/sPnqXh346vrWRu9mLpaVvXYbCPS79ovY3sOfHV3F2MC/p3LTW 41rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cA8gnk4c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h13-20020a63df4d000000b0056336fb99aasi1432738pgj.850.2023.11.23.07.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=cA8gnk4c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9BB23822C392; Thu, 23 Nov 2023 07:28:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346184AbjKWP1r (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346123AbjKWP1T (ORCPT ); Thu, 23 Nov 2023 10:27:19 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3DCD10D2; Thu, 23 Nov 2023 07:27:08 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1AC7720003; Thu, 23 Nov 2023 15:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753227; 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=rqcWJwc1AByHKusITSkSLKzXeuC6sREuOa9GwKxdEz4=; b=cA8gnk4c2ebNPLlE8xjCOmR+nRVjZEhrf0LPTWqZdJbEDnaMVSzbKN00sa5f52u0+4Gjzc NbemReqzCxWY/T8kRf2dw4W7qVw7g07Wz0LmzmXpMQMsOPRvoB2QpzFh6hrUZFuZlHifOp TxqLHM0rXC6PFF2AFVEKocSqPfe8RlZM1ZCvOFlsI7QyMgnbZg6thVFeKZU5eMdx821F+j EV8gSpmtJmzEi64NYyGaxNfApr2fkiPZd4vdEoF33ywDfJIyYYKtX1XQLNu3ZgYz28GuLT zCkVXL9fdf3yI2mePjZMU03utdaWzuRZDmmpsEg29BYvJosyXQCy0eFuW2TaGw== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v2 16/21] dt-bindings: mips: Add bindings for Mobileye SoCs Date: Thu, 23 Nov 2023 16:26:33 +0100 Message-ID: <20231123152639.561231-17-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:06 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369113585942664 X-GMAIL-MSGID: 1783369113585942664 Add the yaml bindings for Mobileye SoCs. Currently only EyeQ5 is supported Signed-off-by: Gregory CLEMENT Reviewed-by: Rob Herring --- .../devicetree/bindings/mips/mobileye.yaml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/mips/mobileye.yaml diff --git a/Documentation/devicetree/bindings/mips/mobileye.yaml b/Documentation/devicetree/bindings/mips/mobileye.yaml new file mode 100644 index 0000000000000..5201cf19f43ad --- /dev/null +++ b/Documentation/devicetree/bindings/mips/mobileye.yaml @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +# Copyright 2023 Mobileye Vision Technologies Ltd. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mips/mobileye.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mobileye SoC series + +maintainers: + - Vladimir Kondratiev + - Gregory CLEMENT + - Théo Lebrun + +description: + Boards with a Mobileye SoC shall have the following properties. + +properties: + $nodename: + const: '/' + + compatible: + oneOf: + - description: Boards with Mobileye EyeQ5 SoC + items: + - enum: + - mobileye,eyeq5-epm5 + - const: mobileye,eyeq5 + +additionalProperties: true + +... From patchwork Thu Nov 23 15:26:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 169000 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526414vqx; Thu, 23 Nov 2023 07:28:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHR+E99AnLwXPMIHL37jL3P1CgptSPVaFwrzH72C3yvIJLVZGUIGejBk1umeZvUJQZoaCcx X-Received: by 2002:a17:902:dac1:b0:1cc:4e46:3e45 with SMTP id q1-20020a170902dac100b001cc4e463e45mr7663528plx.49.1700753324371; Thu, 23 Nov 2023 07:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753324; cv=none; d=google.com; s=arc-20160816; b=dEcrehwwFtVn3cQlJVxIXRekRFH9M5w0SImAiW5VvBGBQAM0pUAc7K2FKUhk8tEyMs 5PdIY1KmXqsww1zGJFwUELjKbkkxohNAN+njt+LFZQki9pnZimyZeFkIQFqe2vx7uAc/ Iu1TF+aQIBIVz1UcU+ESDQ6GJmeBystHvzGLJ0ksAvD/HrB5dgm9pLH+Bs2UdPU+KWgj iEpIAX5ydTCp5GsIGs8CzgKiMtw6NLtD1dpws4BGgtlKwGudTB27zKK1cT9BgSN9ZPS4 Ki7thAkVa7qsKJywhQyBxSiQ5t2hS/4EKmNCMh1NfPt8VnicxNuGBcmjZcXTi2beDCWJ Ok4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xArXSVFGHompfCB7X6Iyz6hEKap2I3z3tNCpAM3xdqQ=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=VHXGd1+KXB/JCXpqXPgZ+qWjy55s5ZBYqjQhSf//FIBGnbktmn9HyDTonYUnS0JuRg bnn5oxTHICOCICoS3dUOfW6Cd7i+AucnOVxkXYTQpx5/BaHVpHCCRQQst1GYF9rtzdZ4 dwvKGxruy75DGN8saAddcEcd57jqJfu4GwQSkR3gqDso2WvhSJ3mbmP7oU+0d61xwmHu TOGivWfkPAILOalXrK5cHOySXxIpUqttwP0PHoVV+mqG4hZo+VFreaHTdmMu5SIZRkH6 xj+78bXMocqFghI5ijC7UcLitvo+OTCe1yIMAEmfPKsBusPiDjs0mxGXxHNVVOooJGBr 4eWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WXGXLw5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id p19-20020a170902a41300b001c722b269b4si1207735plq.620.2023.11.23.07.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WXGXLw5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8FA4381A2061; Thu, 23 Nov 2023 07:28:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346133AbjKWP16 (ORCPT + 99 others); Thu, 23 Nov 2023 10:27:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346180AbjKWP1T (ORCPT ); Thu, 23 Nov 2023 10:27:19 -0500 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C95C810D7; Thu, 23 Nov 2023 07:27:10 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E10F91BF20C; Thu, 23 Nov 2023 15:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xArXSVFGHompfCB7X6Iyz6hEKap2I3z3tNCpAM3xdqQ=; b=WXGXLw5D87idEX3BN9ufg3N3Hiy/YffUYPeFKR9OcVymDgEil1UcbAHS+zm4lGpYwURb+O bs4tqs8hPE5aYDGN3O8yZYrqeu85BVbgex6+fYp1gPFWlJb8yV8lRrrpGdE5dEvRvfO4ur xP5aaUgKBz+GTOGtAtd3EDeNhMG1YnEfCGUTOMfZR+HxUQPuYa32OoHkAA0N4ZJd86iLU/ rgyuRUB9QeU8LAZyg0UoRCuFtjZmSROCwRV2tz5r9O15yucBVZ95B9YuZfxhaKtumTl/uR haIYFIY5q0lX4UlqOOcesGFvkqlUWN+BZjQCk2qRtRWdnix4TdGK/TbNgnYl/w== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v2 17/21] dt-bindings: mfd: syscon: Document EyeQ5 OLB Date: Thu, 23 Nov 2023 16:26:34 +0100 Message-ID: <20231123152639.561231-18-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:37 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369117960237537 X-GMAIL-MSGID: 1783369117960237537 Document Mobileye EyeQ5 compatibles for OLB registers that are miscellaneous SoC related registers. It is used to expose SoC specific configuration such as for example reset, clock or pinctrl. Signed-off-by: Gregory CLEMENT Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/mfd/syscon.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml index 084b5c2a2a3c2..c90633460eeca 100644 --- a/Documentation/devicetree/bindings/mfd/syscon.yaml +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml @@ -55,6 +55,7 @@ properties: - mediatek,mt8135-pctl-a-syscfg - mediatek,mt8135-pctl-b-syscfg - mediatek,mt8365-syscfg + - mobileye,eyeq5-olb - microchip,lan966x-cpu-syscon - microchip,sparx5-cpu-syscon - mstar,msc313-pmsleep From patchwork Thu Nov 23 15:26:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168992 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526216vqx; Thu, 23 Nov 2023 07:28:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRtM3I5qF1CLT/ZhBLhwL6kyD8dRSe3um2ERjPTlT1wrqqcJ3Xg4NbAT2e8hd61ZALV3oS X-Received: by 2002:a05:6a00:148b:b0:693:3be8:feba with SMTP id v11-20020a056a00148b00b006933be8febamr6258674pfu.19.1700753306942; Thu, 23 Nov 2023 07:28:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753306; cv=none; d=google.com; s=arc-20160816; b=IiSzLwUZ87EnrogbWa/4Rmh1WF1OKEMRknW39pwtBNFm7xdaRlq0gk4MZyax7RaXx/ eUGrGxIYm8H7EtyjeqFQs3OqVO1+dN0oGoGaT2LtLPXrVLaHwSCtHRk1morBYDKT1OAv dmo+hyUp647D5oMztfqtl70zlcdspq67xnu3qQGHVWaL7E8KbciJfFDjCaDYqje62TX1 ZGOd6WgmFWeJN2ynCu5F5//StmWY2OSxsAKu2JbK9Y8yU8I85SdHjQjXtXw47hE5GzI+ iKfBxlKhWFZVUD10o7Eca8tyvZ56IESaC38H2VL/DWz4E+3jnc76XrBUE4xoAIwEVEzV aMrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fiiFYKflC5zkDRB2NKyGH/e+lKR/Wnt17eXuJIWdFqY=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=Lck/YVQ6vjLXL7I+Rpj/yfamN873fDzuGZYWkP/Hlb5JcsSJ1ZAJ8wc3B7jzXMp13O VAqo45xCEKQDK0ltToGw0Y/xeFYyaEfjUqbsIw0JEbzsCjJUNcifzfKkHlytjdVW61i7 JQgi8t5zMt1aZ+ndUGpBdoheBT9fuX5DXkeowjPT7UiwUgJ4BTL3JNyqD5FVcEPjGsS7 iNbwodNS78F9thCfar8l1J5FdyQJ+i+G7JZ/4bgBrPi8Tcp1lypNuThkfsMHltIHp3Pt VsZyg4G+NHGuXmw0nyIZqAn4IBmbTVKu1Anlmbjrb+n3DPrZD+SF8Hhnfbe2cw5SHGzq UvVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Jui/c321"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f23-20020a63f117000000b005bdc949fee3si1495902pgi.880.2023.11.23.07.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Jui/c321"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 20E3C8263EAB; Thu, 23 Nov 2023 07:28:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346072AbjKWP2C (ORCPT + 99 others); Thu, 23 Nov 2023 10:28:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346194AbjKWP1U (ORCPT ); Thu, 23 Nov 2023 10:27:20 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79623171A; Thu, 23 Nov 2023 07:27:11 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 04CC160006; Thu, 23 Nov 2023 15:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fiiFYKflC5zkDRB2NKyGH/e+lKR/Wnt17eXuJIWdFqY=; b=Jui/c321OV3qIKKjeBHZBpRpF1QgMBJ06wCwBOm4d15CJ+Ce3TLWfLVLzX+ITMWuU1A85O va7SQsL7ngqSpfd8JG/U0h+YaTk+gOX6XjkYYc+Mm1hsCEsmFAYhpJauHfUE2nPPHXDJsk kzET604hwezAZkZvamsf33Y4facoFqNUOWBsb1Q8P+cypiEO0FIcqSkm44TmRBzI5AA7SR klsyRn0PVgXmILxd0d3wyGMTqjFrVg50HSdbnX6QyJkJTcwPK7oYHcSoWWYn1BD4/wflSs LMlgtzHh35xONmqw2gzQsQnbGFS4KUt/WJ3YSBjSYpfTYUqVJy2/R0APhUw8Ag== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v2 18/21] MIPS: mobileye: Add EyeQ5 dtsi Date: Thu, 23 Nov 2023 16:26:35 +0100 Message-ID: <20231123152639.561231-19-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:17 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369099540364555 X-GMAIL-MSGID: 1783369099540364555 Add a device tree include file for the Mobileye EyeQ5 SoC. Based on the work of Slava Samsonov Signed-off-by: Gregory CLEMENT --- arch/mips/boot/dts/Makefile | 1 + .../boot/dts/mobileye/eyeq5-fixed-clocks.dtsi | 292 ++++++++++++++++++ arch/mips/boot/dts/mobileye/eyeq5.dtsi | 134 ++++++++ 3 files changed, 427 insertions(+) create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-fixed-clocks.dtsi create mode 100644 arch/mips/boot/dts/mobileye/eyeq5.dtsi diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile index 928f38a79dff9..edb8e8dee7583 100644 --- a/arch/mips/boot/dts/Makefile +++ b/arch/mips/boot/dts/Makefile @@ -8,6 +8,7 @@ subdir-$(CONFIG_LANTIQ) += lantiq subdir-$(CONFIG_MACH_LOONGSON64) += loongson subdir-$(CONFIG_SOC_VCOREIII) += mscc subdir-$(CONFIG_MIPS_MALTA) += mti +subdir-$(CONFIG_SOC_EYEQ5) += mobileye subdir-$(CONFIG_LEGACY_BOARD_SEAD3) += mti subdir-$(CONFIG_FIT_IMAGE_FDT_NI169445) += ni subdir-$(CONFIG_MACH_PIC32) += pic32 diff --git a/arch/mips/boot/dts/mobileye/eyeq5-fixed-clocks.dtsi b/arch/mips/boot/dts/mobileye/eyeq5-fixed-clocks.dtsi new file mode 100644 index 0000000000000..78f5533a95c67 --- /dev/null +++ b/arch/mips/boot/dts/mobileye/eyeq5-fixed-clocks.dtsi @@ -0,0 +1,292 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +/* + * Copyright 2023 Mobileye Vision Technologies Ltd. + */ + +/ { + /* Fixed clock */ + pll_cpu: pll-cpu { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1500000000>; + }; + + pll_vdi: pll-vdi { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1280000000>; + }; + + pll_per: pll-per { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <2000000000>; + }; + + pll_ddr0: pll-ddr0 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1857210000>; + }; + + pll_ddr1: pll-ddr1 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1857210000>; + }; + +/* PLL_CPU derivatives */ + occ_cpu: occ-cpu { + compatible = "fixed-factor-clock"; + clocks = <&pll_cpu>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + si_css0_ref_clk: si-css0-ref-clk { /* gate ClkRstGen_si_css0_ref */ + compatible = "fixed-factor-clock"; + clocks = <&occ_cpu>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + cpc_clk: cpc-clk { + compatible = "fixed-factor-clock"; + clocks = <&si_css0_ref_clk>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + core0_clk: core0-clk { + compatible = "fixed-factor-clock"; + clocks = <&si_css0_ref_clk>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + core1_clk: core1-clk { + compatible = "fixed-factor-clock"; + clocks = <&si_css0_ref_clk>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + core2_clk: core2-clk { + compatible = "fixed-factor-clock"; + clocks = <&si_css0_ref_clk>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + core3_clk: core3-clk { + compatible = "fixed-factor-clock"; + clocks = <&si_css0_ref_clk>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + cm_clk: cm-clk { + compatible = "fixed-factor-clock"; + clocks = <&si_css0_ref_clk>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + mem_clk: mem-clk { + compatible = "fixed-factor-clock"; + clocks = <&si_css0_ref_clk>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + occ_isram: occ-isram { + compatible = "fixed-factor-clock"; + clocks = <&pll_cpu>; + #clock-cells = <0>; + clock-div = <2>; + clock-mult = <1>; + }; + isram_clk: isram-clk { /* gate ClkRstGen_isram */ + compatible = "fixed-factor-clock"; + clocks = <&occ_isram>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + occ_dbu: occ-dbu { + compatible = "fixed-factor-clock"; + clocks = <&pll_cpu>; + #clock-cells = <0>; + clock-div = <10>; + clock-mult = <1>; + }; + si_dbu_tp_pclk: si-dbu-tp-pclk { /* gate ClkRstGen_dbu */ + compatible = "fixed-factor-clock"; + clocks = <&occ_dbu>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; +/* PLL_VDI derivatives */ + occ_vdi: occ-vdi { + compatible = "fixed-factor-clock"; + clocks = <&pll_vdi>; + #clock-cells = <0>; + clock-div = <2>; + clock-mult = <1>; + }; + vdi_clk: vdi-clk { /* gate ClkRstGen_vdi */ + compatible = "fixed-factor-clock"; + clocks = <&occ_vdi>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + occ_can_ser: occ-can-ser { + compatible = "fixed-factor-clock"; + clocks = <&pll_vdi>; + #clock-cells = <0>; + clock-div = <16>; + clock-mult = <1>; + }; + can_ser_clk: can-ser-clk { /* gate ClkRstGen_can_ser */ + compatible = "fixed-factor-clock"; + clocks = <&occ_can_ser>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + i2c_ser_clk: i2c-ser-clk { + compatible = "fixed-factor-clock"; + clocks = <&pll_vdi>; + #clock-cells = <0>; + clock-div = <20>; + clock-mult = <1>; + }; +/* PLL_PER derivatives */ + occ_periph: occ-periph { + compatible = "fixed-factor-clock"; + clocks = <&pll_per>; + #clock-cells = <0>; + clock-div = <16>; + clock-mult = <1>; + }; + periph_clk: periph-clk { + compatible = "fixed-factor-clock"; + clocks = <&occ_periph>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + can_clk: can-clk { + compatible = "fixed-factor-clock"; + clocks = <&occ_periph>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + spi_clk: spi-clk { + compatible = "fixed-factor-clock"; + clocks = <&occ_periph>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + uart_clk: uart-clk { + compatible = "fixed-factor-clock"; + clocks = <&occ_periph>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; + i2c_clk: i2c-clk { + compatible = "fixed-factor-clock"; + clocks = <&occ_periph>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + clock-output-names = "i2c_clk"; + }; + timer_clk: timer-clk { + compatible = "fixed-factor-clock"; + clocks = <&occ_periph>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + clock-output-names = "timer_clk"; + }; + gpio_clk: gpio-clk { + compatible = "fixed-factor-clock"; + clocks = <&occ_periph>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + clock-output-names = "gpio_clk"; + }; + emmc_sys_clk: emmc-sys-clk { + compatible = "fixed-factor-clock"; + clocks = <&pll_per>; + #clock-cells = <0>; + clock-div = <10>; + clock-mult = <1>; + clock-output-names = "emmc_sys_clk"; + }; + ccf_ctrl_clk: ccf-ctrl-clk { + compatible = "fixed-factor-clock"; + clocks = <&pll_per>; + #clock-cells = <0>; + clock-div = <4>; + clock-mult = <1>; + clock-output-names = "ccf_ctrl_clk"; + }; + occ_mjpeg_core: occ-mjpeg-core { + compatible = "fixed-factor-clock"; + clocks = <&pll_per>; + #clock-cells = <0>; + clock-div = <2>; + clock-mult = <1>; + clock-output-names = "occ_mjpeg_core"; + }; + hsm_clk: hsm-clk { /* gate ClkRstGen_hsm */ + compatible = "fixed-factor-clock"; + clocks = <&occ_mjpeg_core>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + clock-output-names = "hsm_clk"; + }; + mjpeg_core_clk: mjpeg-core-clk { /* gate ClkRstGen_mjpeg_gen */ + compatible = "fixed-factor-clock"; + clocks = <&occ_mjpeg_core>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + clock-output-names = "mjpeg_core_clk"; + }; + fcmu_a_clk: fcmu-a-clk { + compatible = "fixed-factor-clock"; + clocks = <&pll_per>; + #clock-cells = <0>; + clock-div = <20>; + clock-mult = <1>; + clock-output-names = "fcmu_a_clk"; + }; + occ_pci_sys: occ-pci-sys { + compatible = "fixed-factor-clock"; + clocks = <&pll_per>; + #clock-cells = <0>; + clock-div = <8>; + clock-mult = <1>; + clock-output-names = "occ_pci_sys"; + }; + pclk: pclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <250000000>; /* 250MHz */ + }; + tsu_clk: tsu-clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <125000000>; /* 125MHz */ + }; +}; diff --git a/arch/mips/boot/dts/mobileye/eyeq5.dtsi b/arch/mips/boot/dts/mobileye/eyeq5.dtsi new file mode 100644 index 0000000000000..21da35ffb0040 --- /dev/null +++ b/arch/mips/boot/dts/mobileye/eyeq5.dtsi @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* +* Copyright 2023 Mobileye Vision Technologies Ltd. +*/ + +#include + +/memreserve/ 0x40000000 0xc0000000; /* DDR32 */ +/memreserve/ 0x08000000 0x08000000; /* DDR_LOW */ + +#include "eyeq5-fixed-clocks.dtsi" + +/ { + #address-cells = <2>; + #size-cells = <2>; + cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { + device_type = "cpu"; + compatible = "img,i6500"; + reg = <0>; + clocks = <&core0_clk>; + }; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* These reserved memory regions are also defined in bootmanager + * for configuring inbound translation for BARS, don't change + * these without syncing with bootmanager + */ + shmem0_reserved: shmem@804000000 { + reg = <0x8 0x04000000 0x0 0x1000000>; + }; + shmem1_reserved: shmem@805000000 { + reg = <0x8 0x05000000 0x0 0x1000000>; + }; + pci0_msi_reserved: pci0-msi@806000000 { + reg = <0x8 0x06000000 0x0 0x100000>; + }; + pci1_msi_reserved: pci1-msi@806100000 { + reg = <0x8 0x06100000 0x0 0x100000>; + }; + + mini_coredump0_reserved: mini-coredump0@806200000 { + reg = <0x8 0x06200000 0x0 0x100000>; + }; + mhm_reserved_0: the-mhm-reserved-0@0 { + reg = <0x8 0x00000000 0x0 0x0000800>; + }; + }; + + aliases { + serial0 = &uart0; + serial1 = &uart1; + serial2 = &uart2; + }; + + cpu_intc: interrupt-controller { + compatible = "mti,cpu-interrupt-controller"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + + gic: interrupt-controller@140000 { + compatible = "mti,gic"; + reg = <0x0 0x140000 0x0 0x20000>; + interrupt-controller; + #interrupt-cells = <3>; + + /* + * Declare the interrupt-parent even though the mti,gic + * binding doesn't require it, such that the kernel can + * figure out that cpu_intc is the root interrupt + * controller & should be probed first. + */ + interrupt-parent = <&cpu_intc>; + + timer { + compatible = "mti,gic-timer"; + interrupts = ; + clocks = <&core0_clk>; + }; + }; + + soc: soc { + #address-cells = <2>; + #size-cells = <2>; + ranges; + compatible = "simple-bus"; + + uart0: serial@800000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0 0x800000 0x0 0x1000>; + reg-io-width = <4>; + interrupt-parent = <&gic>; + interrupts = ; + clocks = <&uart_clk>, <&occ_periph>; + clock-names = "uartclk", "apb_pclk"; + }; + + uart1: serial@900000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0 0x900000 0x0 0x1000>; + reg-io-width = <4>; + interrupt-parent = <&gic>; + interrupts = ; + clocks = <&uart_clk>, <&occ_periph>; + clock-names = "uartclk", "apb_pclk"; + }; + + uart2: serial@a00000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0 0xa00000 0x0 0x1000>; + reg-io-width = <4>; + interrupt-parent = <&gic>; + interrupts = ; + clocks = <&uart_clk>, <&occ_periph>; + clock-names = "uartclk", "apb_pclk"; + }; + + olb: olb@e00000 { + compatible = "mobileye,eyeq5-olb", "syscon", "simple-mfd"; + reg = <0 0xe00000 0x0 0x400>; + reg-io-width = <4>; + }; + + }; +}; From patchwork Thu Nov 23 15:26:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168999 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526395vqx; Thu, 23 Nov 2023 07:28:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJMoHYx6JSnut/HBDmlJQthltw5NK0Vay/tafWHfNiJ17o2Sr8Ds9KHxqZl2djgapeKUL0 X-Received: by 2002:a05:6a20:8421:b0:187:a75d:29dd with SMTP id c33-20020a056a20842100b00187a75d29ddmr7329034pzd.40.1700753322183; Thu, 23 Nov 2023 07:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753322; cv=none; d=google.com; s=arc-20160816; b=c48ecbSk8Oa+edLs5ozdZO027j9W3OOFk6rseqLWe1tdLpqtq9FI7ywzO8xSXwFzAD mzEutNF5/nc2pwwXe87ftqexO1qMZ0ecXB3rmktWgD5NTiDtYwpKYoRcb1XpfyDG11lG 7t4Hy0yJLRI5kyrK3p+vSYbP2p1EQd7QAiXPTxdRoYwIjP/yP0RBAtcQo7895WV1nW2O 2YezdiWH2k0Me30hIDi76Syo523/mDk1um1aYy/SUs0rPrXcYsPz7ZBhMl+wuecCqzGd inR5yukyqtJy72mXO1ecz5vtMXATE1/CjRtn5E7NxVklJCWXXFrFyt1Sl915pMQbDim6 3EaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PyCSrF1JgQ4iScyRiIk/6IapzgqC+RV3b88nNkBvQYI=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=RVWEOGrKW3ls74bgoGmwDn9X7AWt6m3jD4Ley43r/VPbRLdkChqEqqXZ8n8WYuXspv 1+wjB+f84nNUZxxqOtu6/MM88P+aDtbY2mlgVuzCeGfU0s0A5vthCfsX+loaFI2CnNky iPCV7+EuhoqBOs12hp60qVjLbiKSwoRuNSp5sy7UIgfcY1M2k3M8xJEm0fbKPILGaR3S Jo64KcIMbT/keF8JUKS9BkJiCZQaY+tEYpCwkakeP5V03/7z++ULrOG84vQbUyrYgk45 LpJOThyuNh/v+BG2LX9hrWUOE50hzurmqJwKfsy8zmDG3YyUuAdVTmtg/R2hdUpZ49tC 5S3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=I5spGNdD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id q11-20020a631f4b000000b005c21d7d1126si1456368pgm.843.2023.11.23.07.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=I5spGNdD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 17440822C3A8; Thu, 23 Nov 2023 07:28:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346105AbjKWP2H (ORCPT + 99 others); Thu, 23 Nov 2023 10:28:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346200AbjKWP1V (ORCPT ); Thu, 23 Nov 2023 10:27:21 -0500 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E60BB172D; Thu, 23 Nov 2023 07:27:13 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 22F76240003; Thu, 23 Nov 2023 15:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753232; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PyCSrF1JgQ4iScyRiIk/6IapzgqC+RV3b88nNkBvQYI=; b=I5spGNdDTyZF9Px7uya/D2or4dtiHN02/WkO8SnPHN0g1AX8FAUVCvkqT/Yur+qZAnwYi7 XTljlHbR6aSs7FX9K+qtoKTbTYqmKcwB1ieU3pOejSZruFDP4lRrK3z/w8MIVICr3O1krB duGvfscdAtGK76E5/jvtxaCCEDWnTQVmzcwuofATN02q5t08pa0K5HhWltr4jGFWr0uOBK gx55k2gdPLNEVYoVMUbWpz0/ynl/I3AJwmZjTMuJ1Q68mFiNs5T/qe8ogSs1y5DQqXrsql +6iLO/BpCnHcgQ1cx684Se83hG5chH0pYSh9g3kgkk/47po5XxXGG1ZvwuT5vw== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v2 19/21] MIPS: mobileye: Add EPM5 device tree Date: Thu, 23 Nov 2023 16:26:36 +0100 Message-ID: <20231123152639.561231-20-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:23 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369115456602036 X-GMAIL-MSGID: 1783369115456602036 Add a device tree for the Mobileye EPM5 evaluation board. Signed-off-by: Gregory CLEMENT --- arch/mips/boot/dts/mobileye/Makefile | 4 ++++ arch/mips/boot/dts/mobileye/eyeq5-epm5.dts | 24 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 arch/mips/boot/dts/mobileye/Makefile create mode 100644 arch/mips/boot/dts/mobileye/eyeq5-epm5.dts diff --git a/arch/mips/boot/dts/mobileye/Makefile b/arch/mips/boot/dts/mobileye/Makefile new file mode 100644 index 0000000000000..b6fa261f0a3a0 --- /dev/null +++ b/arch/mips/boot/dts/mobileye/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright 2023 Mobileye Vision Technologies Ltd. + +dtb-$(CONFIG_SOC_EYEQ5) += eyeq5-epm5.dtb diff --git a/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts b/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts new file mode 100644 index 0000000000000..ff16c3c760a19 --- /dev/null +++ b/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +/* + * Copyright 2023 Mobileye Vision Technologies Ltd. + */ + +/dts-v1/; + +#include "eyeq5.dtsi" + +/ { + compatible = "mobileye,eyeq5-epm5", "mobileye,eyeq5"; + model = "Mobile EyeQ5 MP5 Evaluation board"; + + chosen { + bootargs = "earlycon"; + stdout-path = "serial2:115200n8"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x08000000 0x0 0x08000000>, + <0x8 0x00000000 0x0 0x78000000>; + }; +}; From patchwork Thu Nov 23 15:26:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 168998 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526389vqx; Thu, 23 Nov 2023 07:28:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjlN0Ao0kFdwNi7Syc8reYRVmejqAUz6h2YOiGHKug2cMC5sBCWGtWD63mnn4z5mRpjxWs X-Received: by 2002:a05:6a20:9387:b0:18b:94c5:257c with SMTP id x7-20020a056a20938700b0018b94c5257cmr2181505pzh.16.1700753321190; Thu, 23 Nov 2023 07:28:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753321; cv=none; d=google.com; s=arc-20160816; b=hmmvIuHSN56WMjfbnTODAVOqov+gppVdsIfCGE2qbmL5Zwu7eQL3wctZ8tKoQccBit 24ypPaKOtPZQhKn0GjBJuRrlLilD0IxKc3Z9nI33yLgs1I1mdLMCffDrXbeOW64BWjdr k6v5KJWruOptZYCgmL7HJQ+LbEAf4V2hn4/7xKxqVTo8fLPIuhWLrPIdocqbGcimAxgB DavSl0efJfZRHZfm9xrC5yGUrw/TquZ7p6OHVuu4i+TOOankviDKIisFO8ZLCkJavzGn r9uD6yU6hGa/XItBrNlj7/Eyw9Hk5vrjnroQVj47uuTy3PNblc/EukRx/+L5v3b+T9or 7VZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+Yyo/N4mKC4G/gBxTIkTwVlDYBPjrl8CA2tLzZW3Lhs=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=hk15X+8s7aZ2742lica3xOKpVEgQiRHIpf7ZSV+LywwqtBQYBNu1Ei4XTVLCL38S6j HDT2t8YuO7RPQM6UKDvbWGel2SMvzaQG0OhYctuqK4chKUHtwmMzUOl+TZLAD5TPzxg3 MEvef4x6jKlKmi3NtZS7AVOBKHcDyqW9AAPK+RVUhvv4F6f6wvwJ4q2+XIWwEZInyImJ ZWQSlneAMMlp/5uQ83CIzdlFdeUTpJ6Zf3uACFDeWQUFrcdjVeYeil2iZ+YYfJzx6QCL f0cmgvUtbwHnSxTixsN1kFHPwtm/YbwCb2hI2KvYQ4hA1/ognOygqZJQgQK0VujTw+Hu dmYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jeKgKp9I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id s18-20020a635252000000b005b96d038729si1489684pgl.728.2023.11.23.07.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jeKgKp9I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 51309823B4F1; Thu, 23 Nov 2023 07:28:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346289AbjKWP2L (ORCPT + 99 others); Thu, 23 Nov 2023 10:28:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346134AbjKWP1V (ORCPT ); Thu, 23 Nov 2023 10:27:21 -0500 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 825361730; Thu, 23 Nov 2023 07:27:14 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D530E60010; Thu, 23 Nov 2023 15:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Yyo/N4mKC4G/gBxTIkTwVlDYBPjrl8CA2tLzZW3Lhs=; b=jeKgKp9I2HTXFR7yHCQXHvIsIk3PNdRiYbKP2xCJzujuVtAQqtBRv1TCKH3fme0oIOhBb9 QtxZoHNZaN6Db4QzX4LSR4howSKqAQHPH+T6cWuO5V0TRI17pb4kNyOc1zIpSR/arT2rBF nzfu4wxYPE0MhuWRWaU53XAaYoNZ5YvD7MkCw8rIMitLBm48oLEcw2pg1jHiIMU/xyel7B Jfp2AG9zCpl1ZRsCwTz657plTqnDRjyoE8y8SzXQw1VyANrWcklCoxCU9f7nMB087Z6yAT Pq0jWt4X2bGKhGGzyOhiqLTO2bkYPi3IKpTcwH1NFvqAKmXRbjmsZkCtJIsVjQ== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v2 20/21] MIPS: generic: Add support for Mobileye EyeQ5 Date: Thu, 23 Nov 2023 16:26:37 +0100 Message-ID: <20231123152639.561231-21-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369114393188804 X-GMAIL-MSGID: 1783369114393188804 Introduce support for the MIPS based Mobileye EyeQ5 SoCs. Signed-off-by: Gregory CLEMENT --- arch/mips/configs/generic/board-eyeq5.config | 43 ++++++++++++++++++++ arch/mips/generic/Kconfig | 15 +++++++ arch/mips/generic/Platform | 2 + arch/mips/generic/board-epm5.its.S | 24 +++++++++++ 4 files changed, 84 insertions(+) create mode 100644 arch/mips/configs/generic/board-eyeq5.config create mode 100644 arch/mips/generic/board-epm5.its.S diff --git a/arch/mips/configs/generic/board-eyeq5.config b/arch/mips/configs/generic/board-eyeq5.config new file mode 100644 index 0000000000000..d5109fda6e821 --- /dev/null +++ b/arch/mips/configs/generic/board-eyeq5.config @@ -0,0 +1,43 @@ +CONFIG_HIGH_RES_TIMERS=y +CONFIG_TASKSTATS=y +CONFIG_FIT_IMAGE_FDT_EPM5=y +CONFIG_BOARD_EYEQ5=y +CONFIG_USE_XKPHYS=y +CONFIG_PHYSICAL_START=0xa800000808000000 +CONFIG_ZBOOT_LOAD_ADDRESS=0xA800000080480000 +CONFIG_CPU_HAS_MSA=y +CONFIG_NET_KEY=y +CONFIG_CAN=y +CONFIG_PCI=y +CONFIG_PCI_MSI=y +CONFIG_PCI_DEBUG=y +CONFIG_PCI_ENDPOINT=y +CONFIG_CONNECTOR=y +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_RAM=y +CONFIG_MTD_ROM=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_PHYSMAP_OF=y +CONFIG_MTD_BLOCK2MTD=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BLOCK=y +CONFIG_NETDEVICES=y +CONFIG_MACVLAN=y +CONFIG_IPVLAN=y +CONFIG_MACB=y +CONFIG_MARVELL_PHY=y +CONFIG_MICREL_PHY=y +CONFIG_CAN_M_CAN=y +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_PINCTRL=y +CONFIG_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_CADENCE=y +CONFIG_RESET_CONTROLLER=y +CONFIG_FANOTIFY=y +CONFIG_ROMFS_FS=y +CONFIG_ROMFS_BACKED_BY_BOTH=y +CONFIG_PAGE_SIZE_16KB=y \ No newline at end of file diff --git a/arch/mips/generic/Kconfig b/arch/mips/generic/Kconfig index 7dc5b3821cc6e..04e1fc6f789b5 100644 --- a/arch/mips/generic/Kconfig +++ b/arch/mips/generic/Kconfig @@ -48,6 +48,13 @@ config SOC_VCOREIII config MSCC_OCELOT bool +config SOC_EYEQ5 + select ARM_AMBA + select WEAK_ORDERING + select WEAK_REORDERING_BEYOND_LLSC + select PHYSICAL_START_BOOL + bool + comment "FIT/UHI Boards" config FIT_IMAGE_FDT_BOSTON @@ -124,4 +131,12 @@ config VIRT_BOARD_RANCHU Android emulator. Android emulator is based on Qemu, and contains the support for the same set of virtual devices. +config FIT_IMAGE_FDT_EPM5 + bool "Include FDT for Mobileye EyeQ5 development platforms" + select SOC_EYEQ5 + default n + help + Enable this to include the FDT for the EyeQ5 development platforms + from Mobileye in the FIT kernel image. + This requires u-boot on the platform. endif diff --git a/arch/mips/generic/Platform b/arch/mips/generic/Platform index 0c03623f38970..45db9824a11d6 100644 --- a/arch/mips/generic/Platform +++ b/arch/mips/generic/Platform @@ -24,3 +24,5 @@ its-$(CONFIG_FIT_IMAGE_FDT_JAGUAR2) += board-jaguar2.its.S its-$(CONFIG_FIT_IMAGE_FDT_SERVAL) += board-serval.its.S its-$(CONFIG_FIT_IMAGE_FDT_XILFPGA) += board-xilfpga.its.S its-$(CONFIG_FIT_IMAGE_FDT_MARDUK) += board-marduk.its.S +its-$(CONFIG_FIT_IMAGE_FDT_EPM5) += board-epm5.its.S + diff --git a/arch/mips/generic/board-epm5.its.S b/arch/mips/generic/board-epm5.its.S new file mode 100644 index 0000000000000..08e8c4f183d63 --- /dev/null +++ b/arch/mips/generic/board-epm5.its.S @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ +/ { + images { + fdt-mobileye-epm5 { + description = "Mobileeye MP5 Device Tree"; + data = /incbin/("boot/dts/mobileye/eyeq5-epm5.dtb"); + type = "flat_dt"; + arch = "mips"; + compression = "none"; + hash { + algo = "sha1"; + }; + }; + }; + + configurations { + default = "conf-1"; + conf-1 { + description = "Mobileye EPM5 Linux kernel"; + kernel = "kernel"; + fdt = "fdt-mobileye-epm5"; + }; + }; +}; From patchwork Thu Nov 23 15:26:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 169001 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp526501vqx; Thu, 23 Nov 2023 07:28:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5IYvdN+9oLpYM1Lc6/HvMNHb6pegbnkr0GfZun3BARkhXwrsfxxaKnCsf/LodG+2j/6oL X-Received: by 2002:a17:90a:e7c2:b0:285:6211:6e1b with SMTP id kb2-20020a17090ae7c200b0028562116e1bmr2378814pjb.28.1700753332804; Thu, 23 Nov 2023 07:28:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753332; cv=none; d=google.com; s=arc-20160816; b=ViR/pLdIex5nvRDcu9B1Pv6QmL34pDI+bEiYCNsFBqIhOKh7yEvdADarU06jTo7lL3 6WSr5/JPpPjy9gC8rEV6Z+gzwNlh3/My7dUC7YB82z0M34gvZbpHEOfy/dXL3F1mG2Jl fnMYZ52ToPNGUUi2Uu3bGVOp56KchHLjEQ2n5W6g0Gvh5lY4xdS2f4AjGC+9ui9X9FYr m96n01/s2S+5F+hYvEmd40OXizfgsyfB8Ev4FenZ11U6PWZ2vyNNxriQuCqlm3U8hrj2 B2LGsjr5IeiMKjjgBsQ0hc2NjEAI7YRjOeMSyIh52C9U9oKgcGVDO4l5CY2y4t9V3ABo eqUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NF5qApw6fMhlr7kXSD5A4ZD9LfVmR7kuExevs+ZXZcs=; fh=jshYI2NwtEb4RFDet1CibhjijWOL1JdxV9n387woDuM=; b=QudIqsfqHLH3DI8LDmsnRpDySPEbc8Tt3Yj2lCssLV5nU63tfWnwta/5dIfXIuwRl1 QgZLXAIy0CI+a9lX1O/WtwYPPdpIp2razUCtu9V55AwkIEfUrVxofFydHcDd8A3xq0ZC 9cbmmQsX2gSZdoVSawNKImXsZeSUmiPmZ1vj4x66rYOSCmAP0PPkL7gqmCrDnBRsseQY RN+1u9toqTDqVy2QELTCc7pi6/sXlWLfpBa6Ei8QSSTKh8dfega8e29cMt5u6zhx0Pon TZZJFBhzXpyWNWgMrENDaytn5Q4F1VpANLOa60/eBJ1PkqBIoFnKkSPOkVBhwxSY9t/j nXXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZT17fTN6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y2-20020a170902864200b001cf85966f78si1286549plt.117.2023.11.23.07.28.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:28:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZT17fTN6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 2CA23820D5D7; Thu, 23 Nov 2023 07:28:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346215AbjKWP2N (ORCPT + 99 others); Thu, 23 Nov 2023 10:28:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346217AbjKWP1W (ORCPT ); Thu, 23 Nov 2023 10:27:22 -0500 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C42B170D; Thu, 23 Nov 2023 07:27:15 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8B0521C0008; Thu, 23 Nov 2023 15:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700753234; 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=NF5qApw6fMhlr7kXSD5A4ZD9LfVmR7kuExevs+ZXZcs=; b=ZT17fTN6J/+GY3gKZqd/0adq9IDJgYSd4cEaqM5qjEHu/zeXJG3646VsxpjcCKm0alpwCO X+rNkovbKD8GaP6IwSjhMYarUZ3l0wlJvdJ2z+5lkNlTF0LTgzwoew2F79qXgYzvN3cVZ5 heCDULrk7lfU0ANT9QP0/uQPqDL66xWx1m6z3VAy2/Yo6IRbiCnjKNtgMmp8BSHbWW2UUN idnCPRDWRJeab+qeUE+GwY1qKWMnglzzcksuSf1Nv6bvXctQPfc9ySf5QlCNmvo0Yj5on3 CWrsgx+fItCzoLU8mNcfQLVKzltTWiT3Yfqa7GKlse0T2gNs9wVq2iqrjq+Dsw== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni , Gregory CLEMENT Subject: [PATCH v2 21/21] MAINTAINERS: Add entry for Mobileye MIPS SoCs Date: Thu, 23 Nov 2023 16:26:38 +0100 Message-ID: <20231123152639.561231-22-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231123152639.561231-1-gregory.clement@bootlin.com> References: <20231123152639.561231-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:28:49 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783369127103277844 X-GMAIL-MSGID: 1783369127103277844 Add Vlad, Théo and myself as co-maintainers for the Mobileye MIPS SoCs. Signed-off-by: Vladimir Kondratiev Signed-off-by: Théo Lebrun Signed-off-by: Gregory CLEMENT --- MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 97f51d5ec1cfd..b9ddedc154091 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14607,6 +14607,18 @@ W: http://palosaari.fi/linux/ Q: http://patchwork.linuxtv.org/project/linux-media/list/ F: drivers/media/dvb-frontends/mn88473* +MOBILEYE MIPS SOCS +M: Vladimir Kondratiev +M: Gregory CLEMENT +M: Théo Lebrun +L: linux-mips@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/mips/mobileye.yaml +F: arch/mips/boot/dts/mobileye/ +F: arch/mips/configs/generic/board-eyeq5.config +F: arch/mips/generic/board-epm5.its.S +F: include/dt-bindings/soc/mobileye,eyeq5.h + MODULE SUPPORT M: Luis Chamberlain L: linux-modules@vger.kernel.org