Merge git://www.denx.de/git/u-boot-sunxi
[platform/kernel/u-boot.git] / include / configs / sunxi-common.h
index 6a3044f..ce038ed 100644 (file)
 
 #define CONFIG_SYS_TEXT_BASE           0x4a000000
 
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DM)
+# define CONFIG_CMD_DM
+# define CONFIG_DM_GPIO
+# define CONFIG_DM_SERIAL
+# define CONFIG_DW_SERIAL
+# define CONFIG_SYS_MALLOC_F_LEN       (1 << 10)
+#endif
+
 /*
  * Display CPU information
  */
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 /* ns16550 reg in the low bits of cpu reg */
-#define CONFIG_SYS_NS16550_REG_SIZE    -4
 #define CONFIG_SYS_NS16550_CLK         24000000
-#define CONFIG_SYS_NS16550_COM1                SUNXI_UART0_BASE
-#define CONFIG_SYS_NS16550_COM2                SUNXI_UART1_BASE
-#define CONFIG_SYS_NS16550_COM3                SUNXI_UART2_BASE
-#define CONFIG_SYS_NS16550_COM4                SUNXI_UART3_BASE
+#ifndef CONFIG_DM_SERIAL
+# define CONFIG_SYS_NS16550_REG_SIZE   -4
+# define CONFIG_SYS_NS16550_COM1               SUNXI_UART0_BASE
+# define CONFIG_SYS_NS16550_COM2               SUNXI_UART1_BASE
+# define CONFIG_SYS_NS16550_COM3               SUNXI_UART2_BASE
+# define CONFIG_SYS_NS16550_COM4               SUNXI_UART3_BASE
+# define CONFIG_SYS_NS16550_COM5               SUNXI_R_UART_BASE
+#endif
 
 /* DRAM Base */
 #define CONFIG_SYS_SDRAM_BASE          0x40000000
@@ -77,6 +88,7 @@
 #define CONFIG_INITRD_TAG
 
 /* mmc config */
+#if !defined(CONFIG_UART0_PORT_F)
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
 #define CONFIG_CMD_MMC
@@ -84,6 +96,7 @@
 #define CONFIG_MMC_SUNXI_SLOT          0
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV         0       /* first detected MMC controller */
+#endif
 
 /* 4MB of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + (4 << 20))
  * Miscellaneous configurable options
  */
 #define CONFIG_CMD_ECHO
-#define CONFIG_SYS_CBSIZE      256     /* Console I/O Buffer Size */
-#define CONFIG_SYS_PBSIZE      384     /* Print Buffer Size */
+#define CONFIG_SYS_CBSIZE      1024    /* Console I/O Buffer Size */
+#define CONFIG_SYS_PBSIZE      1024    /* Print Buffer Size */
 #define CONFIG_SYS_MAXARGS     16      /* max number of command args */
 #define CONFIG_SYS_GENERIC_BOARD
 
 /* Boot Argument Buffer Size */
 #define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
 
-#define CONFIG_SYS_LOAD_ADDR           0x48000000 /* default load address */
+#define CONFIG_SYS_LOAD_ADDR           0x42000000 /* default load address */
 
 /* standalone support */
-#define CONFIG_STANDALONE_LOAD_ADDR    0x48000000
-
-#define CONFIG_SYS_HZ                  1000
+#define CONFIG_STANDALONE_LOAD_ADDR    0x42000000
 
 /* baudrate */
 #define CONFIG_BAUDRATE                        115200
 #define CONFIG_ENV_OFFSET              (544 << 10) /* (8 + 24 + 512) KiB */
 #define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB */
 
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       "bootm_size=0x10000000\0"
-
-#define CONFIG_SYS_BOOT_GET_CMDLINE
-
 #include <config_cmd_default.h>
+#undef CONFIG_CMD_FPGA
 
 #define CONFIG_FAT_WRITE       /* enable write access */
 
 #define CONFIG_SYS_SPL_MALLOC_START    0x4ff00000
 #define CONFIG_SYS_SPL_MALLOC_SIZE     0x00080000      /* 512 KiB */
 
-#undef CONFIG_CMD_FPGA
-#undef CONFIG_CMD_NET
-#undef CONFIG_CMD_NFS
-
 /* I2C */
 #define CONFIG_SPL_I2C_SUPPORT
 #define CONFIG_SYS_I2C
 
 /* GPIO */
 #define CONFIG_SUNXI_GPIO
+#define CONFIG_SPL_GPIO_SUPPORT
 #define CONFIG_CMD_GPIO
 
 /* Ethernet support */
 #define CONFIG_PHYLIB
 #endif
 
-#ifdef CONFIG_CMD_NET
-#define CONFIG_CMD_NFS
-#define CONFIG_CMD_DNS
-#define CONFIG_NETCONSOLE
-#define CONFIG_BOOTP_DNS2
-#define CONFIG_BOOTP_SEND_HOSTNAME
-#endif
-
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_CMD_USB
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 1
 
 #ifndef CONFIG_SPL_BUILD
 #include <config_distro_defaults.h>
+
+/* 256M RAM (minimum), 32M uncompressed kernel, 16M compressed kernel, 1M fdt,
+ * 1M script, 1M pxe and the ramdisk at the end */
+#define MEM_LAYOUT_ENV_SETTINGS \
+       "bootm_size=0x10000000\0" \
+       "kernel_addr_r=0x42000000\0" \
+       "fdt_addr_r=0x43000000\0" \
+       "scriptaddr=0x43100000\0" \
+       "pxefile_addr_r=0x43200000\0" \
+       "ramdisk_addr_r=0x43300000\0"
+
+#ifdef CONFIG_MMC
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
+#else
+#define BOOT_TARGET_DEVICES_MMC(func)
+#endif
+
+#ifdef CONFIG_AHCI
+#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
+#else
+#define BOOT_TARGET_DEVICES_SCSI(func)
+#endif
+
+#ifdef CONFIG_USB_EHCI
+#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
+#else
+#define BOOT_TARGET_DEVICES_USB(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+       BOOT_TARGET_DEVICES_MMC(func) \
+       BOOT_TARGET_DEVICES_SCSI(func) \
+       BOOT_TARGET_DEVICES_USB(func) \
+       func(PXE, pxe, na) \
+       func(DHCP, dhcp, na)
+
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       MEM_LAYOUT_ENV_SETTINGS \
+       "fdtfile=" CONFIG_FDTFILE "\0" \
+       "console=ttyS0,115200\0" \
+       BOOTENV
+
+#else /* ifndef CONFIG_SPL_BUILD */
+#define CONFIG_EXTRA_ENV_SETTINGS
 #endif
 
 #endif /* _SUNXI_COMMON_CONFIG_H */