From owner-freebsd-arm@FreeBSD.ORG Tue May 12 16:35:11 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A780F63 for ; Tue, 12 May 2015 16:35:11 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2D6F156B for ; Tue, 12 May 2015 16:35:10 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t4CGZAji054187 for ; Tue, 12 May 2015 16:35:10 GMT (envelope-from daemon-user@phabric-backend.isc.freebsd.org) Received: (from daemon-user@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t4CGZAsQ054186; Tue, 12 May 2015 16:35:10 GMT (envelope-from daemon-user) Date: Tue, 12 May 2015 16:35:10 +0000 To: freebsd-arm@freebsd.org From: "zbb (Zbigniew Bodek)" Subject: [Differential] [Updated, 1, 031 lines] D2377: Introduce ARM GICv3 support Message-ID: <5d0214dede86ae74079a9a209dbb7bd0@localhost.localdomain> X-Priority: 3 Thread-Topic: D2377: Introduce ARM GICv3 support X-Herald-Rules: <28>, <31>, <32>, <34>, <8> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: MjA1ZGZkZWI5MTE4ZDk2Nzk0YzAyZGRiMWRiIFVSK74= Precedence: bulk X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_5d0214dede86ae74079a9a209dbb7bd0" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2015 16:35:11 -0000 --b1_5d0214dede86ae74079a9a209dbb7bd0 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit zbb updated this revision to Diff 5343. zbb marked an inline comment as done. CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D2377?vs=5327&id=5343 REVISION DETAIL https://reviews.freebsd.org/D2377 AFFECTED FILES sys/arm64/arm64/gic_v3.c sys/arm64/arm64/gic_v3_fdt.c sys/arm64/arm64/gic_v3_reg.h sys/arm64/arm64/gic_v3_var.h sys/arm64/arm64/locore.S sys/arm64/include/armreg.h sys/conf/files.arm64 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: zbb, emaste, ian, imp, andrew, brueffer, joel, wblock Cc: kostikbel, emaste, andrew, imp, freebsd-arm --b1_5d0214dede86ae74079a9a209dbb7bd0 Content-Type: text/x-patch; charset=utf-8; name="D2377.5343.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D2377.5343.patch" ZGlmZiAtLWdpdCBhL3N5cy9jb25mL2ZpbGVzLmFybTY0IGIvc3lzL2NvbmYvZmlsZXMuYXJtNjQK LS0tIGEvc3lzL2NvbmYvZmlsZXMuYXJtNjQKKysrIGIvc3lzL2NvbmYvZmlsZXMuYXJtNjQKQEAg LTE5LDYgKzE5LDggQEAKIGFybTY0L2FybTY0L2VsZl9tYWNoZGVwLmMJc3RhbmRhcmQKIGFybTY0 L2FybTY0L2V4Y2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ldikpCisJ CXJldHVybiAoRU5YSU8pOworCisJaWYgKCFvZndfYnVzX2lzX2NvbXBhdGlibGUoZGV2LCAiYXJt LGdpYy12MyIpKQorCQlyZXR1cm4gKEVOWElPKTsKKworCWRldmljZV9zZXRfZGVzYyhkZXYsIEdJ Q19WM19ERVZTVFIpOworCXJldHVybiAoQlVTX1BST0JFX0RFRkFVTFQpOworfQorCitzdGF0aWMg aW50CitnaWNfdjNfZmR0X2F0dGFjaChkZXZpY2VfdCBkZXYpCit7CisJc3RydWN0IGdpY192M19z b2Z0YyAqc2M7CisJcGNlbGxfdCByZWRpc3RfcmVnaW9uczsKKwlpbnQgZXJyOworCisJc2MgPSBk ZXZpY2VfZ2V0X3NvZnRjKGRldik7CisJc2MtPmRldiA9IGRldjsKKworCS8qCisJICogUmVjb3Zl ciBudW1iZXIgb2YgdGhlIFJlLURpc3RyaWJ1dG9yIHJlZ2lvbnMuCisJICovCisJaWYgKE9GX2dl dGVuY3Byb3Aob2Z3X2J1c19nZXRfbm9kZShkZXYpLCAiI3JlZGlzdHJpYnV0b3ItcmVnaW9ucyIs CisJICAgICZyZWRpc3RfcmVnaW9ucywgc2l6ZW9mKHJlZGlzdF9yZWdpb25zKSkgPD0gMCkKKwkJ c2MtPmdpY19yZWRpc3RzLm5yZWdpb25zID0gMTsKKwllbHNlCisJCXNjLT5naWNfcmVkaXN0cy5u cmVnaW9ucyA9IHJlZGlzdF9yZWdpb25zOworCisJZXJyID0gZ2ljX3YzX2F0dGFjaChkZXYpOwor CWlmIChlcnIpCisJCWdvdG8gZXJyb3I7CisKKwlyZXR1cm4gKGVycik7CisKK2Vycm9yOgorCWlm IChib290dmVyYm9zZSkgeworCQlkZXZpY2VfcHJpbnRmKGRldiwKKwkJICAgICJGYWlsZWQgdG8g YXR0YWNoLiBFcnJvciAlZFxuIiwgZXJyKTsKKwl9CisJLyogRmFpbHVyZSBzbyBmcmVlIHJlc291 cmNlcyAqLworCWdpY192M19kZXRhY2goZGV2KTsKKworC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GF0aWMgZGV2aWNlX21ldGhvZF90IGdpY192M19tZXRob2RzW10gPSB7CisJLyogRGV2 aWNlIGludGVyZmFjZSAqLworCURFVk1FVEhPRChkZXZpY2VfZGV0YWNoLAlnaWNfdjNfZGV0YWNo KSwKKworCS8qIFBJQyBpbnRlcmZhY2UgKi8KKwlERVZNRVRIT0QocGljX2Rpc3BhdGNoLAkJZ2lj X3YzX2Rpc3BhdGNoKSwKKwlERVZNRVRIT0QocGljX2VvaSwJCWdpY192M19lb2kpLAorCURFVk1F VEhPRChwaWNfbWFzaywJCWdpY192M19tYXNrX2lycSksCisJREVWTUVUSE9EKHBpY191bm1hc2ss CQlnaWNfdjNfdW5tYXNrX2lycSksCisKKwkvKiBFbmQgKi8KKwlERVZNRVRIT0RfRU5ECit9Owor CitERUZJTkVfQ0xBU1NfMChnaWNfdjMsIGdpY192M19kcml2ZXIsIGdpY192M19tZXRob2RzLAor ICAgIHNpemVvZihzdHJ1Y3QgZ2ljX3YzX3NvZnRjKSk7CisKKy8qCisgKiBEcml2ZXItc3BlY2lm aWMgZGVmaW5pdGlvbnMuCisgKi8KK01BTExPQ19ERUZJTkUoTV9HSUNfVjMsICJHSUN2MyIsIEdJ Q19WM19ERVZTVFIpOworCisvKgorICogSGVscGVyIGZ1bmN0aW9ucyBhbmQgZGVmaW5pdGlvbnMu CisgKi8KKy8qIERlc3RpbmF0aW9uIHJlZ2lzdGVycywgZWl0aGVyIERpc3RyaWJ1dG9yIG9yIFJl LURpc3RyaWJ1dG9yICovCitlbnVtIGdpY192M194ZGlzdCB7CisJRElTVCA9IDAsCisJUkVESVNU LAorfTsKKworLyogSGVscGVyIHJvdXRpbmVzIHN0YXJ0aW5nIHdpdGggZ2ljX3YzXyAqLworc3Rh dGljIGludCBnaWNfdjNfZGlzdF9pbml0KHN0cnVjdCBnaWNfdjNfc29mdGMgKik7CitzdGF0aWMg aW50IGdpY192M19yZWRpc3RfZmluZChzdHJ1Y3QgZ2ljX3YzX3NvZnRjICopOwor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pc3RlcnNcbiIsIGNwdWlkKTsKKwkJcmV0dXJuIChFTlhJTyk7CisJfSBlbHNlIGlm IChib290dmVyYm9zZSAhPSAwKSB7CisJCWRldmljZV9wcmludGYoc2MtPmRldiwKKwkJICAgICJD UFUldSBlbmFibGVkIENQVSBpbnRlcmZhY2UgdmlhIHN5c3RlbSByZWdpc3RlcnNcbiIsCisJCSAg ICBjcHVpZCk7CisJfQorCisJcmV0dXJuICgwKTsKK30KKworc3RhdGljIGludAorZ2ljX3YzX2Nw dV9pbml0KHN0cnVjdCBnaWNfdjNfc29mdGMgKnNjKQoreworCWludCBlcnI7CisKKwkvKiBFbmFi bGUgYWNjZXNzIHRvIENQVSBpbnRlcmZhY2UgdmlhIHN5c3RlbSByZWdpc3RlcnMgKi8KKwllcnIg PSBnaWNfdjNfY3B1X2VuYWJsZV9zcmUoc2MpOworCWlmIChlcnIgIT0gMCkKKwkJcmV0dXJuIChl cnIpOworCS8qIFByaW9yaXR5IG1hc2sgdG8gbWluaW11bSAtIGFjY2VwdCBhbGwgaW50ZXJydXB0 cyAqLworCWdpY192M19jcHVfcHJpb3JpdHkoR0lDX1BSSU9SSVRZX01JTik7CisJLyogRGlzYWJs ZSBFT0kgbW9kZSAqLworCWdpY19pY2NfY2xlYXIoQ1RMUiwgSUNDX0NUTFJfRUwxX0VPSU1PREUp OworCS8qIEVuYWJsZSBncm91cCAxIChpbnNlY3VyZSkgaW50ZXJydXBzICovCisJZ2ljX2ljY19z ZXQoSUdSUEVOMSwgSUNDX0lHUlBFTjBfRUwxX0VOKTsKKworCXJldHVybiAoMCk7Cit9CisKKy8q IERpc3RyaWJ1dG9yICovCitzdGF0aWMgaW50CitnaWNfdjNfZGlzdF9pbml0KHN0cnVjdCBnaWNf djNfc29mdGMgKnNjKQoreworCXVpbnQ2NF90IGFmZjsKKwl1X2ludCBpOworCisJLyoKKwkgKiAx LiBEaXNhYmxlIHRoZSBEaXN0cmlidXRvcgorCSAqLworCWdpY19kX3dyaXRlKHN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