SHARE
TWEET

MiSTer u-boot script

a guest Feb 9th, 2018 144 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. u-boot_MiSTer/include/configs/socfpga_de10_nano.h
  2. https://github.com/MiSTer-devel/u-boot_MiSTer/blob/MiSTer/include/configs/socfpga_de10_nano.h
  3. # Annotated environment parameters for MiSTer platform U-Boot
  4. # u-boot_MiSTer/include/configs/socfpga_de10_nano.h
  5. # URL: https://github.com/MiSTer-devel/u-boot_MiSTer/blob/MiSTer/include/configs/socfpga_de10_nano.h
  6.  
  7. # Commands executed on preboot stage. Start USB PHY.
  8. preboot=usb start
  9.  
  10. # CONFIG_SYS_LOAD_ADDR = CONFIG_LOADADDR = 0x01000000 (as defined in /include/configs/socfpga_de10_nano.h)
  11. loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "
  12.  
  13. # Load compressed Linux kernel from /boot/zImage
  14. bootimage=zImage
  15.  
  16. # Set address for FDT (Flat device tree) to 100(0x00000064) and set device tree image file to /boot/socfpga.dtb
  17. # See more: https://www.denx.de/wiki/DULG/UBootCmdFDT
  18. fdt_addr=100
  19. fdtimage=socfpga.dtb
  20.  
  21. # Load FPGA binary to address 0x02000000. Set FPGA core name as menu.rbf (It will be loaded from )
  22. fpgadata=0x02000000
  23. core=menu.rbf
  24.  
  25. # Check FPGA state procedure
  26. # 1. If TSTSCRATCH (0xFFD05054) register contains zero (Cold reset was made), then call loading FPGA image data procedure
  27. # 2. Otherwise (warm reset case)
  28. # 2.1 Check for 4 bytes signature 0x87654321(12345678) is found in memory on address 0x1FFFF000. That means extra env block was loaded from file.
  29. # 2.2 If such block found, load extra env settings starting from address 0x1FFFF004 (skipping 4 signature bytes)
  30. # 2.3 Call loading FPGA image data procedure
  31. fpgacheck=if mt 0xFFD05054 0;then run fpgaload;else if mt 0x1FFFF000 0x87654321;then env import 0x1FFFF004;run fpgaload;fi;fi
  32.  
  33. # Procedure 'fpgaload'
  34. # 1. Load FPGA image from file on MMC Boot (/boot/menu.rbf)
  35. fpgaload=load mmc 0:$mmc_boot $fpgadata $core;fpga load 0 $fpgadata $filesize;bridge enable;mw 0x1FFFF000 0;mw 0xFFD05054 0x12345678
  36.  
  37. scrload1=load mmc 0:$mmc_boot $loadaddr u-boot.scr;source $loadaddr
  38. scrload2=load mmc 0:$mmc_os $loadaddr u-boot.scr;source $loadaddr
  39.  
  40. # If MMC Boot location contains u-boot.scr file - load and execute it
  41. scrtest=if test -e mmc 0:$mmc_boot /u-boot.scr;then run scrload1;fi;
  42.  
  43. # If MMC OS location contains u-boot.scr file - load and execute it
  44. if test -e mmc 0:$mmc_os /u-boot.scr;then run scrload2;fi
  45.  
  46. # Set Ethernet address to 02:03:04:05:06:07
  47. ethaddr=02:03:04:05:06:07
  48.  
  49. # Boot application image from memory
  50. # arg1 = $loadaddr - Linux image address in memory
  51. # arg2 = - (dash) - No initrd ramdisk image should be used
  52. # arg3 = $fdt_addr - Address of Flat device tree BLOB loaded into memory
  53. # See more: https://www.denx.de/wiki/DULG/UBootCmdGroupExec
  54. bootm $loadaddr - $fdt_addr
  55.  
  56. # Define partition index (in SD card MBR) for:
  57. # MMC Boot partition. mmc_boot = 1
  58. # MMC OS partition mmc_os = 2
  59. # MMC root path (MMC block device partition) mmc_root = /dev/mmcblk0p2
  60. mmc_boot=" __stringify(CONFIG_SYS_MMCSD_FS_BOOT_PARTITION) "
  61. mmc_os=" __stringify(CONFIG_SYS_MMCSD_FS_OS_PARTITION) "
  62. mmcroot=/dev/mmcblk0p" __stringify(CONFIG_SYS_MMCSD_FS_OS_PARTITION) "
  63.  
  64. # Set loglevel to 4 (default_loglevel = 4). That means that no messages will be logged.
  65. v=loglevel=4
  66.  
  67.  
  68. mmcboot=setenv bootargs " CONFIG_BOOTARGS " root=$mmcroot ro rootwait;" "bootz $loadaddr - $fdt_addr
  69. mmcload=mmc rescan;
  70.  
  71. run fpgacheck;
  72. run scrtest;
  73.  
  74. # Load zImage and socfpga.dtb into memory on specified addresses
  75. # zImage -> 0x
  76. # socfpga.dtb -> 0x00000064
  77. load mmc 0:$mmc_os $loadaddr /boot/$bootimage;
  78.  
  79. load mmc 0:$mmc_os $fdt_addr /boot/$fdtimage
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top