2004-06-09 21:50:45 +00:00
|
|
|
/*
|
2005-04-02 23:52:25 +00:00
|
|
|
* board/mx1ads/lowlevel_init.S
|
2004-06-19 21:19:10 +00:00
|
|
|
*
|
2004-06-09 21:50:45 +00:00
|
|
|
* (c) Copyright 2004
|
|
|
|
* Techware Information Technology, Inc.
|
|
|
|
* http://www.techware.com.tw/
|
|
|
|
*
|
|
|
|
* Ming-Len Wu <minglen_wu@techware.com.tw>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2004-06-09 21:50:45 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <version.h>
|
|
|
|
|
|
|
|
#define SDCTL0 0x221000
|
|
|
|
#define SDCTL1 0x221004
|
|
|
|
|
|
|
|
|
|
|
|
_TEXT_BASE:
|
2010-10-07 19:51:12 +00:00
|
|
|
.word CONFIG_SYS_TEXT_BASE
|
2004-06-09 21:50:45 +00:00
|
|
|
|
2005-04-02 23:52:25 +00:00
|
|
|
.globl lowlevel_init
|
|
|
|
lowlevel_init:
|
2008-05-20 14:00:29 +00:00
|
|
|
/* memory controller init */
|
2004-06-09 21:50:45 +00:00
|
|
|
|
|
|
|
ldr r1, =SDCTL0
|
|
|
|
|
|
|
|
/* Set Precharge Command */
|
|
|
|
|
|
|
|
ldr r3, =0x92120200
|
|
|
|
/* ldr r3, =0x92120251
|
|
|
|
*/
|
|
|
|
str r3, [r1]
|
|
|
|
|
|
|
|
/* Issue Precharge All Commad */
|
|
|
|
ldr r3, =0x8200000
|
|
|
|
ldr r2, [r3]
|
2004-06-19 21:19:10 +00:00
|
|
|
|
2008-05-20 14:00:29 +00:00
|
|
|
/* Set AutoRefresh Command */
|
2004-06-09 21:50:45 +00:00
|
|
|
ldr r3, =0xA2120200
|
|
|
|
str r3, [r1]
|
|
|
|
|
|
|
|
/* Issue AutoRefresh Command */
|
|
|
|
ldr r3, =0x8000000
|
|
|
|
ldr r2, [r3]
|
|
|
|
ldr r2, [r3]
|
|
|
|
ldr r2, [r3]
|
|
|
|
ldr r2, [r3]
|
|
|
|
ldr r2, [r3]
|
|
|
|
ldr r2, [r3]
|
|
|
|
ldr r2, [r3]
|
|
|
|
ldr r2, [r3]
|
2004-06-19 21:19:10 +00:00
|
|
|
|
2008-05-20 14:00:29 +00:00
|
|
|
/* Set Mode Register */
|
2004-06-09 21:50:45 +00:00
|
|
|
ldr r3, =0xB2120200
|
|
|
|
str r3, [r1]
|
2004-06-19 21:19:10 +00:00
|
|
|
|
2004-06-09 21:50:45 +00:00
|
|
|
/* Issue Mode Register Command */
|
2008-05-20 14:00:29 +00:00
|
|
|
ldr r3, =0x08111800 /* Mode Register Value */
|
2004-06-09 21:50:45 +00:00
|
|
|
ldr r2, [r3]
|
|
|
|
|
|
|
|
/* Set Normal Mode */
|
|
|
|
ldr r3, =0x82124200
|
|
|
|
str r3, [r1]
|
|
|
|
|
2008-05-20 14:00:29 +00:00
|
|
|
/* everything is fine now */
|
2004-06-09 21:50:45 +00:00
|
|
|
mov pc, lr
|