From patchwork Mon Sep 26 07:08:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Albert ARIBAUD (3ADEV)" X-Patchwork-Id: 674976 X-Patchwork-Delegate: sbabic@denx.de 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 3sjFTM2c4zz9ryZ for ; Mon, 26 Sep 2016 17:09:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DADF3B38D5; Mon, 26 Sep 2016 09:09:36 +0200 (CEST) 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 s2hdmVtYhqWL; Mon, 26 Sep 2016 09:09:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AEA38B38DC; Mon, 26 Sep 2016 09:09:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 048EEB38D6 for ; Mon, 26 Sep 2016 09:09:33 +0200 (CEST) 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 jFFHtpsmv2FH for ; Mon, 26 Sep 2016 09:09:32 +0200 (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 smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by theia.denx.de (Postfix) with ESMTPS id 7F8CCB38C4 for ; Mon, 26 Sep 2016 09:09:25 +0200 (CEST) Received: from localhost.localdomain (unknown [37.162.148.156]) (Authenticated sender: aribaud.smtp) by smtp3-g21.free.fr (Postfix) with ESMTPSA id 77A3D13F89D; Mon, 26 Sep 2016 09:09:20 +0200 (CEST) From: "Albert ARIBAUD (3ADEV)" To: u-boot@lists.denx.de Date: Mon, 26 Sep 2016 09:08:05 +0200 Message-Id: <20160926070808.17021-4-albert.aribaud@3adev.fr> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160926070808.17021-3-albert.aribaud@3adev.fr> References: <20160926070808.17021-1-albert.aribaud@3adev.fr> <20160926070808.17021-2-albert.aribaud@3adev.fr> <20160926070808.17021-3-albert.aribaud@3adev.fr> Cc: "Albert ARIBAUD \(3ADEV\)" Subject: [U-Boot] [PATCH 3/6] pcm052: add 'm4go' command 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" Add the 'm4go' command to pcm052-based targets. It loads scatter file images. Signed-off-by: Albert ARIBAUD (3ADEV) --- board/phytec/pcm052/pcm052.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/board/phytec/pcm052/pcm052.c b/board/phytec/pcm052/pcm052.c index e4f61e1..7341899 100644 --- a/board/phytec/pcm052/pcm052.c +++ b/board/phytec/pcm052/pcm052.c @@ -513,3 +513,41 @@ int checkboard(void) return 0; } + +static int do_m4go(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + ulong addr; + + /* Consume 'm4go' */ + argc--; argv++; + + /* + * Parse provided address - default to load_addr in case not provided. + */ + + if (argc) + addr = simple_strtoul(argv[0], NULL, 16); + else + addr = load_addr; + + /* + * Write boot address in PERSISTENT_ENTRY1[31:0] aka SRC_GPR2[31:0] + */ + writel(addr + 0x401, 0x4006E028); + + /* + * Start secondary processor by enabling its clock + */ + writel(0x15a5a, 0x4006B08C); + + return 1; +} + +U_BOOT_CMD( + m4go, 2 /* one arg max */, 1 /* repeatable */, do_m4go, + "start the secondary Cortex-M4 from scatter file image", + "[]\n" + " - start secondary Cortex-M4 core using a scatter file image\n" + "The argument needs to be a scatter file\n" +);