blob: 9dbafcdcf4791e3ba7eb8522cf1b6de911c05b0a [file] [log] [blame]
Robin Getzf16295e2007-08-03 18:07:17 +08001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Do some checking to make sure things are OK
Robin Getzf16295e2007-08-03 18:07:17 +08003 *
Robin Getz96f10502009-09-24 14:11:24 +00004 * Copyright 2007-2009 Analog Devices Inc.
Robin Getzf16295e2007-08-03 18:07:17 +08005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Licensed under the GPL-2 or later.
Robin Getzf16295e2007-08-03 18:07:17 +08007 */
8
Mike Frysinger13752042008-08-06 17:10:57 +08009#include <asm/fixed_code.h>
Bryan Wu639f6572008-08-27 10:51:02 +080010#include <mach/anomaly.h>
11#include <asm/clocks.h>
Robin Getzf16295e2007-08-03 18:07:17 +080012
13#ifdef CONFIG_BFIN_KERNEL_CLOCK
14
15# if (CONFIG_VCO_HZ > CONFIG_MAX_VCO_HZ)
16# error "VCO selected is more than maximum value. Please change the VCO multipler"
17# endif
18
19# if (CONFIG_SCLK_HZ > CONFIG_MAX_SCLK_HZ)
20# error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
21# endif
22
23# if (CONFIG_SCLK_HZ < CONFIG_MIN_SCLK_HZ)
24# error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
25# endif
26
27# if (ANOMALY_05000273) && (CONFIG_SCLK_HZ * 2 > CONFIG_CCLK_HZ)
28# error "ANOMALY 05000273, please make sure CCLK is at least 2x SCLK"
29# endif
30
31# if (CONFIG_SCLK_HZ > CONFIG_CCLK_HZ) && (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ) && (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
32# error "Please select sclk less than cclk"
33# endif
34
35#endif /* CONFIG_BFIN_KERNEL_CLOCK */
Mike Frysinger13752042008-08-06 17:10:57 +080036
37#if CONFIG_BOOT_LOAD < FIXED_CODE_END
38# error "The kernel load address must be after the fixed code section"
39#endif
40
41#if (CONFIG_BOOT_LOAD & 0x3)
42# error "The kernel load address must be 4 byte aligned"
43#endif
Mike Frysingerf7e989a2009-03-05 17:33:36 +080044
45/* The entire kernel must be able to make a 24bit pcrel call to start of L1 */
46#if ((0xffffffff - L1_CODE_START + 1) + CONFIG_BOOT_LOAD) > 0x1000000
47# error "The kernel load address is too high; keep it below 10meg for safety"
48#endif
Robin Getz00049522009-03-05 18:18:49 +080049
Mike Frysinger357fd372009-03-06 00:24:01 +080050#if ANOMALY_05000448
51# error You are using a part with anomaly 05000448, this issue causes random memory read/write failures - that means random crashes.
Robin Getz00049522009-03-05 18:18:49 +080052#endif
Graf Yang5ba76672009-05-07 04:09:15 +000053
54/* if 220 exists, can not set External Memory WB and L2 not_cached, either External Memory not_cached and L2 WB */
55#if ANOMALY_05000220 && \
Jie Zhang41ba6532009-06-16 09:48:33 +000056 ((defined(CONFIG_BFIN_EXTMEM_WRITEBACK) && !defined(CONFIG_BFIN_L2_DCACHEABLE)) || \
57 (!defined(CONFIG_BFIN_EXTMEM_DCACHEABLE) && defined(CONFIG_BFIN_L2_WRITEBACK)))
Graf Yang5ba76672009-05-07 04:09:15 +000058# error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB.
59#endif