From: Alexey Galakhov <agalakhov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCHv4 6/7] S5P DRAM support
Date: Tue, 22 May 2012 15:17:32 +0600 [thread overview]
Message-ID: <4FBB59AC.6050202@gmail.com> (raw)
In-Reply-To: <20120521200249.GF30400@pengutronix.de>
On 22.05.2012 02:02, Sascha Hauer wrote:
> On Fri, May 18, 2012 at 03:43:30PM +0600, Alexey Galakhov wrote:
>> +void __bare_init s5p_init_dram_bank(uint32_t base, uint32_t mc0, uint32_t mc1)
>> +{
>> +#ifdef S5P_DRAM_LPDDR
>> + uint32_t reg = 0x100;
>> +#endif
>> +#ifdef S5P_DRAM_LPDDR2
>> + uint32_t reg = 0x200;
>> +#endif
>> +#ifdef S5P_DRAM_DDR2
>> + uint32_t reg = 0x400;
>> +#endif
>> + reg |= (S5P_DRAM_BURST) << 20;
>> +#ifdef S5P_DRAM_16BIT
>> + reg |= 0x1000;
>> +#else /* 32-bit */
>> + reg |= 0x2000;
>> +#endif
>
> Since this function is called from board specific code, can we pass in
> the DDR/DDR2 16BIT/32BIT settings as arguments to this function and
> get rid of these ifdefs?
>
> Sascha
Thank you for the question. Most likely not.
According to the datasheet, LPDDR/LPDDR2/DDR2 initialization sequence is
completely different. It is in init_seq() function. Since I have no
LPDDR(2) hardware to test, I coded the DDR2 version only. A runtime
switch like that:
switch(mode) {
case LPDDR:
lpddr_init_seq();
break;
case LPDDR2:
lpddr2_init_seq();
break;
case DDR2:
ddr2_init_seq();
break;
}
is too expensive for S5PV210's __bare_init which is very limited in
space. Thus it is better to have only one function compiled in.
Of course, it is possible to get rid of #ifdefs in s5p_init_dram_bank()
but #ifdef is still needed for init_seq(). Ot is there any better solution?
Regards,
--
Alex
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-05-22 9:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 13:20 [PATCHv3 0/7] Cleaned up version of S5PV210 code Alexey Galakhov
2012-05-15 13:20 ` [PATCH 1/7] Make S3C24xx config options available for all S3Cs Alexey Galakhov
2012-05-15 13:20 ` [PATCH 2/7] Split S3C generic and S3C24xx specific code Alexey Galakhov
2012-05-17 17:52 ` Sascha Hauer
2012-05-17 18:33 ` Alexey Galakhov
2012-05-17 19:49 ` Juergen Beisert
2012-05-18 6:49 ` Alexey Galakhov
2012-05-18 8:38 ` Sascha Hauer
2012-05-18 9:06 ` Alexey Galakhov
2012-05-18 8:35 ` Sascha Hauer
2012-05-18 9:43 ` [PATCHv4 0/7] S5PV210 support (upd.) Alexey Galakhov
2012-05-18 9:43 ` [PATCH 1/7] Make S3C24xx config options available for all S3Cs Alexey Galakhov
2012-05-18 9:43 ` [PATCHv4 2/7] Split S3C generic and S3C24xx specific code Alexey Galakhov
2012-05-18 9:43 ` [PATCH 3/7] Add support for Samsung S5P architecture (S5PV210) Alexey Galakhov
2012-05-18 9:43 ` [PATCH 4/7] S5P boot header and image generator Alexey Galakhov
2012-05-18 9:43 ` [PATCHv4 5/7] S5P lowlevel clock init Alexey Galakhov
2012-05-18 9:43 ` [PATCHv4 6/7] S5P DRAM support Alexey Galakhov
2012-05-21 20:02 ` Sascha Hauer
2012-05-22 9:17 ` Alexey Galakhov [this message]
2012-05-22 18:29 ` Sascha Hauer
2012-05-22 19:12 ` Alexey Galakhov
2012-05-18 9:43 ` [PATCHv4 7/7] Add FriendlyArm Tiny210 board (S5PV210) Alexey Galakhov
2012-05-21 20:00 ` [PATCHv4 0/7] S5PV210 support (upd.) Sascha Hauer
2012-05-22 9:18 ` Alexey Galakhov
2012-05-15 13:20 ` [PATCH 3/7] Add support for Samsung S5P architecture (S5PV210) Alexey Galakhov
2012-05-15 13:20 ` [PATCH 4/7] S5P boot header and image generator Alexey Galakhov
2012-05-15 13:20 ` [PATCH 5/7] S5P lowlevel clock init Alexey Galakhov
2012-05-15 13:20 ` [PATCH 6/7] S5P DRAM support Alexey Galakhov
2012-05-15 13:20 ` [PATCH 7/7] Add FriendlyArm Tiny210 board (S5PV210) Alexey Galakhov
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=4FBB59AC.6050202@gmail.com \
--to=agalakhov@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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.