From nobody Fri Sep 20 20:32:50 2024 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 4X9QVZ0cGqz5XB7t for ; Fri, 20 Sep 2024 21:28:38 +0000 (UTC) (envelope-from dsl@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9QVY6KB6z4qpp; Fri, 20 Sep 2024 21:28:37 +0000 (UTC) (envelope-from dsl@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726867717; h=from:from: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=DCvR7jMHGxF9BMvLDSFKdcMkBYAMKhsXUvTt+LdIeRo=; b=Vv/AFNrhU2xMzfeBnrb/l180eR+J1GGQA4WqIYGgoB9rNIz0r0tkoOxzpzh7y0/BmED0R7 EyEnsvewM4T+WAtEyci1LeaL5UnqWc24ziHn5r9+BVTTW1uzQ0DaOO/mMNmIWKmB7VDTn0 IpGM3MEevRKzTFdbAdZXhPoG9ss/KgFRcZ+NKgrqlwrOt2VSCUujILRfioye6xMpyPoSe6 bi86m9HlyiiB4DSSKKTQ4bCRkibD9nz4rGx6lbYrWEpsbiM9h/cwb/5hz+1S+J2gjgTU4n Vt60+YUA3eNoLvqQZZF/EH19Xl2MS1z1s6lwbonawaKj/ApVOAjdo8PZyDy7XA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726867717; a=rsa-sha256; cv=none; b=mPL/XeaXIKd8IQ26YQ17rznsaR2xH7IAruBCwSki7NIyg7lxo6a3aqtx/6iRmrw+kIcl9C o2cPnJPa9k4MwDbBqPvAGv1JdT7UDnxMm30ajBcCbcyibpiw/dTZTavRQXUcwx5HR3LfsP p15qR+Q8htzfg3nsejEozFh5eAkRX/dUe+fzFBY/Sg4SoOsfoQH8obX/ETScHSd/QyrEFP 7TxqUSnj1/d2uG+eUgpCRmHV9GmuyUNpaB8RL51MS+ydG7JJnJKT9L52zeBI3n4J7GfY+a 8c4KDqQ7jV0j42O4WqvpSshh/DGpA2JdMh64f/8UEb4SoM6u/W1puWKgtxtOgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726867717; h=from:from: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=DCvR7jMHGxF9BMvLDSFKdcMkBYAMKhsXUvTt+LdIeRo=; b=wfJcDi8bPcRAmhjpAPKISSCPhWYs4OHLytcXN3ZBqwQ4kiPmd0o60NCK3gfn/bk79DRgso smzn8hJWmyr3Bel0feUfUilypSEHCCusjQ6Dsqu8CHB7X7pE2dreMqTGangOco0rxOuIQZ ydsR3d8OHiUtXZPSTIoT8y4hCLhriZuUElCaotC2GajNNjQ4h26E7WfYX9hQjTgAayuQJU pIE4l2SRAaSQB39C/M89pU557W6NwIQOCVWb2QkakEYK7+Gwsbrnij5ncJwI7jN4Evf12W X8VHFKcqzHndQT/QpYoPlD2kyPA4a884s5zg6cVtLCxbMLwnWzUODF1J3Q/Kcg== Received: from localhost (unknown [91.226.51.235]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: dsl) by smtp.freebsd.org (Postfix) with ESMTPSA id 4X9QVY3tRHzQZk; Fri, 20 Sep 2024 21:28:37 +0000 (UTC) (envelope-from dsl@FreeBSD.org) References: <5kADboXE-OUia2ncm13XjDesvDmjB3tjWSyr3ytCpa5XYof9xOrL9AbRownQoRG9eJcJpYswqjbMt0P0XiZfs7KNNfiNF7vQ93m72mm_Fyk=@protonmail.com> User-agent: mu4e 1.8.13; emacs 29.4 From: Dmitry Salychev To: Christoph Pfaller Cc: freebsd-arm@freebsd.org Subject: Re: Rockchip RK3328 Rock64 HDMI Date: Fri, 20 Sep 2024 22:32:50 +0200 In-reply-to: <5kADboXE-OUia2ncm13XjDesvDmjB3tjWSyr3ytCpa5XYof9xOrL9AbRownQoRG9eJcJpYswqjbMt0P0XiZfs7KNNfiNF7vQ93m72mm_Fyk=@protonmail.com> Message-ID: <86a5g2ypz1.fsf@peasant.bootbsd.com> 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: text/plain Christoph Pfaller writes: > Hello! > > I recently switched to FreeBSD on my Rock64 due to appearing kernel panics when running the board with Linux. So far I > enjoy the operating system. However; there is one little annoyance - the integrated HDMI output does not work. So I want to > change that. > > As we are on ARM my first intention was looking into the device tree for the rk3328. I compared it to Linux device tree and also > found some missing parts. My next step was looking into the drivers itself and as the Linux drivers sources are available here > https://github.com/torvalds/linux/tree/master/drivers/gpu/drm/rockchip I got some idea how the corresponding driver should > look like. > > However, I am unsure how I should proceed getting HDMI to work. Accodring to https://wiki.freebsd.org/arm/RockChip HDMI > works for the rockchip rk3399 but I could not find any drivers neither in the freebsd-src or drm-kmod (I am new to FreeBSD so > i don't know if this is even the right place to look for). I hope someone with more technical knowledge about FreeBSD or HDMI > can provide me with some guidance on where I have to look and work on. > > Greetings > pf0 Hey! I'd start digging into: sys/contrib/device-tree/src/arm64/rockchip/rk3399-rockpro64.dts sys/contrib/device-tree/src/arm64/rockchip/rk3399-rockpro64.dtsi sys/contrib/device-tree/src/arm64/rockchip/rk3399-rockpro64-v2.dts Btw, "hdmi" node is enabled in rk3399-rockpro64.dtsi: #include "rk3399.dtsi" #include "rk3399-opp.dtsi" ... &hdmi { ddc-i2c-bus = <&i2c3>; pinctrl-names = "default"; pinctrl-0 = <&hdmi_cec>; status = "okay"; }; If you take a look at rk3399.dtsi, you'll see: hdmi: hdmi@ff940000 { compatible = "rockchip,rk3399-dw-hdmi"; reg = <0x0 0xff940000 0x0 0x20000>; interrupts = ; clocks = <&cru PCLK_HDMI_CTRL>, <&cru SCLK_HDMI_SFR>, <&cru SCLK_HDMI_CEC>, <&cru PCLK_VIO_GRF>, <&cru PLL_VPLL>; clock-names = "iahb", "isfr", "cec", "grf", "ref"; power-domains = <&power RK3399_PD_HDCP>; reg-io-width = <4>; rockchip,grf = <&grf>; #sound-dai-cells = <0>; status = "disabled"; Try to grep sys/dev, but I don't see any driver on the latest CURRENT which declares compatibility with "rockchip,rk3399-dw-hdmi". drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c from the Linux source tree is only ~600 LoC. You'd try to port it to FreeBSD using LinuxKPI[1], I guess. I'd love to try running it on my PinePhone Pro. Regards, Dmitry [1] https://wiki.freebsd.org/LinuxKPI -- https://wiki.freebsd.org/DmitrySalychev