From patchwork Mon Dec 1 07:05:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 416308 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 6E04414016A for ; Mon, 1 Dec 2014 18:06:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 320864B7AF; Mon, 1 Dec 2014 08:06:42 +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 fPQ+gm2RX4Xn; Mon, 1 Dec 2014 08:06:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CDA8F4B7FA; Mon, 1 Dec 2014 08:06:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BBA6A4B7C7 for ; Mon, 1 Dec 2014 08:06:36 +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 2uRLT4tBXMxV for ; Mon, 1 Dec 2014 08:06:36 +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 mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by theia.denx.de (Postfix) with ESMTPS id D2FCC4B7D7 for ; Mon, 1 Dec 2014 08:06:26 +0100 (CET) Received: by mail-pd0-f169.google.com with SMTP id fp1so10258925pdb.0 for ; Sun, 30 Nov 2014 23:06:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bBkd0xRoxgvOGZ4EKlsaa3w3vOyAyhG/5p5W/mlsX3o=; b=b/Nhwy7Tm7OpdlvanX3jRidB/G28tWkFMuXSmjlK2VhB+SimZayHZLdZfzqH6VOT9r OlivBwpOWhh+gIpiqB8o06bng/mjDLq3O/FjJ/Mg6/T1gKqNLmG5stsyi0D/K037jznJ /rguDwAJ2jNL3x/2uX78O9+TlXRIlQdUyz4ryEZGHMFSKV/tLZmv37pweJE8QwGo4x4Z AkwufsV9HNvxbSzJqpGlWHz7wgss794P7UMZ3rzRQgyG0OXRRGhs3ecs1maGqz4mwPUT sZ8rVTmWMKKGqQyRq1opgsXC/+SH4R6wK9iTGQ1xMW099hn+bA8LLFK7aJiKs1zCa58E 021g== X-Gm-Message-State: ALoCoQlMK4923D9cikQ/ki1ZGSE2ZZHd2pLmltbmk8PfNA/7ikb0p2IDhO/GJRlf2xGLj5bCpCsS X-Received: by 10.66.253.197 with SMTP id ac5mr77642845pad.152.1417417585424; Sun, 30 Nov 2014 23:06:25 -0800 (PST) Received: from xps-iwamatsu.renesas.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id v7sm12599237pdl.5.2014.11.30.23.06.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 30 Nov 2014 23:06:24 -0800 (PST) From: Nobuhiro Iwamatsu To: u-boot@lists.denx.de, Nobuhiro Iwamatsu Date: Mon, 1 Dec 2014 16:05:53 +0900 Message-Id: <1417417556-23946-4-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1417417556-23946-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> References: <1417417556-23946-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> Cc: Nobuhiro Iwamatsu , Hisashi Nakamura Subject: [U-Boot] [PATCH 4/7] arm: rmobile: lager: Halt clock prior to booting kernel X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Before a kernel boots, GPIO, SYS-DMAC, QSPI and MSIOF clock is halted. Signed-off-by: Hisashi Nakamura Signed-off-by: Nobuhiro Iwamatsu --- board/renesas/lager/lager.c | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c index 47cf51b..077a78f 100644 --- a/board/renesas/lager/lager.c +++ b/board/renesas/lager/lager.c @@ -67,10 +67,49 @@ int board_early_init_f(void) return 0; } +static struct mstp_ctl { + u32 s_addr; + u32 s_dis; + u32 s_ena; + u32 r_addr; + u32 r_dis; + u32 r_ena; +} mstptbl[] = { + [0] = { SMSTPCR0, 0x00640801, 0x00400001, + RMSTPCR0, 0x00640801, 0x00000000 }, + [1] = { SMSTPCR1, 0xDB6E9BDF, 0x00000000, + RMSTPCR1, 0xDB6E9BDF, 0x00000000 }, + [2] = { SMSTPCR2, 0x300DA1FC, 0x000CA120, + RMSTPCR2, 0x300DA1FC, 0x00000000 }, + [3] = { SMSTPCR3, 0xF08CF831, 0x00000000, + RMSTPCR3, 0xF08CF831, 0x00000000 }, + [4] = { SMSTPCR4, 0x80000184, 0x00000180, + RMSTPCR4, 0x80000184, 0x00000000 }, + [5] = { SMSTPCR5, 0x44C00046, 0x00000000, + RMSTPCR5, 0x44C00046, 0x00000000 }, + [7] = { SMSTPCR7, 0x07F30718, 0x00200000, + RMSTPCR7, 0x07F30718, 0x00000000 }, + [8] = { SMSTPCR8, 0x01F0FF84, 0x00000000, + RMSTPCR8, 0x01F0FF84, 0x00000000 }, + [9] = { SMSTPCR9, 0xF5979FCF, 0x00021F80, + RMSTPCR9, 0xF5979FCF, 0x00001F80 }, + [10] = { SMSTPCR10, 0xFFFEFFE0, 0x00000000, + RMSTPCR10, 0xFFFEFFE0, 0x00000000 }, + [11] = { SMSTPCR11, 0x00000000, 0x00000000, + RMSTPCR11, 0x00000000, 0x00000000 }, +}; + void arch_preboot_os(void) { - /* Disable TMU0 */ - mstp_setbits_le32(MSTPSR1, SMSTPCR1, TMU0_MSTP125); + int i; + + /* Stop all module clock */ + for (i = 0; i < ARRAY_SIZE(mstptbl); i++) { + mstp_setclrbits_le32(mstptbl[i].s_addr, mstptbl[i].s_addr, + mstptbl[i].s_dis, mstptbl[i].s_ena); + mstp_setclrbits_le32(mstptbl[i].r_addr, mstptbl[i].r_addr, + mstptbl[i].r_dis, mstptbl[i].r_ena); + } } DECLARE_GLOBAL_DATA_PTR;