]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/configs/sunxi-common.h
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[people/ms/u-boot.git] / include / configs / sunxi-common.h
index 8de9c2b70632ef9bf7b11fd7151b1733a5874bb9..1d475b10ddf491eca0ecf34bae39bc2c92c9bc60 100644 (file)
 # define CONFIG_MACH_TYPE_COMPAT_REV   1
 #endif
 
-/*
- * High Level Configuration Options
- */
-#define CONFIG_SUNXI           /* sunxi family */
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_SYS_THUMB_BUILD /* Thumbs mode to save space in SPL */
-#endif
-
 /* Serial & console */
 #define CONFIG_SYS_NS16550_SERIAL
 /* ns16550 reg in the low bits of cpu reg */
@@ -54,8 +46,7 @@
 #endif
 
 /* CPU */
-#define CONFIG_DISPLAY_CPUINFO
-#define CONFIG_TIMER_CLK_FREQ          24000000
+#define COUNTER_FREQUENCY              24000000
 
 /*
  * The DRAM Base differs between some models. We cannot use macros for the
@@ -69,7 +60,6 @@
 #define CONFIG_SYS_SDRAM_BASE          0x20000000
 #define CONFIG_SYS_LOAD_ADDR           0x22000000 /* default load address */
 #define CONFIG_SYS_TEXT_BASE           0x2a000000
-#define CONFIG_PRE_CON_BUF_ADDR                0x2f000000
 /* Note SPL_STACK_R_ADDR is set through Kconfig, we include it here 
  * since it needs to fit in with the other values. By also #defining it
  * we get warnings if the Kconfig value mismatches. */
@@ -80,7 +70,6 @@
 #define CONFIG_SYS_SDRAM_BASE          0x40000000
 #define CONFIG_SYS_LOAD_ADDR           0x42000000 /* default load address */
 #define CONFIG_SYS_TEXT_BASE           0x4a000000
-#define CONFIG_PRE_CON_BUF_ADDR                0x4f000000
 /* Note SPL_STACK_R_ADDR is set through Kconfig, we include it here 
  * since it needs to fit in with the other values. By also #defining it
  * we get warnings if the Kconfig value mismatches. */
@@ -90,7 +79,7 @@
 
 #define CONFIG_SPL_BSS_MAX_SIZE                0x00080000 /* 512 KiB */
 
-#if defined(CONFIG_MACH_SUN9I) || defined(CONFIG_MACH_SUN50I)
+#ifdef CONFIG_SUNXI_HIGH_SRAM
 /*
  * The A80's A1 sram starts at 0x00010000 rather then at 0x00000000 and is
  * slightly bigger. Note that it is possible to map the first 32 KiB of the
 #define CONFIG_SYS_NAND_MAX_ECCPOS 1664
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 #define CONFIG_SYS_MAX_NAND_DEVICE 8
+
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
 #endif
 
 #ifdef CONFIG_SPL_SPI_SUNXI
 
 /* mmc config */
 #ifdef CONFIG_MMC
-#define CONFIG_GENERIC_MMC
-#define CONFIG_MMC_SUNXI
 #define CONFIG_MMC_SUNXI_SLOT          0
-#define CONFIG_ENV_IS_IN_MMC
+#endif
+
+#if defined(CONFIG_ENV_IS_IN_MMC)
 #define CONFIG_SYS_MMC_ENV_DEV         0       /* first detected MMC controller */
+#define CONFIG_SYS_MMC_MAX_DEVICE      4
+#elif defined(CONFIG_ENV_IS_NOWHERE)
+#define CONFIG_ENV_SIZE                        (128 << 10)
 #endif
 
 /* 64MB of malloc() pool */
 /* standalone support */
 #define CONFIG_STANDALONE_LOAD_ADDR    CONFIG_SYS_LOAD_ADDR
 
-/* baudrate */
-#define CONFIG_BAUDRATE                        115200
-
-/* The stack sizes are set up in start.S using the settings below */
-#define CONFIG_STACKSIZE               (256 << 10)     /* 256 KiB */
-
 /* FLASH and environment organization */
 
-#define CONFIG_SYS_NO_FLASH
-
 #define CONFIG_SYS_MONITOR_LEN         (768 << 10)     /* 768 KiB */
-#define CONFIG_IDENT_STRING            " Allwinner Technology"
-#define CONFIG_DISPLAY_BOARDINFO
-
-#define CONFIG_ENV_OFFSET              (544 << 10) /* (8 + 24 + 512) KiB */
-#define CONFIG_ENV_SIZE                        (128 << 10)     /* 128 KiB */
 
 #define CONFIG_FAT_WRITE       /* enable write access */
 
 #define CONFIG_SPL_FRAMEWORK
 
+#ifndef CONFIG_ARM64           /* AArch64 FEL support is not ready yet */
 #define CONFIG_SPL_BOARD_LOAD_IMAGE
+#endif
 
-#if defined(CONFIG_MACH_SUN9I)
+#ifdef CONFIG_SUNXI_HIGH_SRAM
 #define CONFIG_SPL_TEXT_BASE           0x10040         /* sram start+header */
-#define CONFIG_SPL_MAX_SIZE            0x5fc0          /* ? KiB on sun9i */
-#elif defined(CONFIG_MACH_SUN50I)
-#define CONFIG_SPL_TEXT_BASE           0x10040         /* sram start+header */
-#define CONFIG_SPL_MAX_SIZE            0x7fc0          /* 32 KiB on sun50i */
+#define CONFIG_SPL_MAX_SIZE            0x7fc0          /* 32 KiB */
+#define LOW_LEVEL_SRAM_STACK           0x00018000
 #else
 #define CONFIG_SPL_TEXT_BASE           0x40            /* sram start+header */
 #define CONFIG_SPL_MAX_SIZE            0x5fc0          /* 24KB on sun4i/sun7i */
+#define LOW_LEVEL_SRAM_STACK           0x00008000      /* End of sram */
 #endif
 
+#define CONFIG_SPL_STACK               LOW_LEVEL_SRAM_STACK
+
 #ifndef CONFIG_ARM64
 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds"
 #endif
 
-#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        80      /* 40KiB */
 #define CONFIG_SPL_PAD_TO              32768           /* decimal for 'dd' */
 
-#if defined(CONFIG_MACH_SUN9I) || defined(CONFIG_MACH_SUN50I)
-/* FIXME: 40 KiB instead of 32 KiB ? */
-#define LOW_LEVEL_SRAM_STACK           0x00018000
-#define CONFIG_SPL_STACK               LOW_LEVEL_SRAM_STACK
-#else
-/* end of 32 KiB in sram */
-#define LOW_LEVEL_SRAM_STACK           0x00008000 /* End of sram */
-#define CONFIG_SPL_STACK               LOW_LEVEL_SRAM_STACK
-#endif
 
 /* I2C */
 #if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER || \
@@ -293,17 +268,13 @@ extern int soft_i2c_gpio_scl;
 
 #define CONFIG_VIDEO_SUNXI
 
-#define CONFIG_CFB_CONSOLE
-#define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_STD_TIMINGS
 #define CONFIG_I2C_EDID
 #define VIDEO_LINE_LEN (pGD->plnSizeX)
 
 /* allow both serial and cfb console. */
-#define CONFIG_CONSOLE_MUX
 /* stop x86 thinking in cfbconsole from trying to init a pc keyboard */
-#define CONFIG_VGA_AS_SINGLE_DEVICE
 
 #endif /* CONFIG_VIDEO */
 
@@ -333,15 +304,10 @@ extern int soft_i2c_gpio_scl;
 #endif
 
 #ifdef CONFIG_USB_MUSB_GADGET
-#define CONFIG_USB_FUNCTION_DFU
 #define CONFIG_USB_FUNCTION_FASTBOOT
 #define CONFIG_USB_FUNCTION_MASS_STORAGE
 #endif
 
-#ifdef CONFIG_USB_FUNCTION_DFU
-#define CONFIG_DFU_RAM
-#endif
-
 #ifdef CONFIG_USB_FUNCTION_FASTBOOT
 #define CONFIG_CMD_FASTBOOT
 #define CONFIG_FASTBOOT_BUF_ADDR       CONFIG_SYS_LOAD_ADDR
@@ -352,7 +318,6 @@ extern int soft_i2c_gpio_scl;
 
 #ifdef CONFIG_MMC
 #define CONFIG_FASTBOOT_FLASH_MMC_DEV  0
-#define CONFIG_EFI_PARTITION
 #endif
 #endif
 
@@ -360,29 +325,15 @@ extern int soft_i2c_gpio_scl;
 #endif
 
 #ifdef CONFIG_USB_KEYBOARD
-#define CONFIG_CONSOLE_MUX
 #define CONFIG_PREBOOT
-#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
 #endif
 
-#if !defined CONFIG_ENV_IS_IN_MMC && \
-    !defined CONFIG_ENV_IS_IN_NAND && \
-    !defined CONFIG_ENV_IS_IN_FAT && \
-    !defined CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_IS_NOWHERE
-#endif
-
 #define CONFIG_MISC_INIT_R
-#define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
 #ifndef CONFIG_SPL_BUILD
 #include <config_distro_defaults.h>
 
-/* Enable pre-console buffer to get complete log on the VGA console */
-#define CONFIG_PRE_CONSOLE_BUFFER
-#define CONFIG_PRE_CON_BUF_SZ          4096 /* Aprox 2 80*25 screens */
-
 #ifdef CONFIG_ARM64
 /*
  * Boards seem to come with at least 512MB of DRAM.
@@ -507,6 +458,20 @@ extern int soft_i2c_gpio_scl;
        "stderr=serial\0"
 #endif
 
+#ifdef CONFIG_MTDIDS_DEFAULT
+#define SUNXI_MTDIDS_DEFAULT \
+       "mtdids=" CONFIG_MTDIDS_DEFAULT "\0"
+#else
+#define SUNXI_MTDIDS_DEFAULT
+#endif
+
+#ifdef CONFIG_MTDPARTS_DEFAULT
+#define SUNXI_MTDPARTS_DEFAULT \
+       "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
+#else
+#define SUNXI_MTDPARTS_DEFAULT
+#endif
+
 #define CONSOLE_ENV_SETTINGS \
        CONSOLE_STDIN_SETTINGS \
        CONSOLE_STDOUT_SETTINGS
@@ -517,6 +482,8 @@ extern int soft_i2c_gpio_scl;
        DFU_ALT_INFO_RAM \
        "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
        "console=ttyS0,115200\0" \
+       SUNXI_MTDIDS_DEFAULT \
+       SUNXI_MTDPARTS_DEFAULT \
        BOOTCMD_SUNXI_COMPAT \
        BOOTENV