From: Yong Wang <yong.y.wang@linux.intel.com>
To: Masayuki Ohtak <masa-korg@dsn.okisemi.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
LKML <linux-kernel@vger.kernel.org>,
Andrew <andrew.chih.howe.khor@intel.com>,
Intel OTC <joel.clark@intel.com>, "Wang, Qi" <qi.wang@intel.com>,
"Wang, Yong Y" <yong.y.wang@intel.com>
Subject: Re: [PATCH] Topcliff PHUB: Generate PacketHub driver
Date: Tue, 8 Jun 2010 15:20:49 +0800 [thread overview]
Message-ID: <20100608072049.GA12940@ywang-moblin2.bj.intel.com> (raw)
In-Reply-To: <4C0DCE87.1090802@dsn.okisemi.com>
On Tue, Jun 08, 2010 at 02:00:55PM +0900, Masayuki Ohtak wrote:
> Hi Alan
>
> We are now updating our Phub driver.
>
> I have a questions for your comment.
>
> (1)
> >> +#ifdef PCH_CAN_PCLK_50MHZ
> >> + /* save clk cfg register */
> >> + g_pch_phub_reg.clkcfg_reg = PCH_READ_REG(CLKCFG_REG_OFFSET);
> >> +#endif
> >
> > This makes it hard to build one kernel for everything
> We couldn't understand your intention.
> Does the above mean we must not use "#ifdef PCH_CAN_PCLK_50MHZ" in source code ?
>
I think what Alan means is that you will have to build two kernel images
for two possible configurations of how your hardware is going to be used
if you write code this way. One is the case when CAN clock runs at 50MHz
and you will build a kernel image with PCH_CAN_PCLK_50MHZ defined. The
other is when CAN clock runs at other speed and you need to build
another kernel image with PCH_CAN_PCLK_50MHZ undefined. It would be much
better if one kernel image could run on all configurations.
Why is 50MHz so special, btw? Don't you need to save and restore the
clock config register when CAN clock runs at other speed?
>
> >> +#define PCH_READ_REG(a) ioread32((pch_phub_base_address + a))
>
> >> +
>
> >> +#define PCH_WRITE_REG(a, b) iowrite32(a, (pch_phub_base_address + b))
>
> >
>
> > These on the other hand do - but not where they are now
>
> >
>
> > iowrite32((a), pcb_phub_base_address + (b))
>
> >
>
> > (so that if a or b are expressions they are evaluated first)
>
> Modify like below.
>
> #define PCH_READ_REG(a) ioread32(pch_phub_base_address + (a))
>
> #define PCH_WRITE_REG(a, b) iowrite32(a, pch_phub_base_address + (b))
>
Note that 'a' is supposed to be surrounded by brackets, too.
#define PCH_WRITE_REG(a, b) iowrite32((a), pcb_phub_base_address + (b))
Thanks
-Yong
next prev parent reply other threads:[~2010-06-08 7:34 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 5:00 [PATCH] Topcliff PHUB: Generate PacketHub driver Masayuki Ohtak
2010-06-08 5:46 ` Masayuki Ohtake
2010-06-08 8:01 ` Alan Cox
2010-06-08 7:20 ` Yong Wang [this message]
2010-06-08 8:09 ` Masayuki Ohtake
2010-06-08 8:04 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2010-06-22 5:33 Masayuki Ohtak
2010-06-22 10:33 ` Masayuki Ohtak
2010-06-22 22:12 ` Andrew Morton
2010-06-23 0:31 ` Masayuki Ohtake
2010-06-22 11:30 ` Arnd Bergmann
2010-06-22 13:52 ` Yong Wang
2010-06-29 23:31 ` Andy Isaacson
2010-06-30 5:58 ` Masayuki Ohtake
2010-06-30 18:28 ` Andy Isaacson
2010-07-01 4:08 ` Masayuki Ohtake
2010-06-22 2:14 Masayuki Ohtake
2010-06-15 6:58 Masayuki Ohtake
2010-06-15 10:37 ` Arnd Bergmann
2010-06-15 12:14 ` Masayuki Ohtake
2010-06-16 8:58 ` Masayuki Ohtake
2010-06-16 10:50 ` Arnd Bergmann
2010-06-17 0:17 ` Masayuki Ohtake
2010-06-07 12:39 Masayuki Ohtak
2010-06-07 15:05 ` Alan Cox
2010-06-08 0:19 ` Masayuki Ohtake
2010-06-14 12:09 ` Masayuki Ohtak
2010-06-14 12:50 ` Arnd Bergmann
2010-06-14 23:56 ` Masayuki Ohtake
2010-06-15 6:25 ` Masayuki Ohtake
2010-06-15 10:42 ` Arnd Bergmann
2010-06-15 12:12 ` Masayuki Ohtake
2010-06-17 2:43 ` Masayuki Ohtak
2010-06-17 11:59 ` Arnd Bergmann
2010-06-17 23:49 ` Masayuki Ohtake
2010-06-18 8:08 ` Wang, Yong Y
2010-06-18 11:39 ` Masayuki Ohtake
2010-06-04 10:16 Masayuki Ohtake
2010-06-04 12:00 ` Alan Cox
2010-06-07 7:53 ` Masayuki Ohtake
2010-06-07 13:37 ` Arnd Bergmann
2010-06-08 0:15 ` Masayuki Ohtake
2010-06-08 8:48 ` Masayuki Ohtake
2010-06-08 9:29 ` Arnd Bergmann
2010-06-09 0:14 ` Wang, Qi
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=20100608072049.GA12940@ywang-moblin2.bj.intel.com \
--to=yong.y.wang@linux.intel.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andrew.chih.howe.khor@intel.com \
--cc=joel.clark@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masa-korg@dsn.okisemi.com \
--cc=qi.wang@intel.com \
--cc=yong.y.wang@intel.com \
/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