Merge branch 'u-boot/master' into 'u-boot-arm/master'
[oweals/u-boot.git] / include / configs / am335x_evm.h
index e0a87f8bc4d193f0c83670045a7c0867a1785f22..8af4d6afba1229d0ab60afb4110b797d50689633 100644 (file)
        "dfu_alt_info_nand=" DFU_ALT_INFO_NAND "\0" \
        "nandroot=ubi0:rootfs rw ubi.mtd=7,2048\0" \
        "nandrootfstype=ubifs rootwait=1\0" \
-       "nandsrcaddr=0x280000\0" \
-               "nandboot=echo Booting from nand ...; " \
+       "nandboot=echo Booting from nand ...; " \
                "run nandargs; " \
-               "nand read ${loadaddr} ${nandsrcaddr} ${nandimgsize}; " \
-               "bootm ${loadaddr}\0" \
-       "nandimgsize=0x500000\0"
+               "nand read ${fdtaddr} u-boot-spl-os; " \
+               "nand read ${loadaddr} kernel; " \
+               "bootz ${loadaddr} - ${fdtaddr}\0"
 #else
 #define NANDARGS ""
 #endif
@@ -61,8 +60,9 @@
        "fdt_high=0xffffffff\0" \
        "boot_fdt=try\0" \
        "rdaddr=0x81000000\0" \
+       "bootpart=0:2\0" \
        "bootdir=/boot\0" \
-       "bootfile=uImage\0" \
+       "bootfile=zImage\0" \
        "fdtfile=undefined\0" \
        "console=ttyO0,115200n8\0" \
        "optargs=\0" \
@@ -71,7 +71,6 @@
        "mmcdev=0\0" \
        "mmcroot=/dev/mmcblk0p2 ro\0" \
        "mmcrootfstype=ext4 rootwait\0" \
-       "bootpart=0:2\0" \
        "rootpath=/export/rootfs\0" \
        "nfsopts=nolock\0" \
        "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
        "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
        "importbootenv=echo Importing environment from mmc ...; " \
                "env import -t $loadaddr $filesize\0" \
+       "dfu_alt_info_ram=" DFU_ALT_INFO_RAM "\0" \
        "ramargs=setenv bootargs console=${console} " \
                "${optargs} " \
                "root=${ramroot} " \
                "rootfstype=${ramrootfstype}\0" \
        "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
-       "loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+       "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
        "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
        "mmcloados=run mmcargs; " \
                "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
                        "if run loadfdt; then " \
-                               "bootm ${loadaddr} - ${fdtaddr}; " \
+                               "bootz ${loadaddr} - ${fdtaddr}; " \
                        "else " \
                                "if test ${boot_fdt} = try; then " \
-                                       "bootm; " \
+                                       "bootz; " \
                                "else " \
                                        "echo WARN: Cannot load the DT; " \
                                "fi; " \
                        "fi; " \
                "else " \
-                       "bootm; " \
+                       "bootz; " \
                "fi;\0" \
        "mmcboot=mmc dev ${mmcdev}; " \
                "if mmc rescan; then " \
                                "echo Running uenvcmd ...;" \
                                "run uenvcmd;" \
                        "fi;" \
-                       "run mmcloados;" \
+                       "if run loadimage; then " \
+                               "run mmcloados;" \
+                       "fi;" \
                "fi;\0" \
        "spiboot=echo Booting from spi ...; " \
                "run spiargs; " \
                "sf probe ${spibusno}:0; " \
                "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
-               "bootm ${loadaddr}\0" \
+               "bootz ${loadaddr}\0" \
        "netboot=echo Booting from network ...; " \
                "setenv autoload no; " \
                "dhcp; " \
                "tftp ${loadaddr} ${bootfile}; " \
                "tftp ${fdtaddr} ${fdtfile}; " \
                "run netargs; " \
-               "bootm ${loadaddr} - ${fdtaddr}\0" \
+               "bootz ${loadaddr} - ${fdtaddr}\0" \
        "ramboot=echo Booting from ramdisk ...; " \
                "run ramargs; " \
-               "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
+               "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
        "findfdt="\
                "if test $board_name = A335BONE; then " \
                        "setenv fdtfile am335x-bone.dtb; fi; " \
        "run mmcboot;" \
        "run nandboot;"
 
-/* USB Composite download gadget - g_dnl */
-#define CONFIG_USB_GADGET
-#define CONFIG_USBDOWNLOAD_GADGET
-
-/* USB TI's IDs */
-#define CONFIG_G_DNL_VENDOR_NUM 0x0403
-#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
-#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
-
-/* USB Device Firmware Update support */
-#define CONFIG_DFU_FUNCTION
-#define CONFIG_DFU_MMC
-#define CONFIG_CMD_DFU
-#define DFU_ALT_INFO_MMC \
-       "boot part 0 1;" \
-       "rootfs part 0 2;" \
-       "MLO fat 0 1;" \
-       "MLO.raw mmc 100 100;" \
-       "u-boot.img.raw mmc 300 400;" \
-       "spl-os-args.raw mmc 80 80;" \
-       "spl-os-image.raw mmc 900 2000;" \
-       "spl-os-args fat 0 1;" \
-       "spl-os-image fat 0 1;" \
-       "u-boot.img fat 0 1;" \
-       "uEnv.txt fat 0 1"
-#ifdef CONFIG_NAND
-#define CONFIG_DFU_NAND
-#define DFU_ALT_INFO_NAND \
-       "SPL part 0 1;" \
-       "SPL.backup1 part 0 2;" \
-       "SPL.backup2 part 0 3;" \
-       "SPL.backup3 part 0 4;" \
-       "u-boot part 0 5;" \
-       "u-boot-spl-os part 0 6;" \
-       "kernel part 0 8;" \
-       "rootfs part 0 9"
-#endif
-
 /* NS16550 Configuration */
 #define CONFIG_SYS_NS16550_COM1                0x44e09000      /* Base EVM has UART0 */
 #define CONFIG_SYS_NS16550_COM2                0x48022000      /* UART1 */
 #define CONFIG_SYS_NS16550_COM6                0x481aa000      /* UART5 */
 #define CONFIG_BAUDRATE                        115200
 
-/* I2C Configuration */
 #define CONFIG_CMD_EEPROM
 #define CONFIG_ENV_EEPROM_IS_ON_I2C
 #define CONFIG_SYS_I2C_EEPROM_ADDR     0x50    /* Main EEPROM */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 #define CONFIG_SYS_I2C_MULTI_EEPROMS
 
+/* PMIC support */
+#define CONFIG_POWER_TPS65217
+#define CONFIG_POWER_TPS65910
+
 /* SPL */
 #ifndef CONFIG_NOR_BOOT
+#define CONFIG_SPL_POWER_SUPPORT
 #define CONFIG_SPL_YMODEM_SUPPORT
+
+/* Bootcount using the RTC block */
+#define CONFIG_BOOTCOUNT_LIMIT
+#define CONFIG_BOOTCOUNT_AM33XX
+
+/* CPSW support */
+#define CONFIG_SPL_ETH_SUPPORT
+
+/* USB gadget RNDIS */
+#define CONFIG_SPL_MUSB_NEW_SUPPORT
+
+/* General network SPL, both CPSW and USB gadget RNDIS */
 #define CONFIG_SPL_NET_SUPPORT
 #define CONFIG_SPL_ENV_SUPPORT
 #define CONFIG_SPL_NET_VCI_STRING      "AM335x U-Boot SPL"
-#define CONFIG_SPL_ETH_SUPPORT
+
+/* SPI flash. */
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_BUS             0
 #define CONFIG_SPL_SPI_CS              0
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x20000
-#define CONFIG_SPL_MUSB_NEW_SUPPORT
+
 #define CONFIG_SPL_LDSCRIPT            "$(CPUDIR)/am33xx/u-boot-spl.lds"
 
 #ifdef CONFIG_NAND
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_NAND_OMAP_ELM
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT     (CONFIG_SYS_NAND_BLOCK_SIZE / \
                                         CONFIG_SYS_NAND_PAGE_SIZE)
 
 #define CONFIG_SYS_NAND_ECCSIZE                512
 #define CONFIG_SYS_NAND_ECCBYTES       14
-
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+#define CONFIG_NAND_OMAP_ECCSCHEME     OMAP_ECC_BCH8_CODE_HW
 #define CONFIG_SYS_NAND_U_BOOT_START   CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_OFFS    0x80000
 #endif
 #endif
 
 /*
- * USB configuration
+ * USB configuration.  We enable MUSB support, both for host and for
+ * gadget.  We set USB0 as peripheral and USB1 as host, based on the
+ * board schematic and physical port wired to each.  Then for host we
+ * add mass storage support and for gadget we add both RNDIS ethernet
+ * and DFU.
  */
 #define CONFIG_USB_MUSB_DSPS
 #define CONFIG_ARCH_MISC_INIT
 #define CONFIG_MUSB_GADGET
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
+#define CONFIG_USB_GADGET
+#define CONFIG_USBDOWNLOAD_GADGET
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW    2
 #define CONFIG_MUSB_HOST
 #define CONFIG_USB_ETHER
 #define CONFIG_USB_ETH_RNDIS
 #define CONFIG_USBNET_HOST_ADDR        "de:ad:be:af:00:00"
+
+/* USB TI's IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x0403
+#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #endif /* CONFIG_MUSB_GADGET */
 
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
 #undef CONFIG_SPL_ETH_SUPPORT
 #endif
 
+/* USB Device Firmware Update support */
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
+#define CONFIG_CMD_DFU
+#define DFU_ALT_INFO_MMC \
+       "boot part 0 1;" \
+       "rootfs part 0 2;" \
+       "MLO fat 0 1;" \
+       "MLO.raw mmc 100 100;" \
+       "u-boot.img.raw mmc 300 400;" \
+       "spl-os-args.raw mmc 80 80;" \
+       "spl-os-image.raw mmc 900 2000;" \
+       "spl-os-args fat 0 1;" \
+       "spl-os-image fat 0 1;" \
+       "u-boot.img fat 0 1;" \
+       "uEnv.txt fat 0 1"
+#ifdef CONFIG_NAND
+#define CONFIG_DFU_NAND
+#define DFU_ALT_INFO_NAND \
+       "SPL part 0 1;" \
+       "SPL.backup1 part 0 2;" \
+       "SPL.backup2 part 0 3;" \
+       "SPL.backup3 part 0 4;" \
+       "u-boot part 0 5;" \
+       "u-boot-spl-os part 0 6;" \
+       "kernel part 0 8;" \
+       "rootfs part 0 9"
+#endif
+#define CONFIG_DFU_RAM
+#define DFU_ALT_INFO_RAM \
+       "kernel ram 0x80200000 0xD80000;" \
+       "fdt ram 0x80F80000 0x80000;" \
+       "ramdisk ram 0x81000000 0x4000000"
+
 /*
  * Default to using SPI for environment, etc.
  * 0x000000 - 0x020000 : SPL (128KiB)
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV         1
 #define CONFIG_SYS_MMC_ENV_PART                2
+#define CONFIG_ENV_OFFSET              0x0
+#define CONFIG_ENV_OFFSET_REDUND       (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 #endif
 
 /* SPI flash. */