Welcome! Log In Create A New Profile

Advanced

Debian on Freecom Silverstore 2 NAS

Posted by garagoyun 
Re: Debian on Freecom Silverstore 2 NAS
November 01, 2018 04:49AM
garagoyun,

Unfortunately, the only Kirkwood box that I have released u-boot for, which has 6282 and also DDR3 is the NS325!

Try the iConnect (uboot.2017.07-tld-1.iconnect.bodhi.tar). This has the 6281, 1GHz, but DDR2. I think it will likely have the same behvior as NSA325, i.e. starts but won't run very far. It's worth a try to see what'll happen.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 01, 2018 01:54PM
bodhi Wrote:
-------------------------------------------------------
> garagoyun,
>
> Unfortunately, the only Kirkwood box that I have
> released u-boot for, which has 6282 and also DDR3
> is the NS325!
>
> Try the iConnect
> (uboot.2017.07-tld-1.iconnect.bodhi.tar). This has
> the 6281, 1GHz, but DDR2. I think it will likely
> have the same behvior as NSA325, i.e. starts but
> won't run very far. It's worth a try to see
> what'll happen.

I have tried iConnect, as well as the rest of the u-boots. The end result is the same, they reach 100% and then nothing more is displayed:

~/Downloads/u-boots_kirkwood/kwboot-tool$ ./kwboot  -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.iconnect.mtd0.kwb  -p  
Sending boot message. Please reboot the target.../
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  6 % [......................................................................]
  8 % [......................................................................]
 10 % [......................................................................]
 11 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 23 % [......................................................................]
 25 % [......................................................................]
 27 % [......................................................................]
 29 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 34 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 44 % [......................................................................]
 46 % [......................................................................]
 47 % [......................................................................]
 49 % [......................................................................]
 51 % [......................................................................]
 53 % [......................................................................]
 54 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 59 % [......................................................................]
 61 % [......................................................................]
 63 % [......................................................................]
 64 % [......................................................................]
 66 % [......................................................................]
 68 % [......................................................................]
 70 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 75 % [......................................................................]
 76 % [......................................................................]
 78 % [......................................................................]
 80 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 85 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 97 % [......................................................................]
 99 % [....................................]
[Type Ctrl-\ + c to quit]

---------------------------------


Regards,
garagoyun
Re: Debian on Freecom Silverstore 2 NAS
November 01, 2018 03:51PM
garagoyun,

Quote

I have tried iConnect, as well as the rest of the u-boots. The end result is the same, they reach 100% and then nothing more is displayed:

Great! so that's out of the way. So now we know there are 2 choices. Etheir try to build stock u-boot, or use the NSA325 u-boot as a base to create new u-boot for this box.

New Kirkwood u-boot is easy for me to roll. But my free time is limited so if we go this path, it will be gradually and slow. OTOH, if stock u-boot can be built, then it is a 10 minutes for code change and we are most likely achieve the goal.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 02, 2018 06:08PM
bodhi,

I tried building the u-boot natively as well tonight, but got some dependencies as well.

---------------------------------


Regards,
garagoyun
Re: Debian on Freecom Silverstore 2 NAS
November 02, 2018 07:07PM
garagoyun Wrote:
-------------------------------------------------------
> bodhi,
>
> I tried building the u-boot natively as well
> tonight, but got some dependencies as well.

I know, the stock u-boot code is too old. It has many problem building with the modern tool chain. I've fixed some compilation problems, but another turned up during building executable (lots of multiple definitions). I'm hesitate to spend too much time patching it. I might as well building new u-boot to get more rewarding result :)

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



Edited 1 time(s). Last edit at 11/02/2018 07:07PM by bodhi.
Re: Debian on Freecom Silverstore 2 NAS
November 03, 2018 07:11PM
bodhi,

I was looking through configuration files in the source code the other day and inside the generic.mk file [/gplsrc/winas6282/target/generic/] I saw the following:

/lib/libc.so.6:
ifeq ($(strip $(ARCH)),arm)
	cp -a /scratchbox/compilers/arm-linux-cs2009q3-67/arm-none-linux-gnueabi/libc/lib/* /lib
	cp -a /scratchbox/compilers/arm-linux-cs2009q3-67/arm-none-linux-gnueabi/libc/usr/lib/libstdc++* /lib
endif

I thought, maybe Scratchbox was used for cross compiling, so I gave it a try. I am not sure if I have set the cross compilert up all correctly, however, I do have a bunch of bin files built now, altough not the same size as the original bin file I dumped from the device:

total 8224K
-rwxrwxr-x 1  1476K Nov  4 00:42 u-boot
-rw-rw-r-- 1   464K Nov  4 00:42 u-boot-3.5.9.bin
-rwxrwxr-x 1   464K Nov  4 00:42 u-boot.bin
-rwxrwxr-x 1  1476K Nov  4 00:42 u-boot-db88f6282bp
-rw-rw-r-- 1   464K Nov  4 00:42 u-boot-db88f6282bp_400ddr3db_nand.bin
-rw-rw-r-- 1   464K Nov  4 00:42 u-boot-db88f6282bp_400ddr3db_uart.bin
-rwxrwxr-x 1   464K Nov  4 00:42 u-boot-db88f6282bp.bin
-rwxrwxr-x 1  1332K Nov  4 00:42 u-boot-db88f6282bp.srec
-rw-rw-r-- 1   286K Nov  4 00:42 u-boot.map
-rwxrwxr-x 1  1332K Nov  4 00:42 u-boot.srec

Had no time to check if the device will boot using the newly compiled u-boot yet.


I have attached the log from the cross compilation.

---------------------------------


Regards,
garagoyun
Attachments:
open | download - u-boot.map (285.6 KB)
open | download - u-boot_build_log (308.8 KB)
Re: Debian on Freecom Silverstore 2 NAS
November 03, 2018 07:59PM
garagoyun,

Quote

total 8224K
-rwxrwxr-x 1 1476K Nov 4 00:42 u-boot
-rw-rw-r-- 1 464K Nov 4 00:42 u-boot-3.5.9.bin
-rwxrwxr-x 1 464K Nov 4 00:42 u-boot.bin
-rwxrwxr-x 1 1476K Nov 4 00:42 u-boot-db88f6282bp
-rw-rw-r-- 1 464K Nov 4 00:42 u-boot-db88f6282bp_400ddr3db_nand.bin
-rw-rw-r-- 1 464K Nov 4 00:42 u-boot-db88f6282bp_400ddr3db_uart.bin
-rwxrwxr-x 1 464K Nov 4 00:42 u-boot-db88f6282bp.bin
-rwxrwxr-x 1 1332K Nov 4 00:42 u-boot-db88f6282bp.srec
-rw-rw-r-- 1 286K Nov 4 00:42 u-boot.map
-rwxrwxr-x 1 1332K Nov 4 00:42 u-boot.srec

Now that's excellent works :) they look correct to me. The sizes are in the ballpark.

Use this binary to try kwboot (without the -p option):

-rw-rw-r-- 1   464K Nov  4 00:42 u-boot-db88f6282bp_400ddr3db_uart.bin

> I have attached the log from the cross
> compilation.

Will take a look.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 03, 2018 08:07PM
garagoyun ,

Please post ./u-boot-3.5.9/include/config.mk here.

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



Edited 1 time(s). Last edit at 11/03/2018 08:07PM by bodhi.
Re: Debian on Freecom Silverstore 2 NAS
November 04, 2018 02:44AM
bodhi Wrote:
-------------------------------------------------------
> garagoyun ,
>
> Please post ./u-boot-3.5.9/include/config.mk here.

That's the config.mk:
ARCH   = arm
CPU    = arm926ejs
BOARD  = config_kw
VENDOR = mv_feroceon
MV_OUTPUT = db88f6282bp
MV_FLAGS += -DMV88F6282
MV_FLAGS += -DDB_88F6282A
MV_IMAGE_FLAGS = -DMV_SEC_256K
MV_IMAGE_FLAGS += -DMV_BOOTSIZE_16M
MV_IMAGE_FLAGS += -DMV_LARGE_PAGE
MV_FLAGS += -DMV_BOOTROM
MV_FLAGS += -DMV_MMC
MV_DDR_FREQ = 400ddr2db
CROSS_COMPILE = 
MV_DDR_FREQ = 400ddr3db
MV_FLAGS += -DMV_USB -DCONFIG_CMD_USB
MV_USB=y
MV_FLAGS += -DMV_NAND_BOOT
MV_FLAGS += -DMV_NAND
NAND_BOOT =y
MV_FLAGS += -DHNCN2_BOARD
CPPFLAGS += $(MV_IMAGE_FLAGS) $(MV_FLAGS)


Quote
bodhi
Use this binary to try kwboot (without the -p option):

-rw-rw-r-- 1 464K Nov 4 00:42 u-boot-db88f6282bp_400ddr3db_uart.bin

I have tried u-boot-db88f6282bp_400ddr3db_uart.bin and it looks like it boots :)
Marvell>> version

U-Boot 1.1.4 (Nov  4 2018 - 00:42:42) Marvell version: 3.5.9
Marvell>>


And complete log:
$ ./kwboot  -t -B 115200 /dev/ttyUSB0 -b u-boot-db88f6282bp_400ddr3db_uart.bin
Sending boot message. Please reboot the target...-
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  7 % [......................................................................]
  9 % [......................................................................]
 11 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 24 % [......................................................................]
 26 % [......................................................................]
 28 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 33 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 43 % [......................................................................]
 45 % [......................................................................]
 47 % [......................................................................]
 49 % [......................................................................]
 50 % [......................................................................]
 52 % [......................................................................]
 54 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 60 % [......................................................................]
 62 % [......................................................................]
 64 % [......................................................................]
 66 % [......................................................................]
 67 % [......................................................................]
 69 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 75 % [......................................................................]
 77 % [......................................................................]
 79 % [......................................................................]
 81 % [......................................................................]
 83 % [......................................................................]
 84 % [......................................................................]
 86 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 96 % [......................................................................]
 98 % [......................................................................]
[Type Ctrl-\ + c to quit]

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__|  ** uboot_ver:v0.0.9 **

 ** MARVELL BOARD: HNC-N2 LE 

U-Boot 1.1.4 (Nov  4 2018 - 00:42:42) Marvell version: 3.5.9

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6282 A1CPU running @ 1000Mhz L2 running @ 333Mhz
SysClock = 400Mhz , TClock = 200Mhz 

DRAM (DDR3) CAS Latency = 6 tRP = 6 tRAS = 15 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Found ADT7473, program PWM1 ... OK
Flash:  0 kB

Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (5)
  Device 0 @ 0 0:
Model: Hitachi HDS721680PLA380                  Firm: P21OABDA Ser#:       PVE201ZESSYGNM
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 76319.0 MB = 74.5 GB (156301488 x 512)
[0 1 0]: Enable DMA mode (5)
  Device 1 @ 0 1:
Model: ST2000DM001-1ER164                       Firm: CC62     Ser#:             Z4Z5TX17
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)


CPU : Marvell Feroceon (Rev 1)
Scanning partition header:

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
PEX 1: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 

NAND read: device 0 offset 0x100000, size 0x199800

Reading data from 0x299000 -- 100% complete.
 1677312 bytes read: OK
Calculate CRC32:
crc32 checksum Pass

NAND read: device 0 offset 0x380000, size 0x27d400

Reading data from 0x5fd000 -- 100% complete.
 2610176 bytes read: OK
Calculate CRC32:
crc32 checksum Pass
## Booting image at 00040000 ...
   Image Name:   Linux-2.6.31.8winas6282
   Created:      2012-10-16  11:18:32 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2608424 Bytes =  2.5 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux.................................................................................................................................................................. done, booting the kernel.
Linux version 2.6.31.8winas6282 (freecom@SS-Build-Server) (gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) ) #6 Tue Oct 16 07:18:13 EDT 2012 v0.0.7
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Feroceon-KW
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 32512
Kernel command line: console=ttyS0,115200 mtdparts=nand_mtd:0x000a0000@0x0(uboot),0x00040000@0x000a0000(param),0x00280000@0x000e0000(preroot),0x00380000@0x00360000(uimage),0x076e0000@0x006e0000(rootfs),0x00240000@0x07dc0000(misc),128m@0x0(flash) root=/dev/ram0 rootfstype=cramfs init=/etc/rc.preroot initrd=0x800000,0x1000000
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 100992KB available (4748K code, 316K data, 136K init, 0K highmem)
Hierarchical RCU implementation.
NR_IRQS:128
Console: colour dummy device 80x30
Calibrating delay loop... 992.87 BogoMIPS (lpj=4964352)
Security Framework initialized
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
xor: measuring software checksum speed
   arm4regs  :   903.600 MB/sec
   8regs     :   685.200 MB/sec
   32regs    :   700.000 MB/sec
xor: using function: arm4regs (903.600 MB/sec)
NET: Registered protocol family 16
Feroceon L2: Enabling L2
Feroceon L2: Cache support initialised.

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 128MB 
SDRAM_CS1 ....disable
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base e0000000, size 128MB 
PEX0_IO ....base f2000000, size   1MB 
PEX1_MEM ....base e8000000, size 128MB 
PEX1_IO ....base f2100000, size   1MB 
INTER_REGS ....base f1000000, size   1MB 
NFLASH_CS ....base fa000000, size   2MB 
SPI_CS ....base f4000000, size  16MB 
BOOT_ROM_CS ....no such
DEV_BOOTCS ....no such
CRYPT_ENG ....base f0000000, size   2MB 

  Marvell Development Board (LSP Version KW_LSP_5.1.3_patch18)-- HNC-N2  Soc: MV88F6282 Rev 1 LE

 Detected Tclk 200000000 and SysClk 400000000 
MV Buttons Device Load
Marvell USB EHCI Host controller #0: c403e740
PEX0 interface detected Link X1
PEX1 interface detected no Link.
pci 0000:00:01.0: PME# supported from D0 D3hot
pci 0000:00:01.0: PME# disabled
PCI: bus0: Fast back to back transfers disabled
PCI: bus1: Fast back to back transfers enabled
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
raid6: int32x1     73 MB/s
raid6: int32x2     91 MB/s
raid6: int32x4     89 MB/s
raid6: int32x8     91 MB/s
raid6: using algorithm int32x2 (91 MB/s)
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (junk in compressed archive); looks like an initrd
Freeing initrd memory: 16384K
rtc mv_rtc: rtc core: registered kw-rtc as rtc0
RTC registered
XOR registered 4 channels
XOR 2nd invalidate WA enabled
cesadev_init(c000ed14)
mvCesaInit: sessions=640, queue=64, pSram=f0000000
MV Buttons Driver Load
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
SGI XFS with security attributes, large block/inode numbers, no debug enabled
SGI XFS Quota Management subsystem
msgmni has been set to 229
alg: No test for cipher_null (cipher_null-generic)
alg: No test for ecb(cipher_null) (ecb-cipher_null)
alg: No test for digest_null (digest_null-generic)
alg: No test for compress_null (compress_null-generic)
alg: No test for stdrng (krng)
alg: No test for hmac(digest_null) (hmac(digest_null-generic))
async_tx: api initialized (sync-only)
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler anticipatory registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
brd: module loaded
loop: module loaded
Integrated Sata device found
IRQ 21/mvSata: IRQF_DISABLED is not guaranteed on shared IRQs
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
scsi 0:0:0:0: Direct-Access     Hitachi  HDS721680PLA380  P21O PQ: 0 ANSI: 5
scsi 1:0:0:0: Direct-Access     Seagate  ST2000DM001-1ER1 CC62 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] Sector size 0 reported, assuming 512.
sd 0:0:0:0: [sda] 156301488 512-byte logical blocks: (80.0 GB/74.5 GiB)
sd 0:0:0:0: [sda] 0-byte physical blocks
sd 1:0:0:0: [sdb] Sector size 0 reported, assuming 512.
sd 1:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
sd 1:0:0:0: [sdb] 0-byte physical blocks
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: Attached scsi generic sg1 type 0
Loading Marvell Ethernet Driver:
  o Cached descriptors in DRAM
  o DRAM SW cache-coherency
  o 2 Giga ports supported
  o Single RX Queue support - ETH_DEF_RXQ=0
  o Single TX Queue support - ETH_DEF_TXQ=0
  o TCP segmentation offload (TSO) supported
  o Large Receive offload (LRO) supported
  o Receive checksum offload supported
  o Transmit checksum offload supported
  o Network Fast Processing (Routing) supported - (Disabled)
  o Proc tool API enabled
  o SKB Reuse supported - (Disabled)
  o SKB Recycle supported - (Disabled)
  o Rx descripors: q0=256
  o Tx descripors: q0=532
  o Loading network interface(s):
     o register under mv88fx_eth platform
sd 0:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 1:0:0:0: [sdb] Sector size 0 reported, assuming 512.
     o egiga0, ifindex = 2, GbE port = 0

Warning: Giga 1 is Powered Off

mvFpRuleDb (c5244000): 1024 entries, 4096 bytes
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 113 at 0x000000e20000
Bad eraseblock 422 at 0x0000034c0000
7 cmdlinepart partitions found on MTD device nand_mtd
Using command line partition definition
Creating 7 MTD partitions on "nand_mtd":
0x000000000000-0x0000000a0000 : "uboot"
 sdb:
0x0000000a0000-0x0000000e0000 : "param"
0x0000000e0000-0x000000360000 : "preroot"
0x000000360000-0x0000006e0000 : "uimage"
0x0000006e0000-0x000007dc0000 : "rootfs"
0x000007dc0000-0x000008000000 : "misc"
0x000000000000-0x000008000000 : "flash"
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci_marvell ehci_marvell.70059: Marvell Orion EHCI
ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 0:0:0:0: [sda] Sector size 0 reported, assuming 512.
 sdb1
sd 1:0:0:0: [sdb] Sector size 0 reported, assuming 512.
ehci_marvell ehci_marvell.70059: USB 2.0 started, EHCI 1.00
 sda:
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
sd 1:0:0:0: [sdb] Attached SCSI disk
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
xhci_hcd 0000:00:01.0: xHCI Host Controller
xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus number 2
xhci_hcd 0000:00:01.0: irq 9, io mem 0xe0000000
usb usb2: config 1 interface 0 altsetting 0 endpoint 0x81 has no SuperSpeed companion descriptor
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 4 ports detected
usbcore: registered new interface driver usblp
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
usbcore: registered new interface driver ums-usbat
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
 sda1 sda2 sda3
sd 0:0:0:0: [sda] Sector size 0 reported, assuming 512.
adt7473_detect....
sd 0:0:0:0: [sda] Attached SCSI disk
adt7473 0-002e: adt7473 chip found
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
md: raid10 personality registered for level 10
md: raid6 personality registered for level 6
md: raid5 personality registered for level 5
md: raid4 personality registered for level 4
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.15.0-ioctl (2009-04-01) initialised: dm-devel@redhat.com
dm_crypt using the OCF package.
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
!!!! wrong MPP 6 setting !!!!
++++ wrong initial value for GPP36, fixed it by wixgpio
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 5
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
rtc mv_rtc: setting system clock to 2018-11-04 12:27:41 UTC (1541334461)
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: Scanned 0 and added 0 devices.
md: autorun ...
md: ... autorun DONE.
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 1636KiB [1 disk] into ram disk... done.
VFS: Mounted root (cramfs filesystem) readonly on device 1:0.
Freeing init memory: 136K
usb 1-1: new high speed USB device using ehci_marvell and address 2
Enter Pre-Root FileSystem:
usb 1-1: configuration #1 chosen from 1 choice
input: ITE Technologies, Inc. USB Deivce as /class/input/input0
generic-usb 0003:048D:9006.0001: input: USB HID v1.01 Keyboard [ITE Technologies, Inc. USB Deivce] on usb-ehci_marvell.70059-1/input1
FW_UPDATE_FLAG_RES:1
FNSA_MODE : ## Error: "FNSA_PRO" not defined
BOARDTEST_FALG:0
1       1049kB  16GB    16GB    ext3                               
2       16GB    18GB    2147MB  linux-swap                         
3       18GB    80GB    62GB    ext3                               
1       1049kB  2000GB  2000GB  ext3                               
DSK1_RES:0
DSK2_RES:0
DSK3_RES:1
DSK4_RES:1
DSK1_S_RES:1
DSK2_S_RES:1
DSK3_S_RES:0
DSK4_S_RES:0
CHK_RES:1
MD0CHK_RES:1
P1 DEVCNT:1 RES:0
port 1:foreign
P1 DEVCNT:2 RES:0
port 2:foreign
init started:  BusyBox v1.1.1 (2008.10.08-08:58+0000) multi-call binary
Starting pid 761, console /dev/ttyS0: '/etc/init.d/rcS'
Starting network...
Starting inetd... OK
NOT_DEF_RES:0
EXT3-fs: unable to read superblock
FAT: unable to read boot sector
EXT3-fs: unable to read superblock
EXT2-fs: unable to read superblock
EXT4-fs (md0): unable to read superblock
FAT: unable to read boot sector
FAT: unable to read boot sector
egiga0: link up, full duplex, speed 100 Mbps
egiga0: started

Looks like it is functional.

---------------------------------


Regards,
garagoyun



Edited 2 time(s). Last edit at 11/04/2018 06:14AM by garagoyun.
Re: Debian on Freecom Silverstore 2 NAS
November 04, 2018 03:47PM
garagoyun,

That config.mk looks very good. It is correct for this box.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 06, 2018 01:34PM
bodhi,

I have amended a bit the patches in the source code and rebuild the u-boot. Tests are positive and the new u-boot does boot straight to Debian.

$ ./kwboot  -t -B 115200 /dev/ttyUSB0 -b u-boot-db88f6282bp_400ddr3db_uart-test1.bin
Sending boot message. Please reboot the target...\
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  7 % [......................................................................]
  9 % [......................................................................]
 11 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 24 % [......................................................................]
 26 % [......................................................................]
 28 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 33 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 43 % [......................................................................]
 45 % [......................................................................]
 47 % [......................................................................]
 49 % [......................................................................]
 50 % [......................................................................]
 52 % [......................................................................]
 54 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 60 % [......................................................................]
 62 % [......................................................................]
 64 % [......................................................................]
 66 % [......................................................................]
 67 % [......................................................................]
 69 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 75 % [......................................................................]
 77 % [......................................................................]
 79 % [......................................................................]
 81 % [......................................................................]
 83 % [......................................................................]
 84 % [......................................................................]
 86 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 96 % [......................................................................]
 98 % [......................................................................]
[Type Ctrl-\ + c to quit]

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__|  ** uboot_ver:v0.0.9 **

 ** MARVELL BOARD: HNC-N2 LE 

U-Boot 1.1.4 (Nov  6 2018 - 17:48:21) Marvell version: 3.5.9

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6282 A1CPU running @ 1000Mhz L2 running @ 333Mhz
SysClock = 400Mhz , TClock = 200Mhz 

DRAM (DDR3) CAS Latency = 6 tRP = 6 tRAS = 15 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Found ADT7473, program PWM1 ... OK
Flash:  0 kB

Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (5)
  Device 0 @ 0 0:
Model: Hitachi HDS721680PLA380                  Firm: P21OABDA Ser#:       PVE201ZESSYGNM
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 76319.0 MB = 74.5 GB (156301488 x 512)
[0 1 0]: Enable DMA mode (5)
  Device 1 @ 0 1:
Model: ST2000DM001-1ER164                       Firm: CC62     Ser#:             Z4Z5TX17
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)


CPU : Marvell Feroceon (Rev 1)
Scanning partition header:

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
PEX 1: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 

Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (5)
  Device 0 @ 0 0:
Model: Hitachi HDS721680PLA380                  Firm: P21OABDA Ser#:       PVE201ZESSYGNM
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 76319.0 MB = 74.5 GB (156301488 x 512)
[0 1 0]: Enable DMA mode (5)
  Device 1 @ 0 1:
Model: ST2000DM001-1ER164                       Firm: CC62     Ser#:             Z4Z5TX17
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)


3833165 bytes read

7708299 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2018-10-02  13:41:37 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3833101 Bytes =  3.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-4.12.1-kirkwood-tld-1
   Created:      2018-10-02  13:36:52 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7708235 Bytes =  7.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.12.1-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Freecom Silverstore HNCN2
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 108972K/131072K available (8192K kernel code, 716K rwdata, 1972K rodata, 1024K init, 288K bss, 22100K reserved, 0K cma-reserved)

Please note, I have no knowledge in coding or u-boot in general, so there might be some issues with the rebuilt u-boot. But it does boot Debian, even after I have reset the environments to defaults. I just need to adjust mtdparts env and maybe remove fail safe feaure.

Marvell>> pri
baudrate=115200
loads_echo=0
ipaddr=10.4.52.165
serverip=10.4.52.7
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/ram0 rootfstype=cramfs init=/etc/rc.preroot initrd=0x800000,0x1000000
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000;
lcd0_enable=0
lcd0_params=640x480-16@60
ethaddr=00:50:43:3c:06:0a
ethmtu=1500
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
uboot_ver=v0.0.9
mfgtest_state=final_tested_ok
mfgmodel=HNC-N2
preroot_ver=0.1.0
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
console=console=ttyS0,115200 mtdparts=nand_mtd:0x000a0000@0x0(uboot),0x00040000@0x000a0000(param),0x00280000@0x000e0000(preroot),0x00380000@0x00360000(uimage),0x076e0000@0x006e0000(rootfs),0x00240000@0x07dc0000(misc),128m@0x0(flash) 
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 ${mtdparts} earlyprintk=serial
bootcmd_usb=usb start; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1 0x2100000 /boot/uInitrd
bootcmd_sata=ide reset; ext2load ide 0:1 0x800000 /boot/uImage; ext2load ide 0:1 0x2100000 /boot/uInitrd
bootcmd_exec=run set_bootargs; run bootcmd_sata; bootm 0x800000 0x2100000
bootcmd_f=run bootcmd_exec; nand reset; nand read.e 0x800000 0x00100000 0x00199800; check_crc32 PrEr; 
bootcmd=run bootcmd_exec; nand reset; nand read.e 0x800000 0x00100000 0x00199800; check_crc32 PrEr; nand reset; nand read.e 0x40000 0x00380000 0x0027d400; check_crc32 KrNl; setenv bootargs $(console) $(bootargs_root);  bootm 0x40000; 
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
pcieTune1=no
ethact=egiga0

Environment size: 2066/131067 bytes

root@silverdebian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "uboot"
mtd1: 00080000 00020000 "uboot_env"
mtd2: 00080000 00020000 "key_store"
mtd3: 00080000 00020000 "info"
mtd4: 00a00000 00020000 "etc"
mtd5: 00a00000 00020000 "kernel_1"
mtd6: 02fc0000 00020000 "rootfs1"
mtd7: 00a00000 00020000 "kernel_2"
mtd8: 02fc0000 00020000 "rootfs2"

root@silverdebian:~# cat /etc/fw_env.config 
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd1 0x0 0x20000 0x20000

root@silverdebian:~# fw_printenv            
Warning: Bad CRC, using default environment
bootargs=
bootcmd=
bootdelay=2
baudrate=115200
arch=sandbox
cpu=sandbox
board=sandbox
board_name=sandbox
stdin=serial,cros-ec-keyb,usbkbd
stdout=serial,vidconsole
stderr=serial,vidconsole
ethaddr=00:00:11:22:33:44
eth1addr=00:00:11:22:33:45
eth3addr=00:00:11:22:33:46
eth5addr=00:00:11:22:33:47
ipaddr=1.2.3.4
host_boot=if host dev ${devnum}; then setenv devtype host; run scan_dev_for_boot_part; fi
boot_net_pci_enum=pci enum
boot_net_usb_start=usb start
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_script_dhcp=boot.scr.uimg
boot_targets=host1 host0 
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
bootcmd_host1=setenv devnum 1; run host_boot
bootcmd_host0=setenv devnum 0; run host_boot
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
bootm_size=0x10000000
kernel_addr_r=0x1000000
fdt_addr_r=0xc00000
ramdisk_addr_r=0x2000000
scriptaddr=0x1000
pxefile_addr_r=0x2000

Also, I would like an option in u-boot that would try to boot first from USB and if there is no bootable USB rootfs to boot from the hard drive. Any advise for env?

---------------------------------


Regards,
garagoyun



Edited 1 time(s). Last edit at 11/06/2018 01:52PM by garagoyun.
Re: Debian on Freecom Silverstore 2 NAS
November 06, 2018 02:32PM
garagoyun,

Cool :)

Quote

Please note, I have no knowledge in coding or u-boot in general, so there might be some issues with the rebuilt u-boot. But it does boot Debian, even after I have reset the environments to defaults. I just need to adjust mtdparts env and maybe remove fail safe feaure.

Did you build the code as is, or if you patched code, what change did you make?

And did you do saveenv after starting kwboot (I could not see where in the last post above)?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 06, 2018 03:37PM
bodhi Wrote:
-------------------------------------------------------
> garagoyun,
>
> Cool :)
>
>
Quote

Please note, I have no knowledge in coding
> or u-boot in general, so there might be some
> issues with the rebuilt u-boot. But it does boot
> Debian, even after I have reset the envvironments
> to defaults. I just need to adjust mtdparts env
> and maybe remove fail safe feaure.
>
> Did you build the code as is, or if you patched
> code, what change did you make?
>
> And did you do saveenv after starting kwboot (I
> could not see where in the last post above)?


I have amended one of the original patches in the source code, mv_main.patch in the package/u-boot/xxx_patches dir. I had to analyse the structure of the existing code and then used the command envs that you have kindly provided me as the basis. And then just built it with 'make u-boot'. You can check the new added as well as modified envs in the test u-boot.bin in my previous message. The values are not set with saveenv. 'bootcmd' and 'bootcmd_f cannot be modified, however I have added 'run bootcmd_exec' to 'bootcmd_f', which gives some extra flexibility. It should be possible (I haven't tested!) to modify 'bootcmd_exec', bootcmd_usb, bootcmd_sata and set_bootargs if needed via serial and save the modifications with saveenv. Upon resetenv their values will be set back to initial ones, as you can see them in my previous message.

Additionally, I have a question regarding CPU speed. If you remember, the CPU in SilverStore runs at 1000Mhz when it should be 1600Mhz. Do you reckon it is a limitation of the board it self or is it controller by the u-boot? DDR3 on NSA325 runs at 533Mhz and on SilverStore at 400Mhz. Could DDR3 be the reason for the cpu speed on this board?

---------------------------------


Regards,
garagoyun



Edited 1 time(s). Last edit at 11/06/2018 04:05PM by garagoyun.
Re: Debian on Freecom Silverstore 2 NAS
November 06, 2018 07:07PM
garagoyun,

> I have a question regarding CPU
> speed. If you remember, the CPU in SilverStore
> runs at 1000Mhz when it should be 1600Mhz. Do you
> reckon it is a limitation of the board it self or
> is it controller by the u-boot? DDR3 on NSA325
> runs at 533Mhz and on SilverStore at 400Mhz. Could
> DDR3 be the reason for the cpu speed on this
> board?

As I mentioned, it is either:

1) They used an old u-boot that they aleady have built for 1Ghz, and did not build new u-boot so the CPU was limited to 1Ghz. And they hope normal users would not notice that.
or
2) They knew the specific CPUs lot that they purchase to use in this box cannot run at 1.6 Ghz, so they underclock it to 1Ghz.

We have no way to know for sure which was the case. The only way to find out is to change u-boot to put the clock back to 1.6Ghz, and test it.


> I have amended one of the original patches in the
> source code, mv_main.patch in the
> package/u-boot/xxx_patches dir.

What we usually do at this point is to create a patch file. That should just simply be

diff -Naur old_file new_file > patchfilename.patch

And then depending on the naming convention of the existing patch files, we would name it accordingly. So, in this case, we should increment the sequence number so that the patch can be applied at the right place, patchfilename.patch in the diff above should be something like below. Also, the patch level should be the same as other patches so it can be applied when we build (this is a little bit non-trivial, so you might have question if you've never created patches before).

u-boot-3.5.9-20-mv_main_bootcmd_env.patch

So after you created the patch file, build new u-boot binary, run a test with kwboot, you would post the patch file and u-boot binary here along with the setenvs commands to boot Debian. And we will declare victory :)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 07, 2018 01:01AM
bodhi Wrote:
-------------------------------------------------------

> As I mentioned, it is either:
>
> 1) They used an old u-boot that they aleady have
> built for 1Ghz, and did not build new u-boot so
> the CPU was limited to 1Ghz. And they hope normal
> users would not notice that.
> or
> 2) They knew the specific CPUs lot that they
> purchase to use in this box cannot run at 1.6 Ghz,
> so they underclock it to 1Ghz.
>
> We have no way to know for sure which was the
> case. The only way to find out is to change u-boot
> to put the clock back to 1.6Ghz, and test it.
>

I have formulated my question not correctly. It should have been: How can I find/test if it is case 1) or 2) ?


> What we usually do at this point is to create a
> patch file. That should just simply be
>
>
> diff -Naur old_file new_file >
> patchfilename.patch
>
>
> And then depending on the naming convention of the
> existing patch files, we would name it
> accordingly. So, in this case, we should increment
> the sequence number so that the patch can be
> applied at the right place, patchfilename.patch in
> the diff above should be something like below.
> Also, the patch level should be the same as other
> patches so it can be applied when we build (this
> is a little bit non-trivial, so you might have
> question if you've never created patches before).
>
>
> u-boot-3.5.9-20-mv_main_bootcmd_env.patch
>

That would create a patch for the existing patch? No experience of creating patches. What I have done until now I have learned along the way following your tips and advice.

I can also just upload the u-boot-3.5.9-07-mv_main.patch that I have modified.

> So after you created the patch file, build new
> u-boot binary, run a test with kwboot, you would
> post the patch file and u-boot binary here along
> with the setenvs commands to boot Debian. And we
> will declare victory :)

The u-boot binary I have built boots straight to Debian. All necessary setenvs are already in place in the patch I have amended.

in original vendor's patch:
+	//setting bootcmd
+	nand_layout_ptr = nand_layout_info;
+	//point to preroot
+	sprintf(buff, "nand reset; nand read.e 0x800000 0x%8.8x 0x%8.8x; ",
+		nand_layout_ptr->actually_offset + nand->erasesize,
+		(nand_layout_ptr->len + nand->oobblock)& 0xfffffe00);
+	strcat(buff, "check_crc32 PrEr; ");
+	setenv("bootcmd_f", buff);	// for fail-safe
+	nand_layout_ptr++;		//point to kernel info
+	sprintf(tmp_s, "nand reset; nand read.e 0x40000 0x%8.8x 0x%8.8x; ",
+		nand_layout_ptr->actually_offset + nand->erasesize,
+		((nand_layout_ptr->len + nand->oobblock)& 0xfffffe00));
+	strcat(tmp_s, "check_crc32 KrNl; ");
+	strcat(buff, tmp_s);
+	strcat(buff, "setenv bootargs $(console) $(bootargs_root);  bootm 0x40000; ");
+	setenv("bootcmd", buff);

new patch looks like that:
+	//setting bootcmd
+	setenv("set_bootargs", "setenv bootargs $(console) root=LABEL=rootfs rootdelay=10 earlyprintk=serial");
+	setenv("bootcmd_usb", "usb start; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1 0x2100000 /boot/uInitrd");
+	setenv("bootcmd_sata", "ide reset; ext2load ide 0:1 0x800000 /boot/uImage; ext2load ide 0:1 0x2100000 /boot/uInitrd");
+	setenv("bootcmd_exec", "run set_bootargs; run bootcmd_sata; bootm 0x800000 0x2100000");
+	nand_layout_ptr = nand_layout_info;
+	//point to preroot
+	sprintf(buff, "run bootcmd_exec; nand reset; nand read.e 0x800000 0x%8.8x 0x%8.8x; ",
+		nand_layout_ptr->actually_offset + nand->erasesize,
+		(nand_layout_ptr->len + nand->oobblock)& 0xfffffe00);
+	strcat(buff, "check_crc32 PrEr; ");
+	setenv("bootcmd_f", buff);	// for fail-safe
+	nand_layout_ptr++;		//point to kernel info
+	sprintf(tmp_s, "nand reset; nand read.e 0x40000 0x%8.8x 0x%8.8x; ",
+		nand_layout_ptr->actually_offset + nand->erasesize,
+		((nand_layout_ptr->len + nand->oobblock)& 0xfffffe00));
+	strcat(tmp_s, "check_crc32 KrNl; ");
+	strcat(buff, tmp_s);
+	strcat(buff, "setenv bootargs $(console) $(bootargs_root);  bootm 0x40000; ");
+	setenv("bootcmd", buff);
+}
+#else

It is probably ok to remove/replace completely all the original code in that section, however, I am not sure what is the importance of some of the commands related to nand and check_crc32, hence I left those in place. Theoretically, it should be still possible to install/boot original vendor software if remove set_bootargs, bootcmd_usb and bootcmd_exec. Although it might be just easier to replace with stock u-boot.

---------------------------------


Regards,
garagoyun
Re: Debian on Freecom Silverstore 2 NAS
November 07, 2018 02:25AM
garagoyun,

> I have formulated my question not correctly. It
> should have been: How can I find/test if it is
> case 1) or 2) ?

The CPU frequency is a constant in u-boot. So to overlock/restore the clock, we would change that and rebuild. This is a very old u-boot, so I don't remember exactly where that constant is.

While your change to the patch is good, I would do it a slightly different way. When it comes to patching code, the best is to do the minimum as we can. In this case, the only line you'll need to change is:

+	sprintf(buff, "run bootcmd_exec; nand reset; nand read.e 0x800000 0x%8.8x 0x%8.8x; ",
+		nand_layout_ptr->actually_offset + nand->erasesize,
+		(nand_layout_ptr->len + nand->oobblock)& 0xfffffe00);

The idea is to insert the "run bootcmd_exec;" in front of the stock u-boot bootcmd. And then you are free to set that env to anything you'd like. When you remove that bootcmd_exec env from u-boot envs set (i.e. clearing it), stock u-boot would be restored back to current stock behavior. Since we know that any other envs can be saved, that would be the most non-invasive change to the behavior of stock u-boot.

To avoid having to do to much, you can consider the new modified patch u-boot-3.5.9-07-mv_main.patch as replacement for the current patch (no need to go to the trouble of creating the 20th patch in the series to add on top of it. That said, in a formal release as by convention, people woud create the 20th patch to add that 1-line change.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 07, 2018 05:21AM
bodhi Wrote:
-------------------------------------------------------
> the only line you'll need to
> change is:
>
>
> +	sprintf(buff, "run bootcmd_exec; nand reset;
> nand read.e 0x800000 0x%8.8x 0x%8.8x; ",
> +		nand_layout_ptr->actually_offset +
> nand->erasesize,
> +		(nand_layout_ptr->len + nand->oobblock)&
> 0xfffffe00);
>
>
> The idea is to insert the "run bootcmd_exec;" in
> front of the stock u-boot bootcmd. And then you
> are free to set that env to anything you'd like.

If you recheck the same line you have quoted: that's exactly what I have done :-) I just added the 'run bootcmd_exec' in front, having the same idea as you. That was test0.

I then added the extra setenv for test1, just to test if that approach would work as well and for the extra convenience (then it would be possible to flash the u-boot on another device without a serial connection and install debian).


> To avoid having to do to much, you can consider
> the new modified patch
> u-boot-3.5.9-07-mv_main.patch as replacement for
> the current patch (no need to go to the trouble of
> creating the 20th patch in the series to add on
> top of it. That said, in a formal release as by
> convention, people woud create the 20th patch to
> add that 1-line change.

I will upload the additional 20th patch and u-boot tonight after testing they are working.

---------------------------------


Regards,
garagoyun



Edited 1 time(s). Last edit at 11/07/2018 11:12AM by garagoyun.
Re: Debian on Freecom Silverstore 2 NAS
November 07, 2018 01:02PM
garagoyun,

> then it would be possible
> to flash the u-boot on another device without a
> serial connection and install debian

If it is possible to set envs in stock OS, then it is not that big a deal to enter the bootcmd_exec and its assciated envs at the Linux shell.

However, that was a very good plan to save users some extra steps as KISS principal dictates :)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 07, 2018 03:49PM
bodhi,

As promised I have attached the patch and the new u-boot.bin resulted from this patch.

I have tested the u-boot with kwboot only, however, I believe it should be fine flashing it as well.

Below the boot log:
$ ./kwboot  -t -B 115200 /dev/ttyUSB0 -b u-boot-3.5.9_HNCN2_bootcmd_exec.bin -p
Sending boot message. Please reboot the target.../
Sending boot image...
  0 % [......................................................................]
  1 % [......................................................................]
  3 % [......................................................................]
  5 % [......................................................................]
  7 % [......................................................................]
  9 % [......................................................................]
 11 % [......................................................................]
 13 % [......................................................................]
 15 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 20 % [......................................................................]
 22 % [......................................................................]
 24 % [......................................................................]
 26 % [......................................................................]
 28 % [......................................................................]
 30 % [......................................................................]
 32 % [......................................................................]
 33 % [......................................................................]
 35 % [......................................................................]
 37 % [......................................................................]
 39 % [......................................................................]
 41 % [......................................................................]
 43 % [......................................................................]
 45 % [......................................................................]
 47 % [......................................................................]
 49 % [......................................................................]
 50 % [......................................................................]
 52 % [......................................................................]
 54 % [......................................................................]
 56 % [......................................................................]
 58 % [......................................................................]
 60 % [......................................................................]
 62 % [......................................................................]
 64 % [......................................................................]
 66 % [......................................................................]
 67 % [......................................................................]
 69 % [......................................................................]
 71 % [......................................................................]
 73 % [......................................................................]
 75 % [......................................................................]
 77 % [......................................................................]
 79 % [......................................................................]
 81 % [......................................................................]
 83 % [......................................................................]
 84 % [......................................................................]
 86 % [......................................................................]
 88 % [......................................................................]
 90 % [......................................................................]
 92 % [......................................................................]
 94 % [......................................................................]
 96 % [......................................................................]
 98 % [......................................................................]
[Type Ctrl-\ + c to quit]

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__|  ** uboot_ver:v0.0.9 **

 ** MARVELL BOARD: HNC-N2 LE 

U-Boot 1.1.4 (Nov  7 2018 - 16:39:05) Marvell version: 3.5.9

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFB00

Soc: 88F6282 A1CPU running @ 1000Mhz L2 running @ 333Mhz
SysClock = 400Mhz , TClock = 200Mhz 

DRAM (DDR3) CAS Latency = 6 tRP = 6 tRAS = 15 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
Found ADT7473, program PWM1 ... OK
Flash:  0 kB

Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (5)
  Device 0 @ 0 0:
Model: Hitachi HDS721680PLA380                  Firm: P21OABDA Ser#:       PVE201ZESSYGNM
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 76319.0 MB = 74.5 GB (156301488 x 512)
[0 1 0]: Enable DMA mode (5)
  Device 1 @ 0 1:
Model: ST2000DM001-1ER164                       Firm: CC62     Ser#:             Z4Z5TX17
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)


CPU : Marvell Feroceon (Rev 1)
Scanning partition header:

Streaming disabled 
Write allocate disabled


USB 0: host mode
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
PEX 1: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0 
Marvell>> pri
baudrate=115200
loads_echo=0
ipaddr=10.4.52.165
serverip=10.4.52.7
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/ram0 rootfstype=cramfs init=/etc/rc.preroot initrd=0x800000,0x1000000
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000;
lcd0_enable=0
lcd0_params=640x480-16@60
ethaddr=00:50:43:3c:06:0a
ethmtu=1500
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
uboot_ver=v0.0.9
mfgtest_state=final_tested_ok
mfgmodel=HNC-N2
preroot_ver=0.1.0
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
console=console=ttyS0,115200 mtdparts=nand_mtd:0x000a0000@0x0(uboot),0x00040000@0x000a0000(param),0x00280000@0x000e0000(preroot),0x00380000@0x00360000(uimage),0x076e0000@0x006e0000(rootfs),0x00240000@0x07dc0000(misc),128m@0x0(flash) 
bootcmd_f=run bootcmd_exec; nand reset; nand read.e 0x800000 0x00100000 0x00199800; check_crc32 PrEr; 
bootcmd=run bootcmd_exec; nand reset; nand read.e 0x800000 0x00100000 0x00199800; check_crc32 PrEr; nand reset; nand read.e 0x40000 0x00380000 0x0027d400; check_crc32 KrNl; setenv bootargs $(console) $(bootargs_root);  bootm 0x40000; 
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
pcieTune1=no
ethact=egiga0

Environment size: 1671/131067 bytes

There is change only in one line, so to be able to boot to Debian one would need to set the env below and then save them:
setenv mtdparts 'mtdparts=orion_nand:0x000a0000@0x0(uboot),0x00040000@0x000a0000(param),0x00280000@0x000e0000(preroot),0x00380000@0x00360000(uimage),0x076e0000@0x006e0000(rootfs),0x00240000@0x07dc0000(misc),128m@0x0(flash)'
setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 ${mtdparts} earlyprintk=serial'
setenv bootcmd_sata 'ide reset; ext2load ide 0:1 0x800000 /boot/uImage; ext2load ide 0:1 0x2100000 /boot/uInitrd'
setenv bootcmd_exec 'run set_bootargs; run bootcmd_sata; bootm 0x800000 0x2100000'
saveenv

That should boot to debian installed on a hard drive:
Marvell>> boot

Reset IDE: 
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (5)
  Device 0 @ 0 0:
Model: Hitachi HDS721680PLA380                  Firm: P21OABDA Ser#:       PVE201ZESSYGNM
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 76319.0 MB = 74.5 GB (156301488 x 512)
[0 1 0]: Enable DMA mode (5)
  Device 1 @ 0 1:
Model: ST2000DM001-1ER164                       Firm: CC62     Ser#:             Z4Z5TX17
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (3907029168 x 512)


3833165 bytes read

7708299 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-4.12.1-kirkwood-tld-1
   Created:      2018-10-02  13:41:37 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3833101 Bytes =  3.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-4.12.1-kirkwood-tld-1
   Created:      2018-10-02  13:36:52 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7708235 Bytes =  7.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.12.1-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Sat Jul 15 21:40:50 PDT 2017
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Freecom Silverstore HNCN2
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:0x000a0000@0x0(uboot),0x00040000@0x000a0000(param),0x00280000@0x000e0000(preroot),0x00380000@0x00360000(uimage),0x076e0000@0x006e0000(rootfs),0x00240000@0x07dc0000(misc),128m@0x0(flash) earlyprintk=serial
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 108972K/131072K available (8192K kernel code, 716K rwdata, 1972K rodata, 1024K init, 288K bss, 22100K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)
[    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
[    0.000000]       .data : 0xc0d00000 - 0xc0db3274   ( 717 kB)
[    0.000000]        .bss : 0xc0db9b9c - 0xc0e01e60   ( 289 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000008] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.007907] Switching to timer-based delay loop, resolution 5ns
[    0.014395] Console: colour dummy device 80x30
[    0.018975] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=2000000)
[    0.029582] pid_max: default: 32768 minimum: 301
[    0.034469] Security Framework initialized
[    0.038800] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.045482] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.053538] CPU: Testing write buffer coherency: ok
[    0.059543] Setting up static identity map for 0x100000 - 0x100058
[    0.066060] mvebu-soc-id: MVEBU SoC ID=0x6282, Rev=0x1
[    0.074815] devtmpfs: initialized
[    0.082999] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.092961] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.099585] prandom: seed boundary self test passed
[    0.109060] prandom: 100 self tests passed
[    0.113225] pinctrl core: initialized pinctrl subsystem
[    0.119744] NET: Registered protocol family 16
[    0.124730] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.133391] cpuidle: using governor ladder
[    0.137621] cpuidle: using governor menu
[    0.142143] Feroceon L2: Enabling L2
[    0.145826] Feroceon L2: Cache support initialised.
[    0.151185] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.167792] No ATAGs?
[    0.178726] vgaarb: loaded
[    0.184208] SCSI subsystem initialized
[    0.188628] usbcore: registered new interface driver usbfs
[    0.194257] usbcore: registered new interface driver hub
[    0.199774] usbcore: registered new device driver usb
[    0.206191] clocksource: Switched to clocksource orion_clocksource
[    0.318231] VFS: Disk quotas dquot_6.6.0
[    0.322305] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.341820] NET: Registered protocol family 2
[    0.347136] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.354174] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.360639] TCP: Hash tables configured (established 1024 bind 1024)
[    0.367159] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.373074] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.379619] NET: Registered protocol family 1
[    0.384508] RPC: Registered named UNIX socket transport module.
[    0.390572] RPC: Registered udp transport module.
[    0.395343] RPC: Registered tcp transport module.
[    0.400152] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.406937] Unpacking initramfs...
[    1.226760] Freeing initrd memory: 7528K
[    1.230931] NetWinder Floating Point Emulator V0.97 (double precision)
[    1.238674] audit: initializing netlink subsys (disabled)
[    1.244693] Initialise system trusted keyrings
[    1.249292] audit: type=2000 audit(1.228:1): state=initialized audit_enabled=0 res=1
[    1.257167] Key type blacklist registered
[    1.261406] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    1.268052] zbud: loaded
[    1.271777] NFS: Registering the id_resolver key type
[    1.276999] Key type id_resolver registered
[    1.281246] Key type id_legacy registered
[    1.285338] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.292151] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    1.298813] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
[    1.306126] fuse init (API version 7.26)
[    1.310563] orangefs_debugfs_init: called with debug mask: :none: :0:
[    1.317415] orangefs_init: module version upstream loaded
[    1.322875] SGI XFS with ACLs, security attributes, realtime, no debug enabled
[    2.566200] random: fast init done
[    8.346943] Key type asymmetric registered
[    8.351110] Asymmetric key parser 'x509' registered
[    8.356110] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    8.363777] io scheduler noop registered
[    8.367834] io scheduler deadline registered
[    8.372245] io scheduler cfq registered (default)
[    8.378534] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    8.388143] mvebu-pcie mbus@f1000000:pcie@82000000: PCI host bridge to bus 0000:00
[    8.395778] pci_bus 0000:00: root bus resource [io  0x1000-0xfffff]
[    8.402189] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xefffffff]
[    8.409177] pci_bus 0000:00: root bus resource [bus 00-ff]
[    8.415100] PCI: bus0: Fast back to back transfers disabled
[    8.420784] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    8.456274] PCI: bus1: Fast back to back transfers disabled
[    8.462120] pci 0000:00:01.0: BAR 14: assigned [mem 0xe0000000-0xe00fffff]
[    8.469100] pci 0000:01:00.0: BAR 0: assigned [mem 0xe0000000-0xe0001fff 64bit]
[    8.476499] pci 0000:00:01.0: PCI bridge to [bus 01]
[    8.481539] pci 0000:00:01.0:   bridge window [mem 0xe0000000-0xe00fffff]
[    8.488495] pcieport 0000:00:01.0: enabling device (0140 -> 0142)
[    8.495327] mv_xor f1060800.xor: Marvell shared XOR driver
[    8.557099] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.564968] mv_xor f1060900.xor: Marvell shared XOR driver
[    8.627096] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy sg intr )
[    8.635199] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    8.643211] console [ttyS0] disabled
[    8.646994] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A
[    8.656040] console [ttyS0] enabled
[    8.656040] console [ttyS0] enabled
[    8.663190] bootconsole [earlycon0] disabled
[    8.663190] bootconsole [earlycon0] disabled
[    8.681800] loop: module loaded
[    8.685617] sata_mv f1080000.sata: slots 32 ports 2
[    8.693831] scsi host0: sata_mv
[    8.697545] scsi host1: sata_mv
[    8.700990] ata1: SATA max UDMA/133 irq 33
[    8.705112] ata2: SATA max UDMA/133 irq 33
[    8.710117] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[    8.716620] nand: Samsung NAND 128MiB 3,3V 8-bit
[    8.721261] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    8.728899] Scanning device for bad blocks
[    8.742176] Bad eraseblock 113 at 0x000000e20000
[    8.771729] Bad eraseblock 422 at 0x0000034c0000
[    8.824856] 7 cmdlinepart partitions found on MTD device orion_nand
[    8.831180] Creating 7 MTD partitions on "orion_nand":
[    8.836380] 0x000000000000-0x0000000a0000 : "uboot"
[    8.842791] 0x0000000a0000-0x0000000e0000 : "param"
[    8.849266] 0x0000000e0000-0x000000360000 : "preroot"
[    8.855855] 0x000000360000-0x0000006e0000 : "uimage"
[    8.862443] 0x0000006e0000-0x000007dc0000 : "rootfs"
[    8.869680] 0x000007dc0000-0x000008000000 : "misc"
[    8.875828] 0x000000000000-0x000008000000 : "flash"
[    8.884508] libphy: Fixed MDIO Bus: probed
[    8.889649] libphy: orion_mdio_bus: probed
[    8.899404] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    9.007431] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:50:43:3c:06:0a
[    9.016390] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    9.023008] ehci-pci: EHCI PCI platform driver
[    9.027585] ehci-orion: EHCI orion driver
[    9.031879] orion-ehci f1050000.ehci: EHCI Host Controller
[    9.037486] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    9.045406] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    9.076235] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    9.082534] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    9.089393] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    9.096672] usb usb1: Product: EHCI Host Controller
[    9.101575] usb usb1: Manufacturer: Linux 4.12.1-kirkwood-tld-1 ehci_hcd
[    9.108330] usb usb1: SerialNumber: f1050000.ehci
[    9.113918] hub 1-0:1.0: USB hub found
[    9.117799] hub 1-0:1.0: 1 port detected
[    9.122499] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    9.127848] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    9.135661] xhci_hcd 0000:01:00.0: hcc params 0x014042cb hci version 0x96 quirks 0x00000004
[    9.144384] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    9.151243] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    9.158523] usb usb2: Product: xHCI Host Controller
[    9.163426] usb usb2: Manufacturer: Linux 4.12.1-kirkwood-tld-1 xhci-hcd
[    9.170181] usb usb2: SerialNumber: 0000:01:00.0
[    9.175657] hub 2-0:1.0: USB hub found
[    9.179530] hub 2-0:1.0: 2 ports detected
[    9.184200] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    9.189532] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 3
[    9.197120] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[    9.205415] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003
[    9.212273] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    9.219582] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    9.226165] ata1.00: ATA-7: Hitachi HDS721680PLA380, P21OABDA, max UDMA/100
[    9.226175] ata1.00: 156301488 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    9.233805] ata1.00: configured for UDMA/100
[    9.234392] scsi 0:0:0:0: Direct-Access     ATA      Hitachi HDS72168 ABDA PQ: 0 ANSI: 5
[    9.235646] sd 0:0:0:0: [sda] 156301488 512-byte logical blocks: (80.0 GB/74.5 GiB)
[    9.235736] sd 0:0:0:0: [sda] Write Protect is off
[    9.235900] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    9.279935] usb usb3: Product: xHCI Host Controller
[    9.284844] usb usb3: Manufacturer: Linux 4.12.1-kirkwood-tld-1 xhci-hcd
[    9.291799] usb usb3: SerialNumber: 0000:01:00.0
[    9.297233] hub 3-0:1.0: USB hub found
[    9.301208] hub 3-0:1.0: 2 ports detected
[    9.306299]  sda: sda1 sda2 sda3
[    9.310459] usbcore: registered new interface driver usb-storage
[    9.318534] sd 0:0:0:0: [sda] Attached SCSI disk
[    9.323603] mousedev: PS/2 mouse device common for all mice
[    9.329980] rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0
[    9.337271] i2c /dev entries driver
[    9.343281] hidraw: raw HID events driver (C) Jiri Kosina
[    9.349240] drop_monitor: Initializing network drop monitor service
[    9.355807] NET: Registered protocol family 17
[    9.360400] Key type dns_resolver registered
[    9.365642] registered taskstats version 1
[    9.369803] Loading compiled-in X.509 certificates
[    9.374679] zswap: loaded using pool lzo/zbud
[    9.390411] Key type big_key registered
[    9.405030] Key type encrypted registered
[    9.410946] rtc-mv f1010300.rtc: setting system clock to 2018-11-07 21:37:30 UTC (1541626650)
[    9.476229] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    9.670663] usb 1-1: New USB device found, idVendor=048d, idProduct=9006
[    9.677437] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    9.684642] usb 1-1: Product: USB Deivce
[    9.688613] usb 1-1: Manufacturer: ITE Technologies, Inc.
[    9.736246] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    9.747115] ata2.00: ATA-9: ST2000DM001-1ER164, CC62, max UDMA/100
[    9.753327] ata2.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    9.769186] ata2.00: configured for UDMA/100
[    9.784101] scsi 1:0:0:0: Direct-Access     ATA      ST2000DM001-1ER1 CC62 PQ: 0 ANSI: 5
[    9.793661] sd 1:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    9.801863] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    9.807238] sd 1:0:0:0: [sdb] Write Protect is off
[    9.812197] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    9.869971]  sdb: sdb1
[    9.873995] sd 1:0:0:0: [sdb] Attached SCSI disk
[    9.882303] Freeing unused kernel memory: 1024K
Loading, please wait...
starting version 232
[   10.464990] input: ITE Technologies, Inc. USB Deivce as /devices/platform/ocp@f1000000/f1050000.ehci/usb1/1-1/1-1:1.1/0003:048D:9006.0001/input/input0
[   10.587214] hid-generic 0003:048D:9006.0001: input,hidraw0: USB HID v1.01 Keyboard [ITE Technologies, Inc. USB Deivce] on usb-f1050000.ehci-1/input1
[   10.653397] usbcore: registered new interface driver usbhid
[   10.692739] usbhid: USB HID core driver
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Will now check root file system ... fsck from util-linux 2.29.2
[/sbin/fsck.ext3 (1) -- /dev/sda1] fsck.ext3 -a -C0 /dev/sda1 
rootfs: clean, 79118/983040 files, 1651209/3932160 blocks
done.
[   21.404400] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[   21.431321] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
[   22.820959] NET: Registered protocol family 10
[   22.826661] Segment Routing with IPv6
[   22.847163] ip_tables: (C) 2000-2006 Netfilter Core Team
[   22.920432] 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)
[   22.939237] systemd[1]: Detected architecture arm.

Welcome to Debian GNU/Linux 9 (stretch)!

---------------------------------


Regards,
garagoyun
Attachments:
open | download - u-boot-3.5.9-20-mv_main_bootcmd_env.patch (672 bytes)
open | download - u-boot-3.5.9_HNCN2.bin (463.7 KB)
Re: Debian on Freecom Silverstore 2 NAS
November 07, 2018 08:31PM
garagoyun,

Thanks! It looks very good.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 08, 2018 03:26PM
bodhi Wrote:
-------------------------------------------------------
> garagoyun,
>
> Thanks! It looks very good.

Would not have been possible without your support.

---------------------------------


Regards,
garagoyun
Re: Debian on Freecom Silverstore 2 NAS
November 08, 2018 05:24PM
garagoyun,

A nit pick. Older u-boot used old naming convention.

Usually in modern Marvell u-boots we use the extension .kwb to indicate that the image is NAND/SPI flash-ready (there is a header in front): u-boot-3.5.9_HNCN2.kwb. We use .bin to indicate that the image has no header: u-boot-3.5.9_HNCN2.bin. BTW, that's the -p option is for: tell kwboot the header needs to be patched for UART booting.

Now you can flash it to mtd0.

- Dumping NAND mtd0 to backup
- Erase the 1st 512k of mtd0
- Flash new u-boot to NAND mtd0

Let me come back later and finish this post with actual commands to flash.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 09, 2018 02:51AM
bodhi Wrote:
-------------------------------------------------------
> garagoyun,
>
> A nit pick. Older u-boot used old naming
> convention.
>
> Usually in modern Marvell u-boots we use the
> extension .kwb to indicate that the image is
> NAND/SPI flash-ready (there is a header in front):
> u-boot-3.5.9_HNCN2.kwb. We use .bin to indicate
> that the image has no header:
> u-boot-3.5.9_HNCN2.bin. BTW, that's the -p option
> is for: tell kwboot the header needs to be patched
> for UART booting.
>
> Now you can flash it to mtd0.
>
> - Dumping NAND mtd0 to backup
> - Erase the 1st 512k of mtd0
> - Flash new u-boot to NAND mtd0
>
> Let me come back later and finish this post with
> actual commands to flash.

bodhi,

I have already flashed u-boot-3.5.9_HNCN2.bin on the test device with Debian and on another device with stock OS. The stock OS has flash_erase and nandwrite so I was able to flash via ssh. I had to use -p as you mentioned, otherwise it was giving an error regarding some padding, haven't saved the log so can't remember what exactly. With -p option it flashed smoothly:

/tmp # nandwrite -p  /dev/mtd0  /tmp/u-boot-3.5.9_HNCN2.bin
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
Writing data to block 60000

The device with Debian as well as with Stock OS boot normally, no need for serial. However, I have noticed fw_printenv have different outputs.

On stock:
~ # fw_printenv
baudrate=115200
loads_echo=0
ipaddr=10.4.52.165
serverip=10.4.52.7
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/ram0 rootfstype=cramfs init=/etc/rc.preroot initrd=0x800000,0x1000000
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000;
lcd0_enable=0
lcd0_params=640x480-16@60
ethmtu=1500
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
mfgmodel=HNC-N2
uboot_ver=v0.0.9
preroot_ver=0.1.0
serial_number=5563U01001G247000BEJ0D1
opid=201002F55
ethaddr=00:01:DB:1E:24:C2
serialNo=560722483400673
modelname=56072
runintime=10000
ftpserver=10.41.34.121
testfile=100M
mfgtest_state=final_tested_ok
mkraid5=preok
ftpserver_ip=10.41.87.42
ftpserver_user=admin
ftpserver_passwd=admin
ftpserver_path=/log/mfg_autotest.tgz
ntpserver_ip=pool.ntp.org
ethact=egiga0
fw_ver=2001.4110
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
console=console=ttyS0,115200 mtdparts=nand_mtd:0x000a0000@0x0(uboot),0x00040000@0x000a0000(param),0x00280000@0x000e0000(preroot),0x00380000@0x00360000(uimage),0x076e0000@0x006e0000(rootfs),0x00240000@0x07dc0000(misc),128m@0x0(flash) 
bootcmd_f=nand reset; nand read.e 0x800000 0x00100000 0x00199800; check_crc32 PrEr; 
bootcmd=nand reset; nand read.e 0x800000 0x00100000 0x00199800; check_crc32 PrEr; nand reset; nand read.e 0x40000 0x00380000 0x0027d400; check_crc32 KrNl; setenv bootargs $(console) $(bootargs_root);  bootm 0x40000; 
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
pcieTune1=no

On Debian:
~# fw_printenv
Warning: Bad CRC, using default environment
bootargs=
bootcmd=
bootdelay=2
baudrate=115200
arch=sandbox
cpu=sandbox
board=sandbox
board_name=sandbox
stdin=serial,cros-ec-keyb,usbkbd
stdout=serial,vidconsole
stderr=serial,vidconsole
ethaddr=00:00:11:22:33:44
eth1addr=00:00:11:22:33:45
eth3addr=00:00:11:22:33:46
eth5addr=00:00:11:22:33:47
ipaddr=1.2.3.4
host_boot=if host dev ${devnum}; then setenv devtype host; run scan_dev_for_boot_part; fi
boot_net_pci_enum=pci enum
boot_net_usb_start=usb start
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
boot_prefixes=/ /boot/
boot_scripts=boot.scr.uimg boot.scr
boot_script_dhcp=boot.scr.uimg
boot_targets=host1 host0 
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
bootcmd_host1=setenv devnum 1; run host_boot
bootcmd_host0=setenv devnum 0; run host_boot
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
bootm_size=0x10000000
kernel_addr_r=0x1000000
fdt_addr_r=0xc00000
ramdisk_addr_r=0x2000000
scriptaddr=0x1000
pxefile_addr_r=0x2000

Shouldn't the outputs be the same as the envs are stored in mtd1 ?

---------------------------------


Regards,
garagoyun
Re: Debian on Freecom Silverstore 2 NAS
November 09, 2018 03:27AM
garagoyun,

> I have already flashed u-boot-3.5.9_HNCN2.bin on
> the test device with Debian and on another device
> with stock OS. The stock OS has flash_erase and
> nandwrite so I was able to flash via ssh. I had
> to use -p as you mentioned, otherwise it was
> giving an error regarding some padding, haven't
> saved the log so can't remember what exactly. With
> -p option it flashed smoothly:

/tmp # nandwrite -p  /dev/mtd0  /tmp/u-boot-3.5.9_HNCN2.bin

Cool! that will work.

The nandwrite -p option (padding) is what people usually use when your u-boot image size is not a mutiple of 128K (NAND sector size). But I don't use that -p option in my u-boot release instruction because to me it is not a perfect solution in that it could not prevent other area in flash to be overwritten accidentally if u-boot image is too big. All my released u-boot images are pre-padded to 512K so they can be flashed to the first 4 blocks of mtd0 without padding while flashing (it serves as a sanity check before you commit to do the flashing).


> The device with Debian as well as with Stock OS
> boot normally, no need for serial. However, I have
> noticed fw_printenv have different outputs.
>
> On Debian:
> ~# fw_printenv
> Warning: Bad CRC, using default environment

> Shouldn't the outputs be the same as the envs are
> stored in mtd1 ?

Check your /etc/fw_env.config in Debian rootfs on the 2nd box. Make sure it is correct and the same as the 1st one.

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



Edited 2 time(s). Last edit at 11/09/2018 03:33AM by bodhi.
Re: Debian on Freecom Silverstore 2 NAS
November 09, 2018 05:49AM
bodhi Wrote:
-------------------------------------------------------

> Check your /etc/fw_env.config in Debian rootfs on
> the 2nd box. Make sure it is correct and the same
> as the 1st one.

bodhi,
Both are the same.
Debian:
root@silverdebian:~# cat /etc/fw_env.config
# MTD device name       Device offset   Env. size       Flash sector size       Number of sectors
/dev/mtd1 0x0 0x20000 0x20000
root@silverdebian:~#
Stock:
~ # cat /etc/fw_env.config
# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundand
# environment sector is assumed present.

# MTD device name       Device offset   Env. size       Flash sector size
/dev/mtd1               0x0             0x20000         0x20000
~ #

Edit: I have found a solution:

It is probably something to do with how fw_printenv was built for Debian and the newer u-boots. Because I have just copied the fw_printenv and fw_setenv from the Stock OS to Debian and executed them.

Stock fw_printenv (even in Debian) prints the correct envs:
root@silverdebian:~# /root/fw_printenv       
baudrate=115200
loads_echo=0
ipaddr=10.4.52.165
serverip=10.4.52.7
rootpath=/srv/ubuntu
netmask=255.255.255.0
run_diag=yes
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/ram0 rootfstype=cramfs init=/etc/rc.preroot initrd=0x800000,0x1000000
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000;
lcd0_enable=0
lcd0_params=640x480-16@60
ethaddr=00:50:43:47:1d:37
ethmtu=1500
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
uboot_ver=v0.0.9
mfgtest_state=final_tested_ok
mfgmodel=HNC-N2
ethact=egiga0
mtdparts=mtdparts=orion_nand:0x000a0000@0x0(uboot),0x00040000@0x000a0000(param),0x00280000@0x000e0000(preroot),0x00380000@0x00360000(uimage),0x076e0000@0x006e0000(rootfs),0x00240000@0x07dc0000(misc),128m@0x0(flash)
bootcmd_usb=usb start; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1 0x2100000 /boot/uInitrd
bootcmd_sata=ide reset; ext2load ide 0:1 0x800000 /boot/uImage; ext2load ide 0:1 0x2100000 /boot/uInitrd
bootcmd_exec=run set_bootargs; run bootcmd_sata; bootm 0x800000 0x2100000
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
console=console=ttyS0,115200 mtdparts=nand_mtd:0x000a0000@0x0(uboot),0x00040000@0x000a0000(param),0x00280000@0x000e0000(preroot),0x00380000@0x00360000(uimage),0x076e0000@0x006e0000(rootfs),0x00240000@0x07dc0000(misc),128m@0x0(flash) 
bootcmd_f=run bootcmd_exec; nand reset; nand read.e 0x800000 0x00100000 0x00199800; check_crc32 PrEr; 
bootcmd=run bootcmd_exec; nand reset; nand read.e 0x800000 0x00100000 0x00199800; check_crc32 PrEr; nand reset; nand read.e 0x40000 0x00380000 0x0027d400; check_crc32 KrNl; setenv bootargs $(console) $(bootargs_root);  bootm 0x40000; 
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
pcieTune1=no
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 ${mtdparts} earlyprintk=serial
root@silverdebian:~#

I have attached stock executables in case someone needs them in the future.

---------------------------------


Regards,
garagoyun



Edited 1 time(s). Last edit at 11/09/2018 10:17AM by garagoyun.
Attachments:
open | download - fw_env.tar.bz2 (8.4 KB)
Re: Debian on Freecom Silverstore 2 NAS
November 09, 2018 03:53PM
garagoyun,

> It is probably something to do with how
> fw_printenv was built for Debian and the newer
> u-boots. Because I have just copied the
> fw_printenv and fw_setenv from the Stock OS to
> Debian and executed them.

Very good temporary solution!

However, we should make the fw_setenv/printenv in Debian work properly. Usually, when you flash a new u-boot like this (stock is too old), it could render the envs unusable, because of the recalculation of the checksum.

So since you don't have serial console on the 2nd box, this 2nd box u-boot flashing should go like this:

1. Log in the first box. Make sure you are booting the new u-boot image on flash. Run fw_printenv and fw_setenv to verify that it works.
2. Dump the mtd1 where the envs are
nanddump --noecc --omitoob -f mtd1.silverstone /dev/mtd1

3. Log into the 2nd box stock OS.
4. Flash new u-boot image, and then flash the saved mtd1.silverstone in step 2
5. Verify that envs can be set and printed before reboot. At this point, it should already be working OK.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 09, 2018 05:27PM
bodhi Wrote:
-------------------------------------------------------
> So since you don't have serial console on the 2nd
> box, this 2nd box u-boot flashing should go like
> this:
>
> 1. Log in the first box. Make sure you are booting
> the new u-boot image on flash. Run fw_printenv and
> fw_setenv to verify that it works.
> 2. Dump the mtd1 where the envs are
>
> nanddump --noecc --omitoob -f mtd1.silverstone
> /dev/mtd1
>
>
> 3. Log into the 2nd box stock OS.
> 4. Flash new u-boot image, and then flash the
> saved mtd1.silverstone in step 2
> 5. Verify that envs can be set and printed before
> reboot. At this point, it should already be
> working OK.

bodhi,

I have flashed the new u-boot on the second box (the one with Stock OS) two days ago. I did not need to flash the mtd1. envs are accessible as before, no problems at all. All working fine so far (second day now). I will do few more tests on it and then install Debian on the hard disk as well. Factory reset should still work, but why would anyone need that :-)


The only thing that still bothers me is the cpu and system clock speed. they run at 333MHz . When ideally they should run at 533MHz. I have scanned, as good as I could, all the files to find out if there are any variables that could be adjusted but I could not find any. I believe that could be a limitation of the motherboard perhaps.

******************************************************************************
* Category     - General
* Functionality- Display the auto detect values of the TCLK and SYSCLK.
* Need modifications (Yes/No) - no
*****************************************************************************/
int clk_cmd( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
    	printf( "TCLK %dMhz, SYSCLK %dMhz (UART baudrate %d)\n",
		mvTclkGet()/1000000, mvSysClkGet()/1000000, CONFIG_BAUDRATE);
	return 1;
}

U_BOOT_CMD(
	dclk,      1,     1,      clk_cmd,
	"dclk	- Display the MV device CLKs.\n",
	" \n"
	"\tDisplay the auto detect values of the TCLK and SYSCLK.\n"
);

---------------------------------


Regards,
garagoyun
Re: Debian on Freecom Silverstore 2 NAS
November 09, 2018 07:20PM
garagoyun,


> I have flashed the new u-boot on the second box
> (the one with Stock OS) two days ago. I did not
> need to flash the mtd1. envs are accessible as
> before, no problems at all. All working fine so
> far (second day now).

That's great to hear! what I meant is, when you cannot use the latest Debian fw_setenv or w_printenv, then there is more work to be done. I explained the reason above.


> I will do few more tests on
> it and then install Debian on the hard disk as
> well. Factory reset should still work, but why
> would anyone need that :-)

Right :)

> The only thing that still bothers me is the cpu
> and system clock speed. they run at 333MHz . When
> ideally they should run at 533MHz. I have scanned,
> as good as I could, all the files to find out if
> there are any variables that could be adjusted but
> I could not find any. I believe that could be a
> limitation of the motherboard perhaps.

As of right now, CPU should run at 1Ghz. The clock is in sync with that. What should be is 1.6Ghz CPU and clock at 533 Mhz. These are defined by u-boot. The reason why it was 1GHz, I've have eductated guess that I've posted above a few posts back. But really the only thing we can do is to change those constants in u-boot (as we normally would to overclock a box) and then see if it can be run stably for a while in all scenarios and then use that u-boot version.

I'll take a look at u-boot source when I have some free time.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Freecom Silverstore 2 NAS
November 16, 2018 09:05AM
bodhi,

Could you tell me what is the relationship between values in the arrays? It should manipulate the values of cpu freq, l2 and ddr, but i am not sure how exactly:
#ifndef MV_ASMLANGUAGE
/* CPU clock for 6281,6192,6282  0->Resereved */
#define MV_CPU_CLCK_TBL { 	0,		400000000,	0, 		0,	\
			     	600000000, 	0,		800000000,	1000000000,	\
			     	0,	 	1200000000,	0,		0,		\
			     	1500000000,	1600000000,		1800000000,		2000000000}

/* DDR clock RATIO for 6281,6192,6282 {0,0}->Reserved */
#define MV_DDR_CLCK_RTIO_TBL	{\
	{1, 1}, {0, 0}, {2, 1}, {5, 1}, \
	{3, 1}, {0, 0}, {4, 1}, {9, 2}, \
	{5, 1}, {6, 1}, {0, 0}, {0, 0}, \
	{0, 0}, {0, 0}, {0, 0}, {0, 0} \
}

/* L2 clock RATIO for 6281,6192,6282 {1,1}->Reserved */
#define MV_L2_CLCK_RTIO_TBL	{\
	{0, 0}, {2, 1}, {0, 0}, {3, 1}, \
	{0, 0}, {4, 1}, {0, 0}, {0, 0} \
}

/* 6180 have different clk reset sampling 		*/
/* ARM CPU, DDR, L2 clock for 6180 {0,0,0}->Reserved 	*/
#define MV_CPU6180_DDR_L2_CLCK_TBL    { \
	{0,   		0,   		0		},\
	{0,   		0,   		0		},\
	{0,   		0,   		0		},\
	{0,   		0,   		0		},\
	{0,   		0,   		0		},\
	{600000000, 	200000000, 	300000000	},\
	{800000000, 	200000000, 	400000000	},\
	{1000000000,   	200000000,   500000000		}\
}

---------------------------------


Regards,
garagoyun
Re: Debian on Freecom Silverstore 2 NAS
November 16, 2018 03:20PM
garagoyun,

That code is pretty old. I'm not familiar with that either!

Let me look at a different area to see if I can find some commonality with the new u-boot code structure.

-bodhi
===========================
Forum Wiki
bodhi's corner
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: