From: Mike Frysinger Date: Tue, 3 Feb 2009 19:08:01 -0500 Subject: [U-Boot] [PATCH 4/7] Blackfin: check for reserved settings in DDR MMRs In-Reply-To: <1233706084-26831-1-git-send-email-vapier@gentoo.org> References: <1233706084-26831-1-git-send-email-vapier@gentoo.org> Message-ID: <1233706084-26831-5-git-send-email-vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Some bits of the DDR MMRs should not be set. If they do, bad things may happen (like random failures or hardware destruction). Signed-off-by: Mike Frysinger --- cpu/blackfin/initcode.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/cpu/blackfin/initcode.c b/cpu/blackfin/initcode.c index ffa5f61..a6e95f4 100644 --- a/cpu/blackfin/initcode.c +++ b/cpu/blackfin/initcode.c @@ -168,11 +168,18 @@ static inline void serial_putc(char c) #ifndef CONFIG_EBIU_RSTCTL_VAL # define CONFIG_EBIU_RSTCTL_VAL 0 /* only MDDRENABLE is useful */ #endif +#if ((CONFIG_EBIU_RSTCTL_VAL & 0xFFFFFFC4) != 0) +# error invalid EBIU_RSTCTL value: must not set reserved bits +#endif #ifndef CONFIG_EBIU_MBSCTL_VAL # define CONFIG_EBIU_MBSCTL_VAL 0 #endif +#if defined(CONFIG_EBIU_DDRQUE_VAL) && ((CONFIG_EBIU_DDRQUE_VAL & 0xFFFF8000) != 0) +# error invalid EBIU_DDRQUE value: must not set reserved bits +#endif + /* Make sure our voltage value is sane so we don't blow up! */ #ifndef CONFIG_VR_CTL_VAL # define BFIN_CCLK ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / CONFIG_CCLK_DIV) -- 1.6.1.2