From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i91HR-0001S2-B4 for barebox@lists.infradead.org; Sat, 14 Sep 2019 06:11:34 +0000 Received: by mail-pg1-x541.google.com with SMTP id u72so16403730pgb.10 for ; Fri, 13 Sep 2019 23:11:32 -0700 (PDT) From: Andrey Smirnov Date: Fri, 13 Sep 2019 23:11:23 -0700 Message-Id: <20190914061123.28389-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v2] ARM: aarch64: Re-implement most of barebox_arm_entry() in assembly To: barebox@lists.infradead.org Cc: Andrey Smirnov R0NDOSBub3cgcHJvZHVjZXMgdGhlIGZvbGxvd2luZyB3YXJuaW5nOgoKY29tbW9uLmg6NTE6Mjog d2FybmluZzogbGlzdGluZyB0aGUgc3RhY2sgcG9pbnRlciByZWdpc3RlciDigJhzcOKAmSBpbiBh IGNsb2JiZXIgbGlzdCBpcyBkZXByZWNhdGVkIFstV2RlcHJlY2F0ZWRdCiAgIDUxIHwgIF9fYXNt X18gX192b2xhdGlsZV9fKCJtb3Ygc3AsICUwIgogICAgICB8ICBefn5+fn5+CmNvbW1vbi5oOjUx OjI6IG5vdGU6IHRoZSB2YWx1ZSBvZiB0aGUgc3RhY2sgcG9pbnRlciBhZnRlciAgYW4g4oCYYXNt 4oCZIHN0YXRlbWVudCBtdXN0IGJlIHRoZSBzYW1lIGFzIGl0IHdhcyBiZWZvcmUgdGhlIHN0YXRl bWVudAoKU3RhY2sgcG9pbnRlciB3YXMgYWRkZWQgdG8gY2xvYmJlciBsaXN0IGluIGNvbW1pdCBm OWZjODI1NGIy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