Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp222521rdb; Thu, 21 Dec 2023 07:28:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8D71cw9pafK6yp7k2bQgRHCv2XOToc7DgmHVNc7Qh2PlZEZEc8GiN3BB9e5f54q5Ud82X X-Received: by 2002:a05:6e02:1ca5:b0:35f:c832:cd19 with SMTP id x5-20020a056e021ca500b0035fc832cd19mr3229920ill.36.1703172490314; Thu, 21 Dec 2023 07:28:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703172490; cv=none; d=google.com; s=arc-20160816; b=doaSbFE5+95OAWzyiLek4qfwwBek5BfekggpWlhtYpv77OkL+u8LY9NMSlyFb6FhO8 yXpfSvdT/FWzWir9p8F4O8gDUDwQAWStxKtT4Cls6bSr0QZ+v1bmnoP78f7uSxtZ0uwB k2y8FB+xLRHhY3aRtVUFprHbQmhwQTRbffpzJRq4wr2zTc1fw9BaJc/e4aKVg61uYaed ouLB/gOQco8MKijCvqmHARWZV6Mn3TfLojaAL9SNtGTiUCdg1LJukR8EONe/F9JhBF7z faytMLsvZqsTHsb3eC8YaZXFSD3thWzEUeZqpeanrn40uNP0DIR1rlurrZ2RtpSQsGIi Oijg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=XnimU0svkWDNRKLCz0ZHPlRmfQ2Z7rDvpCfZmcxrsRA=; fh=go5l/YadXPDKX1vZHaMydfb5N4Brr4e+QN8YOJxkjnU=; b=ueV5TlL/YZMTEuhM1iPxFXoX6JPtRVv/NroghQuKfmMOzuoBsznLa90dBlK2Dr/Jvx sP3ym231sIuRMn5yzchMmlfRzGRd8nsY/TJ9cYzEuf+l/EvqVNsWMwrhtMmjf0tsNIl6 PyGvo6O8Jl8pMJ9I02s7QVqiIA7NGZB2F8sBSe0yVI4JzA0X4VsKzoRYARj9P8fYwXO7 hfLPnhMWxfcdKzOSRh5IaPCE/LZ0OBWTtKFjYnRUdVVfrVB5LwyvyFzGibcnCTLYOxxW FKNaUx8i+VGX/cSWiJu+iNeBdh1vqmn7k6Y+rpo0xQTXuFJqo0SDaZlzH/yGM/mRBtjE igKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PVVrDZW8; spf=pass (google.com: domain of linux-kernel+bounces-8659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f26-20020a67ea9a000000b00466b427c59esi326510vso.783.2023.12.21.07.28.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:28:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PVVrDZW8; spf=pass (google.com: domain of linux-kernel+bounces-8659-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8659-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0F2201C259FE for ; Thu, 21 Dec 2023 15:28:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CE2B59931; Thu, 21 Dec 2023 15:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PVVrDZW8" X-Original-To: linux-kernel@vger.kernel.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDFF662812; Thu, 21 Dec 2023 15:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 5DF4A1C0008; Thu, 21 Dec 2023 15:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1703172364; 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: in-reply-to:in-reply-to:references:references; bh=XnimU0svkWDNRKLCz0ZHPlRmfQ2Z7rDvpCfZmcxrsRA=; b=PVVrDZW8xJ8POwGPVj8PmC3/ImUj1UkPGA2n10kyjrVPwnsbr49JHOiasX5HibWVMGoPVD Dp8D1cj2DYgjaGFsv3bUuEsUjLpT5yskbduq7VJ+NeiKYiVxKZJmoAhhkeulSd0729r2Dg /nPjzT+NiDc9HznVjwzGGrNng9opes3zrTD3f972m0kq+dTQcD0qq43P+WtShk0eBKZB5x lZzwS7JwMHBSNEMg3jMVoOpnOKjF4sxmUlnwSt3HK4L4IZipz0V4QBy/GmHEg4ShUTnwdV xAT7a3nzHojAC1XjgJgY+Lg5zxdso+Il1ydaz0DrQG+x7eLxWBd2EpwO9C3V4A== From: Gregory CLEMENT To: Thomas Bogendoerfer Cc: Paul Burton , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?Q?Th=C3=A9o?= Lebrun , Thomas Petazzoni Subject: Re: [PATCH v5 00/22] Add support for the Mobileye EyeQ5 SoC In-Reply-To: References: <20231212163459.1923041-1-gregory.clement@bootlin.com> <878r5vctdg.fsf@BL-laptop> <87frzwasxo.fsf@BL-laptop> Date: Thu, 21 Dec 2023 16:26:02 +0100 Message-ID: <87a5q3bmr9.fsf@BL-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: gregory.clement@bootlin.com Thomas Bogendoerfer writes: > On Thu, Dec 21, 2023 at 08:57:55AM +0100, Gregory CLEMENT wrote: >> I do not oppose the addition of a new platform, even though, like >> Jiaxun, I would prefer to avoid duplicating code. The only thing >> preventing the use of the same kernel for EyeQ5 and other platforms is >> the starting address. > > there shouldn't be code duplication. > > My rough idea would be something like Thanks for the feedback, I am going to test it. > > diff --git a/arch/mips/Kbuild b/arch/mips/Kbuild > index af2967bffb73..d683993ed331 100644 > --- a/arch/mips/Kbuild > +++ b/arch/mips/Kbuild > @@ -17,6 +17,7 @@ obj- := $(platform-y) > # mips object files > # The object files are linked as core-y files would be linked > > +obj-y += generic/ > obj-y += kernel/ > obj-y += mm/ > obj-y += net/ > diff --git a/arch/mips/generic/Makefile b/arch/mips/generic/Makefile > index e37a59bae0a6..56011d738441 100644 > --- a/arch/mips/generic/Makefile > +++ b/arch/mips/generic/Makefile > @@ -4,9 +4,9 @@ > # Author: Paul Burton > # > > -obj-y += init.o > -obj-y += irq.o > -obj-y += proc.o > +obj-$(CONFIG_MACH_GENERIC_CORE) += init.o > +obj-$(CONFIG_MACH_GENERIC_CORE) += irq.o > +obj-$(CONFIG_MACH_GENERIC_CORE) += proc.o > > obj-$(CONFIG_YAMON_DT_SHIM) += yamon-dt.o > obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o > > so everyboady needing these parts of a generic kernel is able > to take it. > >> Therefore, if it were possible to have a relocatable kernel, this >> issue would disappear. > > yes. There is support for relocatable kernel, so what are we missing > there ? But in arch/mips/generic/Platform we have: load-$(CONFIG_MIPS_GENERIC) += 0xffffffff80100000 So, the load address is defined during compilation; for example, I don't think there is such a mechanism currently for ARM. hat's what I mean by 'relocatable,' but perhaps it's not exactly what you have in mind. Gregory -- Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com