All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
To: David Daney <ddaney.cavm@gmail.com>
Cc: "Steven J. Hill" <Steven.Hill@imgtec.com>,
	<linux-mips@linux-mips.org>, <ralf@linux-mips.org>
Subject: Re: [PATCH 2/6] MIPS: APRP: Add VPE loader support for CMP platforms.
Date: Thu, 17 Oct 2013 16:13:49 -0700	[thread overview]
Message-ID: <52606F2D.7020508@imgtec.com> (raw)
In-Reply-To: <52606AC1.10403@gmail.com>

On 10/17/2013 03:54 PM, David Daney wrote:
> 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 <dengcheng.zhu@imgtec.com>
>>>>>>
>>>>>> This patch adds VPE loader support for platforms having a CMP.
>>>>>>
>>>>>> Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
>>>>>> Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
>>>>>> Reviewed-by: Qais Yousef <Qais.Yousef@imgtec.com>
>>>>>> ---
>>>>>>   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
>>>>>> archive
>>>>>> + * for more details.
>>>>>> + *
>>>>>> + * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights
>>>>>> reserved.
>>>>>> + * Copyright (C) 2013 Imagination Technologies Ltd.
>>>>>> + */
>>>>>> +#ifdef CONFIG_MIPS_CMP
>>>>>> +
>>>>>
>>>>> 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: http://patchwork.linux-mips.org/patch/5059/
>>>>
>>>>
>>>
>>> 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:
> ---------------------
> config MIPS_VPE_LOADER_CMP
>     bool
>     default "y"
>     depends on MIPS_VPE_LOADER && MIPS_CMP
>
> config MIPS_VPE_LOADER_MT
>     bool
>     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

Yes, I forgot to use the generic variables for vpe.o and rtlx.o in my last 
reply. Your solution above is right what I wanted to discuss. Thanks for 
the catch of large ifdefs in the C files.


Deng-Cheng

WARNING: multiple messages have this Message-ID (diff)
From: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
To: David Daney <ddaney.cavm@gmail.com>
Cc: "Steven J. Hill" <Steven.Hill@imgtec.com>,
	linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: Re: [PATCH 2/6] MIPS: APRP: Add VPE loader support for CMP platforms.
Date: Thu, 17 Oct 2013 16:13:49 -0700	[thread overview]
Message-ID: <52606F2D.7020508@imgtec.com> (raw)
Message-ID: <20131017231349.HyOOfAp0efXrBHULqLDml-2iNVCJNG2smrgLiOWdSNA@z> (raw)
In-Reply-To: <52606AC1.10403@gmail.com>

On 10/17/2013 03:54 PM, David Daney wrote:
> 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 <dengcheng.zhu@imgtec.com>
>>>>>>
>>>>>> This patch adds VPE loader support for platforms having a CMP.
>>>>>>
>>>>>> Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
>>>>>> Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
>>>>>> Reviewed-by: Qais Yousef <Qais.Yousef@imgtec.com>
>>>>>> ---
>>>>>>   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
>>>>>> archive
>>>>>> + * for more details.
>>>>>> + *
>>>>>> + * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights
>>>>>> reserved.
>>>>>> + * Copyright (C) 2013 Imagination Technologies Ltd.
>>>>>> + */
>>>>>> +#ifdef CONFIG_MIPS_CMP
>>>>>> +
>>>>>
>>>>> 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: http://patchwork.linux-mips.org/patch/5059/
>>>>
>>>>
>>>
>>> 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:
> ---------------------
> config MIPS_VPE_LOADER_CMP
>     bool
>     default "y"
>     depends on MIPS_VPE_LOADER && MIPS_CMP
>
> config MIPS_VPE_LOADER_MT
>     bool
>     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

Yes, I forgot to use the generic variables for vpe.o and rtlx.o in my last 
reply. Your solution above is right what I wanted to discuss. Thanks for 
the catch of large ifdefs in the C files.


Deng-Cheng

  reply	other threads:[~2013-10-17 23:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17  2:14 [PATCH 0/6] MIPS: APRP: Enable APRP for platforms with a CM Steven J. Hill
2013-10-17  2:14 ` [PATCH 1/6] MIPS: APRP: Split VPE loader into separate files Steven J. Hill
2013-10-17  2:14 ` [PATCH 2/6] MIPS: APRP: Add VPE loader support for CMP platforms Steven J. Hill
2013-10-17 17:40   ` David Daney
2013-10-17 22:00     ` Deng-Cheng Zhu
2013-10-17 22:00       ` Deng-Cheng Zhu
2013-10-17 22:11       ` David Daney
2013-10-17 22:38         ` Deng-Cheng Zhu
2013-10-17 22:38           ` Deng-Cheng Zhu
2013-10-17 22:54           ` David Daney
2013-10-17 23:13             ` Deng-Cheng Zhu [this message]
2013-10-17 23:13               ` Deng-Cheng Zhu
2013-10-17  2:14 ` [PATCH 3/6] MIPS: APRP: Split RTLX support into separate files Steven J. Hill
2013-10-17  2:14 ` [PATCH 4/6] MIPS: APRP: Add RTLX API support for CMP platforms Steven J. Hill
2013-10-17  2:14 ` [PATCH 5/6] MIPS: APRP: Malta Add support for Malta CMP platform Steven J. Hill
2013-10-17  2:14 ` [PATCH 6/6] MIPS: APRP: Code formatting clean-ups Steven J. Hill
2013-10-17 17:50   ` David Daney
2013-10-17 18:26     ` Steven J. Hill
2013-10-17 18:26       ` Steven J. Hill
  -- strict thread matches above, loose matches on Subject: below --
2013-10-30 20:52 [PATCH v2 0/6] MIPS: APRP: Enable APRP for platforms with a CM Steven J. Hill
2013-10-30 20:52 ` [PATCH 2/6] MIPS: APRP: Add VPE loader support for CMP platforms Steven J. Hill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52606F2D.7020508@imgtec.com \
    --to=dengcheng.zhu@imgtec.com \
    --cc=Steven.Hill@imgtec.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.