From nobody Thu Jun 22 10:21:20 2023 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QmxH446v8z4fhgB for ; Thu, 22 Jun 2023 10:21:20 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QmxH43bHJz4KT4; Thu, 22 Jun 2023 10:21:20 +0000 (UTC) (envelope-from daemon-user@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687429280; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=ubqjT9/J9Kv82MJyPt9VLu6wNY/ygh2ktbmUuDhj/8k=; b=bC6NLpuTL0ljillelwyz5rd1fQyqzbMjbGKps+VctChYFw3PyWFfGg5CmrYuu9mqG/oh+0 zw/M9yths/HrM6o5sQRe98VL/rBg9y5nY8W1xP32D/iqmzycM94knDSx3YQ+LiPlzm0fq3 39R6081l6ofmjOPWI79tAqsmz2IDWjCSPnsR7ICe5/9r2Sj0WRTBUx2XRMLNkM56unkx4S AsfbZh5/a0RJfEvs0M2MHZSD3EZuwWGn+USeFLOxP+AW5UpV1q0h9ufycZ1D83AaljYn/Z dVlJrJ8kLzO5Qqvxq1cGyR/hd8juGWFYPQIBJGmcoUnUsOCcgnuG9tSYA8Jqiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687429280; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=ubqjT9/J9Kv82MJyPt9VLu6wNY/ygh2ktbmUuDhj/8k=; b=ortCxLh1TBv1ZSdU4BFXHgqSkK/prajlqJIz5ttK4t49gH8gvXGpO3+eIcbVTKNAmRWSl0 OvvaY5L5WQbhG3AjTfBQifR25lBu/AmUtTz4Yxhg1gn6kZRMVhMOxPkarLiEsBHORaKWDj tGquHr8esejRay4DUkc2Xpejurg0obIA0oXgwweV/MxXCW5zgFeqV8HFkBs6VnZ6CM2rK1 sM1akx2+APEKinAncdXB8PopI2KBnHcnazqVRxVgGciroms6QBDtNhkouWwdotdVa3x3vI gE8vIsPPMLPdFCoCudhHCbAurEr+Nh6YdbMDpi3HtbzLRIdHFyHtLUlnwAREWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687429280; a=rsa-sha256; cv=none; b=FCzuqfU5WHUVKzpIrwVfxgwONpYP7VEQ/ISoDagpU5ahi5GwA90HrTGZ6jOfSbWX7bj9Xy zfnEMfafEkZOL7lyVU5AXWUmuaVhAvDZB3OeFoI/K/cuTdSpFLXeDBGEbxff45693Nu8TY zIzoc4mdcOgdKmLppE6ZfIxlc5JOC8vDLYoitjC7Adcxn7iQErc3pIpsE7NkfSlJXtCNUI 9r50VwunicvAA7fj2VUSj6cbJlTLHgMf1NVdlwOmR05mdNBQiSk+34HhRkD5QnllJaNkzC 7VlWE6NGN9B3UH3nbwjzkJ4k6zpwl2j7juE5cYyo9lIoxQwyO9Zy2JSV0rj3fQ== Received: from reviews.nyi.freebsd.org (reviews.nyi.freebsd.org [IPv6:2610:1c1:1:606c::16:b]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4QmxH42d8szK6B; Thu, 22 Jun 2023 10:21:20 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by reviews.nyi.freebsd.org (Postfix, from userid 1346) id 58AF211AFA; Thu, 22 Jun 2023 10:21:20 +0000 (UTC) Date: Thu, 22 Jun 2023 10:21:20 +0000 To: Phabricator From: "titus_edc.ro (Titus Manea)" Cc: freebsd-arm@freebsd.org Reply-to: "titus_edc.ro (Titus Manea)" Subject: [Differential] D40717: support for pwm controlled voltage regulator Message-ID: <680f2bb9fe25a8b507280cd708d2922a@localhost.localdomain> X-Priority: 3 X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , X-Herald-Rules: <135> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: Precedence: bulk Thread-Topic: PHID-DREV-4acnpqq523bd2phe3rki X-Phabricator-Mail-ID: 3926034 X-Phabricator-Send-Attempt: 5hof4n4lpchuactc In-Reply-To: References: Thread-Index: OWIxNTdjYWFjM2NkZTc3M2EyYjdjZThlOGJlIGSUIKA= X-Phabricator-Stamps: actor(@titus_edc.ro) application(Differential) author(@titus_edc.ro) herald(H135) monogram(D40717) object-type(DREV) phid(PHID-DREV-4acnpqq523bd2phe3rki) reviewer(#arm64) reviewer(@manu) revision-status(needs-review) subscriber(@freebsd-arm-list) via(web) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_680f2bb9fe25a8b507280cd708d2922a" X-ThisMailContainsUnwantedMimeParts: N --b1_680f2bb9fe25a8b507280cd708d2922a Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: base64 dGl0dXNfZWRjLnJvIGNyZWF0ZWQgdGhpcyByZXZpc2lvbi4KdGl0dXNfZWRjLnJvIGFkZGVkIGEg cmV2aWV3ZXI6IGFybTY0LgpIZXJhbGQgYWRkZWQgYSByZXZpZXdlcjogbWFudS4KdGl0dXNfZWRj LnJvIHJlcXVlc3RlZCByZXZpZXcgb2YgdGhpcyByZXZpc2lvbi4KClJFVklTSU9OIFNVTU1BUlkK ICBvbmx5IGNvbnRpbnVvdXMgbW9kZSBzdXBwb3J0ZWQsIHRhYmxlcyBhcmUgbm90CiAgaW5zcGly ZWQvcG9ydGVkIGZyb20gb3BlbmJzZCBhbmQgZnJhbmtlbnN0ZWluZWQgcmVndWxhdG9yLWZpeGVk CiAganVzdCBuZWVkZWQgaXQgc28gY3B1ZnJlcV9kdCB3aWxsIHdvcmsgb24gcmszMzA4CgpSRVZJ U0lPTiBERVRBSUwKICBodHRwczovL3Jldmlld3MuZnJlZWJzZC5vcmcvRDQwNzE3CgpBRkZFQ1RF RCBGSUxFUwogIHN5cy9jb25mL2ZpbGVzCiAgc3lzL2Rldi9leHRyZXMvcmVndWxhdG9yL3JlZ3Vs YXRvcl9wd20uYwogIHN5cy9kZXYvZXh0cmVzL3JlZ3VsYXRvci9yZWd1bGF0b3JfcHdtLmgKCkVN QUlMIFBSRUZFUkVOQ0VTCiAgaHR0cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL3NldHRpbmdzL3Bh bmVsL2VtYWlscHJlZmVyZW5jZXMvCgpUbzogdGl0dXNfZWRjLnJvLCAjYXJtNjQsIG1hbnUKQ2M6 IGZyZWVic2QtYXJtLWxpc3QK --b1_680f2bb9fe25a8b507280cd708d2922a Content-Type: text/x-patch; charset=utf-8; name="D40717.123652.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D40717.123652.patch" ZGlmZiAtLWdpdCBhL3N5cy9kZXYvZXh0cmVzL3JlZ3VsYXRvci9yZWd1bGF0b3JfcHdtLmggYi9z eXMvZGV2L2V4dHJlcy9yZWd1bGF0b3IvcmVndWxhdG9yX3B3bS5oCm5ldyBmaWxlIG1vZGUgMTAw NjQ0Ci0tLSAvZGV2L251bGwKKysrIGIvc3lzL2R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ktPmdwaW9fcGluOworCWlmIChzYy0+Z3Bpb19lbnRyeS0+ZW5hYmxlX2NudCA+ IDApIHsKKwkJLyogT3RoZXIgcmVndWxhdG9yKHMpIGFyZSBlbmFibGVkLiAqLworCQkvKiBYWFhY IEFueSBkaWFnbm9zdGljIG1lc3NhZ2U/IE9yIGVycm9yPyAqLworCQlyZXR1cm4gKDApOworCX0K KwlydiA9IEdQSU9fUElOX1NFVChwaW4tPmRldiwgcGluLT5waW4sCisJICAgIHNjLT5wYXJhbS0+ ZW5hYmxlX2FjdGl2ZV9oaWdoID8gZmFsc2U6IHRydWUpOworCWlmIChydiAhPSAwKSB7CisJCWRl dmljZV9wcmludGYoZGV2LCAiQ2Fubm90IHNldCBHUElPIHBpbjogJWRcbiIsIHBpbi0+cGluKTsK KwkJcmV0dXJuIChydik7CisJfQorCSp1ZGVsYXkgPSBzYy0+cGFyYW0tPmVuYWJsZV9kZWxheTsK KwlyZXR1cm4gKDApOworfQorCitzdGF0aWMgaW50CityZWdub2RlX3B3bV9zdGF0dXMoc3RydWN0 IHJlZ25vZGUgKnJlZ25vZGUsIGludCAqc3RhdHVzKQoreworCXN0cnVjdCByZWdub2RlX3B3bV9z YyAqc2M7CisJc3RydWN0IGdwaW9idXNfcGluICpwaW47CisJdWludDMyX3QgdmFsOworCWludCBy djsKKworCXNjID0gcmVnbm9kZV9nZXRfc29mdGMocmVnbm9kZSk7CisKKwkqc3RhdHVzID0gMDsK KwlpZiAoc2MtPmdwaW9fZW50cnkgPT0gTlVMTCkgeworCQkqc3RhdHVzID0gUkVHVUxBVE9SX1NU QVRVU19FTkFCTEVEOworCQlyZXR1cm4gKDApOworCX0KKwlwaW4gPSAmc2MtPmdwaW9fZW50cnkt PmdwaW9fcGluOworCisJcnYgPSBHUElPX1BJTl9HRVQocGluLT5kZXYsIHBpbi0+cGluLCAmdmFs KTsKKwlpZiAocnYgPT0gMCkgeworCQlpZiAoIXNjLT5wYXJhbS0+ZW5hYmxlX2FjdGl2ZV9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vKiBSZWdpc3RlciByZWd1bGF0b3IuICovCisJcmVnbm9kZV9wd21fcmVnaXN0ZXIo c2MtPmRldiwgJnNjLT5pbml0X2RlZik7CisJc2MtPmF0dGFjaF9kb25lID0gdHJ1ZTsKK30KKwor c3RhdGljIGludAorcmVncHdtX3Byb2JlKGRldmljZV90IGRldikKK3sKKworCWlmICghb2Z3X2J1 c19zdGF0dXNfb2theShkZXYpKQorCQlyZXR1cm4gKEVOWElPKTsKKworCWlmICghb2Z3X2J1c19z ZWFyY2hfY29tcGF0aWJsZShkZXYsIGNvbXBhdF9kYXRhKS0+b2NkX2RhdGEpCisJCXJldHVybiAo RU5YSU8pOworCisJZGV2aWNlX3NldF9kZXNjKGRldiwgIlBXTSBSZWd1bGF0b3IiKTsKKwlyZXR1 cm4gKEJVU19QUk9CRV9ERUZBVUxUKTsKK30KKworc3RhdGljIGludAorcmVncHdtX2RldGFjaChk ZXZpY2VfdCBkZXYpCit7CisKKwkvKiBUaGlzIGRldmljZSBpcyBhbHdheXMgcHJlc2VudC4gKi8K KwlyZXR1cm4gKEVCVVNZKTsKK30KKworc3RhdGljIGludAorcmVncHdtX2F0dGFjaChkZXZpY2Vf dCBkZXYpCit7CisJc3RydWN0IHJlZ3B3bV9zb2Z0YyAqIHNjOworCWludCBydjsKKworCXNjID0g ZGV2aWNlX2dldF9zb2Z0YyhkZXYpOworCXNjLT5kZXYgPSBkZXY7CisKKwkvKiBQYXJzZSBGRFQg ZGF0YS4gKi8KKwlydiA9IHJlZ3B3bV9wYXJzZV9mZHQoc2MpOworCWlmIChydiAhPSAwKQorCQly ZXR1cm4oRU5YSU8pOworCisJLyogRmlsbCByZXNldCBvZiBpbml0LiAqLworCXNjLT5pbml0X2Rl Zi5yZWdfaW5pdF9kZWYuaWQgPSAxOworCXNjLT5pbml0X2RlZi5yZWdfaW5pdF9kZWYuZmxhZ3Mg PSBSRUdVTEFUT1JfRkxBR1NfU1RBVElDOworCisJLyogVHJ5IHRvIGdldCBhbmQgY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