All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Wunderlich <linux@fw-web.de>
To: u-boot@lists.denx.de
Subject: [RFC PATCH 2/4] mt7622: add lowlevel_init from 2014-04
Date: Mon, 10 Aug 2020 16:26:50 +0200	[thread overview]
Message-ID: <20200810142652.40669-3-linux@fw-web.de> (raw)
In-Reply-To: <20200810142652.40669-1-linux@fw-web.de>

From: Frank Wunderlich <frank-w@public-files.de>

add low level initialisation to gain access to jumparch64 target in
mt7622 ATF from 32bit uboot.

jumparch64 allows switching from 32bit to 64bit to
load 64bit kernel from 32bit uboot

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 arch/arm/mach-mediatek/mt7622/Makefile        |  4 +++
 arch/arm/mach-mediatek/mt7622/lowlevel_init.S | 33 +++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100755 arch/arm/mach-mediatek/mt7622/lowlevel_init.S

diff --git a/arch/arm/mach-mediatek/mt7622/Makefile b/arch/arm/mach-mediatek/mt7622/Makefile
index 886ab7e4eb..5fe4505ddf 100644
--- a/arch/arm/mach-mediatek/mt7622/Makefile
+++ b/arch/arm/mach-mediatek/mt7622/Makefile
@@ -1,3 +1,7 @@
 # SPDX-License-Identifier:	GPL-2.0
 
 obj-y += init.o
+
+ifeq ($(CONFIG_ARCH_MEDIATEK_32),y)
+	obj-y += lowlevel_init.o
+endif
diff --git a/arch/arm/mach-mediatek/mt7622/lowlevel_init.S b/arch/arm/mach-mediatek/mt7622/lowlevel_init.S
new file mode 100755
index 0000000000..bf20cbd1e7
--- /dev/null
+++ b/arch/arm/mach-mediatek/mt7622/lowlevel_init.S
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+.globl lowlevel_init
+lowlevel_init:
+    /*Enable SMP bit*/
+	mrc	p15, 0, r0, c1, c0, 1
+	orr	r0, r0, #0x40
+	mcr	p15, 0, r0, c1, c0, 1
+	mov	pc, lr
+
+.global jumparch64_smc
+jumparch64_smc:
+	mov r3, r2
+	mov r2, r1
+	mov r1, r0
+	ldr r0, =0x82000200  /*please check MTK_SIP_KERNEL_TMP_AARCH32 in  vendor/arm/atf/include/bl31/services/sip_svc.h*/
+#	smc #0
+	.word   0xe1600070  @ SMC #0 to enter monitor - hand assembled
+	b   .
-- 
2.25.1

  parent reply	other threads:[~2020-08-10 14:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10 14:26 [RFC PATCH 0/4] Add 32bit-mode for mt7622 Frank Wunderlich
2020-08-10 14:26 ` [RFC PATCH 1/4] mt7622: Support to build 32 bits version Frank Wunderlich
2020-08-11  2:11   ` Sam Shih
2020-08-11 10:01     ` Frank Wunderlich
2020-08-10 14:26 ` Frank Wunderlich [this message]
2020-08-10 14:26 ` [RFC PATCH 3/4] jumparch64: insert into bootm Frank Wunderlich
2020-08-10 14:26 ` [RFC PATCH 4/4] jumparch64: add go64 Frank Wunderlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200810142652.40669-3-linux@fw-web.de \
    --to=linux@fw-web.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.