From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b8Nfi-00048g-Tn for barebox@lists.infradead.org; Thu, 02 Jun 2016 08:08:14 +0000 Received: by mail-wm0-x241.google.com with SMTP id n184so12948465wmn.1 for ; Thu, 02 Jun 2016 01:07:49 -0700 (PDT) From: Raphael Poggi Date: Thu, 2 Jun 2016 10:06:57 +0200 Message-Id: <1464854818-28653-12-git-send-email-poggi.raph@gmail.com> In-Reply-To: <1464854818-28653-1-git-send-email-poggi.raph@gmail.com> References: <1464854818-28653-1-git-send-email-poggi.raph@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 11/12] arm: cpu: add basic arm64 mmu support To: barebox@lists.infradead.org Cc: Raphael Poggi VGhpcyBjb21taXQgYWRkcyBiYXNpYyBtbXUgc3VwcG9ydCwgaWU6CiAgICAgICAgLSBETUEgY2Fj aGUgaGFuZGxpbmcgaXMgbm90IHN1cHBvcnRlZAogICAgICAgIC0gUmVtYXBwaW5nIG1lbW9yeSBy ZWdpb24gYWxzbwoKVGhlIGN1cnJlbnQgbW11IHNldHRpbmcgaXM6CiAgICAgICAgLSA0S0IgZ3Jh bnVsYXJpdHkKICAgICAgICAtIDMgbGV2ZWwgbG9va3VwIChza2lwcGluZyBMMCkKICAgICAgICAt IDMzIGJpdHMgcGVyIFZBCgpUaGlzIGlzIGJhc2VkIG9uIGNvcmVib290IGFuZCB1LWJvb3QgbW11 IGNvbmZpZ3VyYXRpb24uCgpTaWduZWQtb2ZmLWJ5OiBSYXBoYWVsIFBvZ2dpIDxwb2dnaS5yYXBo QGdtYWlsLmNvbT4KLS0tC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MTksOCArMjIs OCBAQCBlbmRpZgogb2JqLSQoQ09ORklHX0NNRF9BUk1fQ1BVSU5GTykgKz0gY3B1aW5mby5vCiBv YmotJChDT05GSUdfQ01EX0FSTV9NTVVJTkZPKSArPSBtbXVpbmZvLm8KIG9iai0kKENPTkZJR19P RkRFVklDRSkgKz0gZHRiLm8KLW9iai0kKENPTkZJR19NTVUpICs9IG1tdS5vIGNhY2hlLm8gbW11 LWVhcmx5Lm8KLXBibC0kKENPTkZJR19NTVUpICs9IG1tdS1lYXJseS5vCitvYmotJChDT05GSUdf TU1VKSArPSBjYWNoZS5vCisKIGlmZXEgKCQoQ09ORklHX01NVSksKQogb2JqLXkgKz0gbm8tbW11 Lm8KIGVuZGlmCmRpZmYgLS1naXQgYS9hcmNoL2FybS9jcHUvbW11LmggYi9hcmNoL2FybS9jcHUv bW11LmgKaW5kZXggNzllYmM4MC4uYmNjMGUyZCAxMDA2NDQKLS0tIGEvYXJjaC9hcm0vY3B1L21t dS5oCisrKyBiL2FyY2gvYXJtL2NwdS9tbXUuaApAQCAtMSw2ICsxLDE2NiBAQAogI2lmbmRlZiBf X0FSTV9NTVVfSAogI2RlZmluZSBfX0FSTV9NTVVfSAogCisjaWZkZWYgQ09ORklHX0NQVV82NHY4 CisKKyNkZWZpbmUgVUwoeCkJCV9BQyh4LCBVTCkKKworI2RlZmluZSBVTlVTRURfREVTQyAgICAg ICAgICAgICAgICAweDZFYkFBRDBCQkFEYkE2RTAKKworI2RlZmluZSBWQV9TVEFSVCAgICAgICAg ICAgICAgICAgICAweDAKKyNkZWZpbmUgQklUU19QRVJfVkEgICAgICAgICAgICAgICAgMzMKKwor LyogR3JhbnVsZSBzaXplIG9mIDRLQiBpcyBiZWluZyB1c2VkICovCisjZGVmaW5lIEdSQU5VTEVf U0laRV9TSElGVCAgICAgICAgIDEyCisjZGVmaW5lIEdSQU5VTEVfU0laRSAgICAgICAgICAgICAg ICgxIDw8IEdSQU5VTEVfU0laRV9TSElGVCkKKyNkZ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bS9zeXN0ZW1faW5mby5o PgorCisjaW5jbHVkZSAibW11LmgiCisKK3N0YXRpYyB1aW50NjRfdCAqdHRiOworc3RhdGljIGlu dCBmcmVlX2lkeDsKKworc3RhdGljIHZvaWQgYXJtX21tdV9ub3RfaW5pdGlhbGl6ZWRfZXJyb3Io dm9pZCkKK3sKKwkvKgorCSAqIFRoaXMgbWVhbnM6CisJICogLSBvbmUgb2YgdGhlIE1NVSBmdW5j dGlvbnMgbGlrZSBkbWFfYWxsb2NfY29oZXJlbnQKKwkgKiAgIG9yIHJlbWFwX3JhbmdlIGlzIGNh bGxlZCB0b28gZWFybHksIGJlZm9yZSB0aGUgTU1VIGlzIGluaXRpYWxpemVkCisJICogLSBPciB0 aGUgTU1VIGluaXRpYWxpemF0aW9uIGhhcyBmYWlsZWQgZWFybGllcgorCSAqLworCXBhbmljKCJN TVUgbm90IGluaXRpYWxpemVkXG4iKTsKK30KKworCisvKgorICogRG8gaXQgdGhlIHNpbXBsZSB3 YXkgZm9yIG5vdyBhbmQgaW52YWxpZGF0ZSB0aGUgZW50aXJlCisgKiB0bGIKKyAqLworc3RhdGlj IGlubGluZSB2b2lkIHRsYl9pbnZhbGlkYXRlKHZvaWQpCit7CisJdW5zaWduZWQgaW50IGVsID0g Y3VycmVudF9lbCgpOworCisJZHNiKCk7CisKKwlpZiAoZWwgPT0gMSkKKwkJX19hc21fXyBfX3Zv bGF0aWxlX18oInRsYmkgYWxsZTFcblx0IiA6IDogOiAibWVtb3J5Iik7CisJZWxzZSBpZiAoZWwg PT0gMikKKwkJX19hc21fXyBfX3ZvbGF0aWxlX18oInRsYmkgYWxsZTJcblx0IiA6IDogOiAibWVt b3J5Iik7CisJZWxzZSBpZiAoZWwgPT0gMykKKwkJX19hc21fXyBfX3ZvbGF0aWxlX18oInRsYmkg YWxsZTNcblx0IiA6IDogOiAibWVtb3J5Iik7CisKKwlkc2IoKTsKKwlpc2IoKTsKK30KKworc3Rh dGljIGludCBsZXZlbDJzaGlmdChp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Rpb25z LgorCSAqIFRoaXMgaXMgdG8gc3BlZWQgdXAgdGhlIGdlbmVyYXRpb24gb2YgMm5kIGxldmVsIHBh Z2UgdGFibGVzCisJICogYmVsb3cKKwkgKi8KKwlmb3JfZWFjaF9tZW1vcnlfYmFuayhiYW5rKQor CQljcmVhdGVfc2VjdGlvbnMoYmFuay0+c3RhcnQsIGJhbmstPnN0YXJ0LCBiYW5rLT5zaXplLCBQ TURfU0VDVF9ERUZfQ0FDSEVEKTsKKworCXJldHVybiAwOworfQorbW11X2luaXRjYWxsKG1tdV9p bml0KTsKKwordm9pZCBtbXVfZW5hYmxlKHZvaWQpCit7CisJaWYgKCF0dGIpCisJCWFybV9tbXVf bm90X2luaXRpYWxpemVkX2Vycm9yKCk7CisKKwlpZiAoIShnZXRfY3IoKSAmIENSX00pKSB7CisK KwkJaXNiKCk7CisJCXNldF9jcihnZXRfY3IoKSB8IENSX00gfCBDUl9DIHwgQ1JfSSk7CisJfQor fQorCit2b2lkIG1tdV9kaXNhYmxlKHZvaWQpCit7CisJdW5zaWduZWQgaW50IGNyOworCisJaWYg KCF0dGIpCisJCWFybV9tbXVfbm90X2luaXRpYWxpemVkX2Vycm9yKCk7CisKKwljciA9IGdldF9j cigpOworCWNyICY9IH4oQ1JfTSB8IENSX0MgfCBDUl9JKTsKKworCXRsYl9pbnZhbGlkYXRlKCk7 CisKKwlkc2IoKTsKKwlpc2IoKTsKKworCXNldF9jcihjcik7CisKKwlkc2IoKTsKKwlpc2IoKTsK K30KKwordm9pZCBtbXVfZWFybHlfZW5hYmxlKHVpbnQ2NF90IG1lbWJhc2UsIHVpbnQ2NF90IG1l bXNpemUsIHVpbnQ2NF90IF90dGIpCit7CisJdHRiID0gKHVpbnQ2NF90ICopX3R0YjsKKworCW1l bXNldCh0dGIsIDAsIEdSQU5VTEVfU0laRSk7CisJZnJlZV9pZHggPSAxOworCisJc2V0X3R0YnJf dGNyX21haXIoY3VycmVudF9lbCgpLCAodWludDY0X3QpdHRiLC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