mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-08 22:24:32 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
96 lines
1.7 KiB
ArmAsm
96 lines
1.7 KiB
ArmAsm
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Board-specific sbf ddr/sdram init.
|
|
*
|
|
* (C) Copyright 2017 Angelo Dureghello <angelo@sysam.it>
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
.global sbf_dram_init
|
|
.text
|
|
|
|
sbf_dram_init:
|
|
/* Dram Initialization a1, a2, and d0 */
|
|
/* mscr sdram */
|
|
move.l #0xFC0A4074, %a1
|
|
move.b #(CONFIG_SYS_SDRAM_DRV_STRENGTH), (%a1)
|
|
nop
|
|
|
|
/* SDRAM Chip 0 and 1 */
|
|
move.l #0xFC0B8110, %a1
|
|
move.l #0xFC0B8114, %a2
|
|
|
|
/* calculate the size */
|
|
move.l #0x13, %d1
|
|
move.l #(CONFIG_SYS_SDRAM_SIZE), %d2
|
|
#ifdef CONFIG_SYS_SDRAM_BASE1
|
|
lsr.l #1, %d2
|
|
#endif
|
|
|
|
dramsz_loop:
|
|
lsr.l #1, %d2
|
|
add.l #1, %d1
|
|
cmp.l #1, %d2
|
|
bne dramsz_loop
|
|
#ifdef CONFIG_SYS_NAND_BOOT
|
|
beq asm_nand_chk_status
|
|
#endif
|
|
/* SDRAM Chip 0 and 1 */
|
|
move.l #(CONFIG_SYS_SDRAM_BASE), (%a1)
|
|
or.l %d1, (%a1)
|
|
#ifdef CONFIG_SYS_SDRAM_BASE1
|
|
move.l #(CONFIG_SYS_SDRAM_BASE1), (%a2)
|
|
or.l %d1, (%a2)
|
|
#endif
|
|
nop
|
|
|
|
/* dram cfg1 and cfg2 */
|
|
move.l #0xFC0B8008, %a1
|
|
move.l #(CONFIG_SYS_SDRAM_CFG1), (%a1)
|
|
nop
|
|
move.l #0xFC0B800C, %a2
|
|
move.l #(CONFIG_SYS_SDRAM_CFG2), (%a2)
|
|
nop
|
|
|
|
move.l #0xFC0B8000, %a1 /* Mode */
|
|
move.l #0xFC0B8004, %a2 /* Ctrl */
|
|
|
|
/* Issue PALL */
|
|
move.l #(CONFIG_SYS_SDRAM_CTRL + 2), (%a2)
|
|
nop
|
|
|
|
move.l #1000, %d1
|
|
bsr asm_delay
|
|
|
|
/* Issue PALL */
|
|
move.l #(CONFIG_SYS_SDRAM_CTRL + 2), (%a2)
|
|
nop
|
|
|
|
/* Perform two refresh cycles */
|
|
move.l #(CONFIG_SYS_SDRAM_CTRL + 4), %d0
|
|
nop
|
|
move.l %d0, (%a2)
|
|
move.l %d0, (%a2)
|
|
nop
|
|
|
|
/* Issue LEMR */
|
|
move.l #(CONFIG_SYS_SDRAM_MODE), (%a1)
|
|
nop
|
|
move.l #(CONFIG_SYS_SDRAM_EMOD), (%a1)
|
|
|
|
move.l #500, %d1
|
|
bsr asm_delay
|
|
|
|
move.l #(CONFIG_SYS_SDRAM_CTRL), %d1
|
|
and.l #0x7FFFFFFF, %d1
|
|
|
|
or.l #0x10000C00, %d1
|
|
|
|
move.l %d1, (%a2)
|
|
nop
|
|
|
|
move.l #2000, %d1
|
|
bsr asm_delay
|
|
|
|
rts
|