From patchwork Wed Mar 6 05:41:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inderpal Singh X-Patchwork-Id: 15247 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 07B9E23E67 for ; Wed, 6 Mar 2013 05:41:37 +0000 (UTC) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by fiordland.canonical.com (Postfix) with ESMTP id 9C0ECA18F9B for ; Wed, 6 Mar 2013 05:41:36 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id cz11so6404384veb.31 for ; Tue, 05 Mar 2013 21:41:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=PhQmrhWjZ+870b7lfbecPxAqQah6Ok98Zh5AcnYCfqg=; b=c8bdWnEQu5+hdvOqkH10obdGENM/xJUzZcJ7YOPk2Rn4L9m0tODcAy5O74kVYVbXne gXFwpbcefYxBLI/LR7UG9izjNGxUHFu4MAQGrv630Z3W1sbFCO8yO/LLNxh8smSTPTU/ BiGELSwstSpESz104Dj10lQBCJMZituDv04q6XQawH0AVzmilHOdB8jkeoooKODlG3wh tpZjsF+ztFhScMCEufuwVCF+4a2Cb3l5d40u1Krt+6HUscHdYx3sANCca91OhMBZlePi 7V80KQHtEVnN1JBU0T1t+1PhXbcaE3hmaP7yvPmQwbw7hWKRsecouhM2gVZIJWd//WVn RzkQ== X-Received: by 10.220.149.82 with SMTP id s18mr10797951vcv.14.1362548496062; Tue, 05 Mar 2013 21:41:36 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp151762veb; Tue, 5 Mar 2013 21:41:35 -0800 (PST) X-Received: by 10.68.136.42 with SMTP id px10mr43791245pbb.32.1362548494972; Tue, 05 Mar 2013 21:41:34 -0800 (PST) Received: from mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) by mx.google.com with ESMTPS id pu7si31305918pbc.322.2013.03.05.21.41.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Mar 2013 21:41:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.42 is neither permitted nor denied by best guess record for domain of inderpal.singh@linaro.org) client-ip=209.85.160.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.42 is neither permitted nor denied by best guess record for domain of inderpal.singh@linaro.org) smtp.mail=inderpal.singh@linaro.org Received: by mail-pb0-f42.google.com with SMTP id xb4so5495165pbc.15 for ; Tue, 05 Mar 2013 21:41:34 -0800 (PST) X-Received: by 10.68.189.65 with SMTP id gg1mr13399663pbc.122.1362548493867; Tue, 05 Mar 2013 21:41:33 -0800 (PST) Received: from inder-ubuntu.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id xr3sm29752958pbc.46.2013.03.05.21.41.31 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Mar 2013 21:41:33 -0800 (PST) From: Inderpal Singh To: u-boot@lists.denx.de Cc: patches@linaro.org Subject: [PATCH 2/3] exynos: update tzpc_init to make it common for exynos4 and exynos5 Date: Wed, 6 Mar 2013 11:11:18 +0530 Message-Id: <1362548479-19132-3-git-send-email-inderpal.singh@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1362548479-19132-1-git-send-email-inderpal.singh@linaro.org> References: <1362548479-19132-1-git-send-email-inderpal.singh@linaro.org> X-Gm-Message-State: ALoCoQnni2tCHXtvwFQHN5eyMol7jL9aGUXpof9gGF5prWGxbL4Kk20bdrVXsQMHti1AdcnbK50l 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 --- 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..136e0d2 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, end; - 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