2 * Code for early processor initialization
4 * Copyright (c) 2004-2011 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
9 #ifndef __BFIN_INITCODE_H__
10 #define __BFIN_INITCODE_H__
12 #include <asm/mach-common/bits/bootrom.h>
14 #ifndef BFIN_IN_INITCODE
15 # define serial_putc(c)
18 #ifndef CONFIG_EBIU_RSTCTL_VAL
19 # define CONFIG_EBIU_RSTCTL_VAL 0 /* only MDDRENABLE is useful */
21 #if ((CONFIG_EBIU_RSTCTL_VAL & 0xFFFFFFC4) != 0)
22 # error invalid EBIU_RSTCTL value: must not set reserved bits
25 #ifndef CONFIG_EBIU_MBSCTL_VAL
26 # define CONFIG_EBIU_MBSCTL_VAL 0
29 #if defined(CONFIG_EBIU_DDRQUE_VAL) && ((CONFIG_EBIU_DDRQUE_VAL & 0xFFFF8000) != 0)
30 # error invalid EBIU_DDRQUE value: must not set reserved bits
33 __attribute__((always_inline)) static inline void
34 program_async_controller(ADI_BOOT_DATA *bs)
36 #ifdef BFIN_IN_INITCODE
38 * We really only need to setup the async banks early if we're
39 * booting out of it. Otherwise, do it later on in cpu_init.
41 if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS &&
42 CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_PARA)
48 /* Program the async banks controller. */
49 bfin_write_EBIU_AMBCTL0(CONFIG_EBIU_AMBCTL0_VAL);
50 bfin_write_EBIU_AMBCTL1(CONFIG_EBIU_AMBCTL1_VAL);
51 bfin_write_EBIU_AMGCTL(CONFIG_EBIU_AMGCTL_VAL);
55 /* Not all parts have these additional MMRs. */
57 bfin_write_EBIU_MBSCTL(CONFIG_EBIU_MBSCTL_VAL);
60 # ifdef CONFIG_EBIU_MODE_VAL
61 bfin_write_EBIU_MODE(CONFIG_EBIU_MODE_VAL);
63 # ifdef CONFIG_EBIU_FCTL_VAL
64 bfin_write_EBIU_FCTL(CONFIG_EBIU_FCTL_VAL);