From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYZA9-0007lf-Du for barebox@lists.infradead.org; Wed, 05 Jun 2019 16:53:25 +0000 From: Oleksij Rempel Date: Wed, 5 Jun 2019 18:52:42 +0200 Message-Id: <20190605165242.17147-4-linux@rempel-privat.de> In-Reply-To: <20190605165242.17147-1-linux@rempel-privat.de> References: <20190605165242.17147-1-linux@rempel-privat.de> 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 v1 4/4] port reduced version of remoteproc framework from linux To: barebox@lists.infradead.org Cc: Oleksij Rempel V2l0aCB0aGlzIHBvcnQgaXQgaXMgcG9zc2libGUgdG8gc3RhcnQgc2FtZSBFTEYgZmlybXdhcmUg aW1hZ2VzIGFzCmZvciBsaW51eCByZW1vdGVwcm9jLgoKU2lnbmVkLW9mZi1ieTogT2xla3NpaiBS ZW1wZWwgPGxpbnV4QHJlbXBlbC1wcml2YXQuZGU+Ci0tLQogZHJpdmVycy9LY29uZmlnICAgICAg ICAgICAgICAgICAgICAgICAgICAgIHwgICAxICsKIGRyaXZlcnMvTWFrZWZpbGUgICAgICAgICAg ICAgICAgICAgICAgICAgICB8ICAgMSArCiBkcml2ZXJzL3JlbW90ZXByb2MvS2NvbmZpZyAgICAg ICAgICAgICAgICAgfCAgMjYgKysKIGRyaXZlcnMvcmVtb3RlcHJvYy9NYWtlZmlsZSAgICAgICAg ICAgICAgICB8ICAgNyArCiBkcml2ZXJzL3JlbW90ZXByb2MvaW14X3Jwcm9jLmMgICAgICAgICAg ICAgfCA0MDIgKysrKysrKysrKysrKysrKysrKysrCiBkcml2ZXJzL3JlbW90ZXByb2MvcmVt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5md19idWZfb2Zz LCBidWYsIHNpemUpOworCXJwcm9jLT5md19idWZfb2ZzICs9IHNpemU7CisKKwlyZXR1cm4gMDsK K30KKworc3RhdGljIGludCBycHJvY19maXJtd2FyZV9maW5pc2goc3RydWN0IGZpcm13YXJlX2hh bmRsZXIgKmZoKQoreworCXN0cnVjdCBycHJvYyAqcnByb2MgPSBjb250YWluZXJfb2YoZmgsIHN0 cnVjdCBycHJvYywgZmgpOworCXN0cnVjdCBmaXJtd2FyZSBmdzsKKwlzdHJ1Y3QgZGV2aWNlX2Qg KmRldjsKKwlpbnQgcmV0OworCisJaWYgKCFycHJvYykgeworCQlwcl9lcnIoImludmFsaWQgcnBy b2MgaGFuZGxlXG4iKTsKKwkJcmV0dXJuIC1FSU5WQUw7CisJfQorCisJZGV2ID0gJnJwcm9jLT5k ZXY7CisKKwlkZXZfaW5mbyhkZXYsICJwb3dlcmluZyB1cCAlc1xuIiwgcnByb2MtPm5hbWUpOwor CisJZncuZGF0YSA9IHJwcm9jLT5md19idWY7CisJZncuc2l6ZSA9IHJwcm9jLT5md19idWZfb2Zz OworCisJcmV0ID0gcnByb2Nfc3RhcnQocnByb2MsICZmdyk7CisKKwlrZnJlZShycHJvYy0+Zndf YnVmKTsKKworCXJldHVybiByZXQ7Cit9CisKK2ludCBycHJvY19hZGQoc3RydWN0IHJwcm9jICpy cHJvYykKK3sKKwlzdHJ1Y3QgZGV2aWNlX2QgKmRldiA9ICZycHJvYy0+ZGV2OworCXN0cnVjdCBm aXJtd2FyZV9oYW5kbGVyICpmaDsKKwlpbnQgcmV0OworCisJZmggPSAmcnByb2MtPmZoOworCWZo LT5pZCA9IHhzdHJkdXAocnByb2MtPm5hbWUpOworCWZoLT5vcGVuID0gcnByb2NfZmlybXdhcmVf c3RhcnQ7CisJZmgtPndyaXRlID0gcnByb2NfZmlybXdhcmVfd3JpdGVfYnVmOworCWZoLT5jbG9z ZSA9IHJwcm9jX2Zpcm13YXJlX2ZpbmlzaDsKKworCXJldCA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