public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chin Liang See <clsee@altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] socfpga: Adding Freeze Controller driver
Date: Fri, 20 Sep 2013 00:08:08 -0500	[thread overview]
Message-ID: <1379653688.5736.11.camel@clsee-VirtualBox> (raw)
In-Reply-To: <20130919225528.GB20481@amd.pavel.ucw.cz>

Hi Pavel,

On Fri, 2013-09-20 at 00:55 +0200, ZY - pavel wrote:
> Hi!
> 
> > Adding Freeze Controller driver. All HPS IOs need to be
> > in freeze state during pin mux or IO buffer configuration.
> > It is to avoid any glitch which might happen
> > during the configuration from propagating to external devices.
> 
> So... code that is currently in u-boot appears to work, but may
> produce some unwanted electrical spikes. They don't matter on
> development boards, but we'd like to get rid of them for production. ?
> 
> It would be nice to put some explanation as a comment into code.

Actually with current code, we still not yet to boot on real board yet.
That why I am working hard to get the code upstreamed asap. Of course,
appreciate your help too as you are very helpful.

> 
> > Signed-off-by: Chin Liang See <clsee@altera.com>
> > Cc: Wolfgang Denk <wd@denx.de>
> > CC: Pavel Machek <pavel@denx.de>
> > Cc: Dinh Nguyen <dinguyen@altera.com>
> > ---
> > Changes for v2
> > - Removed FREEZE_CONTROLLER_FSM_HW
> > - Removed the get_timer_count_masked and convert to use delay in us
> > - Used shorter local variables
> 
> Thanks! Still there's a bit to go:

Yup, actually I miss out the header file after update the source file.

> 
> > +#define SYSMGR_FRZCTRL_LOOP_PARAM       (1000)
> > +#define SYSMGR_FRZCTRL_DELAY_LOOP_PARAM (10)
> > +#define SYSMGR_FRZCTRL_INTOSC_33	(33)
> > +#define SYSMGR_FRZCTRL_INTOSC_1000	(1000)
> 
> We no longer need these, right?

Yup

> 
> > +#define FREEZE_CHANNEL_NUM		(4)
> 
> Check this one, it may not be needed.

Actually we still need this to maintain the state of IO. It would be
useful for the next new driver "Scan Manager".

> 
> > +typedef enum {
> > +	FREEZE_CTRL_FROZEN = 0,
> > +	FREEZE_CTRL_THAWED = 1
> > +} FREEZE_CTRL_CHAN_STATE;
> 
> This definitely should not be needed.

Same as above

> 
> > +typedef enum  {
> > +	FREEZE_CHANNEL_0 = 0,   /* EMAC_IO & MIXED2_IO */
> > +	FREEZE_CHANNEL_1,	/* MIXED1_IO and FLASH_IO */
> > +	FREEZE_CHANNEL_2,	/* General IO */
> > +	FREEZE_CHANNEL_3,	/* DDR IO */
> > +	FREEZE_CHANNEL_UNDEFINED
> > +} FreezeChannelSelect;
> 
> CamelCaseIsUnwelcome. And actually haveing enum for numbers 0..3 looks
> like overkill. Could we just use plain numbers?

Good suggestion. We put that initially due to potential hardware change
in initial design. We can remove this now.

> 
> > +typedef enum {
> > +	FREEZE_CONTROLLER_FSM_SW = 0,
> > +	FREEZE_CONTROLLER_FSM_HW,
> > +	FREEZE_CONTROLLER_FSM_UNDEFINED
> > +} FreezeControllerFSMSelect;
> 
> No longer needed.

Yup :)

> 
> > +#define SYSMGR_FRZCTRL_HWCTRL_VIO1STATE_GET(x) (((x) & 0x00000006)
>   >> 1)
> 
> Is this still used?

Nope, no more.

> 
> > +#define SYSMGR_FRZCTRL_VIOCTRL_SHIFT 0x2
> > +
> > +u32 sys_mgr_frzctrl_freeze_req(FreezeChannelSelect channel_id,
> > +	FreezeControllerFSMSelect fsm_select);
> > +u32 sys_mgr_frzctrl_thaw_req(FreezeChannelSelect channel_id,
> > +	FreezeControllerFSMSelect fsm_select);
> 
> We can remove second parameter here. And maybe use some more
> reasonable names.
> 
> sysmgr_freeze_req / sysmgr_thaw_req?

Yup removed the second parameter. About the name freeze and thaw, its
how its labeled in hardware documentation. :)

> 
> Thanks, and sorry for two-phase review.

No problem as you are very supportive.

Thanks

Chin Liang

> 									Pavel

      reply	other threads:[~2013-09-20  5:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19 15:14 [U-Boot] [PATCH v2] socfpga: Adding Freeze Controller driver Chin Liang See
2013-09-19 22:55 ` Pavel Machek
2013-09-20  5:08   ` Chin Liang See [this message]

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=1379653688.5736.11.camel@clsee-VirtualBox \
    --to=clsee@altera.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox