Example #1
0
    def do_set_env(
        self, ub: board.UBootShell
    ) -> bool:
        ub.env("serverip", tbot.selectable.LabHost.serverip["socrates"])
        ub.env("netmask", "255.255.255.0")
        ub.env("ipaddr", tbot.selectable.LabHost.boardip["socrates"])

        for env in ub_env:
            ub.env(env["name"], env["val"])
Example #2
0
 def do_set_env(self, ub: board.UBootShell) -> bool:
     ub.env("serverip", tbot.selectable.LabHost.serverip["wandboard"])
     ub.env("netmask", "255.255.255.0")
     ub.env("ipaddr", tbot.selectable.LabHost.boardip["wandboard"])
     ta = ub.host.tftp_dir_board
     f = ta / "SPL"
     ub.env("spl_file", ge.get_path(f))
     f = ta / "u-boot.img"
     ub.env("ub_file", ge.get_path(f))
     ub.env("cmp_addr_r", "11000000")
     for env in ub_env:
         ub.env(env["name"], env["val"])
Example #3
0
 def do_set_env(self, ub: board.UBootShell) -> bool:
     ub.env("serverip", tbot.selectable.LabHost.serverip)
     ub.env("netmask", "255.255.255.0")
     ub.env("ipaddr", tbot.selectable.LabHost.boardip["bbb"])
     ub.env("load_addr_r", "81000000")
     ub.env("cmp_addr_r", "82000000")
     tftpboardname = "bbb"
     ub_load_board_env_subdir = tbot.selectable.LabHost.ub_load_board_env_subdir
     #nfs_subdir = ge.get_path(tbot.selectable.LabHost.nfs_root) + "/bbb"
     nfs_subdir = "/work/tbot2go/tbot/nfs/bbb"
     ub.env("mlofile", f"{tftpboardname}/{ub_load_board_env_subdir}/MLO")
     ub.exec0("setenv", "load_mlo", "tftp",
              linux.special.Raw("${load_addr_r}"),
              linux.special.Raw("${mlofile}"))
     ub.env("ubfile",
            f"{tftpboardname}/{ub_load_board_env_subdir}/u-boot.img")
     ub.exec0("setenv", "load_uboot", "tftp",
              linux.special.Raw("${load_addr_r}"),
              linux.special.Raw("${ubfile}"))
     ub.exec0(
         linux.special.Raw(
             'setenv upd_mlo mmc dev 0\;fatwrite mmc 0:1 \${load_addr_r} MLO \${filesize}'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv upd_uboot mmc dev 0\;fatwrite mmc 0:1 \${load_addr_r} u-boot.img \${filesize}'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv cmp_mlo fatload mmc 0:1 \${load_addr_r} MLO \${filesize}\;tftp \${cmp_addr_r} \${mlofile}\;cmp.b \${load_addr_r} \${cmp_addr_r} \${filesize}'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv cmp_uboot fatload mmc 0:1 \${load_addr_r} u-boot.img\;tftp \${cmp_addr_r} \${ubfile}\;cmp.b \${load_addr_r} \${cmp_addr_r} \${filesize}'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv tbot_upd_uboot run load_uboot\;run upd_uboot_emmc'))
     ub.exec0(linux.special.Raw('setenv tbot_cmp_uboot run cmp_uboot_emmc'))
     ub.exec0(
         linux.special.Raw(
             'setenv tbot_upd_spl run load_mlo\;run upd_mlo_emmc'))
     ub.exec0(linux.special.Raw('setenv tbot_cmp_spl run cmp_mlo_emmc'))
     ub.exec0(
         linux.special.Raw(
             'setenv upd_mlo_emmc mmc dev 1\;mmc write \${load_addr_r} 100 100'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv upd_uboot_emmc mmc dev 1\;mmc erase 400 400\;mmc write \${load_addr_r} 300 600'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv cmp_mlo_emmc mmc read \${cmp_addr_r} 100 100\;cmp.b \${load_addr_r} \${cmp_addr_r} \${filesize}'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv cmp_uboot_emmc mmc read \${cmp_addr_r} 300 600\;cmp.b \${load_addr_r} \${cmp_addr_r} \${filesize}'
         ))
     ub.exec0(linux.special.Raw('setenv console ttyO0,115200n8'))
     ub.exec0(linux.special.Raw('setenv console ttyS0,115200n8'))
     ub.env("bootfile",
            f"{tftpboardname}/{ub_load_board_env_subdir}/zImage")
     ub.env(
         "fdtfile",
         f"{tftpboardname}/{ub_load_board_env_subdir}/am335x-boneblack.dtb")
     ub.exec0(
         linux.special.Raw(
             'setenv netmmcboot echo Booting from network ... with mmcargs ...\; setenv autoload no\; run netloadimage\; run netloadfdt\; run args_mmc\; bootz \${loadaddr} - \${fdtaddr}'
         ))
     ub.env("netdev", "eth0")
     ub.env("hostname", "bbb")
     ub.exec0(
         linux.special.Raw(
             'setenv addip setenv bootargs \${bootargs} ip=\${ipaddr}:\${serverip}:\${gatewayip}:\${netmask}:\${hostname}:\${netdev}::off panic=1'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv addcon setenv bootargs \${bootargs} console=\${console}'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv addmisc setenv bootargs \${bootargs} loglevel=8'))
     ub.exec0(
         linux.special.Raw(
             'setenv addmtd setenv bootargs \${bootargs} \${mtdparts}'))
     ub.env("rootpath", nfs_subdir)
     ub.env("nfsopts", "nfsvers=3 nolock rw")
     ub.exec0(
         linux.special.Raw(
             'setenv nfsargs setenv bootargs \${bootargs} root=/dev/nfs rw nfsroot=\${serverip}:\${rootpath},\${nfsopts}'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv net_nfs run netloadimage\; run netloadfdt\;run nfsargs addcon addip addmtd addmisc\;bootz \${loadaddr} - \${fdtaddr}'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv sdloadk ext2load mmc 0:2 \${loadaddr} /boot/zImage'))
     ub.exec0(
         linux.special.Raw(
             'setenv sdloadfdt ext2load mmc 0:2 \${fdtaddr} /boot/am335x-boneblack.dtb'
         ))
     ub.exec0(
         linux.special.Raw(
             'setenv sd_sd run sdloadk\; run sdloadfdt\;run args_mmc addip addmtd addmisc\;bootz \${loadaddr} - \${fdtaddr}'
         ))
     for env in ub_env:
         ub.env(env["name"], env["val"])