| 1 | == Switching between Xorp+ (Regular switching) and Open flow == |
| 2 | |
| 3 | In order to switch between the two firmware modes, the switch must be rebooted. Once rebooted you have to intercept the boot loader |
| 4 | countdown (otherwise it will boot it's default). Once the countdown in interrupted you will be in the Uboot PreOs. From here you can modify the boot varibles to swtich between the diffrent firmwares. A few usefull Uboot commands: |
| 5 | * printenv - List current environment varibles |
| 6 | * setenv - sets the env variable. Syntax is: setenv VARNAME 'VARVALUE' |
| 7 | * saveenv - saves modifications |
| 8 | * boot - Once env varibles are set to desired varibles, continues the boot process |
| 9 | |
| 10 | ''' Complete list at the bottom ''' |
| 11 | |
| 12 | The output of printenv currently looks like this: |
| 13 | {{{ |
| 14 | => printenv |
| 15 | bootdelay=5 |
| 16 | baudrate=115200 |
| 17 | loads_echo=1 |
| 18 | ethaddr=00:E0:0C:00:00:FD |
| 19 | eth1addr=00:E0:0C:00:01:FD |
| 20 | eth2addr=00:E0:0C:00:02:FD |
| 21 | rootpath=/nfsroot |
| 22 | hostname=LB9A_X |
| 23 | loadaddr=4000000 |
| 24 | ethact=TSEC0 |
| 25 | ipaddr=10.50.0.93 |
| 26 | gatewayip=10.50.0.42 |
| 27 | netmask=255.255.0.0 |
| 28 | serverip=10.50.0.42 |
| 29 | bootfile=LB9A.dtb |
| 30 | filesize=1860 |
| 31 | fileaddr=2000000 |
| 32 | flash_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$baudrate rw DEV_ADDR=172.16.20.253 ETH0_IP=172.16.20.253; bootm ffd00000 ff000000 ffee0000 |
| 33 | cfcard_bootcmd=setenv bootargs root=/dev/ram console=ttyS0,$baudrate rw; ext2load ide 0:1 0x1000000 /uImage;ext2load ide 0:1 0x2000000 /uInitrd2m;ext2load ide 0:1 0x400000 /LB9A.dtb;bootm 1000000 2000000 400000 |
| 34 | bootcmd=run cfcard_bootcmd |
| 35 | stdin=serial |
| 36 | stdout=serial |
| 37 | stderr=serial |
| 38 | |
| 39 | Environment size: 742/8188 bytes |
| 40 | }}} |
| 41 | |
| 42 | The major varibles we'll be concerned with are: |
| 43 | * flash_bootcmd - Open flow boot commands |
| 44 | * cfcard_bootcmd - Xorp+ boot commands |
| 45 | * bootcmd - Uboot consults this varible to determine what to boot |
| 46 | |
| 47 | The bootcmd variable is the one that dictates what actually gets booted. It is currently configured (this should be the default) to run the cfcard_bootcmd varible. This variable will be substituted with it contents, which are the commands required to boot from the cfcard into the xorp environment. We will change this from 'run cfcard_bootcmd' to 'run flash_bootcmd'. |
| 48 | |
| 49 | {{{ |
| 50 | setenv bootcmd 'run flash_bootcmd' |
| 51 | }}} |
| 52 | |
| 53 | From here we can simply boot if we don't want to change the default boot config. Or we could do a saveenv if we require that default booting behavior be changed. |
| 54 | |
| 55 | ---- |
| 56 | |
| 57 | ==== The complete uboot command list as per the ? command ==== |
| 58 | {{{ |
| 59 | ? - alias for 'help' |
| 60 | autoscr - run script from memory |
| 61 | base - print or set address offset |
| 62 | bdinfo - print Board Info structure |
| 63 | boot - boot default, i.e., run 'bootcmd' |
| 64 | bootd - boot default, i.e., run 'bootcmd' |
| 65 | bootm - boot application image from memory |
| 66 | bootp - boot image via network using BootP/TFTP protocol |
| 67 | cmp - memory compare |
| 68 | coninfo - print console devices and information |
| 69 | copy - download image file from tftp server |
| 70 | cp - memory copy |
| 71 | crc32 - checksum calculation |
| 72 | dhcp - invoke DHCP client to obtain IP/boot params |
| 73 | diskboot- boot from IDE device |
| 74 | echo - echo args to console |
| 75 | erase - erase FLASH memory |
| 76 | exit - exit script |
| 77 | ext2load- load binary file from a Ext2 filesystem |
| 78 | ext2ls - list files in a directory (default /) |
| 79 | flinfo - print FLASH memory information |
| 80 | go - start application at address 'addr' |
| 81 | help - print online help |
| 82 | icrc32 - checksum calculation |
| 83 | ide - IDE sub-system |
| 84 | iloop - infinite loop on address range |
| 85 | imd - i2c memory display |
| 86 | iminfo - print header information for application image |
| 87 | imls - list all images found in flash |
| 88 | imm - i2c memory modify (auto-incrementing) |
| 89 | imw - memory write (fill) |
| 90 | inm - memory modify (constant address) |
| 91 | iprobe - probe to discover valid I2C chip addresses |
| 92 | itest - return true/false on integer compare |
| 93 | loadb - load binary file over serial line (kermit mode) |
| 94 | loads - load S-Record file over serial line |
| 95 | loady - load binary file over serial line (ymodem mode) |
| 96 | loop - infinite loop on address range |
| 97 | md - memory display |
| 98 | mii - MII utility commands |
| 99 | mm - memory modify (auto-incrementing) |
| 100 | mtest - simple RAM test |
| 101 | mw - memory write (fill) |
| 102 | nfs - boot image via network using NFS protocol |
| 103 | nm - memory modify (constant address) |
| 104 | pci - list and access PCI Configuration Space |
| 105 | ping - send ICMP ECHO_REQUEST to network host |
| 106 | printenv- print environment variables |
| 107 | protect - enable or disable FLASH write protection |
| 108 | rarpboot- boot image via network using RARP/TFTP protocol |
| 109 | reset - Perform RESET of the CPU |
| 110 | run - run commands in an environment variable |
| 111 | saveenv - save environment variables to persistent storage |
| 112 | setenv - set environment variables |
| 113 | sleep - delay execution for some time |
| 114 | test - minimal test like /bin/sh |
| 115 | tftpboot- boot image via network using TFTP protocol |
| 116 | version - print monitor version |
| 117 | }}} |