[U-Boot] [PATCH] [ARM] Move machine specific code to board at s3c64xx
Guennadi Liakhovetski
lg at denx.de
Thu Oct 23 09:39:20 CEST 2008
On Wed, 22 Oct 2008, Kyungmin Park wrote:
> Move machine specific code to smdk6400.
> Some board use OneNAND instead of NAND.
>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> ---
> diff --git a/board/samsung/smdk6400/lowlevel_init.S b/board/samsung/smdk6400/lowlevel_init.S
> index e0119a7..53d9125 100644
> --- a/board/samsung/smdk6400/lowlevel_init.S
> +++ b/board/samsung/smdk6400/lowlevel_init.S
> @@ -104,6 +104,13 @@ lowlevel_init:
> bl nand_asm_init
> #endif
>
> + /* Memory subsystem address 0x7e00f120 */
> + ldr r0, =ELFIN_MEM_SYS_CFG
> +
> + /* Xm0CSn2 = NFCON CS0, Xm0CSn3 = NFCON CS1 */
> + mov r1, #0xd
> + str r1, [r0]
> +
Hm, no, I don't quite agree. In principle, yes, this configuration can be
considered platform-specific and moving it this way of course works. But:
1. The patch comment is not correct. This code doesn't select between NAND
and OneNAND. It selects between (one of) NANDs and SROMs.
2. While at it, we could fix the value being written to the MEM_SYS_CFG
register too. Currently it writes 0xd =
(1 << 0) - ignored, default 0, so, better set it to 0
| (0 << 1) - set Xm0CSn[2] to OneNANDC CS0 or NFCON CS0
| (1 << 2) - ignored, default 0, so, better set it to 0
| (1 << 3) - set Xm0CSn[3] to SROMC CS3
So, we should just write an 8 in it:
+ mov r1, #0x8
+ str r1, [r0]
3. The comment in the code doesn't look right. According to the above it
should read
+ /* Xm0CSn[2] = OneNANDC CS0 or NFCON CS0, Xm0CSn[3] = SROMC CS3 */
The only thing that confuses me, is why the author, belonging to the
manufacturer of the chip, hasn't done this. Maybe the documentation is
wrong?
I tested it with the "8" - it works. So, once the issues are fixed, you
get my "Tested-by", although, I guess, you can test it just as well:-)
Thanks
Guennadi
> bl mem_ctrl_asm_init
>
> /* Wakeup support. Don't know if it's going to be used, untested. */
> diff --git a/cpu/arm1176/s3c64xx/cpu_init.S b/cpu/arm1176/s3c64xx/cpu_init.S
> index 08bda99..32bb467 100644
> --- a/cpu/arm1176/s3c64xx/cpu_init.S
> +++ b/cpu/arm1176/s3c64xx/cpu_init.S
> @@ -28,13 +28,6 @@
>
> .globl mem_ctrl_asm_init
> mem_ctrl_asm_init:
> - /* Memory subsystem address 0x7e00f120 */
> - ldr r0, =ELFIN_MEM_SYS_CFG
> -
> - /* Xm0CSn2 = NFCON CS0, Xm0CSn3 = NFCON CS1 */
> - mov r1, #0xd
> - str r1, [r0]
> -
> /* DMC1 base address 0x7e001000 */
> ldr r0, =ELFIN_DMC1_BASE
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
---
Guennadi Liakhovetski, Ph.D.
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
More information about the U-Boot
mailing list