From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hZ9MN-0005gu-6y for barebox@lists.infradead.org; Fri, 07 Jun 2019 07:32:26 +0000 From: Oleksij Rempel Date: Fri, 7 Jun 2019 09:32:10 +0200 Message-Id: <20190607073210.13915-4-linux@rempel-privat.de> In-Reply-To: <20190607073210.13915-1-linux@rempel-privat.de> References: <20190607073210.13915-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 v2 4/4] port reduced version of remoteproc framework from linux To: barebox@lists.infradead.org Cc: Oleksij Rempel SSB0ZXN0ZWQgaXQgb24gcGh5dGVjIGlteDcgYm9hcmQgd2l0aCByZW1vdGVwcm9jIEVMRiBpbWFn ZSBwcmV2aW91c2x5IHVzZWQgb24KTGludXguIExpbnV4IHdvdWxkIGxvYWQgdGhpcyBpbWFnZSwg Y3JlYXRlIGFwcHJvcHJpYXRlIHJlc291cmNlIChpZiBkZWZpbmVkIGluCmltYWdlKSBhbmQgYm9v dCBpdC4gVGhlIGJhcmVib3ggdmVyc2lvbiBpcyBvbmx5IGxvYWRpbmcgaW1hZ2UgYW5kIGJvb3Qg aXQuCgpDdXJyZW50bHkgYmFyZWJveCB2ZXJzaW9uIGRvIG5vdCBleHRyYWN0IHJlc291cmNlcyBk ZWZpbmVkIGJ5IHJwcm9jIEVMRiBpbWFnZS4KT24gdGhpcyBlYXJseSBzdGFnZSBpdCBpcyBoYXJk IHRvIHNheSwgaWYgaXQgaXMgbmVlZGVkLgoKUHJldmlvdXNseSB0aGVyZSB3YXMgYW4gYXR0ZW1w dCB0byBwb3J0IGJvb3RhdXggY29tbWFuZCBmcm9t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ljZV9nZXRfbWF0Y2hf ZGF0YShkZXYpOworCWlmICghZGNmZykgeworCQlyZXQgPSAtRUlOVkFMOworCQlnb3RvIGVycl9w dXRfcnByb2M7CisJfQorCisJcHJpdiA9IHJwcm9jLT5wcml2OworCXByaXYtPnJwcm9jID0gcnBy b2M7CisJcHJpdi0+cmVnbWFwID0gcmVnbWFwOworCXByaXYtPmRjZmcgPSBkY2ZnOworCXByaXYt PmRldiA9IGRldjsKKworCXJldCA9IGlteF9ycHJvY19hZGRyX2luaXQocHJpdiwgZGV2KTsKKwlp ZiAocmV0KSB7CisJCWRldl9lcnIoZGV2LCAiZmlsZWQgb24gaW14X3Jwcm9jX2FkZHJfaW5pdFxu Iik7CisJCWdvdG8gZXJyX3B1dF9ycHJvYzsKKwl9CisKKwlwcml2LT5jbGsgPSBjbGtfZ2V0KGRl diwgMCk7CisJaWYgKElTX0VSUihwcml2LT5jbGspKSB7CisJCWRldl9lcnIoZGV2LCAiRmFpbGVk IHRvIGdldCBjbG9ja1xuIik7CisJCXJldCA9IFBUUl9FUlIocHJpdi0+Y2xrKTsKKwkJZ290byBl cnJfcHV0X3Jwcm9jOworCX0KKworCS8qCisJICogY2xrIGZvciBNNCBibG9jayBpbmNsdWRpbmcg bWVtb3J5LiBTaG91bGQgYmUKKwkgKiBlbmFibGVkIGJlZm9yZSAuc3RhcnQgZm9yIEZXIHRyYW5z ZmVyLgorCSAqLworCXJldCA9IGNsa19lbmFibGUocHJpdi0+Y2xrKTsKKwlpZiAocmV0KSB7CisJ CWRldl9lcnIoJnJwcm9jLT5kZXYsICJGYWlsZWQgdG8gZW5hYmxlIGNsb2NrXG4iKTsKKwkJZ290 byBlcnJfcHV0X3Jwcm9jOworCX0KKworCXJldCA9IHJwcm9jX2FkZChycHJvYyk7CisJaWYgKHJl dCkgeworCQlkZXZfZXJyKGRldiwgInJwcm9jX2FkZCBmYWlsZWRcbiIpOworCQlnb3RvIGVycl9w dXRfY2xrOworCX0KKworCXJldHVybiAwOworCit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ZGUgPGZpcm13YXJlLmg+CisKK3N0cnVjdCByZXNvdXJjZV90YWJsZSB7CisJ dTMyIHZlcjsKKwl1MzIgbnVtOworCXUzMiByZXNlcnZlZFsyXTsKKwl1MzIgb2Zmc2V0WzBdOwor fSBfX3BhY2tlZDsKKworc3RydWN0IGZpcm13YXJlIHsKKwlzaXplX3Qgc2l6ZTsKKwljb25zdCB1 OCAqZGF0YTsKK307CisKK3N0cnVjdCBycHJvYzsKKworc3RydWN0IHJwcm9jX29wcyB7CisJaW50 ICgqc3RhcnQpKHN0cnVjdCBycHJvYyAqcnByb2MpOworCWludCAoKnN0b3ApKHN0cnVjdCBycHJv YyAqcnByb2MpOworCXZvaWQgKiAoKmRhX3RvX3ZhKShzdHJ1Y3QgcnByb2MgKnJwcm9jLCB1NjQg ZGEsIGludCBsZW4pOworCWludCAoKmxvYWQpKHN0cnVjdCBycHJvYyAqcnByb2MsIGNvbnN0IHN0 cnVjdCBmaXJtd2FyZSAqZncpOworfTsKKworc3RydWN0IHJwcm9jIHsKKwlzdHJ1Y3QgZmlybXdh cmVfaGFuZGxlciBmaDsKKwljb25zdCBjaGFyICpuYW1lOworCXZvaWQgKnByaXY7CisJc3RydWN0 IHJwcm9jX29wcyAqb3BzOworCXN0cnVjdCBkZXZpY2VfZCBkZXY7CisJaW50IGluZGV4OworCisJ dm9pZCAqZndfYnVmOworCXNpemVfdCBmd19idWZfb2ZzOworfTsKKworc3RydWN0IHJwcm9jICpy cHJvY19hbGxvYyhzdHJ1Y3QgZGV2aWNlX2QgKmRldiwgY29uc3QgY2hhciAqbmFtZSwKKwkJCSAg Y29uc3Qgc3RydWN0IHJwcm9jX29wcyAqb3BzLCBpbnQgbGVuKTsKK2ludCBycHJvY19hZGQoc3Ry dWN0IHJwcm9jICpycHJvYyk7CisKKyNlbmRpZiAvKiBSRU1PVEVQUk9DX0ggKi8KLS0KMi4yMC4x CgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYmFyZWJv eCBtYWlsaW5nIGxpc3QKYmFyZWJveEBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5p bmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vYmFyZWJveAo=