Linux M68K Architecture development
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gregungerer00@gmail.com>,
	Daniel Palmer <danieruru@gmail.com>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH 1/2] Add correct PLL settings for DragonBall VZ.
Date: Fri, 4 Apr 2014 18:45:42 +1100 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1404041755100.29768@nippy.intranet> (raw)
In-Reply-To: <CAMuHMdVECm8bWBZ_ZUhrQ34dgmf3aZ2c7aMnXORtPe9ufggsfQ@mail.gmail.com>


On Thu, 3 Apr 2014, Geert Uytterhoeven wrote:

> On Thu, Apr 3, 2014 at 2:41 PM, Greg Ungerer <gregungerer00@gmail.com> wrote:
> >> -#ifdef CONFIG_PILOT
> >> +#if defined(CONFIG_PILOT)
> >>         movew   #0x2410, 0xfffff200             /* PLLCR */
> >> +#elif defined(CONFIG_M68VZ328)
> >> +       movew   #0x2493, 0xfffff200             /* PLLCR */
> >
> >
> > Would it be cleaner to have a defined value here instead?
> > This moves the #ifdef'ery to just the PLLCR value, and keeps the
> > code instructions here cleaner. So something like this at the top of
> > this head.S:
> >
> > #if defined(CONFIG_PILOT)
> > #define PLLCR   0x2410
> > #elif defined(CONFIG_M68VZ328)
> > #define PLLCR   0x2493
> > #else
> > #define PLLCR   0x2400
> > #endif
> >
> > and then just
> >
> >         movew   #PLLCR, 0xfffff200              /* PLLCR */

In this case, the #ifdef ... #elif ... #else ... #endif cascade is already 
present, so I wonder whether your way is in fact better here.

> 
> While I like this advice in general, I prefer to use a different name than
> "PLLCR" for this definition.
> 
> One day someone may want to put "#define PLLCR 0xfffff200" in a
> header file...
> 

It's defined in asm/MC68328.h:

#define PLLCR_ADDR      0xfffff200
...
#define PLLCR_DISPLL           0x0008   /* Disable PLL */
#define PLLCR_CLKEN            0x0010   /* Clock (CLKO pin) enable */
#define PLLCR_SYSCLK_SEL_MASK  0x0700   /* System Clock Selection */
#define PLLCR_SYSCLK_SEL_SHIFT 8
#define PLLCR_PIXCLK_SEL_MASK  0x3800   /* LCD Clock Selection */
#define PLLCR_PIXCLK_SEL_SHIFT 11

Some bit name definitions are missing, i.e.

#define PLLCR_PRESC1           0x0080

-- 

  parent reply	other threads:[~2014-04-04  7:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 14:43 [PATCH 1/2] Add correct PLL settings for DragonBall VZ Daniel Palmer
2014-04-02 14:43 ` [PATCH 2/2] Fix mach_sched_init for EZ and VZ DragonBall chips Daniel Palmer
2014-04-03 12:45   ` Greg Ungerer
2014-04-03 12:41 ` [PATCH 1/2] Add correct PLL settings for DragonBall VZ Greg Ungerer
2014-04-03 12:48   ` Geert Uytterhoeven
2014-04-04  3:18     ` Daniel Palmer
2014-04-04  8:16       ` Finn Thain
2014-04-04 13:42       ` Greg Ungerer
2014-04-04  7:45     ` Finn Thain [this message]
2014-04-04 13:35       ` Greg Ungerer
2014-04-05  8:46         ` Finn Thain

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=alpine.LNX.2.00.1404041755100.29768@nippy.intranet \
    --to=fthain@telegraphics.com.au \
    --cc=danieruru@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=gregungerer00@gmail.com \
    --cc=linux-m68k@lists.linux-m68k.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox