本文整理汇总了C++中sdram_init函数的典型用法代码示例。如果您正苦于以下问题:C++ sdram_init函数的具体用法?C++ sdram_init怎么用?C++ sdram_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sdram_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: board_init_f
void board_init_f(ulong bootflag)
{
u32 plat_ratio, ddr_ratio;
unsigned long bus_clk;
ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
/* initialize selected port with appropriate baud rate */
plat_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
plat_ratio >>= 1;
bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
ddr_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_DDR_RATIO;
ddr_ratio = ddr_ratio >> MPC85xx_PORPLLSR_DDR_RATIO_SHIFT;
ddr_freq_mhz = (CONFIG_SYS_CLK_FREQ * ddr_ratio) / 0x1000000;
NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
bus_clk / 16 / CONFIG_BAUDRATE);
puts("\nNAND boot... ");
/* Initialize the DDR3 */
sdram_init();
/* copy code to RAM and jump to it - this should not return */
/* NOTE - code has to be copied out of NAND buffer before
* other blocks can be read.
*/
relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC_SP, 0,
CONFIG_SYS_NAND_U_BOOT_RELOC);
}
示例2: main
void main(void)
{
timestamp_add_now(TS_START_ROMSTAGE);
console_init();
configure_l2ctlr();
tsadc_init();
/* vdd_log 1200mv is enough for ddr run 666Mhz */
regulate_vdd_log(1200);
timestamp_add_now(TS_BEFORE_INITRAM);
sdram_init(get_sdram_config());
timestamp_add_now(TS_AFTER_INITRAM);
/* Now that DRAM is up, add mappings for it and DMA coherency buffer. */
mmu_config_range((uintptr_t)_dram/MiB,
sdram_size_mb(), DCACHE_WRITEBACK);
mmu_config_range((uintptr_t)_dma_coherent/MiB,
_dma_coherent_size/MiB, DCACHE_OFF);
cbmem_initialize_empty();
timestamp_add_now(TS_END_ROMSTAGE);
run_ramstage();
}
示例3: mymain
int mymain(void)
{
// beep off
GPBCON = 0x1; // output
GPBDAT = 0x0; // Tout = 0;
// watchdog timer off
WTCON = 0;
uart_init();
uart_putchar('a');
sdram_init();
*(int *)TEST = 0x12345678;
print_addr(TEST);
while (1)
{
char c;
c = uart_getchar();
uart_putchar(c);
}
while (1);
return 0;
}
示例4: initdram
long int initdram (int board_type)
{
volatile immap_t *im = (immap_t *)CFG_IMMR;
u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
return -1;
/* DDR SDRAM - Main SODIMM */
im->sysconf.ddrlaw[0].bar = CFG_DDR_BASE & LAWBAR_BAR;
#if defined(CONFIG_SPD_EEPROM)
msize = spd_sdram();
#else
msize = fixed_sdram();
#endif
/*
* Initialize SDRAM if it is on local bus.
*/
sdram_init();
#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
/*
* Initialize and enable DDR ECC.
*/
ddr_enable_ecc(msize * 1024 * 1024);
#endif
/* return total bus SDRAM size(bytes) -- DDR */
return (msize * 1024 * 1024);
}
示例5: main
static void main(unsigned long bist)
{
pc97317_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
uart_init();
console_init();
/* Halt if there was a built in self test failure */
report_bist_failure(bist);
cs5530_enable_rom();
sdram_init();
/* Check all of memory */
#if 0
ram_check(0x00000000, msr.lo);
#endif
#if 0
static const struct {
unsigned long lo, hi;
} check_addrs[] = {
/* Check 16MB of memory @ 0*/
{ 0x00000000, 0x01000000 },
#if TOTAL_CPUS > 1
/* Check 16MB of memory @ 2GB */
{ 0x80000000, 0x81000000 },
#endif
};
int i;
for(i = 0; i < ARRAY_SIZE(check_addrs); i++) {
ram_check(check_addrs[i].lo, check_addrs[i].hi);
}
#endif
}
示例6: _initStr
TestDisplay::TestDisplay(WhichDisplay which) :
_initStr(NULL),
_lcdCfg(NULL),
_lcdBoard(P0_27, P0_28),
_touch(P0_27, P0_28, P2_25) {
switch (which) {
case TFT_5:
_lcdCfg = new LcdController::Config(LCD_CONFIGURATION_50);
_initStr = LCD_INIT_STRING_50;
break;
case TFT_4_3:
_lcdCfg = new LcdController::Config(LCD_CONFIGURATION_43);
_initStr = LCD_INIT_STRING_43;
break;
default:
mbed_die();
}
if (sdram_init() == 1) {
printf("Failed to initialize SDRAM\n");
_framebuffer = 0;
} else {
_framebuffer = (uint32_t) malloc(_lcdCfg->width * _lcdCfg->height * 2 * 3); // 2 is for 16 bit color, 3 is the number of buffers
if (_framebuffer != 0) {
memset((uint8_t*)_framebuffer, 0, _lcdCfg->width * _lcdCfg->height * 2 * 3);
}
}
}
示例7: main
static void main(unsigned long bist)
{
pc87351_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
console_init();
report_bist_failure(bist);
cs5530_enable_rom();
sdram_init();
}
示例8: sdramiodev_init
static bool sdramiodev_init(struct cyg_devtab_entry *tab)
{
int stat = sdram_init();
//diag_printf("sdramiodev_init\n");
if ( stat == 0 )
return true;
else
return false;
}
示例9: board_init_f
void board_init_f(ulong bootflag)
{
u32 plat_ratio;
ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
#ifndef CONFIG_QE
ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
#elif defined(CONFIG_P1021RDB)
par_io_t *par_io = (par_io_t *) &(gur->qe_par_io);
#endif
/* initialize selected port with appropriate baud rate */
plat_ratio = in_be32(&gur->porpllsr) & MPC85xx_PORPLLSR_PLAT_RATIO;
plat_ratio >>= 1;
bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
bus_clk / 16 / CONFIG_BAUDRATE);
puts("\nNAND boot... ");
#ifndef CONFIG_QE
/* init DDR3 reset signal */
puts("\nDDR & BCM56445 reset... ");
__raw_writel(0x02210000, &pgpio->gpdir);
__raw_writel(0x00210000, &pgpio->gpodr);
__raw_writel(0x00000000, &pgpio->gpdat);
udelay(20000);
__raw_writel(0x00210000, &pgpio->gpdat);
udelay(20000);
__raw_writel(0x00000000, &pgpio->gpdir);
#elif defined(CONFIG_P1021RDB)
/* init DDR3 reset signal CE_PB8 */
out_be32(&par_io[1].cpdir1, 0x00004000);
out_be32(&par_io[1].cpodr, 0x00800000);
out_be32(&par_io[1].cppar1, 0x00000000);
/* reset DDR3 */
out_be32(&par_io[1].cpdat, 0x00800000);
udelay(1000);
out_be32(&par_io[1].cpdat, 0x00000000);
udelay(1000);
out_be32(&par_io[1].cpdat, 0x00800000);
/* disable the CE_PB8 */
out_be32(&par_io[1].cpdir1, 0x00000000);
#endif
//sdram_reset();
/* Initialize the DDR3 */
sdram_init();
puts("\nsdram_init ok... ");
/* copy code to RAM and jump to it - this should not return */
/* NOTE - code has to be copied out of NAND buffer before
* other blocks can be read.
*/
relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC_SP, 0,
CONFIG_SYS_NAND_U_BOOT_RELOC);
}
示例10: board_init_f
void board_init_f(ulong dummy)
{
/* Set global data pointer */
gd = &gdata;
/* Setup global info */
#ifndef CONFIG_CMD_BURN
gd->arch.gi = &ginfo;
#else
gd->arch.gi = (struct global_info *)CONFIG_SPL_GINFO_BASE;
#endif
gpio_init();
#ifndef CONFIG_FPGA
/* Init uart first */
enable_uart_clk();
#endif
#ifdef CONFIG_SPL_SERIAL_SUPPORT
preloader_console_init();
#endif
#ifndef CONFIG_FPGA
debug("Timer init\n");
timer_init();
#ifdef CONFIG_SPL_REGULATOR_SUPPORT
debug("regulator set\n");
spl_regulator_set();
#endif
debug("CLK stop\n");
clk_prepare();
debug("PLL init\n");
pll_init();
debug("CLK init\n");
clk_init();
#endif
debug("SDRAM init\n");
sdram_init();
debug("SDRAM init ok\n");
#ifdef CONFIG_DDR_TEST
ddr_basic_tests();
#endif
#ifndef CONFIG_BURNER
/* Clear the BSS */
memset(__bss_start, 0, (char *)&__bss_end - __bss_start);
debug("board_init_r\n");
board_init_r(NULL, 0);
#endif
}
示例11: main
static void main(unsigned long bist)
{
w83977f_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
uart_init();
console_init();
report_bist_failure(bist);
cs5530_enable_rom();
sdram_init();
/* ram_check(0, 640 * 1024); */
}
示例12: board_init_f
void board_init_f(ulong dummy)
{
hw_data_init();
early_system_init();
board_early_init_f();
sdram_init();
/* dram_init must store complete ramsize in gd->ram_size */
gd->ram_size = get_ram_size(
(void *)CONFIG_SYS_SDRAM_BASE,
CONFIG_MAX_RAM_BANK_SIZE);
}
示例13: initdram
phys_size_t initdram (int board_type)
{
/*
* ToDo: Move the asm init routine sdram_init() to this C file,
* or even better use some common ppc4xx code available
* in cpu/ppc4xx
*/
sdram_init();
return get_dram_size ();
}
示例14: dram_init
int dram_init(void)
{
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
sdram_init();
#endif
/* dram_init must store complete ramsize in gd->ram_size */
gd->ram_size = get_ram_size(
(void *)CONFIG_SYS_SDRAM_BASE,
CONFIG_MAX_RAM_BANK_SIZE);
return 0;
}
示例15: rtc_only
/*
* Check if we are executing rtc-only + DDR mode, and resume from it if needed
*/
static void rtc_only(void)
{
struct davinci_rtc *rtc = (struct davinci_rtc *)RTC_BASE;
struct prm_device_inst *prm_device =
(struct prm_device_inst *)PRM_DEVICE_INST;
u32 scratch1;
void (*resume_func)(void);
scratch1 = readl(&rtc->scratch1);
/*
* Check RTC scratch against RTC_MAGIC_VAL, RTC_MAGIC_VAL is only
* written to this register when we want to wake up from RTC only
* with DDR in self-refresh mode. Contents of the RTC_SCRATCH1:
* bits 0-15: RTC_MAGIC_VAL
* bits 16-31: board type (needed for sdram_init)
*/
if ((scratch1 & 0xffff) != RTC_MAGIC_VAL)
return;
rtc32k_unlock(rtc);
/* Clear RTC magic */
writel(0, &rtc->scratch1);
/*
* Update board type based on value stored on RTC_SCRATCH1, this
* is done so that we don't need to read the board type from eeprom
* over i2c bus which is expensive
*/
rtc_only_update_board_type(scratch1 >> RTC_BOARD_TYPE_SHIFT);
/*
* Enable EMIF_DEVOFF in PRCM_PRM_EMIF_CTRL to indicate to EMIF we
* are resuming from self-refresh. This avoids an unnecessary re-init
* of the DDR. The re-init takes time and we would need to wait for
* it to complete before accessing DDR to avoid L3 NOC errors.
*/
writel(EMIF_CTRL_DEVOFF, &prm_device->emif_ctrl);
rtc_only_prcm_init();
sdram_init();
/* Disable EMIF_DEVOFF for normal operation and to exit self-refresh */
writel(0, &prm_device->emif_ctrl);
resume_func = (void *)readl(&rtc->scratch0);
if (resume_func)
resume_func();
}