Re: Debian on Synology RS816 (Armada 385) June 14, 2019 02:54AM |
Admin Registered: 13 years ago Posts: 18,853 |
Quote
> U-Boot 2013.01 (May 18 2017 - 16:37:44) Marvell
> version: 2015_T1.QA.0p16
Re: Debian on Synology RS816 (Armada 385) June 14, 2019 02:29PM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 14, 2019 05:08PM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 15, 2019 12:11AM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 15, 2019 03:28AM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 15, 2019 03:44AM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 15, 2019 05:46PM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 15, 2019 10:14PM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 16, 2019 12:00AM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 16, 2019 02:41AM |
Admin Registered: 13 years ago Posts: 18,853 |
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
Re: Debian on Synology RS816 (Armada 385) June 16, 2019 04:05PM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 16, 2019 04:51PM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 20, 2019 05:17AM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 20, 2019 06:34AM |
Registered: 5 years ago Posts: 257 |
setenv mtdparts 'mtdparts=mtdparts=spi0.0:4m(boot),-(spi-rootfs)'And the usual usb rootfs env
setenv ipaddr 192.168.1.250 setenv serverip 192.168.1.1 setenv usb_setup 'setenv usbActive 1; setenv usbType 3; usb start;' setenv load_dtb_addr 0x1000000 setenv load_initrd_addr 0x3000000 setenv load_image_addr 0x02000000 setenv load_image 'echo loading zImage from tftpserver ...; tftpboot $load_image_addr zImage' setenv load_initrd 'echo loading uInitrd from tftpserver ...; tftpboot $load_initrd_addr uInitrd' setenv load_dtb 'echo loading DTB from tftpserver ...; tftpboot $load_dtb_addr armada-385-synology-rs816-rj.dtb' setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=20 $mtdparts earlyprintk=serial"' setenv bootcmd_exec 'echo Booting Debian . . .; run usb_setup; run set_bootargs; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; run load_image; run load_initrd; run load_dtb; bootz $load_image_addr $load_initrd_addr $load_dtb_addr' setenv bootcmd 'run bootcmd_exec; run bootspi' boot
flashcp -v mtd0.stock.rs816 /dev/mtd0 flashcp -v mtd1.stock.rs816 /dev/mtd1
run bootspi
Re: Debian on Synology RS816 (Armada 385) June 20, 2019 07:12AM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 20, 2019 03:15PM |
Registered: 5 years ago Posts: 257 |
Marvell>> printenv CASset=max MALLOC_len=5 MPmode=SMP ata_hdd_detect=syno_hdd_detect=39,39,39,39 ata_hdd_enable=syno_hdd_enable=37,37,37,37 autoload=no baudrate=115200 boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr bootargs= bootargs_dflt=$console $nandEcc $mtdparts_lgcy $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none bootargs_root=root=/dev/nfs rw bootcmd=run bootcmd_exec; run bootspi bootcmd_auto=stage_boot $boot_order bootcmd_exec=echo Booting Debian . . .; run usb_setup; run set_bootargs; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; run load_image; run load_initrd; run load_dtb; bootz $load_image_addr $load_initrd_addr $load_dtb_addr bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr; bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr; bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot bootcmd_lgcy=tftpboot 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts_lgcy $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootm $loadaddr; bootdelay=3 bootftp=run syno_bootargs;tftpboot $loadaddr_kernel $file_kernel;tftpboot $loadaddr_rootfs $file_rootfs;sf probe; sf read $loadaddr_dt $spi_pt_addr_dt $spi_pt_size_dt;fdt addr $loadaddr_dt;bootm $loadaddr_kernel $loadaddr_rootfs $loadaddr_dt; bootspi=run syno_bootargs;sf probe 0 50000000;sf read $loadaddr_kernel $spi_pt_addr_kernel $spi_pt_size_kernel;sf read $loadaddr_rootfs $spi_pt_addr_rootfs $spi_pt_size_rootfs;sf read $loadaddr_dt $spi_pt_addr_dt $spi_pt_size_dt;bootm $loadaddr_kernel $loadaddr_rootfs $loadaddr_dt; cacheShare=no clean_env=sf probe; sf erase $spi_pt_addr_env $spi_pt_size_env; console=console=ttyS0,115200 device_partition=0:1 disaMvPnp=no eeeEnable=no enaClockGating=no enaCpuStream=no enaFPU=yes enaMonExt=no enaWrAllo=no eth1addr=00:50:43:1c:24:27 eth1mtu=1500 eth2addr=00:50:43:1c:1c:27 eth2mtu=1500 eth3addr=00:50:43:24:1c:1c eth3mtu=1500 ethact=egiga0 ethaddr=00:50:43:1c:24:27 ethmtu=1500 ethprime=egiga0 fdt_addr=2040000 fdt_skip_update=yes fdtaddr=0x1000000 fdtfile=armada-38x.dtb file_flash=armada38x/flash.bin file_kernel=armada38x/uImage file_rootfs=armada38x/rd.bin file_uboot=armada38x/uboot.bin ide_path=/ image_name=uImage initrd_high=8000000 initrd_name=uInitrd ipaddr=192.168.1.250 kernel_addr_r=2080000 lcd0_enable=0 lcd0_params=640x480-16@60 lcd_panel=0 limit_dram_size=yes load_dtb=echo loading DTB from tftpserver ...; tftpboot $load_dtb_addr armada-385-synology-rs816-rj.dtb load_dtb_addr=0x1000000 load_image=echo loading zImage from tftpserver ...; tftpboot $load_image_addr zImage load_image_addr=0x02000000 load_initrd=echo loading uInitrd from tftpserver ...; tftpboot $load_initrd_addr uInitrd load_initrd_addr=0x3000000 loadaddr=0x02000000 loadaddr_dt=0x1000000 loadaddr_kernel=0x2000000 loadaddr_rootfs=0x3000000 loads_echo=0 mtdids=spi0=spi_flash mtdparts=mtdparts=mtdparts=spi0.0:4m(boot),-(spi-rootfs) mtdparts_lgcy=mtdparts=spi_flash:4m(boot),-(spi-rootfs) mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500 mv_pon_addr=00:50:43:27:1c:1c netbsd_en=no netretry=no pcieTune=no pexMode=RC pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm pxefile_addr_r=3100000 ramdisk_addr_r=2880000 rootpath=/srv/nfs/ run_script=no sata_delay_reset=0 sata_dma_mode=yes script_addr_r=3000000 script_name=boot.scr sd_detection_dat3=no serverip=192.168.1.1 set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=20 $mtdparts earlyprintk=serial" spi_pt_addr_dt=0x0E0000 spi_pt_addr_env=0x7e0000 spi_pt_addr_kernel=0x0F0000 spi_pt_addr_rootfs=0x3C0000 spi_pt_size_dt=0x010000 spi_pt_size_env=0x010000 spi_pt_size_kernel=0x2D0000 spi_pt_size_rootfs=0x410000 standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts_lgcy root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000; stderr=serial stdin=serial stdout=serial syno_boot_dev=/dev/md0 syno_bootargs=setenv bootargs console=ttyS0,115200 ip=off initrd=$loadaddr_rootfs root=$syno_boot_dev rw $syno_extra_args syno_hw_version=$syno_hw_version hd_power_on_seq=$syno_hdd_powerup_seq ihd_num=$syno_hdd_powerup_seq netif_num=$syno_net_if_num $ata_hdd_detect $ata_hdd_enable flash_size=8 syno_extra_args=HddHotplug=4 sata_remap=0>4:4>0 syno_hdd_powerup_seq=4 syno_hw_version=RS816 syno_net_if_num=2 upd_flash=setenv tftpfile $file_flash; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then echo "This may take a while, please be patient..."; sf probe; sf erase 0 +$filesize; sf write $loadaddr 0 $filesize; echo "\ Flash Update Done"; fi; upd_kernel=setenv tftpfile $file_kernel; mw.b $loadaddr 0xFF $spi_pt_size_kernel; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase $spi_pt_addr_kernel $spi_pt_size_kernel; sf write $loadaddr $spi_pt_addr_kernel $spi_pt_size_kernel; echo "\ Kernel Update Done"; fi; upd_rootfs=setenv tftpfile $file_rootfs; mw.b $loadaddr 0xFF $spi_pt_size_rootfs; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase $spi_pt_addr_rootfs +$filesize; sf write $loadaddr $spi_pt_addr_rootfs $filesize; echo "\ Rootfs Update Done"; fi; upd_uboot=setenv tftpfile $file_uboot; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase 0 +$filesize; sf write $loadaddr 0 $filesize; echo "\ Uboot Update Done"; fi; usb0Mode=host usbActive=0 usbType=2 usb_setup=setenv usbActive 1; setenv usbType 3; usb start; vxworks_en=no yuk_ethaddr=00:00:00:EE:51:81 Environment size: 6534/65532 bytes
root@debian:~# fw_printenv Warning: Bad CRC, using default environment bootcmd=run distro_bootcmd bootdelay=2 baudrate=115200 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 sata_boot=if sata dev ${devnum}; then setenv devtype sata; run scan_dev_for_boot_part; fi scsi_init=if ${scsi_need_init}; then setenv scsi_need_init false; scsi scan; fi scsi_boot=run scsi_init; if scsi dev ${devnum}; then setenv devtype scsi; run scan_dev_for_boot_part; fi virtio_boot=if virtio dev ${devnum}; then setenv devtype virtio; 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_syslinux_conf=extlinux/extlinux.conf boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf} scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_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=setenv scsi_need_init; 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
root@debian:~# cat /proc/mtd dev: size erasesize name mtd0: 000f0000 00001000 "RedBoot" mtd1: 002d0000 00001000 "zImage" mtd2: 00410000 00001000 "rd.gz" mtd3: 00010000 00001000 "vendor" mtd4: 00010000 00001000 "RedBoot config" mtd5: 00010000 00001000 "FIS directory"
root@debian:~# cat /etc/fw_env.config # MTD device name Device offset Env. size Flash sector size Number of sectors /dev/mtd1 0x3E0000 0x10000 0x00001000
Re: Debian on Synology RS816 (Armada 385) June 21, 2019 01:06AM |
Admin Registered: 13 years ago Posts: 18,853 |
Quote
The only bit I need to work out now is how to restore the original envs so it will autoboot synology (any tips gratefully received)
setenv bootcmd 'mw 0xf10a2620 0x251;mw 0xf10a2e20 0x251;usb xhciinit; run bootspi' boot
setenv bootcmd 'mw 0xf10a2620 0x251;mw 0xf10a2e20 0x251;usb xhciinit; run bootspi' saveenv
Re: Debian on Synology RS816 (Armada 385) June 21, 2019 01:20AM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 21, 2019 04:41AM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 22, 2019 06:31PM |
Admin Registered: 13 years ago Posts: 18,853 |
fw_setenv fw_printenv flash_unlock flashcp
Re: Debian on Synology RS816 (Armada 385) June 23, 2019 06:41PM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 24, 2019 05:06AM |
Admin Registered: 13 years ago Posts: 18,853 |
dm-mod.create
Quote
dm: add support to directly boot to a mapped device
Add a "create" module parameter, which allows device-mapper targets to
be configured at boot time. This enables early use of DM targets in the
boot process (as the root device or otherwise) without the need of an
initramfs.
The syntax used in the boot param is based on the concise format from
the dmsetup tool to follow the rule of least surprise:
dmsetup table --concise /dev/mapper/lroot
Which is:
dm-mod.create=<name>,<uuid>,<minor>,<flags>,<table>[,<table>+][;<name>,<uuid>,<minor>,<flags>,<table>[,<table>+]+]
Where,
<name> ::= The device name.
<uuid> ::= xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | ""
<minor> ::= The device minor number | ""
<flags> ::= "ro" | "rw"
<table> ::= <start_sector> <num_sectors> <target_type> <target_args>
<target_type> ::= "verity" | "linear" | ...
For example, the following could be added in the boot parameters:
dm-mod.create="lroot,,,rw, 0 4096 linear 98:16 0, 4096 4096 linear 98:32 0" root=/dev/dm-0
Only the targets that were tested are allowed and the ones that don't
change any block device when the device is create as read-only. For
example, mirror and cache targets are not allowed. The rationale behind
this is that if the user makes a mistake, choosing the wrong device to
be the mirror or the cache can corrupt data.
The only targets initially allowed are:
* crypt
* delay
* linear
* snapshot-origin
* striped
* verity
Re: Debian on Synology RS816 (Armada 385) June 24, 2019 08:24PM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 25, 2019 04:29AM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 25, 2019 03:45PM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 26, 2019 04:46AM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) June 26, 2019 03:51PM |
Registered: 5 years ago Posts: 257 |
Re: Debian on Synology RS816 (Armada 385) June 27, 2019 01:11AM |
Admin Registered: 13 years ago Posts: 18,853 |
Re: Debian on Synology RS816 (Armada 385) July 08, 2019 12:51AM |
Registered: 5 years ago Posts: 257 |
root@server:~# cat /proc/mtd dev: size erasesize name mtd0: 000e0000 00001000 "u-boot" mtd1: 00010000 00001000 "dtb" mtd2: 006f0000 00001000 "kernel" mtd3: 00020000 00001000 "env"
setenv mtdparts 'mtdparts=mtdparts=spi0.0:4m(boot),-(spi-rootfs)'followed by the usual USB boot process but once booted into the usb rootfs I get
root@debian:~# cat /proc/mtd dev: size erasesize name mtd0: 000f0000 00001000 "RedBoot" mtd1: 002d0000 00001000 "zImage" mtd2: 00410000 00001000 "rd.gz" mtd3: 00010000 00001000 "vendor" mtd4: 00010000 00001000 "RedBoot config" mtd5: 00010000 00001000 "FIS directory"which I believe is the stock mtd layout.
Re: Debian on Synology RS816 (Armada 385) July 08, 2019 01:50AM |
Admin Registered: 13 years ago Posts: 18,853 |
> root@debian:~# cat /proc/mtd > dev: size erasesize name > mtd0: 000f0000 00001000 "RedBoot" > mtd1: 002d0000 00001000 "zImage" > mtd2: 00410000 00001000 "rd.gz" > mtd3: 00010000 00001000 "vendor" > mtd4: 00010000 00001000 "RedBoot config" > mtd5: 00010000 00001000 "FIS directory" >> which I believe is the stock mtd layout.
cat /proc/cmdline
dmesg | grep -8 MTD
[ 2.370320] 1 cmdlinepart partitions found on MTD device .......