From patchwork Thu Jul 24 02:47:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 373097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4F88D140199 for ; Thu, 24 Jul 2014 13:02:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B765DA7609; Thu, 24 Jul 2014 05:02:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gemIrbl7etoA; Thu, 24 Jul 2014 05:02:22 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2BD70A769F; Thu, 24 Jul 2014 05:02:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 57369A769F for ; Thu, 24 Jul 2014 05:02:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g5HyMacoDJ1T for ; Thu, 24 Jul 2014 05:02:12 +0200 (CEST) X-Greylist: delayed 897 seconds by postgrey-1.27 at theia; Thu, 24 Jul 2014 05:02:08 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0207.outbound.protection.outlook.com [207.46.163.207]) by theia.denx.de (Postfix) with ESMTPS id 48483A7609 for ; Thu, 24 Jul 2014 05:02:08 +0200 (CEST) Received: from CH1PR03CA012.namprd03.prod.outlook.com (10.255.156.157) by DM2PR03MB366.namprd03.prod.outlook.com (10.141.55.18) with Microsoft SMTP Server (TLS) id 15.0.995.14; Thu, 24 Jul 2014 02:47:09 +0000 Received: from BY2FFO11FD012.protection.gbl (10.255.156.132) by CH1PR03CA012.outlook.office365.com (10.255.156.157) with Microsoft SMTP Server (TLS) id 15.0.990.7 via Frontend Transport; Thu, 24 Jul 2014 02:47:08 +0000 Received: from nwd2mta1.analog.com (137.71.25.55) by BY2FFO11FD012.mail.protection.outlook.com (10.1.14.130) with Microsoft SMTP Server (TLS) id 15.0.980.11 via Frontend Transport; Thu, 24 Jul 2014 02:47:08 +0000 Received: from NWD2HUBCAS8.ad.analog.com (nwd2hubcas8.ad.analog.com [10.64.72.141]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id s6O2kZXi029418 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 23 Jul 2014 19:46:35 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS8.ad.analog.com (10.64.72.141) with Microsoft SMTP Server id 14.3.158.1; Wed, 23 Jul 2014 22:45:55 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id s6O2jqbq027957; Wed, 23 Jul 2014 22:45:53 -0400 Received: from nine.ad.analog.com (unknown [10.99.24.98]) by linux.site (Postfix) with ESMTP id 61DF23AEB6DC; Wed, 23 Jul 2014 12:43:58 -0600 (MDT) From: Sonic Zhang To: Tom Rini , Wolfgang Denk Date: Thu, 24 Jul 2014 10:47:02 +0800 Message-ID: <1406170022-25020-2-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1406170022-25020-1-git-send-email-sonic.adi@gmail.com> References: <1406170022-25020-1-git-send-email-sonic.adi@gmail.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130506436284219896; (52f37747-95c3-483a-bd05-08d153b03fac); () X-Forefront-Antispam-Report: CIP:137.71.25.55; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(199002)(93916002)(19580405001)(6806004)(89996001)(81442001)(87286001)(83072002)(85852003)(77982001)(79102001)(62966002)(19580395003)(102836001)(44976005)(73972005)(55446002)(20776003)(64706001)(87936001)(36756003)(47776003)(61266001)(92566001)(80022001)(77156001)(88136002)(81542001)(82202001)(81342001)(92726001)(74662001)(33646002)(99396002)(48376002)(50466002)(21056001)(46102001)(229853001)(4396001)(105596002)(31966008)(86362001)(74502001)(73392001)(85306003)(106466001)(95666004)(107046002)(50226001)(87572001)(50986999)(76176999)(104166001)(41533002); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR03MB366; H:nwd2mta1.analog.com; FPR:; MLV:sfv; PTR:nwd2mail10.analog.com; MX:1; A:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 028256169F Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 137.71.25.55 as permitted sender) Authentication-Results: spf=softfail (sender IP is 137.71.25.55) smtp.mailfrom=sonic.adi@gmail.com; Cc: u-boot@lists.denx.de, Sonic Zhang , adi-u-boot-devel@lists.sourceforge.net Subject: [U-Boot] [PATCH 2/2] support blackfin board initialization in generic board_f X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Sonic Zhang - init hardware watchdog if applicable - use CONFIG_SYS_MONITOR_LEN as the gd monitor len for Blackfin - reserve u-boot memory at the top field of the RAM for Blackfin - avoid refer to CONFIG_SYS_MONITOR_LEN, which is not defined by Blackfin Signed-off-by: Sonic Zhang --- common/board_f.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/common/board_f.c b/common/board_f.c index bdab38e..079e1fa 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -107,6 +107,9 @@ __weak void blue_led_off(void) {} #if defined(CONFIG_WATCHDOG) static int init_func_watchdog_init(void) { +#ifdef CONFIG_HW_WATCHDOG + hw_watchdog_init(); +#endif puts(" Watchdog enabled\n"); WATCHDOG_RESET(); @@ -144,7 +147,11 @@ static int display_text_info(void) bss_end = (ulong)&__bss_end; debug("U-Boot code: %08X -> %08lX BSS: -> %08lX\n", +#ifdef CONFIG_SYS_TEXT_BASE CONFIG_SYS_TEXT_BASE, bss_start, bss_end); +#else + CONFIG_SYS_MONITOR_BASE, bss_start, bss_end); +#endif #endif #ifdef CONFIG_MODEM_SUPPORT @@ -259,6 +266,8 @@ static int setup_mon_len(void) gd->mon_len = (ulong)&__bss_end - (ulong)_start; #elif defined(CONFIG_SANDBOX) gd->mon_len = (ulong)&_end - (ulong)_init; +#elif defined(CONFIG_BLACKFIN) + gd->mon_len = CONFIG_SYS_MONITOR_LEN; #else /* TODO: use (ulong)&__bss_end - (ulong)&__text_start; ? */ gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE; @@ -719,7 +728,9 @@ static int reloc_fdt(void) static int setup_reloc(void) { +#ifdef CONFIG_SYS_TEXT_BASE gd->reloc_off = gd->relocaddr - CONFIG_SYS_TEXT_BASE; +#endif memcpy(gd->new_gd, (char *)gd, sizeof(gd_t)); debug("Relocation Offset is: %08lx\n", gd->reloc_off); @@ -802,7 +813,7 @@ static init_fnc_t init_sequence_f[] = { /* TODO: can we rename this to timer_init()? */ init_timebase, #endif -#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) +#if defined(CONFIG_ARM) || defined(CONFIG_MIPS) || defined(CONFIG_BLACKFIN) timer_init, /* initialize timer */ #endif #ifdef CONFIG_SYS_ALLOC_DPRAM @@ -901,6 +912,10 @@ static init_fnc_t init_sequence_f[] = { * - board info struct */ setup_dest_addr, +#if defined(CONFIG_BLACKFIN) + /* Blackfin u-boot monitor should be on top of the ram */ + reserve_uboot, +#endif #if defined(CONFIG_LOGBUFFER) && !defined(CONFIG_ALT_LB_ADDR) reserve_logbuffer, #endif @@ -921,7 +936,9 @@ static init_fnc_t init_sequence_f[] = { && !defined(CONFIG_ARM) && !defined(CONFIG_X86) reserve_video, #endif +#if !defined(CONFIG_BLACKFIN) reserve_uboot, +#endif #ifndef CONFIG_SPL_BUILD reserve_malloc, reserve_board,