From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 4.mo3.mail-out.ovh.net ([178.33.46.10] helo=mo3.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SMDav-0006hA-VV for barebox@lists.infradead.org; Mon, 23 Apr 2012 07:22:12 +0000 Received: from mail622.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo3.mail-out.ovh.net (Postfix) with SMTP id E9507FFA71D for ; Mon, 23 Apr 2012 09:23:29 +0200 (CEST) From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 23 Apr 2012 09:02:12 +0200 Message-Id: <1335164539-2188-3-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <20120423065650.GM20601@game.jcrosoft.org> References: <20120423065650.GM20601@game.jcrosoft.org> 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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 03/10] ARM: Add support for IXP4xx Network Process Engine and queue Manager support To: barebox@lists.infradead.org Cc: =?UTF-8?q?Krzysztof=20Ha=C5=82asa?= RnJvbTogS3J6eXN6dG9mIEhhxYJhc2EgPGtoY0BwbS53YXcucGw+CgpTaWduZWQtb2ZmLWJ5OiBL cnp5c3p0b2YgSGHFgmFzYSA8a2hjQHBtLndhdy5wbD4KU2lnbmVkLW9mZi1ieTogSmVhbi1DaHJp c3RvcGhlIFBMQUdOSU9MLVZJTExBUkQgPHBsYWduaW9qQGpjcm9zb2Z0LmNvbT4KLS0tCiBhcmNo L2FybS9tYWNoLWl4cDR4eC9LY29uZmlnICAgICAgICAgICAgICAgICB8ICAgMTIgKwogYXJjaC9h cm0vbWFjaC1peHA0eHgvTWFrZWZpbGUgICAgICAgICAgICAgICAgfCAgICAyICsKIGFyY2gvYXJt L21hY2gtaXh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QRV80MlhfREFUQV9TSVpFICAgICAgICAg ICAgICAweDgwMCAvKiBpbiBkd29yZHMgKi8KKyNkZWZpbmUgTlBFXzQ2WF9EQVRBX1NJWkUgICAg ICAgICAgICAgIDB4MTAwMAorI2RlZmluZSBOUEVfQV80MlhfSU5TVFJfU0laRSAgICAgICAgICAg MHgxMDAwCisjZGVmaW5lIE5QRV9CX0FORF9DXzQyWF9JTlNUUl9TSVpFICAgICAweDgwMAorI2Rl ZmluZSBOUEVfNDZYX0lOU1RSX1NJWkUgICAgICAgICAgICAgMHgxMDAwCisjZGVmaW5lIFJFR1Nf U0laRSAgICAgICAgICAgICAgICAgICAgICAweDEwMDAKKworI2RlZmluZSBOUEVfUEhZU19SRUcg ICAgICAgICAgICAgICAgICAgMzIKKworI2RlZmluZSBGV19NQUdJQyAgICAgICAgICAgICAgICAg ICAgICAgMHhGRUVERjAwRAorI2RlZmluZSBGV19CTE9DS19UWVBFX0lOU1RSICAgICAgICAgICAg MHgwCisjZGVmaW5lIEZXX0JMT0NLX1RZUEVfREFUQSAgICAgICAgICAgICAweDEKKyNkZWZpbmUg RldfQkxPQ0tfVFlQRV9FT0YgICAgICAgICAgICAgIDB4RgorCisvKiBOUEUgZXhlYyBzdGF0dXMg KHJlYWQpIGFuZCBjb21tYW5kICh3cml0ZSkgKi8KKyNkZWZpbmUgQ01EX05QRV9TVEVQICAgICAg ICAgICAgICAgICAgIDB4MDEKKyNkZWZpbmUgQ01EX05QRV9TVEFSVCAgICAgICAgICAgICAgICAg IDB4MDIKKyNkZWZpbmUgQ01EX05QRV9TVE9QICAgICAgICAgICAgICAgICAgIDB4MDMKKyNkZWZp bmUgQ01EX05QRV9DTFJfUElQRSAgICAgICAgICAgICAgIDB4MDQKKyNkZWZpbmUgQ01EX0NMUl9Q Uk9GSUxFX0NOVCAgICAgICAgICAgIDB4MEMKKyNkZWZpbmUgQ01EX1JEX0lOU19NRU0gICAgICAg ICAgICAgICAgIDB4MTAgLyogaW5zdHJ1Y3Rpb24gbWVtb3J5ICovCisjZGVmaW5lIENNRF9XUl9J TlNfTUVNICAgICAgICAgICAgICAgICAweDExCisjZGVmaW5lIENNRF9SRF9EQVRBX01FTSAgICAg ICAgICAgICAgICAweDEyIC8qIGRhdGEgbWVtb3J5ICovCisjZGVmaW5lIENNRF9XUl9EQVRBX01F TSAgICAgICAgICAgICAgICAweDEzCisjZGVmaW5lIENNRF9SRF9FQ1NfUkVHICAgICAgICAgICAg ICAgICAweDE0IC8qIGV4ZWMgYWNjZXNzIHJlZ2lzdGVyICovCisjZGVmaW5lIENNRF9XUl9FQ1Nf UkVHICAgICAgICAgICAgICAgICAweDE1CisKKyNkZWZpbmUgU1RBVF9SVU4gICAgICAgICAgICAg ICAgICAgICAgIDB4ODAwMDAwMDAKKyNkZWZpbmUgU1RBVF9TVE9QICAgICAgICAgICAgICAgICAg ICAgIDB4NDAwMDAwMDAKKyNkZWZpbmUgU1RBVF9DTEVBUiAgICAgICAgICAgICAgICAgICAgIDB4 MjAwMDAwMDAKKyNkZWZpbmUgU1RBVF9FQ1NfSyAgICAgICAgICAgICAgICAgICAgIDB4MDA4MDAw MDAgLyogcGlwZWxpbmUgY2xlYW4gKi8KKworI2RlZmluZSBOUEVfU1RFVlQgICAgICAgICAgICAg ICAgICAgICAgMHgxQgorI2RlZmluZSBOUEVfU1RBUlRQQyAgICAgICAgICAgICAgICAgICAgMHgx QworI2RlZmluZSBOUEVfUkVHTUFQICAgICAgICAgICAgICAgICAgICAgMHgxRQorI2RlZmluZSBO UEVfQ0lOREVYICAgICAgICAgICAgICAgICAgICAgMHgxRgorCisjZGVmaW5lIElOU1RSX1dSX1JF R19TSE9SVCAgICAgICAgICAgICAweDAwMDBDMDAwCisjZGVmaW5lIElOU1RSX1dSX1JFR19CWVRF ICAgICAgICAgICAgICAweDAwMDA0MDAwCisjZGVmaW5lIElOU1RSX1JEX0ZJRk8gICAgICAgICAg ICAgICAgICAweDBGODg4MjIwCisjZGVmaW5lIElOU1RSX1JFU0VUX01CT1ggICAgICAgICAgICAg ICAweDBGQUM4MjEwCisKKyNkZWZpbmUgRUNTX0JHX0NUWFRfUkVHXzAgICAgICAgICAgICAgIDB4 MDAgLyogQmFja2dyb3VuZCBFeGVjdXRpbmcgQ29udGV4dCAqLworI2RlZmluZSBFQ1NfQkdfQ1RY VF9SRUdfMSAgICAgICAgICAgICAgMHgwMSAvKiBTdGFjayBsZXZlbCAqLworI2RlZmluZSBFQ1Nf QkdfQ1RYVF9SRUdfMiAgICAgICAgICAgICAgMHgwMgorI2RlZmluZSBFQ1NfUFJJXzFfQ1RYVF9S RUdfMCAgICAgICAgICAgMHgwNCAvKiBQcmlvcml0eSAxIEV4ZWN1dGluZyBDb250ZXh0ICovCisj ZGVmaW5lIEVDU19QUklfMV9DVFhUX1JFR18xICAgICAgICAgICAweDA1IC8qIFN0YWNrIGxldmVs ICovCisjZGVmaW5lIEVDU19QUklfMV9DVFhUX1JFR18yICAgICAgICAgICAweDA2CisjZGVmaW5l IEVDU19QUklfMl9DVFhUX1JFR18wICAgICAgICAgICAweDA4IC8qIFByaW9yaXR5IDIgRXhlY3V0 aW5nIENvbnRleHQgKi8KKyNkZWZpbmUgRUNTX1BSSV8yX0NUWFRfUkVHXzEgICAgICAgICAgIDB4 MDkgLyogU3RhY2sgbGV2ZWwgKi8KKyNkZWZpbmUgRUNTX1BSSV8yX0NUWFRfUkVHXzIgICAgICAg ICAgIDB4MEEKKyNkZWZpbmUgRUNTX0RCR19DVFhUX1JFR18wICAgICAgICAgICAgIDB4MEMgLyog RGVidWcgRXhlY3V0aW5nIENvbnRleHQgKi8KKyNkZWZpbmUgRUNTX0RCR19DVFhUX1JFR18xICAg ICAgICAgICAgIDB4MEQgLyogU3RhY2sgbGV2ZWwgKi8KKyNkZWZpbmUgRUNTX0RCR19DVFhUX1JF R18yICAgICAgICAgICAgIDB4MEUKKyNkZWZpbmUgRUNTX0lOU1RSVUNUX1JFRyAgICAgICAgICAg ICAgIDB4MTEgLyogTlBFI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sgaisrKQorCQkJbnBlX2NtZF93cml0ZShucGUsIGNiLT5u cGVfYWRkciArIGosIGNtZCwgY2ItPmRhdGFbal0pOworCX0KKworCW5wZV9zdGFydChucGUpOwor CWlmICghbnBlX3J1bm5pbmcobnBlKSkKKwkJcHJpbnRfbnBlKG5wZSwgInVuYWJsZSB0byBzdGFy dFxuIik7CisJZnJlZShpbWFnZSk7CisJcmV0dXJuIDA7CisKK3Rvb19iaWc6CisJcHJpbnRfbnBl KG5wZSwgIm1pY3JvY29kZSBibG9jayAjJWkgZG9lc24ndCBmaXQgaW4gTlBFICIKKwkJICAibWVt b3J5OiB0eXBlICVjLCBzdGFydCAweCVYLCBsZW5ndGggMHglWFxuIiwgaSwKKwkJICBibGstPnR5 cGUgPT0gRldfQkxPQ0tfVFlQRV9JTlNUUiA/ICdJJyA6ICdEJywKKwkJICBjYi0+bnBlX2FkZHIs IGNiLT5zaXplKTsKK2VycjoKKwlmcmVlKGltYWdlKTsKKwlyZXR1cm4gZXJyOworfQorCisKK3N0 cnVjdCBucGUgKm5wZV9yZXF1ZXN0KGludCBpZCkKK3sKKwlpZiAoaWQgPCBOUEVfQ09VTlQpCisJ CWlmIChucGVfdGFiW2lkXS52YWxpZCkKKwkJCXJldHVybiAmbnBlX3RhYltpZF07CisJcmV0dXJu IE5VTEw7Cit9CisKK3N0YXRpYyBpbnQgX19pbml0IG5wZV9pbml0KHZvaWQpCit7CisJaW50IGk7 CisKKwlmb3IgKGkgPSAwOyBpIDwgTlBFX0NPVU5UOyBpKyspIHsKKwkJc3RydWN0IG5wZSAqbnBl ID0gJm5wZV90YWJbaV07CisJCWlmICghKGl4cDR4eF9yZWFkX2ZlYXR1cmVfYml0cygpICYgKElY UDRYWF9GRUFUVVJFX1JFU0VUX05QRUEgPDwgaSkpKQorCQkJY29udGludWU7IC8qIE5QRSBhbHJl YWR5IGRpc2FibGVkIG9yIG5vdCBwcmVzZW50ICovCisJCWlmIChucGVfcmVzZXQobnBlKSkKKwkJ CWN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