From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCL49-0000D7-0u for barebox@lists.infradead.org; Mon, 23 Sep 2019 09:55:36 +0000 From: Oleksij Rempel Date: Mon, 23 Sep 2019 11:55:27 +0200 Message-Id: <20190923095527.29174-4-o.rempel@pengutronix.de> In-Reply-To: <20190923095527.29174-1-o.rempel@pengutronix.de> References: <20190923095527.29174-1-o.rempel@pengutronix.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 v3 3/3] port reduced version of remoteproc framework from linux To: barebox@lists.infradead.org Cc: Oleksij Rempel RnJvbTogT2xla3NpaiBSZW1wZWwgPGxpbnV4QHJlbXBlbC1wcml2YXQuZGU+CgpJIHRlc3RlZCBp dCBvbiBwaHl0ZWMgaW14NyBib2FyZCB3aXRoIHJlbW90ZXByb2MgRUxGIGltYWdlIHByZXZpb3Vz bHkgdXNlZCBvbgpMaW51eC4gTGludXggd291bGQgbG9hZCB0aGlzIGltYWdlLCBjcmVhdGUgYXBw cm9wcmlhdGUgcmVzb3VyY2UgKGlmIGRlZmluZWQgaW4KaW1hZ2UpIGFuZCBib290IGl0LiBUaGUg YmFyZWJveCB2ZXJzaW9uIGlzIG9ubHkgbG9hZGluZyBpbWFnZSBhbmQgYm9vdCBpdC4KCkN1cnJl bnRseSBiYXJlYm94IHZlcnNpb24gZG8gbm90IGV4dHJhY3QgcmVzb3VyY2VzIGRlZmluZWQgYnkg cnByb2MgRUxGIGltYWdlLgpPbiB0aGlzIGVhcmx5IHN0YWdlIGl0IGlzIGhhcmQgdG8gc2F5LCBp ZiBpdCBpcyBuZWVkZ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f c3RhcnQpOworCWlmIChyZXQpCisJCWRldl9lcnIoZGV2LCAiRmlsZWQgdG8gZW5hYmxlIE00IVxu Iik7CisKKwlyZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IGlteF9ycHJvY19zdG9wKHN0cnVj dCBycHJvYyAqcnByb2MpCit7CisJc3RydWN0IGlteF9ycHJvYyAqcHJpdiA9IHJwcm9jLT5wcml2 OworCWNvbnN0IHN0cnVjdCBpbXhfcnByb2NfZGNmZyAqZGNmZyA9IHByaXYtPmRjZmc7CisJc3Ry dWN0IGRldmljZV9kICpkZXYgPSBwcml2LT5kZXY7CisJaW50IHJldDsKKworCXJldCA9IHJlZ21h cF91cGRhdGVfYml0cyhwcml2LT5yZWdtYXAsIGRjZmctPnNyY19yZWcsCisJCQkJIGRjZmctPnNy Y19tYXNrLCBkY2ZnLT5zcmNfc3RvcCk7CisJaWYgKHJldCkKKwkJZGV2X2VycihkZXYsICJGaWxl ZCB0byBzdG9wIE00IVxuIik7CisKKwlyZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50IGlteF9y cHJvY19kYV90b19zeXMoc3RydWN0IGlteF9ycHJvYyAqcHJpdiwgdTY0IGRhLAorCQkJICAgICAg IGludCBsZW4sIHU2NCAqc3lzKQoreworCWNvbnN0IHN0cnVjdCBpbXhfcnByb2NfZGNmZyAqZGNm ZyA9IHByaXYtPmRjZmc7CisJaW50IGk7CisKKwkvKiBwYXJzZSBhZGRyZXNzIHRyYW5zbGF0aW9u IHRhYmxlICovCisJZm9yIChpID0gMDsgaSA8IGRjZmctPmF0dF9zaXplOyBpKyspIHsKKwkJY29u c3Qgc3RydWN0IGlteF9ycHJvY19hdHQgKmF0dCA9ICZkY2ZnLT5hdHRbaV07CisKKwkJaWYgKGRh ID49IGF0dC0+ZGEgJiYgZGEgKyBsZW4gPCBhdHQtPmRhICsgYXR0LT5zaXplKSB7CisJCQl1bnNp Z25lZCBpbnQgb2Zmc2V0ID0gZGEgLSBhdHQtPmRhOworCis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gZGV2X25hbWUoZGV2KSwgJmlteF9ycHJvY19vcHMsIHNpemVvZigqcHJpdikpOworCWlmICgh cnByb2MpCisJCXJldHVybiAtRU5PTUVNOworCisJZGNmZyA9IG9mX2RldmljZV9nZXRfbWF0Y2hf ZGF0YShkZXYpOworCWlmICghZGNmZykgeworCQlyZXQgPSAtRUlOVkFMOworCQlnb3RvIGVycl9w dXRfcnByb2M7CisJfQorCisJcHJpdiA9IHJwcm9jLT5wcml2OworCXByaXYtPnJwcm9jID0gcnBy b2M7CisJcHJpdi0+cmVnbWFwID0gcmVnbWFwOworCXByaXYtPmRjZmcgPSBkY2ZnOworCXByaXYt PmRldiA9IGRldjsKKworCXJldCA9IGlteF9ycHJvY19hZGRyX2luaXQocHJpdiwgZGV2KTsKKwlp ZiAocmV0KSB7CisJCWRldl9lcnIoZGV2LCAiZmlsZWQgb24gaW14X3Jwcm9jX2FkZHJfaW5pdFxu Iik7CisJCWdvdG8gZXJyX3B1dF9ycHJvYzsKKwl9CisKKwlwcml2LT5jbGsgPSBjbGtfZ2V0KGRl diwgMCk7CisJaWYgKElTX0VSUihwcml2LT5jbGspKSB7CisJCWRldl9lcnIoZGV2LCAiRmFpbGVk IHRvIGdldCBjbG9ja1xuIik7CisJCXJldCA9IFBUUl9FUlIocHJpdi0+Y2xrKTsKKwkJZ290byBl cnJfcHV0X3Jwcm9jOworCX0KKworCS8qCisJICogY2xrIGZvciBNNCBibG9jayBpbmNsdWRpbmcg bWVtb3J5LiBTaG91bGQgYmUKKwkgKiBlbmFibGVkIGJlZm9yZSAuc3RhcnQgZm9yIEZXIHRyYW5z ZmVyLgorCSAqLworCXJldCA9IGNsa19lbmFibGUocHJpdi0+Y2xrKTsKKwlpZiAocmV0KSB7CisJ CWRldl9lcnIoJnJwcm9jLT5kZXYsICJGYWlsZWQgdG8gZW5hYmxlIGNsb2NrXG4iKTsKKwkJZ290 byBlcnJfcHV0X3Jwcm9jOworCX0KKworCXJldCA9IHJwcm9jX2FkZChycHJv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AmcnByb2MtPmRldjsK KwlpbnQgcmV0OworCisJLyogbG9hZCB0aGUgRUxGIHNlZ21lbnRzIHRvIG1lbW9yeSAqLworCXJl dCA9IHJwcm9jX2xvYWRfc2VnbWVudHMocnByb2MsIGZ3KTsKKwlpZiAocmV0KSB7CisJCWRldl9l cnIoZGV2LCAiRmFpbGVkIHRvIGxvYWQgcHJvZ3JhbSBzZWdtZW50czogJWRcbiIsIHJldCk7CisJ CXJldHVybiByZXQ7CisJfQorCisJLyogcG93ZXIgdXAgdGhlIHJlbW90ZSBwcm9jZXNzb3IgKi8K KwlyZXQgPSBycHJvYy0+b3BzLT5zdGFydChycHJvYyk7CisJaWYgKHJldCkgeworCQlkZXZfZXJy KGRldiwgImNhbid0IHN0YXJ0IHJwcm9jICVzOiAlZFxuIiwgcnByb2MtPm5hbWUsIHJldCk7CisJ CXJldHVybiByZXQ7CisJfQorCisJZGV2X2luZm8oZGV2LCAicmVtb3RlIHByb2Nlc3NvciAlcyBp cyBub3cgdXBcbiIsIHJwcm9jLT5uYW1lKTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50 IHJwcm9jX2Zpcm13YXJlX3N0YXJ0KHN0cnVjdCBmaXJtd2FyZV9oYW5kbGVyICpmaCkKK3sKKwlz dHJ1Y3QgcnByb2MgKnJwcm9jID0gY29udGFpbmVyX29mKGZoLCBzdHJ1Y3QgcnByb2MsIGZoKTsK KworCXJwcm9jLT5md19idWYgPSBremFsbG9jKCg0MDk2ICogMTAyNCksIEdGUF9LRVJORUwpOwor CXJwcm9jLT5md19idWZfb2ZzID0gMDsKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCBycHJv Y19maXJtd2FyZV93cml0ZV9idWYoc3RydWN0IGZpcm13YXJlX2hhbmRsZXIgKmZoLCBjb25zdCB2 b2lkICpidWYsCisJCXNpemVfdCBzaXplKQoreworCXN0cnVjdCBycHJvYyAqcnByb2MgPSBjb250 YWluZXJfb2YoZmgsIHN0cnVjdCBycHJvYywg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