Ejemplo n.º 1
0
void board_init_f(ulong dummy)
{
	dcache_disable();

	socfpga_init_security_policies();
	socfpga_sdram_remap_zero();

	/* Assert reset to all except L4WD0 and L4TIMER0 */
	socfpga_per_reset_all();
	socfpga_watchdog_disable();

	spl_early_init();

	/* Configure the clock based on handoff */
	cm_basic_init(gd->fdt_blob);

#ifdef CONFIG_HW_WATCHDOG
	/* release osc1 watchdog timer 0 from reset */
	socfpga_reset_deassert_osc1wd0();

	/* reconfigure and enable the watchdog */
	hw_watchdog_init();
	WATCHDOG_RESET();
#endif /* CONFIG_HW_WATCHDOG */

	config_dedicated_pins(gd->fdt_blob);
	WATCHDOG_RESET();
}
void spl_board_init(void)
{
	/*
	 * Save the boot parameters passed from romcode.
	 * We cannot delay the saving further than this,
	 * to prevent overwrites.
	 */
	save_omap_boot_params();

	/* Prepare console output */
	preloader_console_init();

#if defined(CONFIG_SPL_NAND_SUPPORT) || defined(CONFIG_SPL_ONENAND_SUPPORT)
	gpmc_init();
#endif
#ifdef CONFIG_SPL_I2C_SUPPORT
	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
#endif
#if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW_SUPPORT)
	arch_misc_init();
#endif
#if defined(CONFIG_HW_WATCHDOG)
	hw_watchdog_init();
#endif
#ifdef CONFIG_AM33XX
	am33xx_spl_board_init();
#endif
}
Ejemplo n.º 3
0
void board_init_f(ulong dummy)
{
	ccgr_init();

	arch_cpu_init();

	gpr_init();

	/* setup GP timer */
	timer_init();

	displ5_set_iomux_uart_spl();

	/* UART clocks enabled and gd valid - init serial console */
	preloader_console_init();

	displ5_init_ecspi();

	/* DDR initialization */
	spl_dram_init();

	/* Clear the BSS. */
	memset(__bss_start, 0, __bss_end - __bss_start);

	displ5_set_iomux_misc_spl();

	/* Initialize and reset WDT in SPL */
	hw_watchdog_init();
	WATCHDOG_RESET();

	/* load/boot image from boot device */
	board_init_r(NULL, 0);
}
Ejemplo n.º 4
0
/*
 * Basic board specific setup.  Pinmux has been handled already.
 */
int board_init(void)
{
#if defined(CONFIG_HW_WATCHDOG)
	hw_watchdog_init();
#endif /* defined(CONFIG_HW_WATCHDOG) */
	i2c_set_bus_num(0);
	if (read_eeprom() < 0)
		puts("Could not get board ID.\n");
#ifdef CONFIG_MACH_TYPE
	gd->bd->bi_arch_number = CONFIG_MACH_TYPE;
#endif
	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;

#ifdef CONFIG_FACTORYSET
	factoryset_read_eeprom(CONFIG_SYS_I2C_EEPROM_ADDR);
#endif

	gpmc_init();

#ifdef CONFIG_NAND_CS_INIT
	board_nand_cs_init();
#endif
#ifdef CONFIG_VIDEO
	board_video_init();
#endif

	return 0;
}
Ejemplo n.º 5
0
void tn_reset_int_handler()
{

    hw_watchdog_init();

    tn_cpu_int_disable(); // switched back in tn_start_system();

#ifdef BOOT_LOADER
    hw_delay(BOOT_DELAY);
#endif // BOOT_LOADER

#ifdef DEBUG
    hw_delay(1000000); // DEBUG delay 1000 mS
#endif // DEBUG

#ifndef BOOT_LOADER
        // Set system clock to 80 MHz
        MAP_SysCtlClockSet(SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ | SYSCTL_SYSDIV_2_5 | SYSCTL_INT_OSC_DIS | SYSCTL_INT_PIOSC_DIS);

        // Set system clock to 50 MHz
        //MAP_SysCtlClockSet(SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ | SYSCTL_SYSDIV_4 | SYSCTL_INT_OSC_DIS | SYSCTL_INT_PIOSC_DIS);
#endif // BOOT_LOADER


    __iar_program_start();
}
Ejemplo n.º 6
0
int board_late_init(void)
{
#ifdef CONFIG_HW_WATCHDOG
	hw_watchdog_init();
#endif

	return 0;
}
Ejemplo n.º 7
0
Archivo: board.c Proyecto: sysplay/bbb
/*
 * Basic board specific setup.  Pinmux has been handled already.
 */
int board_init(void)
{
#if defined(CONFIG_HW_WATCHDOG)
	hw_watchdog_init();
#endif

	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
	return 0;
}
Ejemplo n.º 8
0
static int init_func_watchdog_init(void)
{
# if defined(CONFIG_HW_WATCHDOG) && (defined(CONFIG_BLACKFIN) || \
	defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \
	defined(CONFIG_SH) || defined(CONFIG_AT91SAM9_WATCHDOG))
	hw_watchdog_init();
# endif
	puts("       Watchdog enabled\n");
	WATCHDOG_RESET();

	return 0;
}
Ejemplo n.º 9
0
static int init_func_watchdog_init(void)
{
# if defined(CONFIG_HW_WATCHDOG) && \
	(defined(CONFIG_M68K) || defined(CONFIG_MICROBLAZE) || \
	defined(CONFIG_SH) || defined(CONFIG_AT91SAM9_WATCHDOG) || \
	defined(CONFIG_DESIGNWARE_WATCHDOG) || \
	defined(CONFIG_IMX_WATCHDOG))
	hw_watchdog_init();
	puts("       Watchdog enabled\n");
# endif
	WATCHDOG_RESET();

	return 0;
}
Ejemplo n.º 10
0
void spl_board_init(void)
{
#ifdef CONFIG_SPL_NAND_SUPPORT
	gpmc_init();
#endif
#if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW_SUPPORT)
	arch_misc_init();
#endif
#if defined(CONFIG_HW_WATCHDOG)
	hw_watchdog_init();
#endif
#ifdef CONFIG_AM33XX
	am33xx_spl_board_init();
#endif
}
Ejemplo n.º 11
0
int board_late_init(void)
{
	u32 val;
	struct pmic *p;
	int ret;

	ret = pmic_init(I2C_PMIC);
	if (ret)
		return ret;

	p = pmic_get("FSL_PMIC");
	if (!p)
		return -ENODEV;
	/* Enable RTC battery */
	pmic_reg_read(p, REG_POWER_CTL0, &val);
	pmic_reg_write(p, REG_POWER_CTL0, val | COINCHEN);
	pmic_reg_write(p, REG_INT_STATUS1, RTCRSTI);
#ifdef CONFIG_HW_WATCHDOG
	hw_watchdog_init();
#endif
	return 0;
}
Ejemplo n.º 12
0
void board_init_f(ulong not_used)
{
    bd_t *bd;
    init_fnc_t **init_fnc_ptr;
    gd = (gd_t *)(CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET);
    bd = (bd_t *)(CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET
                  - GENERATED_BD_INFO_SIZE);
#if defined(CONFIG_CMD_FLASH) && !defined(CONFIG_SPL_BUILD)
    ulong flash_size = 0;
#endif
    asm ("nop");	/* FIXME gd is not initialize - wait */
    memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
    memset((void *)bd, 0, GENERATED_BD_INFO_SIZE);
    gd->bd = bd;
    gd->baudrate = CONFIG_BAUDRATE;
    bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
    bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
    gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */

    monitor_flash_len = __end - __text_start;

#ifdef CONFIG_OF_EMBED
    /* Get a pointer to the FDT */
    gd->fdt_blob = __dtb_dt_begin;
#elif defined CONFIG_OF_SEPARATE
    /* FDT is at end of image */
    gd->fdt_blob = (void *)__end;
#endif

#ifndef CONFIG_SPL_BUILD
    /* Allow the early environment to override the fdt address */
    gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
                                        (uintptr_t)gd->fdt_blob);
#endif

    /*
     * The Malloc area is immediately below the monitor copy in DRAM
     * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off
     * as our monitory code is run from SDRAM
     */
    mem_malloc_init(CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN);

    serial_initialize();

#ifdef CONFIG_XILINX_TB_WATCHDOG
    hw_watchdog_init();
#endif
    for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
        WATCHDOG_RESET();
        if ((*init_fnc_ptr) () != 0)
            hang();
    }

#ifndef CONFIG_SPL_BUILD
#ifdef CONFIG_OF_CONTROL
    /* For now, put this check after the console is ready */
    if (fdtdec_prepare_fdt())
        panic("** No FDT - please see doc/README.fdt-control");
    else
        printf("DTB: 0x%x\n", (u32)gd->fdt_blob);
#endif

    puts("SDRAM :\n");
    printf("\t\tIcache:%s\n", icache_status() ? "ON" : "OFF");
    printf("\t\tDcache:%s\n", dcache_status() ? "ON" : "OFF");
    printf("\tU-Boot Start:0x%08x\n", CONFIG_SYS_TEXT_BASE);

#if defined(CONFIG_CMD_FLASH)
    puts("Flash: ");
    bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
    flash_size = flash_init();
    if (bd->bi_flashstart && flash_size > 0) {
# ifdef CONFIG_SYS_FLASH_CHECKSUM
        print_size(flash_size, "");
        /*
         * Compute and print flash CRC if flashchecksum is set to 'y'
         *
         * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX
         */
        if (getenv_yesno("flashchecksum") == 1) {
            printf("  CRC: %08X",
                   crc32(0, (const u8 *)bd->bi_flashstart,
                         flash_size)
                  );
        }
        putc('\n');
# else	/* !CONFIG_SYS_FLASH_CHECKSUM */
        print_size(flash_size, "\n");
# endif /* CONFIG_SYS_FLASH_CHECKSUM */
        bd->bi_flashsize = flash_size;
        bd->bi_flashoffset = bd->bi_flashstart + flash_size;
    } else {
        puts("Flash init FAILED");
        bd->bi_flashstart = 0;
        bd->bi_flashsize = 0;
        bd->bi_flashoffset = 0;
    }
#endif

#ifdef CONFIG_SPI
    spi_init();
#endif

    /* relocate environment function pointers etc. */
    env_relocate();

    /* Initialize stdio devices */
    stdio_init();

    /* Initialize the jump table for applications */
    jumptable_init();

    /* Initialize the console (after the relocation and devices init) */
    console_init_r();

    board_init();

    /* Initialize from environment */
    load_addr = getenv_ulong("loadaddr", 16, load_addr);

#if defined(CONFIG_CMD_NET)
    printf("Net:   ");
    eth_initialize(gd->bd);

    uchar enetaddr[6];
    eth_getenv_enetaddr("ethaddr", enetaddr);
    printf("MAC:   %pM\n", enetaddr);
#endif

    /* main_loop */
    for (;;) {
        WATCHDOG_RESET();
        main_loop();
    }
#endif /* CONFIG_SPL_BUILD */
}