FreeBSD for Edge / Edge-V

Can this script be used in Freebsd? As I don’t see you mentioned anything about freebsd here.
Yes the fan is always on.

This is throwing some error. Lan does not have dhcp enabled.
I will try it again and get back,
My board is Edge-V Pro.

I dont see /dev/pwm

root@khadas-edge-v:~ # pwm -f /dev/                                                                          
audit%       diskid/      kbd1@        mmcsd1boot0% stdin@       ugen4.3@                                    
auditpipe%   efi%         kbdmux0%     mmcsd1boot1% stdout@      ugen4.4@                                    
bpf%         fd/          klog%        mmcsd1rpmb%  sysmouse%    uhid0%                                      
bpf0@        fido%        kmem%        msdosfs/     ttyu0.init%  uinput%                                     
console%     full%        led/         music0%      ttyu0.lock%  ukbd0%                                      
consolectl%  geom.ctl%    log@         netdump%     ttyu0%       ums0%                                       
ctty%        gpioc0%      md0%         nfslock%     ttyu1.init%  urandom@                                    
cuau0.init%  gpioc1%      md1%         null%        ttyu1.lock%  usb/                                        
cuau0.lock%  gpioc2%      mdctl%       openfirm%    ttyu1%       usbctl%                                     
cuau0%       gpioc3%      mem%         pci%         ufssuspend%  xpt0%                                       
cuau1.init%  gpioc4%      midistat%    pfil%        ugen0.1@     zero%                                       
cuau1.lock%  iic0%        mmcsd0%      random%      ugen1.1@                                                 
cuau1%       iic1%        mmcsd0s1%    reroot/      ugen2.1@                                                 
devctl%      iic2%        mmcsd0s2%    sequencer0%  ugen3.1@                                                 
devctl2%     input/       mmcsd0s2a%   sndstat%     ugen4.1@                                                 
devstat%     kbd0@        mmcsd1%      stderr@      ugen4.2@  

dhcpclient runs but cannot find an ip, While my router is working and the same cable is used on all the other boards tested on my desk.

Yes, I wrote it specifically for FreeBSD, since it does not have the built-in fan control like Linux.

I’m not sure your LAN message is related to the PWM fan controller at all. It’s possible the Edge-V Pro has a different pwm device. For example, on my RockPro64 board, I had to modify the script to use /dev/pwm/pwmc1.0 instead of /dev/pwm/pwmc0.0.

Try ls -l /dev/pwm/ and then use the pwm command to iterate through the various devices and see which is controlling the fan.

Edit: Oh, I see your update now. I’m not sure why you aren’t seeing /dev/pwm/ - does “dmesg | grep -i pwm” show anything? Perhaps your DTB is not accurate because you’re using the Edge-V Pro?

 # dmesg | grep pwm                                                                      
Clock: clk_vop0_pwm_c, parent: vpll(0), freq: 4000000                                                        
Clock: clk_vop1_pwm_c, parent: vpll(0), freq: 4000000                                                        
Clock: clk_vop1_pwm, parent: clk_vop1_pwm_c(0), freq: 4000000                                                
Clock: clk_vop0_pwm, parent: clk_vop0_pwm_c(0), freq: 4000000                                                
Processing 1 pin-config node(s) in pinctrl-0 for pwm@ff420000                                                
Processing 1 pin-config node(s) in pinctrl-0 for pwm@ff420020                                                
ofwbus0: <pwm@ff420000> mem 0xff420000-0xff42000f compat rockchip,rk3399-pwm (no driver attached)            
ofwbus0: <pwm@ff420010> mem 0xff420010-0xff42001f disabled compat rockchip,rk3399-pwm (no driver attached)   
ofwbus0: <pwm@ff420020> mem 0xff420020-0xff42002f compat rockchip,rk3399-pwm (no driver attached)            
ofwbus0: <pwm@ff420030> mem 0xff420030-0xff42003f disabled compat rockchip,rk3399-pwm (no driver attached)   
ofwbus0: <vdd-log> compat pwm-regulator (no driver attached)                                                 
ofwbus0: <pwm-fan> compat pwm-fan (no driver attached)                                                       
root@khadas-edge-v:~ # 

Yeah, I think there’s something up with your DTB that isn’t right. I don’t know if there’s an rk3399-khadas-edge-pro.dtb (there isn’t on my system, but I haven’t updated in awhile). My output has the devices correctly detected:

Clock: pclk_rkpwm_pmu, parent: pclk_pmu_src(0), freq: 48000000
Clock: clk_vop0_pwm_c, parent: vpll(0), freq: 4000000
Clock: clk_vop1_pwm_c, parent: vpll(0), freq: 4000000
Clock: clk_vop1_pwm, parent: clk_vop1_pwm_c(0), freq: 4000000
Clock: clk_vop0_pwm, parent: clk_vop0_pwm_c(0), freq: 4000000
Processing 1 pin-config node(s) in pinctrl-0 for pwm@ff420000
Processing 1 pin-config node(s) in pinctrl-0 for pwm@ff420020
pwm0: <Rockchip PWM> mem 0xff420000-0xff42000f on ofwbus0
pwmbus0: <OFW PWM bus> on pwm0
pwmc0: <PWM Control> channel 0 on pwmbus0
ofwbus0: <pwm@ff420010> mem 0xff420010-0xff42001f disabled compat rockchip,rk3399-pwm (no driver attached)
pwm1: <Rockchip PWM> mem 0xff420020-0xff42002f on ofwbus0
pwmbus1: <OFW PWM bus> on pwm1
pwmc1: <PWM Control> channel 0 on pwmbus1
ofwbus0: <pwm@ff420030> mem 0xff420030-0xff42003f disabled compat rockchip,rk3399-pwm (no driver attached)
ofwbus0: <vdd-log> compat pwm-regulator (no driver attached)
ofwbus0: <pwm-fan> compat pwm-fan (no driver attached)

Yes also I am trying to find the network issue.
I cannot find the reason for lan not getting IP. Must be something similar related to Lan driver in the dtb

Maybe @hyphop can advice something? Is there any difference between Edge-V Basic & Pro in terms of Lan and Pwm-Fan ?

Ethernet works only at 1Gbps speed, 100Mbps does not work correctly!

Experience shows that the fan can be turned off, there is enough Heatsink
khadas-edge will not overheat when compiling the kernel or the world.

I recommend using this image.
https://mega.nz/#!RNdRiI6B!0cqZ-W-4O900AHYBiEQsQ6DxLCnNqQQmFGB2oXZEl2E

1 Like

Hi @microdude

You don’t perhaps know how to auto enable the fan on Edge-V but using the 4.4 kernel without using any scripts? I want to enable the fan for LibreELEC and the 4.4 kernel is the only one supporting all the video codecs correctly until support is merged into mainline which might only be finished in a year’s time.

See Khadas Edge-V Fan support in Linux 4.4 kernel?

Sorry, I don’t. I’m not very familiar with the Linux kernel.

Hello @SleepWalker

Any progress on this? Did you get time to look into emmc boot?

Hi
You can just burn the system image on eMMC with the dd command.

1 Like

Amazing,
I just booted in freebsd the latest image on megacloud is working and I have intenet working on 1gb port.

Time to work on freebsd.

UPDATE: Flashed img to emmc using our Manjaro Emmc installer on sd card and now I have a working FreeBSD on emmc and it

UPDATE2: @microdude you fan script seems to work fine on the latest freebsd image.

Thanks for the response.

1 Like

Hi!

New FreeBSD-13.0-CURRENT Images for KHADAS-EDGE available for download.

STATUS:

  • U-BOOT-2020-07
  • FreeBSD-13.0-CURRENT r361113M
  • Boot from SD or eMMC.
  • Ethernet works only on 1Gbps
  • USB 2.0 - OK
  • USB 3.0 - OK
  • NVMe - OK
  • HDMI FULL HD - OK

Download link:

Minimal
FreeBSD-aarch64-13.0-CURRENT-Khadas-EDGE-20200722.img.xz

MATE Desktop
FreeBSD-aarch64-13.0-DESKTOP-Khadas-EDGE-20200717.img.xz

Username: admin
Password: admin

Welcome to the FreeBSD Community!

5 Likes

Nice this works fine.
The new FreeBSD splash screen is wonderful.

@SleepWalker I am doing stress test on this image and I am putting alot of stress on the cpu using the stress app and I see the temperature is always around 46-47 Degree C. I see that only 4 cores are being shown on hop
I see that you have added pwmfan control and it works. Either you have dropped the cpu frequency or have done some amazing thermal script. As I am aware that Rk3399 get hot alot when all cpu’s are under stress.

Image here.

Thanks.

1 Like

There is a script in my image cpu.
They can observe the temperature and frequency of the processor.
If you do not use NVMe, then you can try to increase the number of cores to 6.
The ncpu parameter in the /boot/loader.conf file.
The system needs to reboot after changing ncpu.

2 Likes

Nice. Thanks

Currently it is building kernel-toolchains and then will build generic kernel and try it on rk3328 device.

Fan works fine when under load.

Nice work. Thanks.

Well done guys, @SleepWalker I have a small question,

what would it take to port this to Amlogic boards?
I was reading on the BSD forums that some were able to port it for themselves for the S912 but no one had a successful build,So what is the feasibility of getting Unix to work on the VIMs, What do we need that’s missing ?

2 Likes

Thanks so much @SleepWalker :smile:

Hello Khadas community!

New Years, a new FreeBSD XFCE DESKTOP installation image is available
for download on the new site. https://personalbsd.org

HDMI audio works now !!!

You can get your FreeBSD XFCE DESKTOP audio experience on Khadas EDGE.

All six cores are working now.

Good luck everyone.

PS:
I will be pleased if you leave comments about your experience and my images on this forum,
or on my website https://personalbsd.org/#respond

5 Likes

hi @SleepWalker tnx for your work
i will check it soon !

Happy new Year