From patchwork Thu May 11 08:28:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 99601 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp563593obb; Thu, 11 May 2017 01:29:15 -0700 (PDT) X-Received: by 10.80.139.65 with SMTP id l59mr7564574edl.52.1494491354939; Thu, 11 May 2017 01:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494491354; cv=none; d=google.com; s=arc-20160816; b=ELKQ+cKqJvMBWgYTYyFLsqUicuoDIp6Lmfzs4H2rjkIVJpEDjA3muwNeQDWZVZ8F9g aFE0Zp7Je/4k6P+Gssm9RRrioT3eopO94M0/hbpVx4eOmhN41NNiCHA9afv3cKGnV17u mo8/YOdD6LiGR2ZRgrBy2x5Vzgz26JSi6et5LMYR5FyRT9BymcMfxQUktqeJTdq/zVB5 PyDW4CIqs3eSkndpsJ7rywVRlMMlwiUqEKO5aG+Z/q48XkQ8u1Ay7aRKmT2Yr68RWOcj aICbZ4yJmzPACdlGVA4qE37XK9AoZ+icdoJ232s0G6nBgLXNgeQwey7G6SaqEZp5gn54 JgXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :dkim-filter:arc-authentication-results; bh=2Q/59ui0E1drd4GNguXXAk3NlhSWNImK8aazUCmbU8k=; b=HzyvEVIfdIfMW2trOFLrZJq9IRi6aP14YfR0AN88G+BLx31xWoMF6YIZM0AI4YJNIk 26NzgxsjOtRy9W4BLVnF574UdM9oyCekxCW/bodUEogZwI6bEfSOawt1BV5iXo2qqyBP lCL+a8qviEW6vpXqsnpPueJA5WObQFLeKnP0XVwzSWKkHxd+IFk+9DrrhuhnAGcyA4nq DejkTs9niGgZxWUh+PQVb8xZO9FYKnP5iW4SGSFICRScgLp/39psPX/OgOgD+zGVkYcQ sjOrh1Dewbimy8naJX799BpA+sQZVgiOkx1x6k0okhI4WRIwnxs8mXralCLE4GKuWguX qeRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id p21si788069edi.170.2017.05.11.01.29.14; Thu, 11 May 2017 01:29:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 583B0C21E1B; Thu, 11 May 2017 08:29:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 024A4C21D1F; Thu, 11 May 2017 08:29:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 35E4EC21D1F; Thu, 11 May 2017 08:29:11 +0000 (UTC) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lists.denx.de (Postfix) with ESMTPS id 35F9BC21CF2 for ; Thu, 11 May 2017 08:29:09 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id v4B8Slbk018054; Thu, 11 May 2017 17:28:47 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v4B8Slbk018054 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1494491328; bh=Fm4GYk5o2AdAJtiwJUdfipbUIpAHV4PhXPfbz6z4MNc=; h=From:To:Cc:Subject:Date:From; b=Ulp1QwbpmumoTjYQYjIccClLpoKCRh3uHziw0r4OSYTACNDYA1x7l5ylOKoEYPbXQ MCLcc6QOaZQwGsQn0oxjx7TERLt/nmXLiYkZWwekHFxaj9k/SxcSr1iaBcCRzlZWp7 m2+oH2alwKFBPHJFXzQRCegQjHJZKH50YY/DJ3nwaBtB4dFdhtQQK9xffG2UYqEBce qgqyemNWzlxQGrhjsrs5nv25FMDQ81M27ZhLLewDSgP2jny2+jrlQBZ1I3HcsnIeUQ sQRlF7Y9RfzaOkvRaGqkJZHfYnLFGCpfX+RdgvId3NBN9vSqY5nKV8/J2KOqsVUYda tnuVcrcSl/akQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 11 May 2017 17:28:45 +0900 Message-Id: <1494491325-12769-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCH] ARM: uniphier: add weird workaround code for LD20 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" When booting from ARM Trusted Firmware, U-Boot runs in EL1-NS. The boot flow is as follows: BL1 -> BL2 -> BL31 -> BL33 (i.e. U-Boot) This boot sequence works fine for LD11 SoC (Cortex-A53), but LD20 SoC (Cortex-A72) hangs in U-Boot. The solution I found is to read sctlr_el1 and write back the value as-is. This should be no effect, but surprisingly fixes the problem and LD20 SoC boots. I do not know why. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/arm64/Makefile | 2 ++ arch/arm/mach-uniphier/arm64/lowlevel_init.S | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 arch/arm/mach-uniphier/arm64/lowlevel_init.S diff --git a/arch/arm/mach-uniphier/arm64/Makefile b/arch/arm/mach-uniphier/arm64/Makefile index eb34c20..3fde6b1 100644 --- a/arch/arm/mach-uniphier/arm64/Makefile +++ b/arch/arm/mach-uniphier/arm64/Makefile @@ -9,5 +9,7 @@ obj-y += mem_map.o ifdef CONFIG_ARMV8_MULTIENTRY obj-y += smp.o smp_kick_cpus.o obj-$(CONFIG_ARCH_UNIPHIER_LD20) += arm-cci500.o +else +obj-y += lowlevel_init.o endif endif diff --git a/arch/arm/mach-uniphier/arm64/lowlevel_init.S b/arch/arm/mach-uniphier/arm64/lowlevel_init.S new file mode 100644 index 0000000..a4255bf --- /dev/null +++ b/arch/arm/mach-uniphier/arm64/lowlevel_init.S @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2017 Socionext Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include + +ENTRY(lowlevel_init) + /* + * I do not know why, but LD20 SoC (Cortex-A72) does not work + * without the following code. + */ + mrs x0, sctlr_el1 + msr sctlr_el1, x0 + ret +ENDPROC(lowlevel_init)