From patchwork Tue Feb 3 12:22:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 435878 X-Patchwork-Delegate: trini@ti.com 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 1D4E61401D0 for ; Tue, 3 Feb 2015 23:26:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 23E524B66A; Tue, 3 Feb 2015 13:25:09 +0100 (CET) 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 mrj1OX974-r8; Tue, 3 Feb 2015 13:25:09 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 733504B585; Tue, 3 Feb 2015 13:24:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A428D4B712 for ; Tue, 3 Feb 2015 13:23:38 +0100 (CET) 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 46JIVN188x0E for ; Tue, 3 Feb 2015 13:23:38 +0100 (CET) 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 s15287728.onlinehome-server.info (hamspirit.at [87.106.47.214]) by theia.denx.de (Postfix) with ESMTP id 9357E4B6E6 for ; Tue, 3 Feb 2015 13:23:19 +0100 (CET) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by s15287728.onlinehome-server.info (Postfix) with ESMTP id 4F8658F480CB; Tue, 3 Feb 2015 12:23:19 +0000 (UTC) Received: from s15287728.onlinehome-server.info ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id USFPS9wP46Bl; Tue, 3 Feb 2015 12:23:19 +0000 (UTC) Received: from hannes-werkstatt.scm.lan (188-23-125-177.adsl.highway.telekom.at [188.23.125.177]) by s15287728.onlinehome-server.info (Postfix) with ESMTP id 93A078F480D9; Tue, 3 Feb 2015 12:23:06 +0000 (UTC) From: Hannes Petermaier To: u-boot@lists.denx.de Date: Tue, 3 Feb 2015 13:22:42 +0100 Message-Id: <1422966166-3973-20-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1422966166-3973-1-git-send-email-oe5hpm@oevsv.at> References: <1422966166-3973-1-git-send-email-oe5hpm@oevsv.at> Subject: [U-Boot] [PATCH v2 20/24] board/BuR/kwb: Form a bootline for vxWorks X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" vxWorks needs several parameters which are set by the bootloader und his environment. So we form a vxWorks bootline and pass the result to vxWorks on a predefined address. Signed-off-by: Hannes Petermaier --- Changes for V2: None --- board/BuR/kwb/board.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c index 30900bc..455f472 100644 --- a/board/BuR/kwb/board.c +++ b/board/BuR/kwb/board.c @@ -47,6 +47,12 @@ #define RSTCTRL_FORCE_PWR_NEN 0x0404 #define RSTCTRL_CAN_STB 0x4040 +#define VXWORKS_BOOTLINE 0x80001100 +#define DEFAULT_BOOTLINE "cpsw(0,0):pme/vxWorks" +#define VXWORKS_USER "u=vxWorksFTP pw=vxWorks tn=vxtarget" + +DECLARE_GLOBAL_DATA_PTR; + #if defined(CONFIG_SPL_BUILD) /* TODO: check ram-timing ! */ static const struct ddr_data ddr3_data = { @@ -248,6 +254,30 @@ int board_late_init(void) } else { puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n"); } + /* setup vxworks bootline */ + char *vxworksbootline = (char *)VXWORKS_BOOTLINE; + + /* setup default IP, in case if there is nothing in environment */ + if (!getenv("ipaddr")) { + setenv("ipaddr", "192.168.60.1"); + setenv("netmask", "255.255.255.0"); + setenv("serverip", "192.168.60.254"); + setenv("gatewayip", "192.168.60.254"); + puts("net: had no IP! made default setup.\n"); + } + + sprintf(vxworksbootline, + "%s h=%s e=%s:%s g=%s %s o=0x%08x;0x%08x;0x%08x;0x%08x", + DEFAULT_BOOTLINE, + getenv("serverip"), + getenv("ipaddr"), getenv("netmask"), + getenv("gatewayip"), + VXWORKS_USER, + (unsigned int) gd->fb_base-0x20, + (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20), + (u32)getenv_ulong("vx_romfsbase", 16, 0), + (u32)getenv_ulong("vx_romfssize", 16, 0)); + /* * reset VBAR registers to its reset location, VxWorks 6.9.3.2 does * expect that vectors are there, original u-boot moves them to _start