All of lore.kernel.org
 help / color / mirror / Atom feed
From: Singh Sandeep-B37400 <B37400@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] powerpc/mpc85xx: Enabling CPC conditionally based on hwconfig options
Date: Fri, 14 Jun 2013 05:26:18 +0000	[thread overview]
Message-ID: <3F1D9DCAAB49B94D88DBE05911FA4E6E070AF829@039-SN1MPN1-006.039d.mgd.msft.net> (raw)
In-Reply-To: <1371141562.2028.8@snotra>

Thanks for your comments.
Please find reply inline.

Regards,
Sandeep

> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Thursday, June 13, 2013 10:09 PM
> To: Singh Sandeep-B37400
> Cc: u-boot at lists.denx.de; Singh Sandeep-B37400; afleming at gmail.com
> Subject: Re: [U-Boot] [PATCH] powerpc/mpc85xx: Enabling CPC conditionally
> based on hwconfig options
> 
> On 06/13/2013 01:59:51 AM, Sandeep Singh wrote:
> > If hwconfig does not contains "en_cpc" then by default all cpcs are
> > enabled If this config is defined then only those individual cpcs
> > which are defined in the subargument of "en_cpc" will be enabled e.g
> > en_cpc:cpc1,cpc2; (this will enable cpc1 and cpc2) or en_cpc:cpc2;
> > (this enables just cpc2)
> >
> > Signed-off-by: Sandeep Singh <Sandeep@freescale.com>
> > ---
> >  arch/powerpc/cpu/mpc85xx/cpu_init.c |   32
> > ++++++++++++++++++++++++++++++++
> >  1 files changed, 32 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c
> > b/arch/powerpc/cpu/mpc85xx/cpu_init.c
> > index 185e0d5..ea75ce5 100644
> > --- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
> > +++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
> > @@ -159,11 +159,43 @@ void config_8560_ioports (volatile ccsr_cpm_t *
> > cpm)
> >  static void enable_cpc(void)
> >  {
> >  	int i;
> > +	int arglen;
> > +	int ret;
> >  	u32 size = 0;
> >
> >  	cpc_corenet_t *cpc = (cpc_corenet_t *)CONFIG_SYS_FSL_CPC_ADDR;
> > +	char buffer[HWCONFIG_BUFFER_SIZE];
> > +	char cpc_subarg[16];
> > +	bool have_hwconfig = 0;
> 
> = false
Ok
> 
> > +	const char *cpc_args = NULL;
> > +
> > +	/*
> > +	 * Extract hwconfig from environment since environment
> > +	 * is not setup properly yet
> > +	 */
> > +	ret = getenv_f("hwconfig", buffer, sizeof(buffer));
> > +	if (ret == -1) {
> > +		printf("Error getting hwconfig\n");
> > +		return;
> > +	}
> 
> It is not an error for hwconfig to be missing.  That just means that no
> options are set.
Right, will rectify
> 
> > +	/*
> > +	 * If "en_cpc" is not defined in hwconfig then by default all
> > +	 * cpcs are enable. If this config is defined then individual
> > +	 * cpcs which have to be enabled should also be defined.
> > +	 * e.g en_cpc:cpc1,cpc2;
> > +	 */
> > +	if (hwconfig_f("en_cpc", buffer))
> > +		have_hwconfig = 1;
> 
> = true
ok
> 
> have_hwconfig should be set based on the return of getenv_f.  Is there
> really any benefit to checking whether en_cpc is present, separately from
> the hwconfig_sub_f call?
This was done with the intension of providing greater configurability. When
en_cpc is defined then it's entirely up to user to decide which cpcs are to
be enabled. Hence we do following:

if_defined("en_cpc"){
	only_then
		check_for_cpc_options;
} else {
	enable_all_cpc;
}

> 
> -Scott

  reply	other threads:[~2013-06-14  5:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-13  6:59 [U-Boot] [PATCH] powerpc/mpc85xx: Enabling CPC conditionally based on hwconfig options Sandeep Singh
2013-06-13 16:39 ` Scott Wood
2013-06-14  5:26   ` Singh Sandeep-B37400 [this message]
2013-06-14 19:39     ` Scott Wood
2013-07-02 10:01       ` Singh Sandeep-B37400
2014-07-02  6:14 Shaveta Leekha
2014-08-06 17:33 ` York Sun
2014-08-07  7:39   ` shaveta at freescale.com
2014-08-20 19:37 ` York Sun

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=3F1D9DCAAB49B94D88DBE05911FA4E6E070AF829@039-SN1MPN1-006.039d.mgd.msft.net \
    --to=b37400@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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.