[Top] [All Lists]

Re: [PATCH 2/6] MIPS: APRP: Add VPE loader support for CMP platforms.

To: Deng-Cheng Zhu <>
Subject: Re: [PATCH 2/6] MIPS: APRP: Add VPE loader support for CMP platforms.
From: David Daney <>
Date: Thu, 17 Oct 2013 15:54:57 -0700
Cc: "Steven J. Hill" <>,,
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=GNaW7s8DipPhM3KFMKJ05IyI200a0wSq+t7nSFNrjzk=; b=Sc/gGyfUGRaTsdwXL67CiYSvkJUbBMbFyD8rQbwvHL59ZA0T+T/nW12n+lsGl0Q+ci +za2dIigFCT7/LBmuYN9KW4poVp9fOSbLNB2OiUdOro4gVJgpQoM2trmpbcfaeI7x6Xa dGrxWAjOEdFfYDBLfVSsPPMUNYXz8XJrfbyd3iP7gRNOWwkzR81S9NfS5RJ6XPMdfGRk 7VLuTnxqXwSugpheKW+gN7718+1yNr9U7HtW5E0fUkKeKocncHCQ7ENoS5TrzxXfBtDF HWGxVARJYB8NXxwAo9YV7M+8ZQVr0FAAGmp87qKthOSUsEI2+4H7zqncRCSFv2bEY4Sy bcog==
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <> <> <> <> <> <>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7
On 10/17/2013 03:38 PM, Deng-Cheng Zhu wrote:
On 10/17/2013 03:11 PM, David Daney wrote:
On 10/17/2013 03:00 PM, Deng-Cheng Zhu wrote:
On 10/17/2013 10:40 AM, David Daney wrote:
On 10/16/2013 07:14 PM, Steven J. Hill wrote:
From: Deng-Cheng Zhu <>

This patch adds VPE loader support for platforms having a CMP.

Signed-off-by: Deng-Cheng Zhu <>
Signed-off-by: Steven J. Hill <>
Reviewed-by: Qais Yousef <>
  arch/mips/kernel/Makefile  |    2 +-
  arch/mips/kernel/vpe-cmp.c |  184
  arch/mips/kernel/vpe-mt.c  |    4 +
  3 files changed, 189 insertions(+), 1 deletion(-)
  create mode 100644 arch/mips/kernel/vpe-cmp.c

diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 51f9117..912eb64 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -54,7 +54,7 @@ obj-$(CONFIG_MIPS_MT_SMP)    += smp-mt.o
  obj-$(CONFIG_MIPS_CMP)        += smp-cmp.o
  obj-$(CONFIG_CPU_MIPSR2)    += spram.o

-obj-$(CONFIG_MIPS_VPE_LOADER)    += vpe.o vpe-mt.o
+obj-$(CONFIG_MIPS_VPE_LOADER)    += vpe.o vpe-cmp.o vpe-mt.o
  obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o

  obj-$(CONFIG_I8259)        += i8259.o
diff --git a/arch/mips/kernel/vpe-cmp.c b/arch/mips/kernel/vpe-cmp.c
new file mode 100644
index 0000000..a5628ca
--- /dev/null
+++ b/arch/mips/kernel/vpe-cmp.c
@@ -0,0 +1,184 @@
+ * This file is subject to the terms and conditions of the GNU
General Public
+ * License.  See the file "COPYING" in the main directory of this
+ * for more details.
+ *
+ * Copyright (C) 2004, 2005 MIPS Technologies, Inc.  All rights
+ * Copyright (C) 2013 Imagination Technologies Ltd.
+ */

Get rid of all these #ifdef.

Use Kconfig symbols in the makefile instead.

Right. Splitting stuff into -cmp/-mt files is an effort to remove such
kind of #ifdef. The example can be found in Makefile in the v4 of this
patch set:

OK, that patch you point to seems a little better, but there are still
ifdefs in the Makefile.  You can create synthetic Kconfig variables so
the makefile is cleaner, but I don't know if it is worth it in this case.

Hmm. That has pros and cons, IMO. So the Makefile will look like:

obj-$(CONFIG_MIPS_VPE_LOADER_CMP)  += vpe.o vpe-cmp.o
obj-$(CONFIG_MIPS_VPE_APSP_API_CMP) += rtlx.o rtlx-cmp.o
obj-$(CONFIG_MIPS_VPE_LOADER_MT)  += vpe.o vpe-mt.o
obj-$(CONFIG_MIPS_VPE_APSP_API_MT) += rtlx.o rtlx-mt.o

It removes ifdef, but doesn't look straightforward to me: CMP and MT
APRP are mutually exclusive.

It is not necessarily cleaner but you could have something like:
        default "y"
        depends on MIPS_VPE_LOADER && MIPS_CMP

        default "y"
        depends on MIPS_VPE_LOADER && !MIPS_CMP

obj-$(CONFIG_MIPS_VPE_LOADER)   += vpe.o
obj-$(CONFIG_MIPS_VPE_LOADER_CMP)       += vpe-cmt.o
obj-$(CONFIG_MIPS_VPE_LOADER_MT)        += vpe-mt.o

I would do either that, or what you have in either is acceptable I think.

My main objection was the thing about putting the #ifdefs around the entire body of the C files.

David Daney

<Prev in Thread] Current Thread [Next in Thread>