turris-omnia.bootscript 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # Determine root device
  2. setexpr rootpart ${distro_bootpart} + 1
  3. if test ${devtype} = mmc -a ${devnum} = 0; then
  4. setenv rootdev /dev/mmcblk0p${rootpart}
  5. elif test ${devtype} = scsi -a ${devnum} = 0; then
  6. setenv rootdev /dev/sda${rootpart}
  7. else
  8. # New U-Boot only
  9. part uuid ${devtype} ${devnum}:${rootpart} uuid
  10. setenv rootdev PARTUUID=${uuid}
  11. fi
  12. setenv bootargs earlyprintk console=ttyS0,115200 root=${rootdev} rootfstype=auto rootwait
  13. # Load device tree and prepare for modification
  14. load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} @[email protected]
  15. fdt addr ${fdt_addr_r}
  16. fdt resize
  17. # Enable SFP cage, if module is present
  18. i2c dev 0
  19. i2c mw 0x70 0.0 0xf
  20. i2c read 0x71 0 1 0x00fffff1
  21. setexpr.b mod_def0 *0x00fffff1 \& 0x10
  22. if test ${mod_def0} -eq 0; then
  23. fdt set /sfp status okay
  24. fdt rm /soc/internal-regs/ethernet@34000 phy-handle
  25. fdt set /soc/internal-regs/ethernet@34000 managed in-band-status
  26. fi
  27. # Load kernel and boot
  28. load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage
  29. bootz ${kernel_addr_r} - ${fdt_addr_r}