Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4361249rwd; Tue, 30 May 2023 04:31:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ab2nLuu3mAcPKh1Aqp3ClPTmuK1JqaQZCdFkzQCQnWwF4g48HSsteWtuGqdtAcjlhuH8U X-Received: by 2002:a17:90b:249:b0:256:50ed:32cd with SMTP id fz9-20020a17090b024900b0025650ed32cdmr2460705pjb.5.1685446316543; Tue, 30 May 2023 04:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685446316; cv=none; d=google.com; s=arc-20160816; b=y8olLQ/5ErR/LbaKLp76f540Ja9bmIIZNnoqkjg0Bb6nXt4Gq1GciDT6X1la4TIuQM PGV3Riiuy8Eq1v9vRFp7KvmTqbHyL71MTUHP8Q9kPj/e6W4BsJkIlijYL41jYY25Bf/V pdDOw/LAhhaykpCU3xXbZGL/zRGyvgzm5uyBwm3OGi6/irwODQpeHo4e1vFFxzMK69vR XjiEIeZUqx1vsIO37UDF3qpX7nOfov/hZxkVZ6MIjVdZAVgF1G6mrgbQGr50LU97ejrh hYUwwQrcCs2RYtxWZitjVa3Wc+LQpjBIiMobvhSsBjvqxrpu39XGYxGPU4UtZBaxvpj7 5Xow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=HiTZwaa5gQTK//8LM38B7ZunZtZpGDbfQRCPkDuEfYk=; b=XKUHgRWU5pTg1rWnDTFRm7GnogULcUvY8IREu0hb2w6ozjJhvpb0QU34/vnNcELbmH P30XOwYSMB2AOyrUnoXuCBHfjHaNdk6lWeW2/hQ0og5jxpXUAfgPH7RsrB1hrSlEJoBp HiJbXT4LyG0XMDPZUZHLSthgTWUslB9gDDGZQfaNl2vxHTOHsCXG+0qcw0wiiD1+LnWi qsaHyToo/a3pOJ82Y9ObVIUTkCjvDVzS+eAovZGavhDP3eLTG6E4qo7E2a5DYdqPAlb/ 3nfdiDtxiZjtk3hTFGBcqfPE8/HmQy4/1I2J234S+GUlaJpbAJ717TzUqJerPkrUpLdA BoIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a63f114000000b00534780446d9si3287197pgi.640.2023.05.30.04.31.44; Tue, 30 May 2023 04:31:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231716AbjE3LH3 (ORCPT + 99 others); Tue, 30 May 2023 07:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbjE3LH2 (ORCPT ); Tue, 30 May 2023 07:07:28 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0F1FC93; Tue, 30 May 2023 04:07:26 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 39AC492009C; Tue, 30 May 2023 13:07:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 3298B92009B; Tue, 30 May 2023 12:07:26 +0100 (BST) Date: Tue, 30 May 2023 12:07:26 +0100 (BST) From: "Maciej W. Rozycki" To: Jiaxun Yang cc: Paul Cercueil , "linux-mips@vger.kernel.org" , linux-kernel@vger.kernel.org, Thomas Bogendoerfer Subject: Re: [PATCH 1/2] MIPS: Allow MIPS32R2 kernel to run on P5600 and M5150 In-Reply-To: <684C1A48-C743-4045-AF12-B0846FCE8EBE@flygoat.com> Message-ID: References: <20230529135245.4085-1-jiaxun.yang@flygoat.com> <684C1A48-C743-4045-AF12-B0846FCE8EBE@flygoat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Tue, 30 May 2023, Jiaxun Yang wrote: > >> M5150 and P5600 are two MIPS32R5 kernels, however as MIPS32R5 is > >> backward compatible with MIPS32R2 there is no reason to forbid > >> M5150 and P5600 on MIPS32R2 kernel. > > > > What problem are you trying to solve? The CONFIG_SYS_HAS_CPU_* settings > > denote overall platform's support for the given CPU and have nothing to do > > with what architecture level a given kernel has been configured for. You > > do need to get the settings right for your platform, just as you do in > > 2/2, but this 1/2 part looks wrong to me. > > Well the universal target is to allow R2 generic kernel to run on R5 CPUs. > As R5 is backward compatible we can just have one universal kernel binary. Sure, but this change is not needed for it. You just need to declare which ISA revisions your platform supports and leave `__get_cpu_type' alone. It has worked like that for a decade now. Back in the day I used to run R1 kernels on R2 hardware myself. And maybe MIPS IV on R1 even, as we had MIPS Malta CPU modules with both MIPS IV devices (QED RM5261/RM7061) and MIPS64r1 devices (MIPS 5Kc/20Kc/25Kf) and switching the kernel when swapping modules was a nuisance. The Malta config still supports these devices although some may not exist anymore. Maciej