From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from inx.pm.waw.pl ([195.116.170.130]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UOviZ-00087k-Jl for barebox@lists.infradead.org; Sun, 07 Apr 2013 19:57:37 +0000 From: Krzysztof Halasa References: <20130402065241.GB1906@pengutronix.de> Date: Sun, 07 Apr 2013 21:57:33 +0200 In-Reply-To: (Krzysztof Halasa's message of "Sun, 07 Apr 2013 13:42:21 +0200") Message-ID: 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] ARM: Support for IXP4xx Network Processor Engines (NPEs). To: barebox@lists.infradead.org U2lnbmVkLW9mZi1ieTogS3J6eXN6dG9mIEhhxYJhc2EgPGtoY0BwbS53YXcucGw+CgpkaWZmIC0t Z2l0IGEvYXJjaC9hcm0vbWFjaC1peHA0eHgvS2NvbmZpZyBiL2FyY2gvYXJtL21hY2gtaXhwNHh4 L0tjb25maWcKaW5kZXggOTI0NGJlOS4uMzNlOGJiMyAxMDA2NDQKLS0tIGEvYXJjaC9hcm0vbWFj aC1peHA0eHgvS2NvbmZpZworKysgYi9hcmNoL2FybS9tYWNoLWl4cDR4eC9LY29uZmlnCkBAIC02 LDQgKzYsMTAgQEAgY29uZmlnIElYUDRYWF9RTUdSCiAJICBUaGlzIGRyaXZlciBzdXBwb3J0cyBJ WFA0eHggYnVpbHQtaW4gaGFyZHdhcmUgcXVldWUgbWFuYWdlcgogCSAgYW5kIGlzIHJlcXVpcmVk IGJ5IHRoZSBFdGhlcm5ldCBkcml2ZXIuCiAKK2NvbmZpZyBJWFA0WFhfTlBFCisJdHJpc3RhdGUg IklYUDR4eCBOZXR3b3JrIFByb2Nlc3NvciBFbmdpbmUgc3VwcG9ydCIKKwlo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NkZWZpbmUgTlBFX0FfNDJYX0lOU1RSX1NJWkUgICAg ICAgICAgIDB4MTAwMAorI2RlZmluZSBOUEVfQl9BTkRfQ180MlhfSU5TVFJfU0laRSAgICAgMHg4 MDAKKyNkZWZpbmUgTlBFXzQ2WF9JTlNUUl9TSVpFICAgICAgICAgICAgIDB4MTAwMAorI2RlZmlu ZSBSRUdTX1NJWkUgICAgICAgICAgICAgICAgICAgICAgMHgxMDAwCisKKyNkZWZpbmUgTlBFX1BI WVNfUkVHICAgICAgICAgICAgICAgICAgIDMyCisKKyNkZWZpbmUgRldfTUFHSUMgICAgICAgICAg ICAgICAgICAgICAgIDB4RkVFREYwMEQKKyNkZWZpbmUgRldfQkxPQ0tfVFlQRV9JTlNUUiAgICAg ICAgICAgIDB4MAorI2RlZmluZSBGV19CTE9DS19UWVBFX0RBVEEgICAgICAgICAgICAgMHgxCisj ZGVmaW5lIEZXX0JMT0NLX1RZUEVfRU9GICAgICAgICAgICAgICAweEYKKworLyogTlBFIGV4ZWMg c3RhdHVzIChyZWFkKSBhbmQgY29tbWFuZCAod3JpdGUpICovCisjZGVmaW5lIENNRF9OUEVfU1RF UCAgICAgICAgICAgICAgICAgICAweDAxCisjZGVmaW5lIENNRF9OUEVfU1RBUlQgICAgICAgICAg ICAgICAgICAweDAyCisjZGVmaW5lIENNRF9OUEVfU1RPUCAgICAgICAgICAgICAgICAgICAweDAz CisjZGVmaW5lIENNRF9OUEVfQ0xSX1BJUEUgICAgICAgICAgICAgICAweDA0CisjZGVmaW5lIENN RF9DTFJfUFJPRklMRV9DTlQgICAgICAgICAgICAweDBDCisjZGVmaW5lIENNRF9SRF9JTlNfTUVN ICAgICAgICAgICAgICAgICAweDEwIC8qIGluc3RydWN0aW9uIG1lbW9yeSAqLworI2RlZmluZSBD TURfV1JfSU5TX01FTSAgICAgICAgICAgICAgICAgMHgxMQorI2RlZmluZSBDTURfUkRfREFUQV9N RU0gICAgICAgICAgICAgICAgMHgxMiAvKiBkYXRhIG1lbW9yeSAqLworI2RlZmluZSBDTURfV1Jf REFUQV9NRU0gICAgICAgICAgICAgICAgMHgxMworI2RlZmluZSBDTURfUkRfRUNTX1JFRyAgICAg ICAgICAgICAgICAgMHgxNCAvKiBleGVjIGFjY2VzcyByZWdpc3RlciAqLworI2RlZmluZSBDTURf V1JfRUNTX1JFRyAgICAgICAgICAgICAgICAgMHgxNQorCisjZGVmaW5lIFNUQVRfUlVOICAgICAg ICAgICAgICAgICAgICAgICAweDgwMDAwMDAwCisjZGVmaW5lIFNUQVRfU1RPUCAgICAgICAgICAg ICAgICAgICAgICAweDQwMDAwMDAwCisjZGVmaW5lIFNUQVRfQ0xFQVIgICAgICAgICAgICAgICAg ICAgICAweDIwMDAwMDAwCisjZGVmaW5lIFNUQVRfRUNTX0sgICAgICAgICAgICAgICAgICAgICAw eDAwODAwMDAwIC8qIHBpcGVsaW5lIGNsZWFuICovCisKKyNkZWZpbmUgTlBFX1NURVZUICAgICAg ICAgICAgICAgICAgICAgIDB4MUIKKyNkZWZpbmUgTlBFX1NUQVJUUEMgICAgICAgICAgICAgICAg ICAgIDB4MUMKKyNkZWZpbmUgTlBFX1JFR01BUCAgICAgICAgICAgICAgICAgICAgIDB4MUUKKyNk ZWZpbmUgTlBFX0NJTkRFWCAgICAgICAgICAgICAgICAgICAgIDB4MUYKKworI2RlZmluZSBJTlNU Ul9XUl9SRUdfU0hPUlQgICAgICAgICAgICAgMHgwMDAwQzAwMAorI2RlZmluZSBJTlNUUl9XUl9S RUdfQllURSAgICAgICAgICAgICAgMHgwMDAwNDAwMAorI2RlZmluZSBJTlNUUl9SRF9GSUZPICAg ICAgICAgICAgICAgICAgMHgwRjg4ODIyMAorI2RlZmluZSBJTlNUUl9SRVNFVF9NQk9YICAgICAg ICAgICAgICAgMHgwRkFDODIxMAorCisjZGVmaW5lIEVDU19CR19DVFhUX1JFR18wICAgICAgICAg ICAgICAweDAwIC8qIEJhY2tncm91bmQgRXhlY3V0aW5nIENvbnRleHQgKi8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W2pdKTsKKwl9CisKKwlucGVfc3RhcnQobnBlKTsK KwlpZiAoIW5wZV9ydW5uaW5nKG5wZSkpCisJCXByaW50X25wZShucGUsICJ1bmFibGUgdG8gc3Rh cnRcbiIpOworCWZyZWUoaW1hZ2UpOworCXJldHVybiAwOworCit0b29fYmlnOgorCXByaW50X25w ZShucGUsICJtaWNyb2NvZGUgYmxvY2sgIyVpIGRvZXNuJ3QgZml0IGluIE5QRSAiCisJCSAgIm1l bW9yeTogdHlwZSAlYywgc3RhcnQgMHglWCwgbGVuZ3RoIDB4JVhcbiIsIGksCisJCSAgYmxrLT50 eXBlID09IEZXX0JMT0NLX1RZUEVfSU5TVFIgPyAnSScgOiAnRCcsCisJCSAgY2ItPm5wZV9hZGRy LCBjYi0+c2l6ZSk7CitlcnI6CisJZnJlZShpbWFnZSk7CisJcmV0dXJuIGVycjsKK30KKworCitz dHJ1Y3QgbnBlICpucGVfcmVxdWVzdChpbnQgaWQpCit7CisJaWYgKGlkIDwgQVJSQVlfU0laRShu cGVfdGFiKSkKKwkJaWYgKG5wZV90YWJbaWRdLnZhbGlkKQorCQkJcmV0dXJuICZucGVfdGFiW2lk XTsKKwlyZXR1cm4gTlVMTDsKK30KKworc3RhdGljIGludCBfX2luaXQgbnBlX2luaXQodm9pZCkK K3sKKwlpbnQgaTsKKworCWZvciAoaSA9IDA7IGkgPCBBUlJBWV9TSVpFKG5wZV90YWIpOyBpKysp IHsKKwkJc3RydWN0IG5wZSAqbnBlID0gJm5wZV90YWJbaV07CisJCWlmICghKGl4cDR4eF9yZWFk X2ZlYXR1cmVfYml0cygpICYgKElYUDRYWF9GRUFUVVJFX1JFU0VUX05QRUEgPDwgaSkpKQorCQkJ Y29udGludWU7IC8qIE5QRSBhbHJlYWR5IGRpc2FibGVkIG9yIG5vdCBwcmVzZW50ICovCisJCWlm IChucGVfcmVzZXQobnBlKSkKKwkJCWNvbnRpbnVlOworCQlucGUtPnZhbGlkID0gMTsKKwl9CisJ cmV0dXJuIDA7Cit9CisKK2NvcmVkZXZpY2VfaW5pdGNhbGwobnBlX2luaXQpOwoKX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYmFyZWJveCBtYWlsaW5nIGxp c3QKYmFyZWJveEBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5pbmZyYWRlYWQub3Jn L21haWxtYW4vbGlzdGluZm8vYmFyZWJveAo=