public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH/review] Blackfin: setup a sane default EBIU_SDBCTL for SDRAM controllers
Date: Sun, 1 Jun 2008 17:12:21 -0400	[thread overview]
Message-ID: <200806011712.22201.vapier@gentoo.org> (raw)
In-Reply-To: <20080601195457.C255224AB1@gemini.denx.de>

On Sunday 01 June 2008, Wolfgang Denk wrote:
> In message <1212298724-15152-8-git-send-email-vapier@gentoo.org> you wrote:
> > If the board config does not specify an explicit EBIU_SDBCTL value, set
> > it up with sane values based on other configuration options.
>
> ...
>
> > +#ifndef EBIU_RSTCTL
> > +/* Blackfin with SDRAM */
> > +#ifndef CONFIG_EBIU_SDBCTL_VAL
> > +# if CONFIG_MEM_SIZE == 16
> > +#  define CONFIG_EBSZ_VAL EBSZ_16
> > +# elif CONFIG_MEM_SIZE == 32
> > +#  define CONFIG_EBSZ_VAL EBSZ_32
> > +# elif CONFIG_MEM_SIZE == 64
> > +#  define CONFIG_EBSZ_VAL EBSZ_64
> > +# elif CONFIG_MEM_SIZE == 128
> > +#  define CONFIG_EBSZ_VAL EBSZ_128
> > +# elif CONFIG_MEM_SIZE == 256
> > +#  define CONFIG_EBSZ_VAL EBSZ_256
> > +# elif CONFIG_MEM_SIZE == 512
> > +#  define CONFIG_EBSZ_VAL EBSZ_512
> > +# else
> > +#  error You need to define CONFIG_EBIU_SDBCTL_VAL or CONFIG_MEM_SIZE
> > +# endif
> > +# if CONFIG_MEM_ADD_WDTH == 8
> > +#  define CONFIG_EBCAW_VAL EBCAW_8
> > +# elif CONFIG_MEM_ADD_WDTH == 9
> > +#  define CONFIG_EBCAW_VAL EBCAW_9
> > +# elif CONFIG_MEM_ADD_WDTH == 10
> > +#  define CONFIG_EBCAW_VAL EBCAW_10
> > +# elif CONFIG_MEM_ADD_WDTH == 11
> > +#  define CONFIG_EBCAW_VAL EBCAW_11
>
> This is pretty ugly code.

little cruft on the backend makes the lives of board porters a lot easier.

> Why do you need the numeric values for CONFIG_MEM_SIZE

because it gets used in many other places as a real value to create a large 
number of sane defaults.  the bitmask EBSZ_# would not be usable.

> and 
> CONFIG_MEM_ADD_WDTH at all? If you change for example
>
> 	#define CONFIG_MEM_ADD_WDTH       9
>
> in your board config file into
>
> 	#define CONFIG_MEM_ADD_WDTH       EBCAW_9
>
> this is barely less readable, but allow for much simpler code.

historically EBCAW_# did not exist.  i could make this transition, but then 
it'd be a little odd wrt CONFIG_MEM_SIZE being a straight number.  doesnt 
matter terribly much to me.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080601/570a58bf/attachment.pgp 

  reply	other threads:[~2008-06-01 21:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-01  5:38 [U-Boot-Users] [PATCH/review] Blackfin: dont call i2c_init() from board_init_r() Mike Frysinger
2008-06-01  5:38 ` [U-Boot-Users] [PATCH/review] Blackfin: protect default flash according to CFG_MONITOR_LEN Mike Frysinger
2008-06-01  5:38   ` [U-Boot-Users] [PATCH/review] Blackfin: update proc headers from toolchain Mike Frysinger
2008-06-01  5:38     ` [U-Boot-Users] [PATCH/review] Blackfin: unify cache handling code Mike Frysinger
2008-06-01  5:38       ` [U-Boot-Users] [PATCH/review] Blackfin: use common memcpy routine during init Mike Frysinger
2008-06-01  5:38         ` [U-Boot-Users] [PATCH/review] Blackfin: enable support for nested interrupts Mike Frysinger
2008-06-01  5:38           ` [U-Boot-Users] [PATCH/review] Blackfin: respect CONFIG_CLKIN_HALF Mike Frysinger
2008-06-01  5:38             ` [U-Boot-Users] [PATCH/review] Blackfin: setup a sane default EBIU_SDBCTL for SDRAM controllers Mike Frysinger
2008-06-01  5:38               ` [U-Boot-Users] [PATCH/review] Blackfin: use on-chip syscontrol() rom function when available Mike Frysinger
2008-06-01  5:38                 ` [U-Boot-Users] [PATCH/review] Blackfin: use on-chip syscontrol() to reset Mike Frysinger
2008-06-01  5:38                   ` [U-Boot-Users] [PATCH/review] Blackfin: add support for BF538/BF539 Mike Frysinger
2008-06-01 20:14                     ` Wolfgang Denk
2008-06-01 21:18                       ` Mike Frysinger
2008-06-01 22:05                         ` Wolfgang Denk
2008-06-01 23:03                           ` Mike Frysinger
2008-06-04  8:56                             ` Detlev Zundel
2008-06-04 10:18                               ` Mike Frysinger
2008-06-04 17:36                                 ` Detlev Zundel
2008-06-04 20:16                                   ` Mike Frysinger
2008-06-05 13:13                                     ` Detlev Zundel
2008-06-05 13:24                                     ` Wolfgang Denk
2008-06-01 19:56                   ` [U-Boot-Users] [PATCH/review] Blackfin: use on-chip syscontrol() to reset Wolfgang Denk
2008-06-01 21:20                     ` Mike Frysinger
2008-06-01 22:07                       ` Wolfgang Denk
2008-06-04  9:05                       ` Detlev Zundel
2008-06-04 10:10                         ` Mike Frysinger
2008-06-01 19:54               ` [U-Boot-Users] [PATCH/review] Blackfin: setup a sane default EBIU_SDBCTL for SDRAM controllers Wolfgang Denk
2008-06-01 21:12                 ` Mike Frysinger [this message]
2008-06-01 21:59                   ` Wolfgang Denk
2008-06-01 22:49                     ` Mike Frysinger
2008-06-01 19:47   ` [U-Boot-Users] [PATCH/review] Blackfin: protect default flash according to CFG_MONITOR_LEN Wolfgang Denk

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=200806011712.22201.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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