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 
blackdevil Wrote:
-------------------------------------------------------
> I think PCIe is not working and so USB is not working too.

> PCI-E0 uses external clock source.
> PCIe: Port[0] Enable PCIe LTSSM
> PCIe: Port[0] Check data link layer...
>
>
>
> Device not found.
>

It should be "Link up" in the log instead of "Device not found" and then both PCIe and usb would work. The usb 3.0 controller is attached to PCIe bus and functioning PCIe bus is a prerequisite for usb to work.
That is the problem I had when I rebooted to 2.65 and then rebooted back to 4.4 kernel. The result was "Device not found" message and I did not have pcie&usb in both systems, neither in 2.65, nor in 4.4. I rebooted couple of times and it did not help. I thought I broke the box somehow :) However I powered the box off for the next couple of hours, and then booted the 4.4 kernel and suddenly pcie&usb resumed to work :)
It is ok until now, after few reboots, but I stayed in 4.4 kernel.

As I studied the pcie driver, in 2.65 kernel it seems to write some (configuration?) data to the pcie registers on exit/power down. My guess is this data stays in the (pcie chip?) memory after reboot and resets only if you power off the box for a longer period of time. However I do not know if it is even possible... So the pcie/usb definitely needs further tests and maybe some patching.

And what I advise you blackdevil, is to power off the device for an hour or so and then try again :)
tommy79 Wrote:

> And what I advise you blackdevil, is to power off
> the device for an hour or so and then try again :)

Speaking of powering off, I noticed that after I issued the shutdown command I could not power up the box again without removing the power cord and plugging it back in. The front button didn't work. The power management may still be a little bit wonky. :)
Hi tommy,
I turned off the NAS for 22 hours, but same result, pci is not properly initialized.
Whitney # setenv bootargs 'console=ttyS0,38400 mem=512M@0x20000000 root=/dev/sda1';setenv loaduimage 'ext2load scsi 0 0x28000000 /boot/uImage';setenv bootcmd_scsi 'scsi init;run loaduimage;bootm 0x28000000'
Whitney # run bootcmd_scsi

Initialize SCSI
AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part 
set feature error!
scanning bus for devices...
Supprt LBA48 addressing.
timeout exit!
  Device 0: (1:0) Vendor: ATA Prod.: HGST HTS725050A7 Rev: GH2Z
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)

3019912 bytes read
enter do_eth_down!!!
## Booting kernel from Legacy Image at 28000000 ...
   Image Name:   Linux-4.4.121-tommy
   Created:      2018-03-18  23:01:24 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3019848 Bytes =  2.9 MB
   Load Address: 22000000
   Entry Point:  22000000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x900
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 4.4.121-tommy (root@debian9) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #26 SMP Sun Mar 18 23:57:36 CET 2018
CPU: ARMv6-compatible processor [410fb024] revision 4 (ARMv7), cr=00c5787d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Seagate CNS3420 NAS
Memory policy: Data cache writealloc
PERCPU: Embedded 12 pages/cpu @dfbd9000 s17004 r8192 d23956 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyS0,38400 mem=512M@0x20000000 root=/dev/sda1
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 513692K/524288K available (4211K kernel code, 159K rwdata, 1256K rodata, 212K init, 101K bss, 10596K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc055ef9c   (5468 kB)
      .init : 0xc055f000 - 0xc0594000   ( 212 kB)
      .data : 0xc0594000 - 0xc05bbe10   ( 160 kB)
       .bss : 0xc05bbe10 - 0xc05d5348   ( 102 kB)
Hierarchical RCU implementation.
	Build-time adjustment of leaf fanout to 32.
NR_IRQS:16 nr_irqs:16 16
clocksource: freerun: mask: 0xffffffffffff max_cycles: 0x179dd7f66, max_idle_ns: 28210892933900 ns
smp_twd: clock not found -2
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating local timer... 347.99MHz.
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)
Initializing cgroup subsys io
Initializing cgroup subsys devices
Initializing cgroup subsys net_cls
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x200082a0 - 0x200082fc
Brought up 2 CPUs
SMP: Total of 2 processors activated (555.41 BogoMIPS).
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
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
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
clocksource: Switched to clocksource freerun
FS-Cache: Loaded
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
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
loop: module loaded
mGine mflash driver, (c) 2008 mGine Co.
zram: Added device: zram0
ahci ahci.0: SSS flag set, parallel bus scan disabled
ahci ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl platform mode
ahci ahci.0: flags: ncq sntf stag pm led clo only pmp pio slum part ccc 
scsi host0: ahci
scsi host1: ahci
ata1: SATA max UDMA/133 mmio [mem 0x83000000-0x83ffffff] port 0x100 irq 65
ata2: SATA max UDMA/133 mmio [mem 0x83000000-0x83ffffff] port 0x180 irq 65
physmap platform flash device: 08000000 at 10000000
physmap-flash physmap-flash.0: map_probe failed
libphy: Fixed MDIO Bus: probed
libphy: CNS3xxx MII Bus: probed
eth0: RGMII PHY 0 on cns3xxx Switch
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ehci-platform: EHCI generic platform driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-pci: OHCI PCI platform driver
ohci-platform: OHCI generic platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
CNS3XXX Real Time Clock, (c) 2009 Cavium Networks
rtc irq:23
rtc rtc0: invalid alarm value: 1900-1-21 0:0:0
cns3xxx-rtc cns3xxx-rtc: rtc core: registered cns3xxx-rtc as rtc0
i2c /dev entries driver
adt7475 0-002e: ADT7473 device, revision 0
adt7475 0-002e: Optional features: fan4 pwm2
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
Initializing XFRM netlink socket
NET: Registered protocol family 17
NET: Registered protocol family 15
bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
PCI-E0 uses external clock source.
ata1: SATA link down (SStatus 0 SControl 300)
PCIe: Port[0] Enable PCIe LTSSM
PCIe: Port[0] Check data link layer...
ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata2.00: ATA-8: HGST HTS725050A7E630, GH2ZB550, max UDMA/133
ata2.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32)
ata2.00: configured for UDMA/133
scsi 1:0:0:0: Direct-Access     ATA      HGST HTS725050A7 B550 PQ: 0 ANSI: 5
sd 1:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
sd 1:0:0:0: [sda] 4096-byte physical blocks
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1
sd 1:0:0:0: [sda] Attached SCSI disk
Device not found.
EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext3 filesystem) on device 8:1.
devtmpfs: mounted
Freeing unused kernel memory: 212K
systemd[1]: System time before build time, advancing clock.
ip_tables: (C) 2000-2006 Netfilter Core Team
random: systemd: uninitialized urandom read (16 bytes read, 29 bits of entropy available)
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)
systemd[1]: Detected architecture arm.

Welcome to Debian GNU/Linux 9 (stretch)!

systemd[1]: Set hostname to <seagate-dev>.
random: systemd: uninitialized urandom read (16 bytes read, 35 bits of entropy available)
random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 37 bits of entropy available)
random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 38 bits of entropy available)
random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 38 bits of entropy available)
random: systemd-cryptse: uninitialized urandom read (16 bytes read, 38 bits of entropy available)
random: systemd: uninitialized urandom read (16 bytes read, 45 bits of entropy available)
random: systemd: uninitialized urandom read (16 bytes read, 45 bits of entropy available)
random: systemd: uninitialized urandom read (16 bytes read, 45 bits of entropy available)
random: systemd: uninitialized urandom read (16 bytes read, 45 bits of entropy available)
systemd[1]: Listening on Journal Socket.
[  OK  ] Listening on Journal Socket.
systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
systemd[1]: Listening on Syslog Socket.
[  OK  ] Listening on Syslog Socket.
systemd[1]: Created slice System Slice.
[  OK  ] Created slice System Slice.
systemd[1]: Mounting POSIX Message Queue File System...
         Mounting POSIX Message Queue File System...
systemd[1]: Mounting Debug File System...
         Mounting Debug File System...
systemd[1]: Starting Remount Root and Kernel File Systems...
         Starting Remount Root and Kernel File Systems...
systemd[1]: dev-hugepages.mount: Couldn't determine result for ConditionVirtualization=!private-users, assuming failed: No such file or directory
systemd[1]: Created slice system-getty.slice.
[  OK  ] Created slice system-getty.slice.
systemd[1]: Listening on udev Kernel Socket.
[  OK  ] Listening on udev Kernel Socket.
systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
systemd[1]: Reached target Paths.
[  OK  ] Reached target Paths.
systemd[1]: Reached target Encrypted Volumes.
[  OK  ] Reached target Encrypted Volumes.
systemd[1]: Reached target Swap.
[  OK  ] Reached target Swap.
systemd[1]: Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket (/dev/log).
systemd[1]: Starting Journal Service...
         Starting Journal Service...
systemd[1]: Reached target Remote File Systems.
[  OK  ] Reached target Remote File Systems.
systemd[1]: Created slice system-serial\x2dgetty.slice.
[  OK  ] Created slice system-serial\x2dgetty.slice.
systemd[1]: Starting Create list of required static device nodes for the current kernel...
         Starting Create list of required st…ce nodes for the current kernel...
systemd[1]: Starting Load Kernel Modules...
         Starting Load Kernel Modules...
systemd[1]: Listening on udev Control Socket.
[  OK  ] Listening on udev Control Socket.
systemd[1]: Created slice User and Session Slice.
[  OK  ] Created slice User and Session Slice.
systemd[1]: Reached target Slices.
[  OK  ] Reached target Slices.
systemd[1]: Mounted POSIX Message Queue File System.
[  OK  ] Mounted POSIX Message Queue File System.
systemd[1]: Mounted Debug File System.
[  OK  ] Mounted Debug File System.
systemd[1]: Started Journal Service.
[  OK  ] Started Journal Service.
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Started Create list of required sta…vice nodes for the current kernel.
[  OK  ] Started Load Kernel Modules.
         Starting Apply Kernel Variables...
         Starting Create Static Device Nodes in /dev...
         Starting Load/Save Random Seed...
         Starting udev Coldplug all Devices...
         Starting Flush Journal to Persistent Storage...
[  OK  ] Started Apply Kernel Variables.
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Started Create Static Device Nodes in /dev.
systemd-journald[481]: Received request to flush runtime journal from PID 1
         Starting udev Kernel Device Manager...
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
         Starting Raise network interfaces...
[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Started udev Kernel Device Manager.
         Starting Create Volatile Files and Directories...
[  OK  ] Found device /dev/ttyS0.
[  OK  ] Started Create Volatile Files and Directories.
         Starting Network Time Synchronization...
         Starting Update UTMP about System Boot/Shutdown...
[  OK  ] Started Network Time Synchronization.
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Reached target System Initialization.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
[  OK  ] Started Regular background program processing daemon.
[  OK  ] Started D-Bus System Message Bus.
         Starting Login Service...
         Starting System Logging Service...
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Started Daily apt download activities.
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Reached target Timers.
[  OK  ] Started System Logging Service.
[  OK  ] Started Login Service.
random: nonblocking pool is initialized

And here for comparism bootlog from 2.6.35

Hit any key to stop autoboot:  0 

Serial Flash Sector 3 Erase OK!
0x00010000        
mmc_init
Detected SD Card

8133168 bytes read
enter do_eth_down!!!
## Booting kernel from Legacy Image at 08000000 ...
   Image Name:   Linux-2.6.35.13-cavm1.whitney-ec
   Created:      2015-03-10   2:09:28 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    8133104 Bytes =  7.8 MB
   Load Address: 02000000
   Entry Point:  02000000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.35.13-cavm1.whitney-econa.whitney-econa (builder@ubuntu) (gcc version 4.4.1 (MontaVista Linux G++ 4.4-) ) #2 Mon Mar 9 19:09:21 PDT 2015
[    0.000000] Whitney release v1.1-beta5
[    0.000000] CPU: ARMv6-compatible processor [410fb024] revision 4 (ARMv7), cr=00c5387f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: Cavium Networks CNS3420 Validation Board
[    0.000000] Ignoring unrecognised tag 0x00000000
[    0.000000] Memory policy: ECC disabled, Data cache writealloc
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8188
[    0.000000] Kernel command line: console=ttyS0,38400 mem=512M root=/dev/md0 rootwait
[    0.000000] PID hash table entries: 2048 (order: -3, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 2, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 1, 131072 bytes)
[    0.000000] allocated 163840 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[    0.000000] Memory: 512MB = 512MB total
[    0.000000] Memory: 510592k/510592k available, 13696k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0x00000000   (  64 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     DMA     : 0xff600000 - 0xffe00000   (   8 MB)
[    0.000000]     vmalloc : 0xc0800000 - 0xe0000000   ( 504 MB)
[    0.000000]     lowmem  : 0xa0000000 - 0xc0000000   ( 512 MB)
[    0.000000]     modules : 0x9f000000 - 0xa0000000   (  16 MB)
[    0.000000]       .init : 0xa0008000 - 0xa04f0000   (5024 kB)
[    0.000000]       .text : 0xa04f0000 - 0xa0ab0000   (5888 kB)
[    0.000000]       .data : 0xa0b12000 - 0xa0b5db80   ( 303 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000] 	RCU-based detection of stalled CPUs is disabled.
[    0.000000] 	Verbose stalled-CPUs detection is disabled.
[    0.000000] NR_IRQS:160
[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [ttyS0] enabled
[    0.020000] Calibrating delay loop... 279.34 BogoMIPS (lpj=1396736)
[    0.260000] pid_max: default: 32768 minimum: 301
[    0.270000] Mount-cache hash table entries: 8192
[    0.280000] Initializing cgroup subsys ns
[    0.290000] Initializing cgroup subsys cpuacct
[    0.300000] Initializing cgroup subsys memory
[    0.310000] Initializing cgroup subsys devices
[    0.320000] Initializing cgroup subsys freezer
[    0.330000] Initializing cgroup subsys net_cls
[    0.340000] Initializing cgroup subsys blkio
[    0.350000] CPU: Testing write buffer coherency: 
[    0.360000] ok
[    0.360000] CNS3XXX: no. of cores (2) greater than configured maximum of 1 - clipping
[    0.370000] CPU1: Booted secondary processor
[    0.370000] <0> DP-core moving to WFI
[    0.370000] cvm_nas_init: cvm_nas_task init
[    0.380000] cvm_nas_init: proc init success
[    0.400000] devtmpfs: initialized
[    0.410000] NET: Registered protocol family 16
[    0.420000] L310 cache controller enabled
[    0.430000] l2x0: 8 ways, CACHE_ID 0x410000c4, AUX_CTRL 0x02540000, Cache size: 262144 B
[    0.440000] cns_rdma_init: start
[    0.450000] cns_rdma_init: reg1: virt=0xbc015d48
[    0.460000] cns_rdma_init: pre-allocating rdma_sg: 32*280=8960
[    0.470000] cns_rdma_init: q1: virt=0xbc0b3a00, phy=0x3c0b3a00 -> 0x3c0b3bf0
[    0.480000] cns_rdma_init: done, err=0
[    0.490000] Cavium feature enabled: SOP-PURENAS, 64KB page size, Jumbo frame, 
[    0.510000] bio: create slab <bio-0> at 0
[    0.520000] vgaarb: loaded
[    0.530000] SCSI subsystem initialized
[    0.540000] usbcore: registered new interface driver usbfs
[    0.560000] usbcore: registered new interface driver hub
[    0.570000] usbcore: registered new device driver usb
[    0.750000] raid6: int32x1     91 MB/s
[    0.930000] raid6: int32x2    128 MB/s
[    1.110000] raid6: int32x4    126 MB/s
[    1.290000] raid6: int32x8    138 MB/s
[    1.470000] raid6: CNS-RAID    48 MB/s
[    1.480000] raid6: using algorithm CNS-RAID (48 MB/s)
[    1.490000] Switching to clocksource timer1
[    1.500000] Slow work thread pool: Starting up
[    1.510000] Slow work thread pool: Ready
[    1.520000] FS-Cache: Loaded
[    1.550000] NET: Registered protocol family 2
[    1.560000] IP route cache hash table entries: 16384 (order: 0, 65536 bytes)
[    1.570000] TCP established hash table entries: 16384 (order: 1, 131072 bytes)
[    1.580000] TCP bind hash table entries: 16384 (order: 0, 65536 bytes)
[    1.590000] TCP: Hash tables configured (established 16384 bind 16384)
[    1.600000] TCP reno registered
[    1.610000] UDP hash table entries: 4096 (order: 0, 65536 bytes)
[    1.620000] UDP-Lite hash table entries: 4096 (order: 0, 65536 bytes)
[    1.630000] NET: Registered protocol family 1
[    1.640000] RPC: Registered udp transport module.
[    1.650000] RPC: Registered tcp transport module.
[    1.660000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.640000] CNS3XXX PCIe Host Control Driver
[    2.650000] ===============================
[    2.660000] CNS3XXX PCIe support both internal and external clock.
[    2.670000] However, incorrect selection may result in system hang.
[    2.680000] If booting hangs, please select choose 
[    2.690000] CONFIG_CNS3XXX_INTERNAL_CLOCK_SOURCE
[    2.700000] instead.
[    2.700000] ===============================
[    2.710000] PCI-E0 uses external clock source.
[    2.720000] PCIe: Port[0] Enable PCIe LTSSM
[    2.730000] PCIe: Port[0] Check data link layer...
[    3.250000] Device not found.
[    3.250000] PCIe: Set Bridge Max_Payload_Size to 128 byte
[    3.260000] PCIe: Set Bridge Max_Read_Request_Size to 128 byte
[    3.270000] PCI: bus0: Fast back to back transfers disabled
[    3.280000] PCI: bus1: Fast back to back transfers enabled
[    3.290000] PCIe0: Bridge found.
[    3.300000] PCI: enabling device 0000:00:00.0 (0140 -> 0143)
[    3.310000] PCIe0 map irq: 0000:00:00.00 slot 0, pin 1, irq: 87
[    3.320000] VFS: Disk quotas dquot_6.5.2
[    3.330000] Dquot-cache hash table entries: 16384 (order 0, 65536 bytes)
[    3.340000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    3.350000] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    3.360000] NTFS driver 2.1.29 [Flags: R/W].
[    3.370000] fuse init (API version 7.14)
[    3.380000] SGI XFS with ACLs, security attributes, large block/inode numbers, no debug enabled
[    3.390000] SGI XFS Quota Management subsystem
[    3.400000] GFS2 (built Mar  9 2015 19:07:00) installed
[    3.410000] msgmni has been set to 996
[    3.420000] alg: No test for stdrng (krng)
[    3.430000] io scheduler noop registered
[    3.440000] io scheduler deadline registered (default)
[    3.460000] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    3.470000] serial8250: ttyS0 at MMIO 0x78000000 (irq = 45) is a 16550A
[    3.480000] brd: module loaded
[    3.490000] loop: module loaded
[    3.500000] drbd: initialized. Version: 8.3.8 (api:88/proto:86-94)
[    3.510000] drbd: built-in
[    3.520000] drbd: registered as block device major 147
[    3.530000] drbd: minor_table @ 0xbc0387e0
[    3.540000] Loading iSCSI transport class v2.0-870.
[    3.550000] iscsi: registered transport (tcp)
[    3.560000] cns3xxx_spi_probe: setup CNS3XXX SPI Controller in polling mode, w/o DMA 
[    3.580000] SPI bit rate = 116/64 Mhz
[    3.590000] m25p80 spi1.0: found mx25l4005a, expected m25p80
[    3.600000] m25p80 spi1.0: mx25l4005a (512 Kbytes)
[    3.610000] Creating 3 MTD partitions on "spi1.0":
[    3.620000] 0x000000000000-0x000000030000 : "SPI-UBoot"
[    3.640000] 0x000000030000-0x000000040000 : "SPI-UBootEnv"
[    3.650000] 0x000000040000-0x000000080000 : "SPI-FileSystem"
[    3.660000] CNS3XXX AHCI SATA low-level driver
[    3.670000] SATA Port0 Spread-spectrum : Disable 
[    3.680000] SATA Port0 Spread-spectrum : Enable 
[    3.690000] SATA Port1 Spread-spectrum : Disable 
[    3.700000] SATA Port1 Spread-spectrum : Enable 
[    3.710000] cns3xxx-ahci cns3xxx-ahci.0: forcing PORTS_IMPL to 0x3
[    3.720000] CPU clock : 700 
[    3.730000] *** Timer 1ms: 100000(0x186a0) ***
[    3.740000] *** Set to: 350000(0x55730) ***
[    3.750000] cns3xxx-ahci cns3xxx-ahci.0: AHCI 0001.0100 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
[    3.760000] cns3xxx-ahci cns3xxx-ahci.0: flags: ncq sntf pm led clo only pmp pio slum part 
[    3.770000] scsi0 : cns3xxx-ahci
[    3.780000] scsi1 : cns3xxx-ahci
[    3.790000] ata1: SATA max UDMA/133 ahci bar m16777216@0x83000000 port 0x83000100 irq 65
[    3.800000] ata2: SATA max UDMA/133 ahci bar m16777216@0x83000000 port 0x83000180 irq 65
[    3.820000] tun: Universal TUN/TAP device driver, 1.6
[    3.830000] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    3.840000] mice: PS/2 mouse device common for all mice
[    3.850000] CNS3XXX Real Time Clock, (c) 2009 Cavium Networks
[    3.860000] rtc irq:23
[    3.860000] cns3xxx-rtc cns3xxx-rtc: rtc core: registered cns3xxx-rtc as rtc0
[    4.380000] i2c /dev entries driver
[    4.400000] adt7475 0-002e: ADT7473 device, revision 0
[    4.410000] adt7475 0-002e: Optional features: fan4 pwm2
[    4.420000] CNS3XXX Watchdog Timer, noboot=0 margin=60 sec (nowayout= 0)
[    4.430000] watchdog: cns3xxx_wdt_probe
[    4.440000] watchdog irq = 30
[    4.450000] watchdog start_regs  = 0xC0A00600
[    4.520000] Watchdog timer frequency : 349.98MHz.
[    4.530000] ata1: SATA link down (SStatus 0 SControl 300)
[    4.540000] md: linear personality registered for level -1
[    4.550000] md: raid0 personality registered for level 0
[    4.560000] md: raid1 personality registered for level 1
[    4.570000] xor: measuring software checksum speed
[    4.630000]    arm4regs  :   448.000 MB/sec
[    4.690000]    8regs     :   275.200 MB/sec
[    4.750000]    32regs    :   300.800 MB/sec
[    4.810000]    CNS-RAID  :   454.400 MB/sec
[    4.820000] xor: using function: CNS-RAID (454.400 MB/sec)
[    4.830000] md: raid6 personality registered for level 6
[    4.840000] md: raid5 personality registered for level 5
[    4.850000] md: raid4 personality registered for level 4
[    4.860000] device-mapper: ioctl: 4.17.0-ioctl (2010-03-05) initialised: dm-devel@redhat.com
[    4.870000] sdhci: Secure Digital Host Controller Interface driver
[    4.880000] sdhci: Copyright(c) Pierre Ossman
[    4.890000] sdhci-cns3xxx, (c) 2009 Cavium Networks
[    4.910000] mmc0: SDHCI controller on cns3xxx [sdhci-cns3xxx.0] using PIO
[    4.920000] usbcore: registered new interface driver hiddev
[    4.940000] usbcore: registered new interface driver usbhid
[    4.950000] usbhid: USB HID core driver
[    4.960000] TCP cubic registered
[    4.970000] NET: Registered protocol family 17
[    4.980000] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 4
[    5.000000] cns3xxx-rtc cns3xxx-rtc: setting system clock to 2018-03-20 21:51:38 UTC (1521582698)
[    5.040000] mmc0: new high speed SD card at address 0007
[    5.050000] mmcblk0: mmc0:0007 SD256 246 MiB 
[    5.060000]  mmcblk0: p1 p2 p3 p4
[   11.930000] ata2: link is slow to respond, please be patient (ready=0)
[   23.880000] ata2: softreset failed (device not ready)
[   24.070000] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[   24.090000] ata2.00: ATA-8: HGST HTS725050A7E630, GH2ZB550, max UDMA/133
[   24.100000] ata2.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 31/32)
[   24.110000] ata2.00: configured for UDMA/133
[   24.140000] scsi 1:0:0:0: Direct-Access     ATA      HGST HTS725050A7 GH2Z PQ: 0 ANSI: 5
[   24.150000] sd 1:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[   24.160000] sd 1:0:0:0: [sda] 4096-byte physical blocks
[   24.170000] sd 1:0:0:0: [sda] Write Protect is off
[   24.180000] sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   24.190000]  sda: sda1
[   24.560000] sd 1:0:0:0: [sda] Attached SCSI disk
Starting initramfs boot...
rootdelay parameter was not passed on kernel command line - assuming 2s delay
If you would like to avoid this delay, pass explicit rootdelay=0
Waiting 2 seconds for devices to settle...
initramfs: Creating device nodes: sda sda1 
initramfs: Loading /initrd.d/60-sop.sh module
[   26.770000] GPIOB_PIN_EN_REG: c430ff80
[   26.780000] 
[   26.780000] Do power enable
[   26.790000] Disabling MAC Ports
[   26.800000] Suspending DMA
[   26.810000] Waiting for DMA Status not IDLE
[   26.820000]  0 0
[   26.820000]  done
[   26.830000] Do power reset
[   26.840000] do cns3xxx gsw memory test
[   26.850000] cns3xxx gsw memory test is complete
[   26.860000] CNS3XXX PSE: Initialize init_port: 7
[   26.880000] MAC 0
[   26.880000] phy_id: 1c
[   26.890000] Initialize RTL8211
[   26.900000] do_ssc_test[64]: phy_addr = 00000001
[   26.920000] MAC 1
[   26.920000] phy_id: 1c
[   26.930000] Initialize RTL8211
[   26.940000] do_ssc_test[64]: phy_addr = 00000002
[   26.960000] MAC 2
[   26.960000] vid: 1
[   26.960000] pmap: 0x4
[   26.960000] age_field: 7
[   26.960000] vlan_mac: 1
[   26.960000] filter: 0
[   26.960000] mac addr: 0:10:75:38:d0:cc
[   26.970000] cns3xxx_probe: using uboot env MAC addr: 00:10:75:38:d0:cc
[   26.980000] vid: 2
[   26.980000] pmap: 0x4
[   26.980000] age_field: 7
[   26.980000] vlan_mac: 1
[   26.980000] filter: 0
[   26.980000] mac addr: 0:10:75:38:d0:cd
[   26.990000] cns3xxx_probe: using uboot env MAC addr: 00:10:75:38:d0:cd
[   27.000000]  pse register_pm_notifer 0
[   27.010000] CPU0: Initializing DataPlane...
[   27.020000] dataPlaneInit: Initializing the rings
[   27.030000] dataPlaneInit: Page Ring Fill for the first time
[   27.040000] ... cns3xxx_setup_all_tx_resources
[   27.050000] ... cns3xxx_setup_all_rx_resources ## ring_num : 0
[   27.060000] CPC: rx resources setup done
[   27.070000] dataPlaneInit: Page Ring Fill for the second time

[   27.080000] CP[   27.o80000] mCPng out oore com<6>[   27.080000] ing out of WFI
[   27.080000] CPU1: dataPlaneEntry ....
[   27.080000]  Start Address of seg_hdr = a0bb7e60, End addr = a0bd7e5f
initramfs: Loading /initrd.d/80-md.sh module
No bootable drives
initramfs: Loading /initrd.d/85-nfsboot.sh module
INIT: version 2.86 booting
Please wait: booting...
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/shares/server.py", line 86, in <module>
    server = Server(socketname, ServerHandler)
  File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
    self.server_bind()
  File "/usr/lib/python2.6/SocketServer.py", line 411, in server_bind
    self.socket.bind(self.server_address)
  File "<string>", line 1, in bind
socket.error: [Errno 30] Read-only file system
rm: cannot remove /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
chown: changing ownership of /var/spool/cups/tmp: Read-only file system
chown: changing ownership of /var/spool/cups: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
chmod: changing permissions of /var/spool/cups/tmp: Read-only file system
chmod: changing permissions of /var/spool/cups: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
/etc/init.d/rcS: /etc/rcS.d/S02populate-volatile.sh: line 1: can't create /etc/volatile.cache: Read-only file system
mount: sysfs already mounted or /sys busy
mount: according to mtab, sysfs is already mounted on /sys
Starting udev
touch: cannot touch /tmp/stype: Read-only file system
Remounting root file system...



mdadm: /dev/md2 not identified in config file.
mount: special device /dev/md2 does not exist
umount: /dev/md2: not found
mdadm: error opening /dev/md2: No such file or directory
umount: /media/cf: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
Starting up raid using
+ d1=sda
+ d2=sdb
+ d3=sdc
+ d4=sdd
+ devcnt=0
+ params=<drives name="set">
+ eval dir=/sys/block/$d1
+ dir=/sys/block/sda
+ [ ! -d /sys/block/sda ]
+ eval device=/dev/$d1
+ device=/dev/sda
+ parted /dev/sda --script print
+ sed 1,/Number/ d
+ wc -l
+ part_cnt=2
+ [ 2 -ge 1 ]
+ continue
+ eval dir=/sys/block/$d2
+ dir=/sys/block/sdb
+ [ ! -d /sys/block/sdb ]
+ continue
+ eval dir=/sys/block/$d3
+ dir=/sys/block/sdc
+ [ ! -d /sys/block/sdc ]
+ continue
+ eval dir=/sys/block/$d4
+ dir=/sys/block/sdd
+ [ ! -d /sys/block/sdd ]
+ continue
+ params=<drives name="set"></drives>
+ [ 0 -ge 1 ]
+ test true = true
+ cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] 
unused devices: <none>
+ sh /usr/sbin/sys_part_recover
+ exit 0
mkdir: cannot create directory /VolumeData: Read-only file system
Setting up IP spoofing protection: rp_filter.
Configuring network interfaces... /usr/bin/restart_mini_dlna: cd: line 12: can't cd to /usr/config/backupconfig
/
run-parts: /etc/network/if-up.d/20-upnp exited with code 1
done.
Failed to kill daemon. (No such file or directory)
[   40.200000] dev->name: eth0 ## dev->features: 1116179
Failed to kill daemon. (No such file or directory)
[   40.370000] dev->name: eth1 ## dev->features: 1116179
Starting portmap daemon: portmap.
rm: cannot remove directory /tmp: Read-only file system
ln: creating symbolic link /tmp/tmp: Read-only file system
Collected errors:
 * opkg_conf_init: Creating temp dir /tmp/opkg-qgEbzs failed: Read-only file system
rm: cannot remove /etc/rcS.d/S98configure: Read-only file system
Letting uboot know initramfs kernel was successful
[   45.680000] EXT4-fs (mmcblk0p4): warning: maximal mount count reached, running e2fsck is recommended
[   45.740000] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: (null)
INIT: Entering runlevel: 5
Starting system message bus: dbus.
/etc/rc5.d/S20mountcomplete: line 5: can't create /etc/.usb_lck: Read-only file system
Starting S.M.A.R.T. daemon: smartd.
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon                       [ ok ]
Starting Lighttpd Web Server: lighttpd.
/usr/bin/setup-lcd: line 8: can't create /proc/cns3xxx/st7066: nonexistent directory
/usr/bin/setup-lcd: line 9: can't create /proc/cns3xxx/st7066: nonexistent directory
/etc/rc5.d/S99sysready.sh: line 11: can't create /etc/dflags/sdflag: Read-only file system
rm: cannot remove /tmp/.volume_migrate: Read-only file system

MontaVista(R) Linux(R) 6.0

MontaVista Linux 6 .dev-snapshot-20150310 whitney-econa-2bay console

whitney-econa-2bay login: /usr/bin/setup-lcd: line 75: can't create /proc/cns3xxx/st7066: nonexistent directory
/usr/bin/setup-lcd: line 75: can't create /proc/cns3xxx/st7066: nonexistent directory
/usr/bin/setup-lcd: line 75: can't create /proc/cns3xxx/st7066: nonexistent directory
/usr/bin/setup-lcd: line 75: can't create /proc/cns3xxx/st7066: nonexistent directory
/usr/bin/setup-lcd: line 75: can't create /proc/cns3xxx/st7066: nonexistent directory
/usr/bin/setup-lcd: line 75: can't create /proc/cns3xxx/st7066: nonexistent directory
/usr/bin/setup-lcd: line 75: can't create /proc/cns3xxx/st7066: nonexistent directory
/usr/bin/setup-lcd: line 75: can't create /proc/cns3xxx/st7066: nonexistent directory

MontaVista(R) Linux(R) 6.0

MontaVista Linux 6 .dev-snapshot-20150310 whitney-econa-2bay console

whitney-econa-2bay login:



Edited 1 time(s). Last edit at 03/20/2018 03:05PM by blackdevil.
Hi again,

You can check the sourcecode: https://www.dropbox.com/s/4c9jhtajmzxqcb6/linux-4.4.121-tommy.tar.gz?dl=0

blackdevil,
I have no idea what is wrong. The pcie driver is picky. Today in my box after few reboots pcie&usb stopped working, I unpluged all cables (power, ethernet, uart cable), plugged again and it resumed working. I am trying to find out any pattern when it is working and when is not, but I can't.

Mark,
In my box me powering on with a button just works, I have no issues with that.
I attached two harddrives and only one got initialized - so I can confirm it is a problem with sata driver. Did you have any patch for this? You mentioned this earlier.
tommy79 Wrote:
-------------------------------------------------------
> Mark,
> In my box me powering on with a button just works,
> I have no issues with that.
> I attached two harddrives and only one got
> initialized - so I can confirm it is a problem
> with sata driver. Did you have any patch for this?
> You mentioned this earlier.

Adding in the kernel's usual SATA Port Multiplier support is what brought all my drives online:
CONFIG_SATA_PMP=y

Thanks for the source! I'll build a kernel with it right away (and re-test the power button issue).

Mark
Mark,
I enabled this CONFIG_SATA_PMP but the result was that none of the drives got recognized....
tommy79 Wrote:
-------------------------------------------------------
> Mark,
> I enabled this CONFIG_SATA_PMP but the result was
> that none of the drives got recognized....

That's a bit unexpected! The port multiplier was the key to getting my drives going. I don't know why enabling support might make your drives unrecognized?

I posted my .120 config a few posts ago if you'd like to double-check my work.

Mark
tommy79 Wrote:
-------------------------------------------------------
> Mark,
> I enabled this CONFIG_SATA_PMP but the result was
> that none of the drives got recognized....

I built a kernel with your config last night and enabled CONFIG_SATA_PMP and all four drives came online. Is there something else your system needs?

Thanks again for the source code and kernel config! I've been happily using USB since last night to speed up my file restoration. :)

Mark
Mark,
Did you use my config (with SATA_PMP enabled) or your config? I saw some options are different in your config.
tommy79 Wrote:
-------------------------------------------------------
> Mark,
> Did you use my config (with SATA_PMP enabled) or
> your config? I saw some options are different in
> your config.

I added it to your config along with RAID support as I need that to boot my array.
So, has anyone been successful in getting the SPI driver to work? I notice there is no mention of SPI in the bootup logs. I've tried KL Yang's kernel, Tommy's kernel, and my own but none seem to work. I believe Yang's kernel driver came from OpenWRT but I haven verified that (nor tried the OpenWRT kernel).

I'm assuming the SPI support is what I need to access the flash partitions and without the ability to put my own kernel into flash I seem unable to get my Seagate booting on its own, without my u-Boot manipulations through the serial console.

On the other hand, if anyone knows how I can get u-Boot booting my kernel directly instead of reverting to flash when left alone that would be great. My tests have shown that u-Boot ignores any bootcmd I save and boots to flash regardless of what it's told.

Mark
Re: (WIP) Linux Kernel and rootfs 4.14.24 for Seagate Business Storage NAS (CNS3xxx) package
April 09, 2018 01:13AM
Hi Mark,

> I'm assuming the SPI support is what I need to
> access the flash partitions and without the
> ability to put my own kernel into flash I seem
> unable to get my Seagate booting on its own,
> without my u-Boot manipulations through the serial
> console.
>
> On the other hand, if anyone knows how I can get
> u-Boot booting my kernel directly instead of
> reverting to flash when left alone that would be
> great. My tests have shown that u-Boot ignores any
> bootcmd I save and boots to flash regardless of
> what it's told.
>

Is this blackdevil and Tommy also experienced? I tend to temprarily forget everything about some subject that I am not working on :) hence the question.

So when you set envs to boot into kernel 4.4.x and used saveenv before boot, it did not stick to the next boot? did you have any error or it was just silently not executing the save?

-bodhi
===========================
Forum Wiki
bodhi's corner
bodhi Wrote:
-------------------------------------------------------

> So when you set envs to boot into kernel 4.4.x and
> used saveenv before boot, it did not stick to the
> next boot? did you have any error or it was just
> silently not executing the save?

Settings will save but u-Boot seems to be ignoring them. It always boots the stock kernel in the flash partition.
I will play around with it more today in case I'm missing something but that's been my experience.

I'm already looking at how to update u-Boot to the latest version but that might be a bit of work.

Mark
@bodhi

what MarkTurner said. Uboot ignores custom settings during autoboot.

Has anyone any hints why my pci express isnt initialized the correct way? The bootlogs I posted earlier.
I had a look at the patches from tommy79, and they seems really good, I didnt found a missing patch or something else. But I dont understand much from kernel/driver development.

Thanks for every hint :)
Re: (WIP) Linux Kernel and rootfs 4.14.24 for Seagate Business Storage NAS (CNS3xxx) package
April 10, 2018 05:05PM
All,

An observation about this box kernel 4.4. Now that I refreshed my memory :) this kernel got stuck at 4.4.x because of the same reason the Pogo V3 has been.

Linux Kernel 4.4.124 Oxnas

Quote

These OXNAS boxes uses the ARM11 MPCore, which has some internal CPU bugs, and has proven to be problematic any time there is significant upstream modification in SMP related code. Thus, I've chosen to stay tracked with an LTS kernel to ensure there is enough upstream tests before moving on to the next version. And therefore I will release a minor version in the series 4.4.x whenever there will be kernel security fixes. After this 4.4 LTS version will have been expired, I will move to a new LTS kernel so we can get the latest Linux features.

So chance is that if you look at the patch for the Pogo V3 and the config file that I uploaded, you will find some interesting info to compare with your 4.4 patch.

Now if Tommy or someone want to transition the kernel to FDT, then it should be for 4.4.x (the Pogo V3 Oxnas is already FDT).

-bodhi
===========================
Forum Wiki
bodhi's corner
MarkTurner Wrote:
-------------------------------------------------------
> bodhi Wrote:
> -------------------------------------------------------
>
> > So when you set envs to boot into kernel 4.4.x
> and
> > used saveenv before boot, it did not stick to
> the
> > next boot? did you have any error or it was
> just
> > silently not executing the save?
>
> Settings will save but u-Boot seems to be ignoring
> them. It always boots the stock kernel in the
> flash partition.
> I will play around with it more today in case I'm
> missing something but that's been my experience.
>
> I'm already looking at how to update u-Boot to the
> latest version but that might be a bit of work.
>
> Mark

Hi guys,

I spotted the u-boot at first checks the nettboot env setting. If it is set to 0, then it defaults to the hard-coded boot command and it results in booting from the flash partition. But if it is set to 1, then it uses the netboot_cmd (or similar, I do not remember the name and cannot access my box right now) env variable.

So the trick is to set the netboot variable to 1 and then provide your own boot command (e.g. one that boots from sata partition) in the netboot_cmd variable. And than save the environment.

Before overwriting netboot_cmd, I myself saved the original command in the new variable with some prefix, so anytime I can restore the original netboot command if I need to.



Edited 1 time(s). Last edit at 04/15/2018 02:21PM by tommy79.
tommy79 Wrote:

> So the trick is to set the netboot variable to 1
> and then provide your own boot command (e.g. one
> that boots from sata partition) in the netboot_cmd
> variable. And than save the environment.

Very interesting, Tommy! I will have to try this tomorrow. Thanks!
tommy79 Wrote:
-------------------------------------------------------
> So the trick is to set the netboot variable to 1
> and then provide your own boot command (e.g. one
> that boots from sata partition) in the netboot_cmd
> variable. And than save the environment.

Excellent! I can confirm that setting the netboot variable keeps uBoot from clobbering upon boot whatever flash settings I provide. I am now able for the first time to boot Debian without using the serial console. Yay!

This is a NAS so I intend to keep it running 24/7, but should I shut it off I still cannot get it to power back on using the front power button. It takes removing the power cord before it will restart. What do you think would cause this? Is "off" really off, or is it somehow stuck in a halt or hibernation-like state?

What else can we get working? Access to /dev/mtd? Second Ethernet (on my model, at least)? LCD display? :)
@MarkTurner,
I would be great to get PCI express and with that USB 3.0 working. I tried it and found no way :(

@tommy79,
Booting with the netboot command is a nice workaround, thanks :-)



Edited 1 time(s). Last edit at 04/16/2018 11:35AM by blackdevil.
blackdevil Wrote:
-------------------------------------------------------
>I would be great to get PCI express and with that USB 3.0 working. I tried it and found no way :(

Hmm. My PCIe works and USB 3.0 as well:

[    3.290000] Board version 1.x.
[    3.290000] PCI-E0 uses external clock source.
[    3.300000] Active PCIe0 Clock, PHY and reset PCIe
[    3.300000] PCIe: Port[0] Enable PCIe LTSSM
[    3.310000] PCIe: Port[0] Check data link layer...
[    3.320000] Link up.
[    3.320000] PCI host bridge to bus 0000:00
[    3.330000] pci_bus 0000:00: root bus resource [io  0xac000000-0xacffffff]
[    3.340000] pci_bus 0000:00: root bus resource [mem 0xa0000000-0xaaffffff]
[    3.360000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    3.380000] pci 0000:00:00.0: [177d:3400] type 01 class 0x060400
[    3.380000] pci 0000:00:00.0: supports D1 D2
[    3.380000] pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    3.380000] PCI: bus0: Fast back to back transfers disabled


Here are all the PCI mentions in my .config file:


grep -i pci .config |grep -v ^#
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_PCI_QUIRKS=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_DOMAINS_GENERIC=y
CONFIG_PCI_SYSCALL=y
CONFIG_OF_ADDRESS_PCI=y
CONFIG_OF_PCI=y
CONFIG_OF_PCI_IRQ=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_OHCI_HCD_PCI=y
CONFIG_MMC_SDHCI_PCI=m
CONFIG_GENERIC_PCI_IOMAP=y

$ lspci
00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01)
01:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller

I'll be happy to share my kernel binary with you if you'd like to try it.

Mark
MarkTurner Wrote:
-------------------------------------------------------
> I'll be happy to share my kernel binary with you
> if you'd like to try it.

Yeah, that would be great!
blackdevil Wrote:
-------------------------------------------------------
> @MarkTurner,
> I would be great to get PCI express and with that
> USB 3.0 working. I tried it and found no way :(
>
> @tommy79,
> Booting with the netboot command is a nice
> workaround, thanks :-)


I'm glad I was able to help you with the netboot trick :)

blackdevil,
I have the 2-bay box, so probably same as yours, and I had problems with pci and usb when I used the disk attached to the sata connector in the USM bay (of course I used regular 2.5 inch hdd, not a USM disk). The pci and usb couldn't get initialized and the disk was not always recognized. However once I started to use only the two regular bays, I get pci and usb initialized most of the times (although time to time it doesn't, I didn't find out why).



Edited 1 time(s). Last edit at 04/16/2018 02:31PM by tommy79.
tommy79 Wrote:
-------------------------------------------------------
> blackdevil,
> I have the 2-bay box, so probably same as yours,
> and I had problems with pci and usb when I used
> the disk attached to the sata connector in the USM
> bay (of course I used regular 2.5 inch hdd, not a
> USM disk). The pci and usb couldn't get
> initialized and the disk was not always
> recognized. However once I started to use only the
> two regular bays, I get pci and usb initialized
> most of the times (although time to time it
> doesn't, I didn't find out why).

I also used a 2.5 inch hdd for many years, but without any problems like disk recognizing. Thanks for the hint for just using the regular hdds, but I tried it and at least it wont work with the Kernel MarkTurner PMed me a few hours ago. I am going to try with some other kernels.

Thanks you both!
Hi,
this my be a dumb question, but is it possible to get an Acronis image type file that will put all the partitions onto a blank 4TB drive?
Thank you
I have a 4 bay NAS and when looking around for a newer kernel I came across this.

Any update on the USB Boot option?

What commands are needed for tftp boot when using a USB drive?
Not sure which model you have, Andy, but the U-Boot included with my 4-Bay Business NAS did not enable USB booting, nor does it react to the "magic packet" on the network. I had to buy an RS232-to-TTL board to access U-Boot's serial console, after which I was able to save BOOT_CMDS to do most of what I need.

It's still a work in progress but mine is now running well enough that I have not felt much motivation to hack up a new version of U-Boot. Maybe I'll look at this again over the summer.

Mark
Hi Mark,

Mine is also a 4-Bay Business NAS, model SRN04D
I have a serial adapter wired in.
Are you booting from a USB drive or from a SATA in one of the 4 bays?
What are the Boot commands you use?

Any assistance appreciated.

Andy
I did all my testing with only two drives in the bays, one of which did not boot and was only there to complete the bus. At the start I was booting the kernel uImage and an initrd from my TFTP server but once I got a combination I liked I put them on my hard drives.

I then formatted he new drives I wanted to use and put a small RAID0 partition on them to act as my boot partition. U-Boot doesn't seem to know what to do with a striped RAID array but if passed one of the partitions of a RAID0 array it will boot.

Here are the U-Boot commands I used when I was testing via TFTP:

dhcp
setenv serverip 192.168.1.1; setenv bootargs 'console=ttyS0,38400 mem=512M@0x20000000 root=/dev/sda3 rootwait';
tftp 0x28000000 uImage; bootm 0x28000000


... 192.168.1.1 being my TFTP server, of course.

Here is the command I later used to boot from disk:

setenv bootargs 'console=ttyS0,38400 mem=512M@0x20000000 root=/dev/md2'
scsi init; ext2load scsi 0:1 0x28000000 /uImage-4.4.121-jmt-1.5; bootm 0x28000000

scsi 0:1 here indicates scsi disk 0, partition 1. I believe the stock U-Boot can boot both ext2 and fat partitions (in which case you would use the FAT equivalent command to ext2load, which I don't have handy).

If you step through this thread you should get the gist of what needs to be done. Let me know if you have more specific questions, too!

Mark

P.S. Your question reminds me that I meant to write all this up for my blog ...
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: