Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1077575ybj; Thu, 7 May 2020 14:22:02 -0700 (PDT) X-Google-Smtp-Source: APiQypLETOvelFVMTmSyElw187abVTDa3RGqP89MWKaxCO8fngtChjEsp+QvQL/5GUqzHRehyEW8 X-Received: by 2002:aa7:c1cf:: with SMTP id d15mr13291041edp.266.1588886522365; Thu, 07 May 2020 14:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588886522; cv=none; d=google.com; s=arc-20160816; b=Qe/PtfnXG22myB93ARxWTM4mf+09HPYwpTeHWakHcj6vP6Z3gMCQwMOuWdk/0ypxPx BnX5I6aiteQ5GK0d1hm+dbS51+3KcUtkFtdWyUZqI/v4OLFjS7EsTb90+x/xAOOqVTsY ZpwB7pEZVypFJPW8sF1xux6xO9l4QFIGz7+wmr0xqZOaAGsspGg/BnnYn6THITuaMehj eZcA6Khm2DbXjKkgiLqQs4LlVZFdjOp1EQo/NXIawCXaLm1bj5VuRBvtzTxOLBp9j9k1 dmYGiFZp9ONHUvcPzCEw6ep35UCEaa4uaLRPu+BwuBSenBpaRZwvpj5M1/EBt6Vd/lfs juLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=yuGmVYCROcTyNklhhmdew9MD/IKoH5FYpvJN7gBF7v4=; b=qkNVKVvYxdFBq7+8Eq0wQBGQ6YXtPXZba8x77y8jT7nFnHPy209AB5TQmOr3njxZEQ 4Q9H2Oh3GKa9GhN/LxNUeYlocsPXZ8RNMTwLL5/pw6OvX05G20YV/7jspCG/hgdwOxr/ wi9Gi+1KiSuBpAWFWlIwPjcdCIEIwnw28w8RE7DUvSVn2tUxY1KoYWaRb3bwvvq7JMgH FxNwbhp0pBaiKqe2GfPBx5VBI0TBnLMI9z48bpcE5Z4i98cYawdN/Lv+Rz+JvcRZGj5f FvBZN/tBSvt6UEhFuTfVXzw/V2Dr8v0CsvIQaTz/I1MGKcvEmLep1quq9kp9TRD5k55H zYZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u1si3904493edi.58.2020.05.07.14.21.37; Thu, 07 May 2020 14:22:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbgEGVTb (ORCPT + 99 others); Thu, 7 May 2020 17:19:31 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:38566 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726531AbgEGVTa (ORCPT ); Thu, 7 May 2020 17:19:30 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 8EF3C803087C; Thu, 7 May 2020 21:19:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iD8rLD5BeSaP; Fri, 8 May 2020 00:19:26 +0300 (MSK) Date: Fri, 8 May 2020 00:19:23 +0300 From: Serge Semin To: Thomas Bogendoerfer CC: Alexey Malahov , Paul Burton , Ralf Baechle , Arnd Bergmann , Rob Herring , , , Jiaxun Yang , Alexander Lobakin , Huacai Chen , Cedric Hombourger , =?utf-8?B?UmVuw6k=?= van Dorst , Ard Biesheuvel , Jessica Yu , Masahiro Yamada , , Subject: Re: [PATCH v2 07/20] mips: Add MIPS Warrior P5600 support Message-ID: <20200507211923.kfu2ly3ncqms4c2u@mobilestation> References: <20200306124807.3596F80307C2@mail.baikalelectronics.ru> <20200506174238.15385-1-Sergey.Semin@baikalelectronics.ru> <20200506174238.15385-8-Sergey.Semin@baikalelectronics.ru> <20200507111735.GF11616@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200507111735.GF11616@alpha.franken.de> X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 07, 2020 at 01:17:35PM +0200, Thomas Bogendoerfer wrote: > On Wed, May 06, 2020 at 08:42:25PM +0300, Sergey.Semin@baikalelectronics.ru wrote: > > > > +config CPU_P5600 > > + bool "MIPS Warrior P5600" > > + depends on SYS_HAS_CPU_P5600 > > + select CPU_HAS_PREFETCH > > + select CPU_SUPPORTS_32BIT_KERNEL > > + select CPU_SUPPORTS_HIGHMEM > > + select CPU_SUPPORTS_MSA > > + select CPU_SUPPORTS_UNCACHED_ACCELERATED > > + select CPU_SUPPORTS_CPUFREQ > > + select CPU_MIPSR2_IRQ_VI > > + select CPU_MIPSR2_IRQ_EI > > + select HAVE_KVM > > + select MIPS_O32_FP64_SUPPORT > > + help > > + Choose this option to build a kernel for MIPS Warrior P5600 CPU. > > + It's based on MIPS32r5 ISA with XPA, EVA, dual/quad issue exec pipes, > > + MMU with two-levels TLB, UCA, MSA, MDU core level features and system > > + level features like up to six P5600 calculation cores, CM2 with L2 > > + cache, IOCU/IOMMU (though might be unused depending on the system- > > + specific IP core configuration), GIC, CPC, virtualisation module, > > + eJTAG and PDtrace. > > + > > config CPU_R3000 > > bool "R3000" > > depends on SYS_HAS_CPU_R3000 > > @@ -1841,7 +1863,8 @@ endchoice > > config CPU_MIPS32_3_5_FEATURES > > bool "MIPS32 Release 3.5 Features" > > depends on SYS_HAS_CPU_MIPS32_R3_5 > > - depends on CPU_MIPS32_R2 || CPU_MIPS32_R5 || CPU_MIPS32_R6 > > + depends on CPU_MIPS32_R2 || CPU_MIPS32_R5 || CPU_MIPS32_R6 || \ > > + CPU_P5600 > > help > > Choose this option to build a kernel for release 2 or later of the > > MIPS32 architecture including features from the 3.5 release such as > > @@ -1861,7 +1884,7 @@ config CPU_MIPS32_3_5_EVA > > config CPU_MIPS32_R5_FEATURES > > bool "MIPS32 Release 5 Features" > > depends on SYS_HAS_CPU_MIPS32_R5 > > - depends on CPU_MIPS32_R2 || CPU_MIPS32_R5 > > + depends on CPU_MIPS32_R2 || CPU_MIPS32_R5 || CPU_P5600 > > help > > Choose this option to build a kernel for release 2 or later of the > > MIPS32 architecture including features from release 5 such as > > @@ -2016,6 +2039,10 @@ config SYS_HAS_CPU_MIPS64_R6 > > bool > > select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT > > > > +config SYS_HAS_CPU_P5600 > > + bool > > + select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT > > + > > P5600 is CPU_MIPS_R5 so can't you select it here and drop all the || CPU_5600 > above/below ? Alas, We can't do this so easy. CONFIG_CPU_MIPS32_{R2,R5,R6} and any other CONFIG_CPU_* configs is something that kernel config-file is supposed to select. Their availability is enabled by the CONFIG_SYS_HAS_CPU_* configs. CONFIG_CPU_* is supposed to activate CPU-specific features and there is only one CONFIG_CPU_x can be enabled at a time seeing it's a part of the "CPU type" choice kconfig menu. In addition the CPU config also tunes a compiler to activate the arch-specific ISA and optimizations in the arch/mips/Makefile by setting -march=cpu-name (where cpu-name can be p5600, mips32r5, etc). Yes, P5600 is based on the MIPS32r5, but it also has got some specific features (see config CPU_P5600 and config MIPS32_R5), which makes it to be different from the ancestor. So In addition to the difficulties described above IMHO converting CPU_P5600 to a set of features activated on top of the CPU_MIPS32_R5 config would contradict the design of the CPU-support configs implemented in the MIPS arch subsystem. -Sergey > > Thomas. > > -- > Crap can work. Given enough thrust pigs will fly, but it's not necessarily a > good idea. [ RFC1925, 2.3 ]