GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
if TARGET_M54451EVB
|
||||
|
||||
config SYS_CPU
|
||||
default "mcf5445x"
|
||||
|
||||
config SYS_BOARD
|
||||
default "m54451evb"
|
||||
|
||||
config SYS_VENDOR
|
||||
default "freescale"
|
||||
|
||||
config SYS_CONFIG_NAME
|
||||
default "M54451EVB"
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,7 @@
|
||||
M54451EVB BOARD
|
||||
#M: -
|
||||
S: Maintained
|
||||
F: board/freescale/m54451evb/
|
||||
F: include/configs/M54451EVB.h
|
||||
F: configs/M54451EVB_defconfig
|
||||
F: configs/M54451EVB_stmicro_defconfig
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# (C) Copyright 2000-2003
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
|
||||
obj-y = m54451evb.o
|
||||
extra-y += sbf_dram_init.o
|
||||
@@ -0,0 +1,95 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2000-2003
|
||||
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
*
|
||||
* Copyright (C) 2004-2008, 2012 Freescale Semiconductor, Inc.
|
||||
* TsiChung Liew (Tsi-Chung.Liew@freescale.com)
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <spi.h>
|
||||
#include <asm/immap.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
/*
|
||||
* need to to:
|
||||
* Check serial flash size. if 2mb evb, else 8mb demo
|
||||
*/
|
||||
puts("Board: ");
|
||||
puts("Freescale M54451 EVB\n");
|
||||
return 0;
|
||||
};
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
u32 dramsize;
|
||||
#ifdef CONFIG_CF_SBF
|
||||
/*
|
||||
* Serial Boot: The dram is already initialized in start.S
|
||||
* only require to return DRAM size
|
||||
*/
|
||||
dramsize = CONFIG_SYS_SDRAM_SIZE * 0x100000;
|
||||
#else
|
||||
sdramc_t *sdram = (sdramc_t *)(MMAP_SDRAM);
|
||||
gpio_t *gpio = (gpio_t *)(MMAP_GPIO);
|
||||
u32 i;
|
||||
|
||||
dramsize = CONFIG_SYS_SDRAM_SIZE * 0x100000;
|
||||
|
||||
if ((in_be32(&sdram->sdcfg1) == CONFIG_SYS_SDRAM_CFG1) &&
|
||||
(in_be32(&sdram->sdcfg2) == CONFIG_SYS_SDRAM_CFG2))
|
||||
return dramsize;
|
||||
|
||||
for (i = 0x13; i < 0x20; i++) {
|
||||
if (dramsize == (1 << i))
|
||||
break;
|
||||
}
|
||||
i--;
|
||||
|
||||
out_8(&gpio->mscr_sdram, CONFIG_SYS_SDRAM_DRV_STRENGTH);
|
||||
|
||||
out_be32(&sdram->sdcs0, CONFIG_SYS_SDRAM_BASE | i);
|
||||
|
||||
out_be32(&sdram->sdcfg1, CONFIG_SYS_SDRAM_CFG1);
|
||||
out_be32(&sdram->sdcfg2, CONFIG_SYS_SDRAM_CFG2);
|
||||
|
||||
udelay(200);
|
||||
|
||||
/* Issue PALL */
|
||||
out_be32(&sdram->sdcr, CONFIG_SYS_SDRAM_CTRL | 2);
|
||||
__asm__("nop");
|
||||
|
||||
/* Perform two refresh cycles */
|
||||
out_be32(&sdram->sdcr, CONFIG_SYS_SDRAM_CTRL | 4);
|
||||
__asm__("nop");
|
||||
out_be32(&sdram->sdcr, CONFIG_SYS_SDRAM_CTRL | 4);
|
||||
__asm__("nop");
|
||||
|
||||
/* Issue LEMR */
|
||||
out_be32(&sdram->sdmr, CONFIG_SYS_SDRAM_MODE);
|
||||
__asm__("nop");
|
||||
out_be32(&sdram->sdmr, CONFIG_SYS_SDRAM_MODE);
|
||||
__asm__("nop");
|
||||
|
||||
out_be32(&sdram->sdcr,
|
||||
(CONFIG_SYS_SDRAM_CTRL & ~0x80000000) | 0x10000000);
|
||||
|
||||
udelay(100);
|
||||
#endif
|
||||
gd->ram_size = dramsize;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
int testdram(void)
|
||||
{
|
||||
/* TODO: XXX XXX XXX */
|
||||
printf("DRAM test not implemented!\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/* 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
|
||||
Reference in New Issue
Block a user