Welcome! Log In Create A New Profile

Advanced

(WIP) Linux Kernel and rootfs 4.14.24 for Seagate Business Storage NAS (CNS3xxx) package

Posted by bodhi 
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 02, 2016 03:46AM
Perhaps 3.18.x is easier to patch, and being an LTS kernel, you'll get bug fixes. So if the kernel is 3.18.x (like one I compiled and uploaded in the 1st post), hopefully it's easier to retrofit the high memory patch in.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 03/02/2016 03:47AM by bodhi.
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 02, 2016 01:51PM
Ok, precisely i go back to 3.18.27 kernel, because on 4.4 i got a kernel panic by SMP and kernel 3.18 is ok.

So for the moment, i have a kernel 3.18 working, with i2c and rtc driver ok, eth0 it's probably to (but not tested for now) and SMP + 256Mo.

In order to have USB3.0 we need to correct pcie init (see the original patch from seagate) and the missing 256Mo of ram.
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 02, 2016 08:30PM
Val532 Wrote:
-------------------------------------------------------
> Ok, precisely i go back to 3.18.27 kernel, because
> on 4.4 i got a kernel panic by SMP and kernel 3.18
> is ok.
>
> So for the moment, i have a kernel 3.18 working,
> with i2c and rtc driver ok, eth0 it's probably to
> (but not tested for now) and SMP + 256Mo.
>
> In order to have USB3.0 we need to correct pcie
> init (see the original patch from seagate) and the
> missing 256Mo of ram.

If you need help with pci and memory patches, then tell me again exactly which patches you had applied to 3.18.27.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 03, 2016 01:40AM
@Val
So are you able to see CPU temperature and control the fan with fancontrol?
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 03, 2016 09:19AM
I don't have it when i test it ^^.

I will try again, but i need to take a look at the fan controler driver.
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 04, 2016 03:29PM
@Yama

Look at this please :
root@seagate-dev:~# sensors-detect
# sensors-detect revision 6209 (2014-01-14 22:51:58 +0100)
# DMI data unavailable, please consider installing dmidecode 2.7
# or later for better results.

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no):
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/3.18.27-val/modules.dep.bin'
Failed to load module cpuid.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no):
Sorry, no supported PCI bus adapters found.
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/3.18.27-val/modules.dep.bin'
Failed to load module i2c-dev.

Next adapter: CNS3xxx I2C 0 (i2c-0)
Do you want to scan it? (YES/no/selectively):
Can't open /dev/i2c-0
Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
http://www.lm-sensors.org/wiki/Devices for driver status.

And this :

[    0.000000] Booting Linux on physical CPU 0x900
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.18.27-val (root@debian-crosscompil) (gcc version 4.9.2 ( 4.9.2-10) ) #7 SMP Thu Mar 3 21:58:51 CET 2016
[    0.000000] CPU: ARMv6-compatible processor [410fb024] revision 4 (ARMv7), cr=00c5787d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Seagate CNS3420 NAS
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 65536
[    0.000000] free_area_init_node: node 0, pgdat c0614c80, node_mem_map cfdf6000
[    0.000000]   Normal zone: 512 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 65536 pages, LIFO batch:15
[    0.000000] PERCPU: Embedded 9 pages/cpu @cfde2000 s6208 r8192 d22464 u36864
[    0.000000] pcpu-alloc: s6208 r8192 d22464 u36864 alloc=9*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS0,38400 mem=256M root=/dev/sda2 rootfstype=ext4 rootwait
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 253456K/262144K available (4591K kernel code, 183K rwdata, 1220K rodata, 204K init, 111K bss, 8688K reserved)
[    0.000000] Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
    vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc05b4f7c   (5812 kB)
      .init : 0xc05b5000 - 0xc05e8000   ( 204 kB)
      .data : 0xc05e8000 - 0xc0615fc0   ( 184 kB)
       .bss : 0xc0615fc0 - 0xc0631bf4   ( 112 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836480000000ns
[    0.000000] Console: colour dummy device 80x30
[    0.200000] console [ttyS0] enabled
[    0.210000] Calibrating delay loop... 277.70 BogoMIPS (lpj=1388544)
[    0.290000] pid_max: default: 32768 minimum: 301
[    0.300000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.310000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.320000] Initializing cgroup subsys devices
[    0.330000] Initializing cgroup subsys net_cls
[    0.340000] Initializing cgroup subsys blkio
[    0.350000] CPU: Testing write buffer coherency: ok
[    0.360000] Setting up static identity map for 0x481e90 - 0x481ec8
[    0.380000] CPU1: Booted secondary processor
[    0.460000] Brought up 2 CPUs
[    0.460000] SMP: Total of 2 processors activated (555.41 BogoMIPS).
[    0.470000] devtmpfs: initialized
[    0.490000] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 4
[    0.510000] NET: Registered protocol family 16
[    0.520000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.530000] L2C: DT/platform modifies aux control register: 0x02040000 -> 0x02540000
[    0.540000] L2C-310 cache controller enabled, 8 ways, 256 kB
[    0.550000] L2C-310: CACHE_ID 0x410000c4, AUX_CTRL 0x06540000
[    0.570000] vgaarb: loaded
[    0.580000] SCSI subsystem initialized
[    0.590000] libata version 3.00 loaded.
[    0.590000] usbcore: registered new interface driver usbfs
[    0.610000] usbcore: registered new interface driver hub
[    0.620000] usbcore: registered new device driver usb
[    0.640000] Switched to clocksource freerun
[    0.650000] Clockevents: could not switch to one-shot mode: dummy_timer is not functional.
[    0.650000] Could not switch to high resolution mode on CPU 0
[    0.650000] Clockevents: could not switch to one-shot mode: dummy_timer is not functional.
[    0.650000] Could not switch to high resolution mode on CPU 1
[    0.740000] FS-Cache: Loaded
[    0.760000] NET: Registered protocol family 2
[    0.770000] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    0.790000] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[    0.810000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.830000] TCP: reno registered
[    0.840000] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.860000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.880000] NET: Registered protocol family 1
[    0.890000] PCI: CLS 0 bytes, default 32
[    0.890000] futex hash table entries: 512 (order: 2, 16384 bytes)
[    0.910000] SGI XFS with security attributes, no debug enabled
[    0.920000] msgmni has been set to 495
[    0.930000] io scheduler noop registered
[    0.940000] io scheduler deadline registered (default)
[    0.960000] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.980000] serial8250: ttyS0 at MMIO 0x78000000 (irq = 45, base_baud = 1500000) is a 16550A
[    1.010000] brd: module loaded
[    1.030000] loop: module loaded
[    1.040000] mGine mflash driver, (c) 2008 mGine Co.
[    1.050000] ahci ahci.0: forcing PORTS_IMPL to 0x3
[    1.070000] ahci ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode
[    1.090000] ahci ahci.0: flags: ncq sntf pm led clo only pmp pio slum part ccc
[    1.120000] scsi host0: ahci_platform
[    1.130000] scsi host1: ahci_platform
[    1.140000] ata1: SATA max UDMA/133 mmio [mem 0x83000000-0x83ffffff] port 0x100 irq 65
[    1.160000] ata2: SATA max UDMA/133 mmio [mem 0x83000000-0x83ffffff] port 0x180 irq 65
[    1.190000] physmap platform flash device: 08000000 at 10000000
[    1.210000] physmap-flash physmap-flash.0: map_probe failed
[    1.240000] libphy: Fixed MDIO Bus: probed
[    1.250000] libphy: CNS3xxx MII Bus: probed
[    1.270000] eth0: RGMII PHY 0 on cns3xxx Switch
[    1.280000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.300000] ehci-pci: EHCI PCI platform driver
[    1.320000] ehci-platform: EHCI generic platform driver
[    1.330000] ehci-platform ehci-platform.0: EHCI Host Controller
[    1.350000] ehci-platform ehci-platform.0: new USB bus registered, assigned bus number 1
[    1.380000] ehci-platform ehci-platform.0: irq 64, io mem 0x82000000
[    1.410000] ehci-platform ehci-platform.0: USB 2.0 started, EHCI 1.00
[    1.430000] hub 1-0:1.0: USB hub found
[    1.440000] hub 1-0:1.0: 1 port detected
[    1.450000] usbcore: registered new interface driver usb-storage
[    1.470000] mousedev: PS/2 mouse device common for all mice
[    1.490000] adt7475 0-002e: ADT7473 device, revision 0
[    1.500000] adt7475 0-002e: Optional features: fan4 pwm2
[    1.510000] usbcore: registered new interface driver usbhid
[    1.520000] usbhid: USB HID core driver
[    1.530000] TCP: cubic registered
[    1.540000] Initializing XFRM netlink socket
[    1.540000] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    1.540000] ata2: SATA link down (SStatus 0 SControl 300)
[    1.570000] NET: Registered protocol family 10
[    1.580000] sit: IPv6 over IPv4 tunneling driver
[    1.590000] NET: Registered protocol family 17
[    1.600000] NET: Registered protocol family 15
[    1.610000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    1.620000] 8021q: 802.1Q VLAN Support v1.8
[    1.640000] PCIe: Port[0] Enable PCIe LTSSM
[    1.650000] PCIe: Port[0] Check data link layer...
[    1.690000] ata1.00: ATA-8: ST500LM021-1KJ152, 0004SDM1, max UDMA/133
[    1.710000] ata1.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32)
[    2.040000] ata1.00: configured for UDMA/133
[    2.050000] scsi 0:0:0:0: Direct-Access     ATA      ST500LM021-1KJ15 SDM1 PQ: 0 ANSI: 5
[    2.080000] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    2.100000] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    2.120000] sd 0:0:0:0: [sda] Write Protect is off
[    2.130000] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.130000] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.170000] Device not found.
[    2.170000] PCIe: Port[1] Enable PCIe LTSSM
[    2.180000] PCIe: Port[1] Check data link layer...
[    2.180000]  sda: sda1 sda2
[    2.180000] sd 0:0:0:0: [sda] Attached SCSI disk
[    2.720000] Device not found.
[    3.000000] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    3.020000] VFS: Mounted root (ext4 filesystem) on device 8:2.
[    3.070000] devtmpfs: mounted
[    3.080000] Freeing unused kernel memory: 204K (c05b5000 - c05e8000)
[    3.520000] random: systemd urandom read with 33 bits of entropy available
[    3.600000] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    3.640000] systemd[1]: Detected architecture 'arm'.
[    3.750000] systemd[1]: Set hostname to <seagate-dev>.
[    4.230000] systemd[1]: Cannot add dependency job for unit dbus.socket, ignoring: Unit dbus.socket failed to load: No such file or directory.
[    4.240000] systemd[1]: Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory.
[    4.250000] systemd[1]: Expecting device dev-ttyS0.device...
[    4.290000] systemd[1]: Starting Forward Password Requests to Wall Directory Watch.
[    4.300000] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    4.310000] systemd[1]: Starting Remote File Systems (Pre).
[    4.350000] systemd[1]: Reached target Remote File Systems (Pre).
[    4.360000] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    4.370000] systemd[1]: Starting Dispatch Password Requests to Console Directory Watch.
[    4.380000] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    4.390000] systemd[1]: Starting Paths.
[    4.430000] systemd[1]: Reached target Paths.
[    4.440000] systemd[1]: Starting Encrypted Volumes.
[    4.490000] systemd[1]: Reached target Encrypted Volumes.
[    4.500000] systemd[1]: Starting Swap.
[    4.540000] systemd[1]: Reached target Swap.
[    4.550000] systemd[1]: Starting Root Slice.
[    4.590000] systemd[1]: Created slice Root Slice.
[    4.600000] systemd[1]: Starting User and Session Slice.
[    4.640000] systemd[1]: Created slice User and Session Slice.
[    4.650000] systemd[1]: Starting Delayed Shutdown Socket.
[    4.690000] systemd[1]: Listening on Delayed Shutdown Socket.
[    4.700000] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[    4.750000] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    4.760000] systemd[1]: Starting Journal Socket (/dev/log).
[    4.810000] systemd[1]: Listening on Journal Socket (/dev/log).
[    4.820000] systemd[1]: Starting udev Control Socket.
[    4.860000] systemd[1]: Listening on udev Control Socket.
[    4.870000] systemd[1]: Starting udev Kernel Socket.
[    4.910000] systemd[1]: Listening on udev Kernel Socket.
[    4.920000] systemd[1]: Starting Journal Socket.
[    4.950000] systemd[1]: Listening on Journal Socket.
[    4.960000] systemd[1]: Starting System Slice.
[    5.000000] systemd[1]: Created slice System Slice.
[    5.010000] systemd[1]: Starting system-getty.slice.
[    5.060000] systemd[1]: Created slice system-getty.slice.
[    5.070000] systemd[1]: Starting system-serial\x2dgetty.slice.
[    5.110000] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    5.120000] systemd[1]: Starting Increase datagram queue length...
[    5.170000] systemd[1]: Starting Load Kernel Modules...
[    5.210000] systemd[1]: Starting udev Coldplug all Devices...
[    5.250000] systemd[1]: Mounting POSIX Message Queue File System...
[    5.290000] systemd[1]: Mounting Debug File System...
[    5.330000] systemd[1]: Started Create list of required static device nodes for the current kernel.
[    5.340000] systemd[1]: Starting Create Static Device Nodes in /dev...
[    5.380000] systemd[1]: Started Set Up Additional Binary Formats.
[    5.390000] systemd[1]: Mounted Huge Pages File System.
[    5.410000] systemd[1]: Starting Slices.
[    5.650000] systemd[1]: Reached target Slices.
[    5.660000] systemd[1]: Started Remount Root and Kernel File Systems.
[    5.670000] systemd[1]: Started Various fixups to make systemd work better on Debian.
[    5.680000] systemd[1]: Starting Load/Save Random Seed...
[    5.950000] systemd[1]: Mounted Debug File System.
[    5.990000] systemd[1]: Mounted POSIX Message Queue File System.
[    6.040000] systemd[1]: Started Increase datagram queue length.
[    6.160000] systemd[1]: Started Load Kernel Modules.
[    6.420000] systemd[1]: Started Create Static Device Nodes in /dev.
[    6.680000] systemd[1]: Started Load/Save Random Seed.
[    6.930000] systemd[1]: Started udev Coldplug all Devices.
[    7.160000] systemd[1]: Starting udev Kernel Device Manager...
[    7.200000] systemd[1]: Starting Local File Systems (Pre).
[    7.240000] systemd[1]: Reached target Local File Systems (Pre).
[    7.250000] systemd[1]: Starting Local File Systems.
[    7.270000] systemd-udevd[825]: starting version 215
[    7.320000] systemd[1]: Reached target Local File Systems.
[    7.330000] systemd[1]: Starting Remote File Systems.
[    7.590000] systemd[1]: Reached target Remote File Systems.
[    7.620000] systemd[1]: Starting Create Volatile Files and Directories...
[    7.710000] systemd[1]: Starting LSB: Raise network interfaces....
[    7.770000] systemd[1]: Starting Apply Kernel Variables...
[    7.860000] systemd[1]: Mounted Configuration File System.
[    7.870000] systemd[1]: Mounted FUSE Control File System.
[    7.880000] systemd[1]: Starting Syslog Socket.
[    8.120000] systemd[1]: Listening on Syslog Socket.
[    8.130000] systemd[1]: Starting Sockets.
[    8.170000] systemd[1]: Reached target Sockets.
[    8.180000] systemd[1]: Starting Journal Service...
[    8.450000] systemd[1]: Started Journal Service.
[    9.530000] systemd-journald[876]: Received request to flush runtime journal from PID 1
[    9.790000] random: nonblocking pool is initialized



Edited 1 time(s). Last edit at 03/04/2016 03:32PM by Val532.
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 14, 2016 01:47PM
How about on kernel 4.4?
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 14, 2016 04:48PM
@Yama

On 4.4 kernel i can't get SMP working...

And on 3.18 i can't get all the ram...

I think we can have a 3.1 kernel with all option since 2.6.35 to 3.1 there aren't a lot of foundamental change.
For me it's the only way to have 512Mo of ram and probably a corect way to work for ethernet.
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
April 24, 2016 05:47PM
How much of this applies to the Seagate Central

uname -a returns :
Linux albert 2.6.35.13-cavm1.whitney-econa.whitney-econa #1 Thu Mar 21 01:31:25 PDT 2013 armv6l GNU/Linux

Looking into /proc/cpuinfo/
Processor : ARMv6-compatible processor rev 4 (v6l)
BogoMIPS : 279.34
Features : swp half thumb fastmult vfp edsp java
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb02
CPU revision : 4

Hardware : Cavium Networks CNS3420 Validation Board Revision : 0000
Serial : 0000000000000000

Specs on the CPU from vendor state it should have 2 cores.. but is only showing one..

most other details seem to show up in part on other messages in this thread....

If removing MVL6 is not to be... has anyone tried building nfs or other apps to improve its usability?

Rich
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
September 16, 2017 09:15PM
For the seagate central's cns3420 cpu, openwrt has bump up to kernel to 4.4.y.
And with a little change, it works on Seagate Central too. SMP/ETHENET works, but not USB and RTC.
A 4.4 kernel with debian stretch rootfs can be found here https://github.com/KL-Yang/seagate_central_linux
And the kernel is compiled on seagate central itself.
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
September 17, 2017 06:01PM
Hi,

I tested on Seagate Business Storage 2-bay NAS, and it is working as expected/descriped. Just 256 MB RAM and the second ethernet port is not working :-(
Great work, many thanks!

Now I need an uboot which reminds the bootcmd and to get USB working... :-)

But I am really happy with it for now!

Regards



Edited 1 time(s). Last edit at 09/17/2017 06:10PM by blackdevil.
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
February 11, 2018 06:14AM
Hi, its me again.

I got the kernel 4.4 compile myself and working, but fancontrol is not working. I think i compiled the necessary drivers builtin, but there is no entry in /sys/class/hwmon, /sys/class/i2c-adapter, /sys/class or /i2c-dev. Also no /dev/i2c* device. Do you have any hints? Config file is attached, other stuff as Code.

Thank you very much!

modules.builtin
kernel/kernel/configs.ko
kernel/mm/zsmalloc.ko
kernel/fs/binfmt_script.ko
kernel/fs/mbcache.ko
kernel/fs/autofs4/autofs4.ko
kernel/fs/exportfs/exportfs.ko
kernel/fs/ext2/ext2.ko
kernel/fs/ext4/ext4.ko
kernel/fs/fscache/fscache.ko
kernel/fs/jbd2/jbd2.ko
kernel/fs/nls/nls_base.ko
kernel/crypto/crypto.ko
kernel/crypto/crypto_wq.ko
kernel/crypto/crypto_algapi.ko
kernel/crypto/aead.ko
kernel/crypto/crypto_blkcipher.ko
kernel/crypto/chainiv.ko
kernel/crypto/eseqiv.ko
kernel/crypto/crypto_hash.ko
kernel/crypto/pcompress.ko
kernel/crypto/akcipher.ko
kernel/crypto/cryptomgr.ko
kernel/crypto/crypto_null.ko
kernel/crypto/aes_generic.ko
kernel/crypto/crc32c_generic.ko
kernel/crypto/rng.ko
kernel/block/deadline-iosched.ko
kernel/drivers/ata/libata.ko
kernel/drivers/ata/ahci_platform.ko
kernel/drivers/ata/libahci.ko
kernel/drivers/ata/libahci_platform.ko
kernel/drivers/base/firmware_class.ko
kernel/drivers/base/regmap/regmap-mmio.ko
kernel/drivers/block/loop.ko
kernel/drivers/block/mg_disk.ko
kernel/drivers/block/zram/zram.ko
kernel/drivers/dma/dmatest.ko
kernel/drivers/gpio/gpio-generic.ko
kernel/drivers/hid/hid.ko
kernel/drivers/hid/hid-generic.ko
kernel/drivers/hid/usbhid/usbhid.ko
kernel/drivers/hwmon/hwmon.ko
kernel/drivers/hwmon/hwmon-vid.ko
kernel/drivers/hwmon/adt7475.ko
kernel/drivers/i2c/i2c-core.ko
kernel/drivers/i2c/i2c-dev.ko
kernel/drivers/i2c/busses/i2c-cns3xxx.ko
kernel/drivers/input/input-core.ko
kernel/drivers/input/mousedev.ko
kernel/drivers/mtd/mtd.ko
kernel/drivers/mtd/ofpart.ko
kernel/drivers/mtd/cmdlinepart.ko
kernel/drivers/mtd/mtd_blkdevs.ko
kernel/drivers/mtd/mtdblock.ko
kernel/drivers/mtd/chips/chipreg.ko
kernel/drivers/mtd/chips/cfi_probe.ko
kernel/drivers/mtd/chips/cfi_util.ko
kernel/drivers/mtd/chips/cfi_cmdset_0002.ko
kernel/drivers/mtd/chips/gen_probe.ko
kernel/drivers/mtd/maps/physmap.ko
kernel/drivers/net/ethernet/cavium/cns3xxx_eth.ko
kernel/drivers/net/phy/libphy.ko
kernel/drivers/net/phy/realtek.ko
kernel/drivers/net/phy/fixed_phy.ko
kernel/drivers/net/phy/mdio-bcm-unimac.ko
kernel/drivers/net/team/team.ko
kernel/drivers/of/of_mdio.ko
kernel/drivers/of/of_pci.ko
kernel/drivers/of/of_pci_irq.ko
kernel/drivers/scsi/scsi_mod.ko
kernel/drivers/scsi/sd_mod.ko
kernel/drivers/spi/spi-bitbang.ko
kernel/drivers/spi/spi-cns3xxx.ko
kernel/drivers/spi/spi-gpio.ko
kernel/drivers/tty/serial/serial_core.ko
kernel/drivers/tty/serial/8250/8250.ko
kernel/drivers/tty/serial/8250/8250_base.ko
kernel/drivers/tty/serial/8250/8250_pci.ko
kernel/drivers/usb/common/usb-common.ko
kernel/drivers/usb/core/usbcore.ko
kernel/drivers/usb/storage/usb-storage.ko
kernel/net/802/p8022.ko
kernel/net/802/psnap.ko
kernel/net/802/stp.ko
kernel/net/bridge/bridge.ko
kernel/net/ipv4/xfrm4_mode_beet.ko
kernel/net/ipv4/inet_lro.ko
kernel/net/ipv4/xfrm4_mode_transport.ko
kernel/net/ipv4/xfrm4_mode_tunnel.ko
kernel/net/ipv4/inet_diag.ko
kernel/net/ipv4/tcp_diag.ko
kernel/net/ipv4/tcp_cubic.ko
kernel/net/key/af_key.ko
kernel/net/llc/llc.ko
kernel/net/packet/af_packet.ko
kernel/net/packet/af_packet_diag.ko
kernel/net/unix/unix.ko
kernel/net/unix/unix_diag.ko
kernel/net/xfrm/xfrm_algo.ko
kernel/net/xfrm/xfrm_user.ko
kernel/lib/bitrev.ko
kernel/lib/crc-ccitt.ko
kernel/lib/crc16.ko
kernel/lib/crc32.ko
kernel/lib/libcrc32c.ko
kernel/lib/lz4/lz4_compress.ko
kernel/lib/lz4/lz4_decompress.ko
kernel/lib/lzo/lzo_compress.ko
kernel/lib/lzo/lzo_decompress.ko
kernel/lib/xz/xz_dec.ko
kernel/lib/zlib_inflate/zlib_inflate.ko
dmesg:
[    0.000000] Booting Linux on physical CPU 0x900
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.4.88-eric (root@seagate-dev) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #11 SMP Sun Feb 11 11:54:13 UTC 2018
[    0.000000] CPU: ARMv6-compatible processor [410fb024] revision 4 (ARMv7), cr=00c5787d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Seagate CNS3420 NAS
[    0.000000] Ignoring tag cmdline (using the default kernel command line)
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 65536
[    0.000000] free_area_init_node: node 0, pgdat c0563e40, node_mem_map cfdf5000
[    0.000000]   Normal zone: 512 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 65536 pages, LIFO batch:15
[    0.000000] PERCPU: Embedded 11 pages/cpu @cfddd000 s16140 r8192 d20724 u45056
[    0.000000] pcpu-alloc: s16140 r8192 d20724 u45056 alloc=11*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: root=/dev/sda3 rw init=/sbin/init mem=256M console=ttyS0,38400
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 254152K/262144K available (3959K kernel code, 149K rwdata, 1180K rodata, 204K init, 101K bss, 7992K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
                   lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
                   modules : 0xbf000000 - 0xc0000000   (  16 MB)
                     .text : 0xc0008000 - 0xc050cfb4   (5140 kB)
                     .init : 0xc050d000 - 0xc0540000   ( 204 kB)
                     .data : 0xc0540000 - 0xc0565648   ( 150 kB)
                      .bss : 0xc0565648 - 0xc057ea68   ( 102 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: freerun: mask: 0xffffffffffff max_cycles: 0x179dd7f66, max_idle_ns: 28210892933900 ns
[    0.000000] smp_twd: clock not found -2
[    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
[    0.000000] Console: colour dummy device 80x30
[    0.210000] console [ttyS0] enabled
[    0.210000] Calibrating local timer... 347.99MHz.
[    0.280000] Calibrating delay loop... 277.70 BogoMIPS (lpj=1388544)
[    0.350000] pid_max: default: 32768 minimum: 301
[    0.360000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.370000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.380000] Initializing cgroup subsys io
[    0.390000] Initializing cgroup subsys devices
[    0.400000] Initializing cgroup subsys net_cls
[    0.400000] CPU: Testing write buffer coherency: ok
[    0.420000] Setting up static identity map for 0x82a0 - 0x82d8
[    0.500000] Brought up 2 CPUs
[    0.500000] SMP: Total of 2 processors activated (555.41 BogoMIPS).
[    0.510000] devtmpfs: initialized
[    0.520000] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 4
[    0.530000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.540000] futex hash table entries: 512 (order: 2, 16384 bytes)
[    0.550000] NET: Registered protocol family 16
[    0.560000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.580000] L2C: DT/platform modifies aux control register: 0x02040000 -> 0x02540000
[    0.590000] L2C-310 cache controller enabled, 8 ways, 256 kB
[    0.600000] L2C-310: CACHE_ID 0x410000c4, AUX_CTRL 0x06540000
[    0.630000] vgaarb: loaded
[    0.630000] SCSI subsystem initialized
[    0.640000] libata version 3.00 loaded.
[    0.640000] usbcore: registered new interface driver usbfs
[    0.650000] usbcore: registered new interface driver hub
[    0.660000] usbcore: registered new device driver usb
[    0.680000] clocksource: Switched to clocksource freerun
[    0.690000] FS-Cache: Loaded
[    0.720000] NET: Registered protocol family 2
[    0.730000] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    0.740000] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[    0.760000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.770000] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.790000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.800000] NET: Registered protocol family 1
[    0.810000] PCI: CLS 0 bytes, default 32
[    0.820000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    0.840000] io scheduler noop registered
[    0.840000] io scheduler deadline registered (default)
[    0.860000] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.880000] serial8250: ttyS0 at MMIO 0x78000000 (irq = 45, base_baud = 1500000) is a 16550A
[    0.910000] loop: module loaded
[    0.910000] mGine mflash driver, (c) 2008 mGine Co.
[    0.930000] zram: Added device: zram0
[    0.930000] ahci ahci.0: forcing PORTS_IMPL to 0x3
[    0.940000] ahci ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode
[    0.960000] ahci ahci.0: flags: ncq sntf pm led clo only pmp pio slum part ccc 
[    0.990000] scsi host0: ahci
[    0.990000] scsi host1: ahci
[    1.000000] ata1: SATA max UDMA/133 mmio [mem 0x83000000-0x83ffffff] port 0x100 irq 65
[    1.020000] ata2: SATA max UDMA/133 mmio [mem 0x83000000-0x83ffffff] port 0x180 irq 65
[    1.040000] physmap platform flash device: 08000000 at 10000000
[    1.050000] physmap-flash physmap-flash.0: map_probe failed
[    1.070000] libphy: Fixed MDIO Bus: probed
[    1.090000] libphy: CNS3xxx MII Bus: probed
[    1.100000] eth0: RGMII PHY 0 on cns3xxx Switch
[    1.110000] usbcore: registered new interface driver usb-storage
[    1.120000] mousedev: PS/2 mouse device common for all mice
[    1.140000] i2c /dev entries driver
[    1.140000] usbcore: registered new interface driver usbhid
[    1.160000] usbhid: USB HID core driver
[    1.160000] Initializing XFRM netlink socket
[    1.170000] NET: Registered protocol family 17
[    1.180000] NET: Registered protocol family 15
[    1.190000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    1.230000] PCIe: Port[0] Enable PCIe LTSSM
[    1.230000] PCIe: Port[0] Check data link layer...
[    1.390000] ata1: SATA link down (SStatus 0 SControl 300)
[    1.400000] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    1.460000] ata2.00: ATA-8: TOSHIBA MK3261GSY, MC000D, max UDMA/100
[    1.480000] ata2.00: 625142448 sectors, multi 16: LBA48 NCQ (depth 31/32)
[    1.500000] ata2.00: configured for UDMA/100
[    1.510000] scsi 1:0:0:0: Direct-Access     ATA      TOSHIBA MK3261GS 0D   PQ: 0 ANSI: 5
[    1.530000] sd 1:0:0:0: [sda] 625142448 512-byte logical blocks: (320 GB/298 GiB)
[    1.550000] sd 1:0:0:0: [sda] Write Protect is off
[    1.560000] sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    1.560000] sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    1.620000]  sda: sda1 sda2 sda3
[    1.630000] sd 1:0:0:0: [sda] Attached SCSI disk
[    1.750000] Device not found.
[    1.750000] PCIe: Port[1] Enable PCIe LTSSM
[    1.760000] PCIe: Port[1] Check data link layer...
[    2.280000] Device not found.
[    2.310000] EXT4-fs (sda3): couldn't mount as ext3 due to feature incompatibilities
[    2.490000] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[    2.510000] VFS: Mounted root (ext4 filesystem) on device 8:3.
[    2.550000] devtmpfs: mounted
[    2.560000] Freeing unused kernel memory: 204K
[    3.290000] systemd[1]: System time before build time, advancing clock.
[    3.420000] ip_tables: (C) 2000-2006 Netfilter Core Team
[    3.520000] random: systemd: uninitialized urandom read (16 bytes read, 47 bits of entropy available)
[    3.580000] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[    3.630000] systemd[1]: Detected architecture arm.
[    3.710000] systemd[1]: Set hostname to <seagate-dev>.
[    3.860000] random: systemd: uninitialized urandom read (16 bytes read, 58 bits of entropy available)
[    3.970000] random: systemd-cryptse: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
[    4.000000] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
[    4.000000] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
[    4.000000] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
[    4.370000] random: systemd: uninitialized urandom read (16 bytes read, 70 bits of entropy available)
[    4.400000] random: systemd: uninitialized urandom read (16 bytes read, 70 bits of entropy available)
[    4.420000] random: systemd: uninitialized urandom read (16 bytes read, 70 bits of entropy available)
[    4.440000] random: systemd: uninitialized urandom read (16 bytes read, 70 bits of entropy available)
[    5.010000] systemd[1]: Listening on Journal Socket (/dev/log).
[    5.110000] systemd[1]: Listening on fsck to fsckd communication Socket.
[    5.160000] systemd[1]: Reached target Remote File Systems.
[    5.200000] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    5.250000] systemd[1]: Listening on Journal Socket.
[    5.290000] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    5.340000] systemd[1]: Created slice User and Session Slice.
[    5.380000] systemd[1]: Listening on Network Service Netlink Socket.
[    5.430000] systemd[1]: Listening on Syslog Socket.
[    5.470000] systemd[1]: Reached target Swap.
[    5.500000] systemd[1]: Created slice System Slice.
[    5.570000] systemd[1]: Starting Journal Service...
[    5.600000] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    5.760000] systemd[1]: Starting Load Kernel Modules...
[    5.800000] systemd[1]: Starting Remount Root and Kernel File Systems...
[    5.850000] systemd[1]: dev-hugepages.mount: Couldn't determine result for ConditionVirtualization=!private-users, assuming failed: No such file or directory
[    5.930000] systemd[1]: Mounting POSIX Message Queue File System...
[    5.980000] systemd[1]: Mounting Debug File System...
[    6.020000] systemd[1]: Created slice system-getty.slice.
[    6.060000] systemd[1]: Reached target Slices.
[    6.090000] systemd[1]: Listening on udev Control Socket.
[    6.160000] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[    6.220000] systemd[1]: Listening on udev Kernel Socket.
[    6.260000] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    6.320000] systemd[1]: Reached target Paths.
[    6.350000] systemd[1]: Reached target Encrypted Volumes.
[    6.390000] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    6.470000] systemd[1]: Mounted POSIX Message Queue File System.
[    6.520000] systemd[1]: Mounted Debug File System.
[    6.550000] systemd[1]: Started Journal Service.
[    7.080000] systemd-journald[449]: Received request to flush runtime journal from PID 1
[    7.630000] random: nonblocking pool is initialized
[    7.730000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.770000] ehci-platform: EHCI generic platform driver
[    7.780000] ehci-platform ehci-platform.0: EHCI Host Controller
[    7.800000] ehci-platform ehci-platform.0: new USB bus registered, assigned bus number 1
[    7.820000] ehci-platform ehci-platform.0: irq 64, io mem 0x82000000
[    7.870000] ehci-platform ehci-platform.0: USB 2.0 started, EHCI 1.00
[    7.910000] hub 1-0:1.0: USB hub found
[    7.920000] hub 1-0:1.0: 1 port detected
[    7.950000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    7.990000] ohci-platform: OHCI generic platform driver
[    8.000000] ohci-platform ohci-platform.0: Generic Platform OHCI controller
[    8.020000] ohci-platform ohci-platform.0: new USB bus registered, assigned bus number 2
[    8.040000] ohci-platform ohci-platform.0: irq 91, io mem 0x88000000
[    8.120000] hub 2-0:1.0: USB hub found
[    8.120000] hub 2-0:1.0: 1 port detected
[   21.220000] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[   25.300000] eth0: link up, speed 1000 Mb/s, full duplex

Attachments:
open | download - config (74.3 KB)
Hi blackdevil,

Is the fancontrol the only thing not working in kernel 4.4? What about USB, rtc, ethernet ports?

Did you use mainline kernel? What patches if any?

I am still using on my NAS kernel 2.6.35 but would like to upgrade.

Thanks for all your contribution in this thread :)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
February 11, 2018 04:16PM
Hi tommy79,
no, the fancontrol is not the only thing. USB, rtc and the 2nd ethernet port is not working. But the first ethernet port without any problem :-) And SMP is working, it feels much faster now, but has only 256MB RAM addressable.
I used the patches from here https://github.com/KL-Yang/seagate_central_linux and patched the mainline kernel 4.4-88.
I also attached the patches. I compiled the Kernel on the NAS itself, it is fast enough after the first run.



Edited 1 time(s). Last edit at 02/11/2018 05:11PM by blackdevil.
Attachments:
open | download - 0001-import-files-from-openwrt-target.patch (112 KB)
open | download - 0002-All-openwrt-cns3xxx-applied.patch (33.8 KB)
open | download - 0003-Fixes-the-compiling-ethernet-and-SMP.patch (6.2 KB)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
February 12, 2018 01:16AM
blackdevil,

I've noticed that you did not have CONFIG_I2C_MUX and its associated config switches.

I don't know enough about this box to say that's the problem. But it does not hurt to include those as modules.

My NSA325 dmesg only shows:

[    6.417771] i2c /dev entries driver
But the i2c device is working fine

ll /sys/class/i2c-* -d
drwxr-xr-x 2 root root 0 Feb 11 22:57 /sys/class/i2c-adapter
drwxr-xr-x 2 root root 0 Feb 11 22:57 /sys/class/i2c-dev

uname -a
Linux tldDebian 4.15.2-kirkwood-tld-1 #1 PREEMPT Fri Feb 9 01:52:00 PST 2018 armv5tel GNU/Linux

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
February 12, 2018 12:35PM
Hi bodhi,

I enabled CONFIG_I2C_MUX, but nothing changed :(

cat .config| grep CONFIG_I2C_MUX
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_GPIO=y
CONFIG_I2C_MUX_PCA9541=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_MUX_REG=y

Any other ideas?

edit: Found some patches for older kernels (2.6.37):
Look here http://lists.infradead.org/pipermail/linux-arm-kernel/2010-November/thread.html#33161

Especially here for USB: http://lists.infradead.org/pipermail/linux-arm-kernel/2010-November/032175.html

Also the second SATA port is not working, maybe here are some hints:
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-January/037144.html



Edited 2 time(s). Last edit at 02/12/2018 01:24PM by blackdevil.
blackdevil,

I think there is no idea in looking for patches for older kernels. All necessary patches were released by Seagate in this source code package (folder GPL/linux).

But the problem is they apply to kernel 2.6.35. The task would be to fit them to modern kernels and although the number of patches is huge (over 1600, but not all of them are necessary) there seems to be even a bigger problem.

From the discussions above, I understood the challenge is that the kernel in the meantime has been moved to a so called flatten device tree and each device got its own .dts file descripting its structure. Unfortunately for our device there is no .dts file and we can not recreate it from any similiar device.

I found some discussions on kernel mailing list relating to.dts file for a board having same Cavium processor as our NAS (see here), however I do not know if the .dts file has been finally created.

Bodhi, please correct me if I am wrong :)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
February 13, 2018 12:30AM
tommy79,

> From the discussions above, I understood the
> challenge is that the kernel in the meantime has
> been moved to a so called flatten device tree and
> each device got its own .dts file descripting its
> structure. Unfortunately for our device there is
> no .dts file and we can not recreate it from any
> similiar device.

Correct. So that's why it is still stuck in older kernel.

> I found some discussions on kernel mailing list
> relating to.dts file for a board having same
> Cavium processor as our NAS
> (see
> here
), however I do not know if the .dts
> file has been finally created.

This is very promising! a good start. Unfortunately it has not got to the mainline yet.

The good way to find out for sure how to handle I2C is to look at the GPL. I have not seen the GPL source, so I can't say how.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
February 26, 2018 02:38PM
Hi,

I think I am not able to build a device tree for this box.

@ bodhi: would you be able to build a device tree I you have access to this box?

blackdevil
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
February 27, 2018 02:05AM
blackdevil,
>
> @ bodhi: would you be able to build a device tree
> I you have access to this box?
>


I probably could. But I have no free time to do it :) there are too many things on my todo list right now.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 04, 2018 10:46AM
How much effort would this involve and is there any way I could help? I've been spending the past few weekends trying to get my NAS440 up to date and would love to help move this forward whatever way I can.

Where can I find any howtos or instructions for creating dts files? Thanks!
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 04, 2018 02:22PM
Hi MarkTurner,
this video is maybe a good first step:
https://www.youtube.com/watch?v=m_NyYEBxfn8
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 04, 2018 04:22PM
All,

Look like that DTS patch that Tommy posted is good enough for a start: https://lkml.org/lkml/2016/6/10/776.

I'll take a look to see if I can build a 4.14.x kernel for this. But you guys will need to do the tests.

Usually the old kernel patches will have code to activate the GPIO, I2C, SATA... we have to look and find them in there. And then code that in the DTS.

@Mark, the DTS syntax is not difficult. The difficult part is to know what data to put it.

Here is the DTS patch

/dts-v1/;
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
#include "skeleton.dtsi"

/ {
	model = "Cavium CNS3420 validation board";
	compatible = "cavium,cns3420";
	interrupt-parent = <&gic>;

	chosen { };

	aliases {
		serial0 = &serial;
	};

	memory {
		/* 256MB at address 0 */
		reg = <0x00000000 0x10000000>;
	};

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;
		enable-method = "cavium,cns3420-smp";

		cpu@0 {
			device_type = "cpu";
			compatible = "arm,arm11mpcore";
			reg = <0>;
			next-level-cache = <&L2>;
		};

		cpu@1 {
			device_type = "cpu";
			compatible = "arm,arm11mpcore";
			reg = <1>;
			next-level-cache = <&L2>;
		};
	};

	/* Primary TestChip GIC synthesized with the CPU */
	gic: interrupt-controller@1f000100 {
		compatible = "arm,arm11mp-gic";
		#interrupt-cells = <3>;
		#address-cells = <1>;
		interrupt-controller;
		reg = <0x90001000 0x1000>,
		      <0x90000100 0x100>;
	};

	L2: l2-cache {
		compatible = "arm,l220-cache";
		reg = <0x92002000 0x1000>;
		interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
		cache-unified;
		cache-level = <2>;
		/* all of the below are probably wrong and
		   have to be fixed before we can use l2x0_of_init */
		cache-size = <1048576>; // 1MB
		cache-sets = <4096>;
		cache-line-size = <32>;
		arm,shared-override;
		arm,parity-enable;
		arm,outer-sync-disable;
	};

	scu@1f000000 {
		compatible = "arm,arm11mp-scu";
		reg = <0x90000000 0x100>;
	};

	flash@10000000 {
		/* 128MiB NOR Flash memory */
		compatible = "cfi-flash";
		reg = <0x10000000 0x08000000>;
		bank-width = <2>;

		partition@00000000 {
			label = "uboot";
			reg = <0 0x00040000>;
		};

		partition@00040000 {
			label = "kernel";
			reg = <0x00040000 0x004c0000>;
        	};

		partition@00500000 {
			label = "filesystem";
			reg = <0x00500000 0x07000000>;
        	};

		partition@07500000 {
			label = "filesystem2";
			reg = <0x07500000 0x00ae0000>;
        	};

		partition@07fe0000 {
			label = "ubootenv";
			reg = <0x07fe0000 0x00020000>;
        	};
        };

	soc {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges;

		serial0: serial@78000000 {
			compatible = "ns16550a";
			reg = <0x78000000 0x1000>;
			interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
			regshift = <2>;
			clocks = <&uartclk>;
		};
	};
};

So for example, serial0: serial@78000000 tells the kernel the serial address is 78000000 and it is compatible with ns16550a. Other things like SATA would have similar but simpler construction.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 04, 2018 05:05PM
blackdevil,

I forgot all about this build I did a couple years ago :)

root@tldDebian:/usr/src/builds-4.4-cns3xxx# lst -h
total 99M
-rw-r--r--   1 root root  84M Feb 25  2016 linux-4.4.3.tar.xz
-rw-r--r--   1 root root 131K Feb 28  2016 wget-log
drwxr-xr-x   4 root root 4.0K Feb 28  2016 cns3xx_patch
-rw-r--r--   1 root root  66K Feb 29  2016 config-4.4.3-cns3xxx-tld-1
-rwxr-xr-x   1 root root 3.1M Feb 29  2016 zImage-4.4.3-cns3xxx-tld-1
-rw-r--r--   1 root root 4.8M Feb 29  2016 linux-image-4.4.3-cns3xxx-tld-1_1.0_armel.deb
-rw-r--r--   1 root root 7.0M Feb 29  2016 linux-headers-4.4.3-cns3xxx-tld-1_1.0_armel.deb
-rw-r--r--   1 root root 145K Feb 29  2016 linux-4.4.3-cns3xxx-tld-1.patch

So what is missing in your kernel 4.4 now?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 04, 2018 06:51PM
Thanks for the link, Blackdevil. I'm working my way through it but before I build a kernel I should probably get someone else's up and running first. It's been at least a decade since I've built kernels and I'm quite rusty.

So far I have not been able to boot anything via tftp on my 4bay Seagate Blackarmor. The rootfs isn't found as the kernel modules apparently aren't loaded properly. My goal at the moment is to get Debian running in RAM so I can completely repartition the RAID from Seagate's default setup.

Rootfs in this case comes from bodhi's Debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2. And my U-Boot is ancient (any upgrades for this?).

Pointers welcome. Thanks! :)

Mark

U-Boot 2008.10-mpcore (Nov 11 2012 - 15:04:27)
Whitney model:(ELCAPITAN) release v1.2-beta2

CPU: Cavium Networks CNS3000
ID Code: 410fb024 (Part number: 0xB02, Revision number: 4) 
CPU ID: 900 
Chip Version: c

DRAM:  512 MB
Parallel Flash:  0 kB
Flash Manufacturer: MX
Serial Flash: 512 kB
Serial Flash:
Bank # 1:  Nb pages: 2048  Page Size: 256
  Size:    524288 bytes,  Logical address: 0x60000000
  Area 0: 60000000 to 60FFFFFF      SPI flash
In:    serial
Out:   serial
Err:   serial
CPU works at 700 MHz (700/1/1)
DDR2 Speed is 400 MHz 
Restoring RTC
Hit any key to stop autoboot:  0 
Whitney # setenv bootargs root=/dev/sda1 init=/bin/sh mem=256M console=ttyS0,38400; setenv arcNumber 2776
Whitney # tftpboot 0x800000 disks/seagate/uImage-3.18.5
Initialize PHY s/w auto-polling
phy_id: 1c
Initialize RTL8211
phy_id: 1c
Initialize RTL8211
TFTP from server 192.168.3.140; our IP address is 192.168.3.17
Filename 'disks/seagate/uImage-3.18.5'.
Load address: 0x800000
Loading: T T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###################################
done
Bytes transferred = 2173432 (2129f8 hex)
Whitney # tftpboot 0x1100000 disks/seagate/uInitrd-3.18.5
TFTP from server 192.168.3.140; our IP address is 192.168.3.17
Filename 'disks/seagate/uInitrd-3.18.5'.
Load address: 0x1100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 6535284 (63b874 hex)
Whitney # tftpboot 0x1c00000 disks/seagate/armada-370-seagate-nas-4bay.dtb
TFTP from server 192.168.3.140; our IP address is 192.168.3.17
Filename 'disks/seagate/armada-370-seagate-nas-4bay.dtb'.
Load address: 0x1c00000
Loading: ####
done
Bytes transferred = 15814 (3dc6 hex)
Whitney # tftpboot 0x1c00000 disks/seagate/kirkwood.dtb
TFTP from server 192.168.3.140; our IP address is 192.168.3.17
Filename 'disks/seagate/kirkwood.dtb'.
Load address: 0x1c00000
Loading: ###
done
Bytes transferred = 10434 (28c2 hex)
Whitney # bootm 0x800000 0x1100000 0x1c00000
enter do_eth_down!!!
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   linux
   Created:      2018-03-04   2:31:24 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2173368 Bytes =  2.1 MB
   Load Address: 02000000
   Entry Point:  02000000
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-3.18.5-kirkwood-tld-1
   Created:      2015-02-19   1:49:36 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6535220 Bytes =  6.2 MB
   Load Address: 00000000
   Entry Point:  00000000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Booting Linux on physical CPU 0x900
Linux version 3.18.5-cns3xxx-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP PREEMPT We5
CPU: ARMv6-compatible processor [410fb024] revision 4 (ARMv7), cr=00c5787d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Cavium Networks CNS3420 Validation Board
Memory policy: Data cache writealloc
PERCPU: Embedded 9 pages/cpu @cfdeb000 s5888 r8192 d22784 u36864
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
Kernel command line: root=/dev/sda1 init=/bin/sh mem=256M console=ttyS0,38400
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 249120K/262144K available (2979K kernel code, 125K rwdata, 952K rodata, 164K init, 78K bss, 13024K r)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
    vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc03def84   (3932 kB)
      .init : 0xc03df000 - 0xc0408000   ( 164 kB)
      .data : 0xc0408000 - 0xc04274a0   ( 126 kB)
       .bss : 0xc04274a0 - 0xc043aea0   (  79 kB)
Preemptible hierarchical RCU implementation.
        Additional per-CPU info printed with stalls.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS:16 nr_irqs:16 16
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836480000000ns
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 277.70 BogoMIPS (lpj=1388544)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
missing device node for CPU 0
CPU0: thread -1, cpu 0, socket -1, mpidr 900
Setting up static identity map for 0x2ee7e0 - 0x2ee82c
Brought up 1 CPUs
SMP: Total of 1 processors activated (277.70 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
L2C: DT/platform modifies aux control register: 0x02040000 -> 0x02540000
L2C-310 cache controller enabled, 8 ways, 256 kB
L2C-310: CACHE_ID 0x410000c4, AUX_CTRL 0x06540000
vgaarb: loaded
SCSI subsystem initialized
Switched to clocksource freerun
FS-Cache: Loaded
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 6384K (c1100000 - c173c000)
futex hash table entries: 256 (order: 2, 16384 bytes)
msgmni has been set to 499
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x78000000 (irq = 45, base_baud = 1500000) is a 16550A
brd: module loaded
loop: module loaded
mGine mflash driver, (c) 2008 mGine Co.
physmap platform flash device: 08000000 at 10000000
physmap-flash physmap-flash.0: map_probe failed
mousedev: PS/2 mouse device common for all mice
I2O subsystem v1.325
i2o: max drivers = 8
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
PCIe: Port[0] Enable PCIe LTSSM
PCIe: Port[0] Check data link layer...
Device not found.
PCIe: Port[1] Enable PCIe LTSSM
PCIe: Port[1] Check data link layer...
Device not found.
Registering SWP/SWPB emulation handler
Freeing unused kernel memory: 164K (c03df000 - c0408000)
Loading, please wait...
mount: mounting udev on /dev failed: No such device
W: devtmpfs not available, falling back to tmpfs for /dev
error getting socket: Address family not supported by protocol
error initializing udev control socketerror initializing udev control socket
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
error getting socket: Address family not supported by protocol
Begin: Waiting for root file system ... 
done.
Gave up waiting for root device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
   - Check root= (did the system wait for the right device?)
 - Missing modules (cat /proc/modules; ls /dev)
chvt: can't open console
ALERT!  /dev/sda1 does not exist.  Dropping to a shell!
modprobe: can't change directory to '3.18.5-cns3xxx-tld-1': No such file or directory
modprobe: can't change directory to '3.18.5-cns3xxx-tld-1': No such file or directory
modprobe: can't change directory to '3.18.5-cns3xxx-tld-1': No such file or directory
modprobe: can't change directory to '3.18.5-cns3xxx-tld-1': No such file or directory
modprobe: can't change directory to '3.18.5-cns3xxx-tld-1': No such file or directory
modprobe: can't change directory to '3.18.5-cns3xxx-tld-1': No such file or directory
modprobe: can't change directory to '3.18.5-cns3xxx-tld-1': No such file or directory
modprobe: can't change directory to '3.18.5-cns3xxx-tld-1': No such file or directory


BusyBox v1.22.1 (Debian 1:1.22.0-9+b1) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
(initramfs)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 05, 2018 12:03AM
MarkTurner,

No, it does not make sense to run a non-FDT kernel:

> Rootfs in this case comes from bodhi's
> Debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2.

With a DTB:

> Whitney # tftpboot 0x1c00000
> disks/seagate/armada-370-seagate-nas-4bay.dtb

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 05, 2018 01:06AM
So basically we need to rebuild the kernel with FDT support. And use a new DTS written for Cavium CNS3xxxx SoC.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 05, 2018 07:49AM
bodhi Wrote:
-------------------------------------------------------
> So basically we need to rebuild the kernel with
> FDT support. And use a new DTS written for Cavium
> CNS3xxxx SoC.

I will help with this, but am I mistaken that others have at least gotten 3.18 to work on this box?

If it will help, I will configure my Blackarmor for remote access.

Mark
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 05, 2018 01:57PM
I didnt get kernel 3.18 to work. I got only 4.4 to work, but some things are missing. May we can have a look at the patches which I posted earlier and build a dts file from it?

Is FDT support just a kernel switch?
Re: (WIP) Linux Kernel 3.18.5 Seagate Business Storage NAS (CNSxxx) package
March 05, 2018 08:17PM
blackdevil,

-------------------------------------------------------
> I didnt get kernel 3.18 to work. I got only 4.4 to
> work, but some things are missing. May we can have
> a look at the patches which I posted earlier and
> build a dts file from it?
>
> Is FDT support just a kernel switch?

It is a combination of a few switches. And those will activate and compile different drivers.

The DTS pach mentioned above has some syntax errors.

I am compiling a new kernel 4.14.24 for this.

Bascally, that’s correct. We will extract info from old patches and put them in DTS syntax.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: