# AHCI SATA controller not detected



## mushu (Feb 22, 2021)

Hi all,

It's for my Helios64 NAS.

I compiled FreeBSD 13.0-BETA2 with GENERIC kernel and the system boot fine but the AHCI SATA controller is not detected.

U-Boot rockpro64-rk3399 :​

```
$ git clone https://github.com/kobol-io/u-boot.git
$ cd u-boot
$ make rockpro64-rk3399_defconfig
$ make CROSS_COMPILE=aarch64-linux-gnu-
$ dd if=idbloader.img of=/dev/da0 seek=64 bs=512 conv=sync
$ dd if=u-boot.itb of=/dev/da0 seek=16384 bs=512 conv=sync
```


```
# pciconf -lv
pcib1@pci0:0:0:0:       class=0x060400 rev=0x00 hdr=0x01 vendor=0x1d87 device=0x0100 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Fuzhou Rockchip Electronics Co., Ltd'
    device     = 'RK3399 PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
ahci0@pci0:1:0:0:       class=0x010601 rev=0x00 hdr=0x00 vendor=0x197b device=0x0585 subvendor=0x197b subdevice=0x0000
    vendor     = 'JMicron Technology Corp.'
    device     = 'JMB58x AHCI SATA controller'
    class      = mass storage
    subclass   = SATA
```

U-Boot helios64 :​

```
$ git clone https://github.com/kobol-io/u-boot.git
$ cd u-boot
$ make helios64_defconfig
$ make CROSS_COMPILE=aarch64-linux-gnu-
$ dd if=idbloader.img of=/dev/da0 seek=64 bs=512 conv=sync
$ dd if=u-boot.itb of=/dev/da0 seek=16384 bs=512 conv=sync
```


```
# pciconf -lv
pcib1@pci0:0:0:0:       class=0x060400 rev=0x00 hdr=0x01 vendor=0x1d87 device=0x0100 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Fuzhou Rockchip Electronics Co., Ltd'
    device     = 'RK3399 PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
```


Thanks


----------



## diizzy (Feb 22, 2021)

Only mainline u-boot is supported, PCIe works fine using ASM1061-based cards or Intel T350-T2 NICs at least.


----------



## SleepWalker (May 14, 2021)

In this image
FreeBSD-aarch64-13.0-RELEASE-Helios64-20210517.img.xz
SATA works great
Boot directly from SATA ZFS root FS


----------



## diizzy (May 14, 2021)

SleepWalker said:


> http://personalbsd.org/images/FreeBSD-aarch64-13.0-RELEASE-Helios64-20210420.img.xz
> SATA works great
> Boot directly from SATA ZFS root FS


Nice!
If not already done, can you submit patches to mainline u-boot and linux kernel (dts)?


----------



## SleepWalker (May 14, 2021)

Probably this should be done by the authors of the patches.
That is, KOBOL TEAM.
I just prepared an unofficial port for u-boot-helios64 based on the patches provided to me.
My port is available








						GitHub - S199pWa1k9r/ports: Unofficial FreeBSD u-boot ports
					

Unofficial FreeBSD u-boot ports. Contribute to S199pWa1k9r/ports development by creating an account on GitHub.




					github.com
				




This still needs testing.
I have no feedback on successful installations other than my own experience.
If you succeed, let me know


----------



## SleepWalker (May 18, 2021)

New image ready!
FreeBSD-aarch64-13.0-RELEASE-Helios64-20210517.img.xz


----------



## langerma (Aug 11, 2022)

SleepWalker is it possible to install the image to the internal flash?


----------



## SleepWalker (Aug 11, 2022)

langerma said:


> SleepWalker is it possible to install the image to the internal flash?


Oh sure
	
	



```
root@helios:~ # df -h
Filesystem            Size    Used   Avail Capacity  Mounted on
zroot/ROOT/default    5.6G    2.4G    3.2G    43%    /
devfs                 1.0K    1.0K      0B   100%    /dev
tmpfs                 7.9G     49M    7.9G     1%    /tmp
zroot/var/log         3.2G    5.6M    3.2G     0%    /var/log
zroot/var/audit       3.2G    104K    3.2G     0%    /var/audit
zroot/var/crash       3.2G     96K    3.2G     0%    /var/crash
zroot/var/mail        3.2G     96K    3.2G     0%    /var/mail
zroot/usr/home        3.4G    198M    3.2G     6%    /usr/home
zroot/var/tmp         3.2G    120K    3.2G     0%    /var/tmp
tank/media             36T     25T     12T    68%    /usr/media
tank/media/git         12T     10G     12T     0%    /usr/media/git
root@helios:~ # gpart show -l -p
=>      40  30535600    mmcsd0  GPT  (15G)
        40     32728            - free -  (16M)
     32768    102400  mmcsd0p1  efi  (50M)
    135168  16777216  mmcsd0p2  swap  (8.0G)
  16912384  13621248  mmcsd0p3  root  (6.5G)
  30533632      2008            - free -  (1.0M)

=>       40  468862048    ada0  GPT  (224G)
         40  251658240  ada0p1  logs  (120G)
  251658280  217203808  ada0p2  cache  (104G)

=>         40  19532873648    ada1  GPT  (9.1T)
           40  19532873648  ada1p1  disk1  (9.1T)

=>         40  19532873648    ada2  GPT  (9.1T)
           40  19532873648  ada2p1  disk2  (9.1T)

=>         40  19532873648    ada3  GPT  (9.1T)
           40  19532873648  ada3p1  disk3  (9.1T)

=>         40  19532873648    ada4  GPT  (9.1T)
           40  19532873648  ada4p1  disk4  (9.1T)

root@helios:~ #
root@helios:~ # zpool list -v
NAME          SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
tank         36.4T  24.7T  11.7T        -         -     9%    67%  1.00x    ONLINE  -
  indirect-0      -      -      -        -         -      -      -      -    ONLINE
  indirect-1      -      -      -        -         -      -      -      -    ONLINE
  gpt/disk1  9.09T  8.08T  1.01T        -         -    11%  88.8%      -    ONLINE
  gpt/disk2  9.09T  7.86T  1.24T        -         -    10%  86.4%      -    ONLINE
  gpt/disk3  9.09T  5.44T  3.66T        -         -     9%  59.8%      -    ONLINE
  gpt/disk4  9.09T  3.33T  5.77T        -         -     7%  36.6%      -    ONLINE
zroot           6G  2.64G  3.36G        -         -    30%    44%  1.00x    ONLINE  -
  mmcsd0p3      6G  2.64G  3.36G        -         -    30%  44.0%      -    ONLINE
```


----------



## langerma (Aug 25, 2022)

SleepWalker well that is fantastic. i want to migrate from my current running armbian to freebsd as it seems to be a bit unstable, so my next question is: how stable is it?  and can i just install any pkg from ports or pkg?


----------



## SleepWalker (Aug 26, 2022)

langerma said:


> SleepWalker well that is fantastic. i want to migrate from my current running armbian to freebsd as it seems to be a bit unstable, so my next question is: how stable is it?  and can i just install any pkg from ports or pkg?



My Helios64 has been running non-stop for over a year now. And I keep updating.

It works very stable for me. But I have over 20 years of FreeBSD experience. 
Maybe that's why everything works for me. 
I don't have feedback from guys who use FreeBSD on Kobol Helios64.

All my SATA drives are in ZFS pools, so it doesn't matter which operating system is currently running (Linux or FreeBSD) the data is equally available.

Usually my Helios64 is running FreeBSD (which is more convenient for me), but if I want to spend the weekend watching movies with my family, 
I just run Linux (with ZFS support) from an SD card or USB Flash and spend time watching movies from my storage on 4K TV via Emby.

I have my own package repository, but this is just to have some fine tuning of some of them, 
of course everything can be installed with the pkg command from the official repository.

I still don't have time to test 2.5G Ethernet well (and I don't have a 2.5Gbit Switch). 
But basically everything works very stable, I'm happy that I have Helios64.

You can write to me if you have any questions.
Good luck.


----------



## langerma (Aug 28, 2022)

SleepWalker very nice. just want to switch the base os. and as i know from the past 15 years, freebsd was allways a stable partner  i am mainly using my helios64 as storage for my nomad cluster. but as the armbian images i used over the past 1.5 half years keep behaving very strangly and damn, i tried so much different configurations with cpu governor and voltage adjustments i just want to have it stable  so as you stated...freebsd will be the way to go for me. thx. i will try it out next weekend.


----------



## SleepWalker (Sep 2, 2022)

Latest image 


			https://personalbsd.org/images/FreeBSD-aarch64-13.1-RELEASE-Helios64-20220524.img.xz
		


My custom build of OPNsense for Helios64


			https://personalbsd.org/images/OPNsense-22.7-OpenSSL-aarch64-Helios64-20220825.img.xz


----------

