From patchwork Mon Feb 5 15:34:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 196873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp955460dyb; Mon, 5 Feb 2024 07:39:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtx7V2c26f/aLy688quK2CNU3po6HfYB3XTLZUe7ItxMx90ZkD5nit6niVa+Nl/aMQfqM/ X-Received: by 2002:a05:622a:800b:b0:42b:f6c1:dc1b with SMTP id jr11-20020a05622a800b00b0042bf6c1dc1bmr5350989qtb.31.1707147560483; Mon, 05 Feb 2024 07:39:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707147560; cv=pass; d=google.com; s=arc-20160816; b=krlJr3khabRwvY03UfOfjLzWPM1jHd/tprnuBMAJ6FcrjIODITPLdoEfri897uhKV0 rmaGyCWtNl+X30VPoZV4YI7DJFzTcRbYHwXQ2Nd11B6A7PqMb9qDTJlmfiIH74xgG31/ AhqQBHMvTNFWtGE17gX+Uay6lmHWuJidHZgWGI6Fg3AH4ZHYhgfRjLDGZSo9a48AkJAS /wWw19ll+6D3+tfv4rnbTEbWqezHNkHIJfKG8bLEgvGTDLztBJLKqFJzhgE9Xozf5GKX BDHMM4TuA36XsW4RNytQnR+wGxzXjgAcNww2y/Em7k4oCJ4vHhlGK+37V4N9XbXK7o7t EO7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2Wk0pf2LEOjDnkraDRWIDqQ91OCoFBDydZfp83yb0pk=; fh=NebCFaDmkFckgtbuZACxCSz8z3ERNn/N+VUo94o46kc=; b=RzF2D1oOFbt62M/N6xtNcPm3gNQhTGZsLnjMtAytES3GMg9ig6BsYVYthgfSdLKrPU fjWTNbK9zkxSvF/tr1y/hQBX6cEkONOfptcxtuuQ2JyUUuiPtp/WV9h0iobJlYORxbMD f6aKfGzei4o9BBpKSx1gOpkjyejofBA0cDm1tyk34N7Re4G+0beR0izgxHkx7Vdkqfty T0qOhMwFrAtCK1ER2Xs7CxgoIZhHCcMcJN/tz54+adNsw6lfjJjumXELDfknbw7TXFT7 evMp3qBE++1Nj8UsBo2Y2rWju6ejxaWHhkEKgnUZUg1KuhcgPZoGrWQivHhee73MWFf6 73ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jyaDsTDt; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-52934-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52934-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=1; AJvYcCXl57iGw1XujtF7OsmkP7LVq3vTPduZ36bPQmHOhrbamJhX8BiMq4T8o+LqcEtOUGAcpOcEN/7OhIEUxobN/8ozYchO4A== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u15-20020a05622a010f00b0042c26c4c5c5si83767qtw.287.2024.02.05.07.39.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 07:39:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52934-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jyaDsTDt; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-52934-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52934-ouuuleilei=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 49F781C21E64 for ; Mon, 5 Feb 2024 15:39:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3561C48CC8; Mon, 5 Feb 2024 15:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="jyaDsTDt" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 339B140BEB; Mon, 5 Feb 2024 15:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707147321; cv=none; b=QzmbKYA9Urz9tC4zIoOmW3YUI5eAunojmHeyRz0scNt6z4gtHOYsG9qMwh/KJutzocoBAt/Cn+V+O2vQMrKg4IXYTkTM5EGmyd5q3/s3IZ2FrQ9EtzsZNNSJEvemvWmclKSowTwjAFlNhKY6JctbYqBAiZ6pzq4hDPDtBndUzVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707147321; c=relaxed/simple; bh=9HL/x4Nj/uz8p4t8CXOhsS0Z/OjK0DF1R3RA4ctG+tM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UQido/O6T9i7j9mMnqjiFR+1n4slz6QwvEUoC4oIAnpaantDKsKCOg9CnvRik/3v5IeARbqcv9JpIUXKrxSh6f5vXalDRYeWZkWq4at28oEmvSGukcEyYbQYEo8ZvN5s7dUY2U3cC5P2ukMwN5zuqM+nEl3pjr180hPUqw19QiY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=jyaDsTDt; arc=none smtp.client-ip=217.70.183.199 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 9C9E8FF805; Mon, 5 Feb 2024 15:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1707147317; 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=2Wk0pf2LEOjDnkraDRWIDqQ91OCoFBDydZfp83yb0pk=; b=jyaDsTDtaEcCfxi8hPZQTaUQj22/lvuqXaHaORad3+otn6iFysGdjUN3h+2TXaM3CzKtNs o3VIoFe5rEow+xgo5hvVBfyBpuz8zg1VjGp43FCFNSh+f8xB0E90PzNA8+YOH5A+24WsDN Dbuz5BptEGagbm10fvmNt46qEqtPiiqX1uYwY1fnvLk2Fm5S36jxqg4AFRGN6K6CR9uRMV Ju1+lYFkDZub/DFKDyCxw12j8BW16y8/lVztTBgNNsWGp60/a2TjzjVALY/2FWycyF9tLc DphsiySOxPYQ2Rv6eqqdxYaSsA22yA9rdOgW5Pk/lA9+N9kmpiHwAfcWxyDQ0A== 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 v7 12/14] MIPS: Share generic kernel code with other architecture Date: Mon, 5 Feb 2024 16:34:58 +0100 Message-ID: <20240205153503.574468-13-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240205153503.574468-1-gregory.clement@bootlin.com> References: <20240205153503.574468-1-gregory.clement@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790073960512720786 X-GMAIL-MSGID: 1790073960512720786 Some architectures might seek to utilize a significant portion of the generic kernel code while maintaining independence from the generic kernel due to specific peculiarities. This patch allows for the reuse of core code, preventing unnecessary duplication. Suggested-by: Thomas Bogendoerfer Signed-off-by: Gregory CLEMENT Reviewed-by: Jiaxun Yang --- arch/mips/Kbuild | 1 + arch/mips/Kconfig | 3 +++ arch/mips/generic/Makefile | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/mips/Kbuild b/arch/mips/Kbuild index af2967bffb73d..d683993ed331c 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/Kconfig b/arch/mips/Kconfig index 797ae590ebdba..5549d26448941 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -109,6 +109,9 @@ config MIPS_FIXUP_BIGPHYS_ADDR config MIPS_GENERIC bool +config MACH_GENERIC_CORE + bool + config MACH_INGENIC bool select SYS_SUPPORTS_32BIT_KERNEL diff --git a/arch/mips/generic/Makefile b/arch/mips/generic/Makefile index e37a59bae0a62..56011d738441f 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