From owner-dev-commits-src-all@freebsd.org Tue Mar 9 16:43:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 744AC568CC1; Tue, 9 Mar 2021 16:43:29 +0000 (UTC) (envelope-from git@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 4Dw1HP2rfwz4fxw; Tue, 9 Mar 2021 16:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54BB11F7BA; Tue, 9 Mar 2021 16:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 129GhTkf077302; Tue, 9 Mar 2021 16:43:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 129GhTSj077301; Tue, 9 Mar 2021 16:43:29 GMT (envelope-from git) Date: Tue, 9 Mar 2021 16:43:29 GMT Message-Id: <202103091643.129GhTSj077301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: 043577b721ec - main - ofwfb: fix boot on LE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 043577b721ec4e5c2ab7571e6c05cfd54e49473c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2021 16:43:29 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=043577b721ec4e5c2ab7571e6c05cfd54e49473c commit 043577b721ec4e5c2ab7571e6c05cfd54e49473c Author: Leandro Lupori AuthorDate: 2021-03-09 15:11:58 +0000 Commit: Leandro Lupori CommitDate: 2021-03-09 16:29:24 +0000 ofwfb: fix boot on LE Some framebuffer properties obtained from the device tree were not being properly converted to host endian. Replace OF_getprop calls by OF_getencprop where needed to fix this. This fixes boot on PowerPC64 LE, when using ofwfb as the system console. Reviewed by: bdragon Sponsored by: Eldorado Research Institute (eldorado.org.br) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27475 --- sys/dev/vt/hw/ofwfb/ofwfb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/vt/hw/ofwfb/ofwfb.c b/sys/dev/vt/hw/ofwfb/ofwfb.c index 8a1b7b3688a7..9dc674c0ebf9 100644 --- a/sys/dev/vt/hw/ofwfb/ofwfb.c +++ b/sys/dev/vt/hw/ofwfb/ofwfb.c @@ -108,7 +108,7 @@ ofwfb_probe(struct vt_device *vd) return (CN_DEAD); node = -1; - if (OF_getprop(chosen, "stdout", &stdout, sizeof(stdout)) == + if (OF_getencprop(chosen, "stdout", &stdout, sizeof(stdout)) == sizeof(stdout)) node = OF_instance_to_package(stdout); if (node == -1) @@ -386,7 +386,7 @@ ofwfb_init(struct vt_device *vd) char buf[64]; phandle_t chosen; phandle_t node; - uint32_t depth, height, width, stride; + pcell_t depth, height, width, stride; uint32_t vendor_id = 0; cell_t adr[2]; uint64_t user_phys; @@ -399,7 +399,7 @@ ofwfb_init(struct vt_device *vd) node = -1; chosen = OF_finddevice("/chosen"); - if (OF_getprop(chosen, "stdout", &sc->sc_handle, + if (OF_getencprop(chosen, "stdout", &sc->sc_handle, sizeof(ihandle_t)) == sizeof(ihandle_t)) node = OF_instance_to_package(sc->sc_handle); if (node == -1) @@ -448,14 +448,14 @@ ofwfb_init(struct vt_device *vd) return (CN_DEAD); /* Only support 8 and 32-bit framebuffers */ - OF_getprop(node, "depth", &depth, sizeof(depth)); + OF_getencprop(node, "depth", &depth, sizeof(depth)); if (depth != 8 && depth != 32) return (CN_DEAD); sc->fb.fb_bpp = sc->fb.fb_depth = depth; - OF_getprop(node, "height", &height, sizeof(height)); - OF_getprop(node, "width", &width, sizeof(width)); - if (OF_getprop(node, "linebytes", &stride, sizeof(stride)) != + OF_getencprop(node, "height", &height, sizeof(height)); + OF_getencprop(node, "width", &width, sizeof(width)); + if (OF_getencprop(node, "linebytes", &stride, sizeof(stride)) != sizeof(stride)) stride = width*depth/8; @@ -537,11 +537,11 @@ ofwfb_init(struct vt_device *vd) * may be the child of the PCI device: in that case, try the * parent for the assigned-addresses property. */ - len = OF_getprop(node, "assigned-addresses", pciaddrs, - sizeof(pciaddrs)); + len = OF_getencprop(node, "assigned-addresses", + (pcell_t *)pciaddrs, sizeof(pciaddrs)); if (len == -1) { - len = OF_getprop(OF_parent(node), "assigned-addresses", - pciaddrs, sizeof(pciaddrs)); + len = OF_getencprop(OF_parent(node), "assigned-addresses", + (pcell_t *)pciaddrs, sizeof(pciaddrs)); } if (len == -1) len = 0;