]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mx23_olinuxino: Add ethernet support
authorOtavio Salvador <otavio@ossystems.com.br>
Sat, 2 Mar 2013 05:17:30 +0000 (05:17 +0000)
committerStefano Babic <sbabic@denx.de>
Thu, 7 Mar 2013 16:22:58 +0000 (17:22 +0100)
This adds support to the LAN9512 chip included in the board and extend
the environment to easy netboot use.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
include/configs/mx23_olinuxino.h

index 90dda01448c09cf6e58bb80422c73cdd2bebcbe6..03893d744d72635776994226f6d3a6a0a46970af 100644 (file)
 #define        CONFIG_DOS_PARTITION
 
 #define        CONFIG_CMD_CACHE
+#define        CONFIG_CMD_DHCP
 #define        CONFIG_CMD_EXT2
 #define        CONFIG_CMD_FAT
 #define        CONFIG_CMD_GPIO
 #define        CONFIG_CMD_LED
 #define        CONFIG_CMD_MMC
+#define        CONFIG_CMD_NET
 #define        CONFIG_CMD_USB
 
 /*
 #define        CONFIG_USB_STORAGE
 #endif
 
+/* Ethernet */
+#ifdef CONFIG_CMD_NET
+#define        CONFIG_USB_HOST_ETHER
+#define        CONFIG_USB_ETHER_SMSC95XX
+#endif
+
 /*
  * Boot Linux
  */
        "fdt_file=imx23-olinuxino.dtb\0" \
        "fdt_addr=0x41000000\0" \
        "boot_fdt=try\0" \
+       "ip_dyn=yes\0" \
        "mmcdev=0\0" \
        "mmcpart=2\0" \
        "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
                        "fi; " \
                "else " \
                        "bootm; " \
+               "fi;\0" \
+       "netargs=setenv bootargs console=${console_mainline},${baudrate} " \
+               "root=/dev/nfs " \
+               "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+       "netboot=echo Booting from net ...; " \
+               "usb start; " \
+               "run netargs; " \
+               "if test ${ip_dyn} = yes; then " \
+                       "setenv get_cmd dhcp; " \
+               "else " \
+                       "setenv get_cmd tftp; " \
+               "fi; " \
+               "${get_cmd} ${uimage}; " \
+               "if test ${boot_fdt} = yes; then " \
+                       "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+                               "bootm ${loadaddr} - ${fdt_addr}; " \
+                       "else " \
+                               "if test ${boot_fdt} = try; then " \
+                                       "bootm; " \
+                               "else " \
+                                       "echo WARN: Cannot load the DT; " \
+                               "fi;" \
+                       "fi; " \
+               "else " \
+                       "bootm; " \
                "fi;\0"
 
 #define CONFIG_BOOTCOMMAND \
                "else " \
                        "if run loaduimage; then " \
                                "run mmcboot; " \
-                       "else " \
-                               "echo ERR: Fail to boot from MMC; " \
+                       "else run netboot; " \
                        "fi; " \
                "fi; " \
-       "else exit; fi"
+       "else run netboot; fi"
 
 #endif /* __MX23_OLINUXINO_CONFIG_H__ */