From patchwork Fri Mar 15 06:23:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inderpal Singh X-Patchwork-Id: 227854 X-Patchwork-Delegate: promsoft@gmail.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 EE1D02C00A7 for ; Fri, 15 Mar 2013 17:24:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE6F04A15B; Fri, 15 Mar 2013 07:24:11 +0100 (CET) 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 eWHZtQPtRKGc; Fri, 15 Mar 2013 07:24:11 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E8244A15C; Fri, 15 Mar 2013 07:23:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9320F4A151 for ; Fri, 15 Mar 2013 07:23:50 +0100 (CET) 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 B9+jq71PxCzR for ; Fri, 15 Mar 2013 07:23:49 +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-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by theia.denx.de (Postfix) with ESMTPS id 5F3AD4A157 for ; Fri, 15 Mar 2013 07:23:39 +0100 (CET) Received: by mail-pb0-f49.google.com with SMTP id xa12so3415009pbc.36 for ; Thu, 14 Mar 2013 23:23:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=iGdHL0LF+nL7A6jeTzLWjdu8MCthhPCxycKmd1HG05k=; b=BEG2zfrNsHkDoGNvBRVyIdJxl5zhYOF68j16DK55SVnPZCngeZcopNFT5UatI895tL vHeOWqUvNJ3akQjAWEhX1T7BcP48CiH0Hlal2upyqp9o9dzW0tN1wLJLLwuatkSey1Q3 nawRW1igLLMU6WuklsU/3VD833AlXN2O5XTuwzQZnJ0T2tkxrHbeHQ3S/tbn4sYagSD+ OHWcQmMAoitChtvKCuCzUIahmKQrwGBN4M1ZcWnhipHxjCHDGAOt84bJULjgVjY8CZ85 AxjH3rxLv7DmHFDEEGxr17YG9O7Wtha+XxmxTJaP4Vl+X09wJQh5L4oiaDEAnrOH81Wa 5cOA== X-Received: by 10.68.25.201 with SMTP id e9mr12758235pbg.145.1363328617665; Thu, 14 Mar 2013 23:23:37 -0700 (PDT) Received: from inder-ubuntu.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id qp13sm7145601pbb.3.2013.03.14.23.23.34 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Mar 2013 23:23:36 -0700 (PDT) From: Inderpal Singh To: u-boot@lists.denx.de Date: Fri, 15 Mar 2013 11:53:21 +0530 Message-Id: <1363328602-5676-3-git-send-email-inderpal.singh@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363328602-5676-1-git-send-email-inderpal.singh@linaro.org> References: <1363328602-5676-1-git-send-email-inderpal.singh@linaro.org> X-Gm-Message-State: ALoCoQnF/LaaMuC753OzAeTyGp0cTtgqVXrkwETNr25xSZdOfjRx+As6ZYOsk8fBE9JWqZd/QRdQ Cc: patches@linaro.org Subject: [U-Boot] [PATCH v2 2/3] exynos: update tzpc_init to make it common for exynos4 and exynos5 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This requires that cpu_is_exynos4/5 should be made available before tzpc_init. Hence this patch also makes necessary changes to have cpu_info in spl and invokes arch_cpu_init before tzpc_init in low_level_init.S for smdk5250. Signed-off-by: Inderpal Singh Acked-by: Chander Kashyap --- arch/arm/cpu/armv7/exynos/tzpc_init.c | 15 ++++++++++++--- arch/arm/cpu/armv7/s5p-common/Makefile | 2 ++ board/samsung/smdk5250/lowlevel_init.S | 2 ++ spl/Makefile | 4 ++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/tzpc_init.c b/arch/arm/cpu/armv7/exynos/tzpc_init.c index 81adb4b..5204fb1 100644 --- a/arch/arm/cpu/armv7/exynos/tzpc_init.c +++ b/arch/arm/cpu/armv7/exynos/tzpc_init.c @@ -22,6 +22,7 @@ * MA 02111-1307 USA */ +#include #include #include @@ -29,12 +30,20 @@ void tzpc_init(void) { struct exynos_tzpc *tzpc; - unsigned int addr; + unsigned int addr, start = 0, end = 0; - for (addr = TZPC0_BASE; addr <= TZPC9_BASE; addr += TZPC_BASE_OFFSET) { + if (cpu_is_exynos5()) { + start = TZPC0_BASE; + end = TZPC9_BASE; + } else if (cpu_is_exynos4()) { + start = TZPC1_BASE; + end = TZPC6_BASE; + } + + for (addr = start; addr <= end; addr += TZPC_BASE_OFFSET) { tzpc = (struct exynos_tzpc *)addr; - if (addr == TZPC0_BASE) + if (addr == start) writel(R0SIZE, &tzpc->r0size); writel(DECPROTXSET, &tzpc->decprot0set); diff --git a/arch/arm/cpu/armv7/s5p-common/Makefile b/arch/arm/cpu/armv7/s5p-common/Makefile index 1705399..0c38bd0 100644 --- a/arch/arm/cpu/armv7/s5p-common/Makefile +++ b/arch/arm/cpu/armv7/s5p-common/Makefile @@ -26,9 +26,11 @@ include $(TOPDIR)/config.mk LIB = $(obj)libs5p-common.o COBJS-y += cpu_info.o +ifndef CONFIG_SPL_BUILD COBJS-y += timer.o COBJS-y += sromc.o COBJS-$(CONFIG_PWM) += pwm.o +endif SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS-y) $(SOBJS)) diff --git a/board/samsung/smdk5250/lowlevel_init.S b/board/samsung/smdk5250/lowlevel_init.S index bc6cb6f..edc565e 100644 --- a/board/samsung/smdk5250/lowlevel_init.S +++ b/board/samsung/smdk5250/lowlevel_init.S @@ -75,12 +75,14 @@ lowlevel_init: bl mem_ctrl_init 1: + bl arch_cpu_init bl tzpc_init ldmia r13!, {ip,pc} wakeup_reset: bl system_clock_init bl mem_ctrl_init + bl arch_cpu_init bl tzpc_init exit_wakeup: diff --git a/spl/Makefile b/spl/Makefile index 101d478..8d33210 100644 --- a/spl/Makefile +++ b/spl/Makefile @@ -92,6 +92,10 @@ LIBS-y += arch/$(ARCH)/cpu/tegra-common/libcputegra-common.o LIBS-y += $(CPUDIR)/tegra-common/libtegra-common.o endif +ifeq ($(SOC),exynos) +LIBS-y += $(CPUDIR)/s5p-common/libs5p-common.o +endif + # Add GCC lib ifeq ("$(USE_PRIVATE_LIBGCC)", "yes") PLATFORM_LIBGCC = $(SPLTREE)/arch/$(ARCH)/lib/libgcc.o