From 8474a81f96740d4e65d5be3963b0498a4da1141f73e70d0b04b9135f4540b3cb Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Wed, 29 Jan 2014 21:22:37 +0000 Subject: [PATCH] Accepting request 215532 from Base:System Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with fix_spl_build_for_am335x.patch to reduce size of am335x SPL (forwarded request 215393 from Guillaume_G) OBS-URL: https://build.opensuse.org/request/show/215532 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/u-boot?expand=0&rev=21 --- 0006-ARMV7-hardfp-build-fix.patch | 5 +- fix_spl_build_for_am335x.patch | 11 + gnuhash.patch | 24 + mlo-ext2.patch | 86 +- u-boot-2013.10.tar.bz2 | 3 - u-boot-2014.01.tar.bz2 | 3 + u-boot-am335xevm.changes | 31 + u-boot-am335xevm.spec | 16 +- u-boot-arndale.changes | 31 + u-boot-arndale.spec | 16 +- u-boot-colibrit20iris.changes | 31 + u-boot-colibrit20iris.spec | 16 +- u-boot-cubieboard.changes | 31 + u-boot-cubieboard.spec | 16 +- u-boot-highbank.changes | 31 + u-boot-highbank.spec | 16 +- u-boot-hyundaia7hd.changes | 31 + u-boot-hyundaia7hd.spec | 16 +- u-boot-melea1000.changes | 31 + u-boot-melea1000.spec | 16 +- u-boot-mx53loco.changes | 31 + u-boot-mx53loco.spec | 16 +- u-boot-omap3beagle.changes | 31 + u-boot-omap3beagle.spec | 16 +- u-boot-omap4panda.changes | 31 + u-boot-omap4panda.spec | 16 +- u-boot-paz00.changes | 31 + u-boot-paz00.spec | 16 +- u-boot-rpib.changes | 31 + u-boot-rpib.spec | 16 +- u-boot.changes | 31 + u-boot.spec | 2 +- u-boot.spec.in | 16 +- v2013.10-sunxi.patch => v2014.01-sunxi.patch | 3462 +++++++++--------- 34 files changed, 2315 insertions(+), 1892 deletions(-) create mode 100644 fix_spl_build_for_am335x.patch create mode 100644 gnuhash.patch delete mode 100644 u-boot-2013.10.tar.bz2 create mode 100644 u-boot-2014.01.tar.bz2 rename v2013.10-sunxi.patch => v2014.01-sunxi.patch (78%) diff --git a/0006-ARMV7-hardfp-build-fix.patch b/0006-ARMV7-hardfp-build-fix.patch index 06e9b55..14da707 100644 --- a/0006-ARMV7-hardfp-build-fix.patch +++ b/0006-ARMV7-hardfp-build-fix.patch @@ -1,10 +1,11 @@ --- ./arch/arm/config.mk.orig 2013-11-21 15:32:54.101087262 +0100 +++ ./arch/arm/config.mk 2013-11-21 15:33:03.803861493 +0100 -@@ -17,7 +17,7 @@ endif +@@ -17,8 +17,7 @@ endif LDFLAGS_FINAL += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \ -- -fno-common -ffixed-r9 -msoft-float +- -fno-common -ffixed-r9 +-PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) + -fno-common -ffixed-r9 # Support generic board on ARM diff --git a/fix_spl_build_for_am335x.patch b/fix_spl_build_for_am335x.patch new file mode 100644 index 0000000..54abc1e --- /dev/null +++ b/fix_spl_build_for_am335x.patch @@ -0,0 +1,11 @@ +--- ./include/configs/ti_armv7_common.h.orig 2014-01-28 15:27:45.324738440 +0100 ++++ ./include/configs/ti_armv7_common.h 2014-01-28 15:36:34.847432559 +0100 +@@ -172,7 +172,7 @@ + #ifndef CONFIG_NOR_BOOT + #define CONFIG_SPL + #define CONFIG_SPL_FRAMEWORK +-#define CONFIG_SPL_OS_BOOT ++/* #define CONFIG_SPL_OS_BOOT */ + + /* + * Place the image at the start of the ROM defined image space. diff --git a/gnuhash.patch b/gnuhash.patch new file mode 100644 index 0000000..ebf4dc9 --- /dev/null +++ b/gnuhash.patch @@ -0,0 +1,24 @@ +diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds +index 4da5d24..fb8bfaf 100644 +--- a/arch/arm/cpu/u-boot.lds ++++ b/arch/arm/cpu/u-boot.lds +@@ -97,6 +97,7 @@ SECTIONS + .dynamic : { *(.dynamic*) } + .plt : { *(.plt*) } + .interp : { *(.interp*) } ++ .gnu.hash : { *(.gnu.hash) } + .gnu : { *(.gnu*) } + .ARM.exidx : { *(.ARM.exidx*) } + .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } +diff --git a/board/ti/am335x/u-boot.lds b/board/ti/am335x/u-boot.lds +index 6a734b3..fec4ccf 100644 +--- a/board/ti/am335x/u-boot.lds ++++ b/board/ti/am335x/u-boot.lds +@@ -113,6 +113,7 @@ SECTIONS + .dynstr : { *(.dynstr*) } + .dynamic : { *(.dynamic*) } + .hash : { *(.hash*) } ++ .gnu.hash : { *(.gnu.hash) } + .plt : { *(.plt*) } + .interp : { *(.interp*) } + .gnu : { *(.gnu*) } diff --git a/mlo-ext2.patch b/mlo-ext2.patch index fc0ebe3..d13e7ab 100644 --- a/mlo-ext2.patch +++ b/mlo-ext2.patch @@ -1,5 +1,20 @@ ---- ./common/spl/spl_mmc.c.orig 2013-11-25 10:36:58.994214337 +0100 -+++ ./common/spl/spl_mmc.c 2013-11-25 10:53:09.983264655 +0100 +diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c +index 2922816..39a94ad 100644 +--- a/arch/arm/cpu/armv7/omap3/board.c ++++ b/arch/arm/cpu/armv7/omap3/board.c +@@ -61,6 +61,8 @@ u32 omap3_boot_device = BOOT_DEVICE_NAND; + /* auto boot mode detection is not possible for OMAP3 - hard code */ + u32 spl_boot_mode(void) + { ++ return MMCSD_MODE_FAT; ++ + switch (spl_boot_device()) { + case BOOT_DEVICE_MMC2: + return MMCSD_MODE_RAW; +diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c +index fc2f226..fc60e98 100644 +--- a/common/spl/spl_mmc.c ++++ b/common/spl/spl_mmc.c @@ -11,6 +11,7 @@ #include #include @@ -8,7 +23,7 @@ #include #include -@@ -70,6 +71,58 @@ static int mmc_load_image_raw_os(struct +@@ -70,6 +71,58 @@ static int mmc_load_image_raw_os(struct mmc *mmc) #endif #ifdef CONFIG_SPL_FAT_SUPPORT @@ -67,12 +82,14 @@ static int mmc_load_image_fat(struct mmc *mmc, const char *filename) { int err; -@@ -142,6 +195,8 @@ void spl_mmc_load_image(void) +@@ -141,7 +194,9 @@ void spl_mmc_load_image(void) + hang(); } - boot_mode = spl_boot_mode(); +- boot_mode = spl_boot_mode(); ++// boot_mode = spl_boot_mode(); + boot_mode = MMCSD_MODE_FAT; /* Fix OMAP4 boot */ -+ ++ if (boot_mode == MMCSD_MODE_RAW) { debug("boot mode - RAW\n"); #ifdef CONFIG_SPL_OS_BOOT @@ -104,8 +121,22 @@ #endif } else { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT ---- ./include/configs/omap3_beagle.h.orig 2013-11-21 14:01:46.884722728 +0100 -+++ ./include/configs/omap3_beagle.h 2013-11-21 14:05:56.469711684 +0100 +diff --git a/fs/Makefile b/fs/Makefile +index 34dc035..a09ada5 100644 +--- a/fs/Makefile ++++ b/fs/Makefile +@@ -8,6 +8,7 @@ + + ifdef CONFIG_SPL_BUILD + obj-$(CONFIG_SPL_FAT_SUPPORT) += fat/ ++obj-$(CONFIG_SPL_FAT_SUPPORT) += ext4/ + else + obj-y += fs.o + +diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h +index c58bc91..7ecae0c 100644 +--- a/include/configs/omap3_beagle.h ++++ b/include/configs/omap3_beagle.h @@ -40,6 +40,7 @@ #define CONFIG_OF_LIBFDT @@ -114,7 +145,7 @@ #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ #define CONFIG_SETUP_MEMORY_TAGS 1 -@@ -249,7 +250,7 @@ +@@ -250,7 +251,7 @@ "if test $fdtfile = undefined; then " \ "echo WARNING: Could not determine device tree to use; fi; \0" \ "bootenv=uEnv.txt\0" \ @@ -123,17 +154,11 @@ "importbootenv=echo Importing environment from mmc ...; " \ "env import -t $loadaddr $filesize\0" \ "ramargs=setenv bootargs console=${console} " \ ---- ./include/configs/omap4_common.h.orig 2013-11-21 14:05:29.066372667 +0100 -+++ ./include/configs/omap4_common.h 2013-11-21 14:06:39.260679071 +0100 -@@ -111,6 +111,7 @@ - #define CONFIG_CMD_FAT /* FAT support */ - #define CONFIG_CMD_I2C /* I2C serial bus support */ - #define CONFIG_CMD_MMC /* MMC support */ -+#define CONFIG_SUPPORT_RAW_INITRD /* bootz raw initrd support */ - - /* Disabled commands */ - #undef CONFIG_CMD_NET -@@ -148,10 +149,10 @@ +diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h +index d099bfd..24b2ceb 100644 +--- a/include/configs/omap4_common.h ++++ b/include/configs/omap4_common.h +@@ -104,10 +104,10 @@ "vram=${vram} " \ "root=${mmcroot} " \ "rootfstype=${mmcrootfstype}\0" \ @@ -146,24 +171,3 @@ "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ "env import -t ${loadaddr} ${filesize}\0" \ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ ---- ./spl/Makefile.orig 2013-11-21 14:10:09.094607542 +0100 -+++ ./spl/Makefile 2013-11-21 14:10:21.476307890 +0100 -@@ -86,6 +86,7 @@ LIBS-$(CONFIG_SPL_SERIAL_SUPPORT) += dri - LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/libspi_flash.o - LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o - LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/libfat.o -+LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/ext4/libext4fs.o - LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/libgeneric.o - LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/libpower.o \ - drivers/power/pmic/libpmic.o ---- arch/arm/cpu/armv7/omap3/board.c.orig 2013-11-21 15:21:32.962225786 +0100 -+++ arch/arm/cpu/armv7/omap3/board.c 2013-11-21 15:22:26.797911840 +0100 -@@ -61,6 +61,8 @@ u32 omap3_boot_device = BOOT_DEVICE_NAND - /* auto boot mode detection is not possible for OMAP3 - hard code */ - u32 spl_boot_mode(void) - { -+ return MMCSD_MODE_FAT; -+ - switch (spl_boot_device()) { - case BOOT_DEVICE_MMC2: - return MMCSD_MODE_RAW; diff --git a/u-boot-2013.10.tar.bz2 b/u-boot-2013.10.tar.bz2 deleted file mode 100644 index 027e017..0000000 --- a/u-boot-2013.10.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55 -size 10027248 diff --git a/u-boot-2014.01.tar.bz2 b/u-boot-2014.01.tar.bz2 new file mode 100644 index 0000000..0ca0ef5 --- /dev/null +++ b/u-boot-2014.01.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdaf8c81583abfa2e73da46cfcf87b0cbd9741d9aa766f3b905376e3652d543d +size 10180625 diff --git a/u-boot-am335xevm.changes b/u-boot-am335xevm.changes index 0cf2df6..23f933e 100644 --- a/u-boot-am335xevm.changes +++ b/u-boot-am335xevm.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-am335xevm.spec b/u-boot-am335xevm.spec index cd1587f..ed3babb 100644 --- a/u-boot-am335xevm.spec +++ b/u-boot-am335xevm.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-am335xevm -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the am335xevm arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" am335x_evm_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-arndale.changes b/u-boot-arndale.changes index 0cf2df6..23f933e 100644 --- a/u-boot-arndale.changes +++ b/u-boot-arndale.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-arndale.spec b/u-boot-arndale.spec index 845239f..d10c399 100644 --- a/u-boot-arndale.spec +++ b/u-boot-arndale.spec @@ -24,7 +24,7 @@ %define arndale_spl 1 Name: u-boot-arndale -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the arndale arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" arndale_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-colibrit20iris.changes b/u-boot-colibrit20iris.changes index 0cf2df6..23f933e 100644 --- a/u-boot-colibrit20iris.changes +++ b/u-boot-colibrit20iris.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-colibrit20iris.spec b/u-boot-colibrit20iris.spec index 474bd0e..20b23d6 100644 --- a/u-boot-colibrit20iris.spec +++ b/u-boot-colibrit20iris.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-colibrit20iris -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the colibrit20iris arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" colibri_t20_iris_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-cubieboard.changes b/u-boot-cubieboard.changes index 0cf2df6..23f933e 100644 --- a/u-boot-cubieboard.changes +++ b/u-boot-cubieboard.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-cubieboard.spec b/u-boot-cubieboard.spec index 3962dd0..17fcbde 100644 --- a/u-boot-cubieboard.spec +++ b/u-boot-cubieboard.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-cubieboard -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the cubieboard arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" cubieboard_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-highbank.changes b/u-boot-highbank.changes index 0cf2df6..23f933e 100644 --- a/u-boot-highbank.changes +++ b/u-boot-highbank.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-highbank.spec b/u-boot-highbank.spec index c775e54..6e8df32 100644 --- a/u-boot-highbank.spec +++ b/u-boot-highbank.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-highbank -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the highbank arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" highbank_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-hyundaia7hd.changes b/u-boot-hyundaia7hd.changes index 0cf2df6..23f933e 100644 --- a/u-boot-hyundaia7hd.changes +++ b/u-boot-hyundaia7hd.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-hyundaia7hd.spec b/u-boot-hyundaia7hd.spec index 9ab9258..f80d629 100644 --- a/u-boot-hyundaia7hd.spec +++ b/u-boot-hyundaia7hd.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-hyundaia7hd -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the hyundaia7hd arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" hyundai_a7hd_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-melea1000.changes b/u-boot-melea1000.changes index 0cf2df6..23f933e 100644 --- a/u-boot-melea1000.changes +++ b/u-boot-melea1000.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-melea1000.spec b/u-boot-melea1000.spec index 4f77383..b36c4f7 100644 --- a/u-boot-melea1000.spec +++ b/u-boot-melea1000.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-melea1000 -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the melea1000 arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" mele_a1000_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-mx53loco.changes b/u-boot-mx53loco.changes index 0cf2df6..23f933e 100644 --- a/u-boot-mx53loco.changes +++ b/u-boot-mx53loco.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-mx53loco.spec b/u-boot-mx53loco.spec index 565048e..c02584e 100644 --- a/u-boot-mx53loco.spec +++ b/u-boot-mx53loco.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-mx53loco -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the mx53loco arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" mx53loco_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.imx %{buildroot}/boot/u-boot.imx # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.imx ]; then - install -D -m 0644 u-boot-dtb.imx %{buildroot}/boot/u-boot.imx -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.imx %{buildroot}/boot/u-boot.imx +elif [ -f u-boot-dtb.imx ]; then + install -D -m 0644 u-boot-dtb.imx %{buildroot}/boot/u-boot.imx else install -D -m 0644 u-boot.imx %{buildroot}/boot/u-boot.imx fi diff --git a/u-boot-omap3beagle.changes b/u-boot-omap3beagle.changes index 0cf2df6..23f933e 100644 --- a/u-boot-omap3beagle.changes +++ b/u-boot-omap3beagle.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-omap3beagle.spec b/u-boot-omap3beagle.spec index 21a080b..bd72d36 100644 --- a/u-boot-omap3beagle.spec +++ b/u-boot-omap3beagle.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-omap3beagle -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the omap3beagle arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" omap3_beagle_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-omap4panda.changes b/u-boot-omap4panda.changes index 0cf2df6..23f933e 100644 --- a/u-boot-omap4panda.changes +++ b/u-boot-omap4panda.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-omap4panda.spec b/u-boot-omap4panda.spec index a4691b9..f59455f 100644 --- a/u-boot-omap4panda.spec +++ b/u-boot-omap4panda.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-omap4panda -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the omap4panda arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" omap4_panda_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-paz00.changes b/u-boot-paz00.changes index 0cf2df6..23f933e 100644 --- a/u-boot-paz00.changes +++ b/u-boot-paz00.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-paz00.spec b/u-boot-paz00.spec index 550974d..eb0c8c8 100644 --- a/u-boot-paz00.spec +++ b/u-boot-paz00.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-paz00 -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the paz00 arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" paz00_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot-rpib.changes b/u-boot-rpib.changes index 0cf2df6..23f933e 100644 --- a/u-boot-rpib.changes +++ b/u-boot-rpib.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot-rpib.spec b/u-boot-rpib.spec index b04d572..1fd8153 100644 --- a/u-boot-rpib.spec +++ b/u-boot-rpib.spec @@ -24,7 +24,7 @@ %define arndale_spl 0 Name: u-boot-rpib -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the rpib arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" rpi_b_config @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.bin ]; then - install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.bin %{buildroot}/boot/u-boot.bin +elif [ -f u-boot-dtb.bin ]; then + install -D -m 0644 u-boot-dtb.bin %{buildroot}/boot/u-boot.bin else install -D -m 0644 u-boot.bin %{buildroot}/boot/u-boot.bin fi diff --git a/u-boot.changes b/u-boot.changes index 0cf2df6..23f933e 100644 --- a/u-boot.changes +++ b/u-boot.changes @@ -1,3 +1,34 @@ +------------------------------------------------------------------- +Tue Jan 28 15:29:14 UTC 2014 - guillaume@opensuse.org + +- Disable CONFIG_SPL_OS_BOOT for ti armv7 configs with +fix_spl_build_for_am335x.patch to reduce size of am335x SPL + +------------------------------------------------------------------- +Sat Jan 26 22:46:44 UTC 2014 - afaerber@suse.de + +- Update to v2014.01 +* Manually updated 0006-ARMV7-hardfp-build-fix.patch +* Dropped v2013.10-sunxi.patch and created + v2014.01-sunxi.patch by merging u-boot.git v2014.01 onto + u-boot-sunxi.git e4a0232e173577893604b94fc3af7c047570970b +* Added gnuhash.patch to fix .gnu.hash section handling in ldscripts +* Rebased mlo-ext2.patch: + omap4_common.h CONFIG_SUPPORT_RAW_INITRD hunk is now covered by + ti_common_initrd_support.patch. + am335xevm build is known breaking due to size constraints not + trivially solvable without dropping our patch. + +------------------------------------------------------------------- +Sun Jan 26 12:14:10 UTC 2014 - afaerber@suse.de + +- Fix regression in packaging u-boot-dtb-tegra.bin: + There is in fact a u-boot-spl.bin SPL being built, + but it is 0xff-padded as u-boot-spl-pad.bin and then + prepended to u-boot.bin and the .dtb. + u-boot-dtb.bin exists independently as just u-boot.bin and .dtb, + so give preference to u-boot-dtb-tegra.bin over u-boot-dtb.bin. + ------------------------------------------------------------------- Mon Jan 20 14:05:13 UTC 2014 - agraf@suse.com diff --git a/u-boot.spec b/u-boot.spec index e4d8de2..8658298 100644 --- a/u-boot.spec +++ b/u-boot.spec @@ -19,7 +19,7 @@ Name: u-boot -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: Tools for the u-boot Firmware License: GPL-2.0 diff --git a/u-boot.spec.in b/u-boot.spec.in index 338b1cd..3bc3092 100644 --- a/u-boot.spec.in +++ b/u-boot.spec.in @@ -24,7 +24,7 @@ %define arndale_spl ARNDALE_SPL Name: u-boot-BOARDNAME -Version: 2013.10 +Version: 2014.01 Release: 0 Summary: The u-boot firmware for the BOARDNAME arm platform License: GPL-2.0 @@ -41,9 +41,11 @@ Patch4: beagle-bootscr.patch Patch5: mx53loco-bootscr.patch Patch6: origen-ext2.patch Patch7: arndale.patch -Patch8: v2013.10-sunxi.patch +Patch8: v2014.01-sunxi.patch Patch9: am335x_evm-bootscr.patch Patch10: rpi_b-bootscr.patch +Patch11: gnuhash.patch +Patch12: fix_spl_build_for_am335x.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # Arndale board need DTC >= 1.4 BuildRequires: dtc >= 1.4.0 @@ -73,7 +75,7 @@ This package contains documentation for u-boot firmware rm -rf board/Marvell # Any custom patches to be applied on top of mainline u-boot %patch1 -%patch2 +%patch2 -p1 %patch3 %patch4 %patch5 @@ -82,6 +84,8 @@ rm -rf board/Marvell %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 +%patch12 %build make %{?jobs:-j %jobs} CFLAGS="$RPM_OPT_FLAGS" BOARDCONFIG @@ -93,10 +97,10 @@ make %{?jobs:-j %jobs} USE_PRIVATE_LIBGG=yes install -D -m 0644 u-boot.BINEND %{buildroot}/boot/u-boot.BINEND # Some times u-boot needs a dtb to configure itself appended to the binary. # In that case prefer the one with a working dtb already appended. -if [ -f u-boot-dtb.BINEND ]; then - install -D -m 0644 u-boot-dtb.BINEND %{buildroot}/boot/u-boot.BINEND -elif [ -f u-boot-dtb-tegra.bin ]; then +if [ -f u-boot-dtb-tegra.bin ]; then install -D -m 0644 u-boot-dtb-tegra.BINEND %{buildroot}/boot/u-boot.BINEND +elif [ -f u-boot-dtb.BINEND ]; then + install -D -m 0644 u-boot-dtb.BINEND %{buildroot}/boot/u-boot.BINEND else install -D -m 0644 u-boot.BINEND %{buildroot}/boot/u-boot.BINEND fi diff --git a/v2013.10-sunxi.patch b/v2014.01-sunxi.patch similarity index 78% rename from v2013.10-sunxi.patch rename to v2014.01-sunxi.patch index 75d7ab2..b160a87 100644 --- a/v2013.10-sunxi.patch +++ b/v2014.01-sunxi.patch @@ -1,6 +1,79 @@ -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/cmd_boot.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/cmd_boot.c ---- u-boot-2013.10/arch/arm/cpu/armv7/cmd_boot.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/cmd_boot.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/Makefile b/Makefile +index 47a03e3..78f09b6 100644 +--- a/Makefile ++++ b/Makefile +@@ -491,6 +491,16 @@ $(obj)u-boot.spr: $(obj)u-boot.img $(obj)spl/u-boot-spl.bin + --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff $@ + cat $(obj)u-boot.img >> $@ + ++# sunxi: Combined object with SPL U-Boot with sunxi header (sunxi-spl.bin) ++# and the full-blown U-Boot attached to it ++$(obj)u-boot-sunxi-with-spl.bin: $(obj)spl/sunxi-spl.bin $(obj)u-boot.img ++ tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_SPL_PAD_TO) \ ++ of=$(obj)spl/sunxi-spl-pad.bin 2>/dev/null ++ dd if=$(obj)spl/sunxi-spl.bin of=$(obj)spl/sunxi-spl-pad.bin \ ++ conv=notrunc 2>/dev/null ++ cat $(obj)spl/sunxi-spl-pad.bin $(obj)u-boot.img > $@ ++ rm $(obj)spl/sunxi-spl-pad.bin ++ + ifneq ($(CONFIG_TEGRA),) + $(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin + $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin +@@ -578,6 +588,9 @@ $(obj)spl/u-boot-spl.bin: $(SUBDIR_TOOLS) depend + $(obj)tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend + $(MAKE) -C spl all CONFIG_TPL_BUILD=y + ++$(obj)spl/sunxi-spl.bin: $(SUBDIR_TOOLS) depend ++ $(MAKE) -C spl all ++ + # Explicitly make _depend in subdirs containing multiple targets to prevent + # parallel sub-makes creating .depend files simultaneously. + depend dep: $(TIMESTAMP_FILE) $(VERSION_FILE) \ +@@ -777,6 +790,8 @@ unconfig: + sinclude $(obj).boards.depend + $(obj).boards.depend: boards.cfg + @awk '(NF && $$1 !~ /^#/) { print $$7 ": " $$7 "_config; $$(MAKE)" }' $< > $@ ++ @awk '(NF && $$1 !~ /^#/ && tolower($$7) != $$7) { print tolower($$7) ": " $$7 "_config; $$(MAKE)" }' $< >> $@ ++ @awk '(NF && $$1 !~ /^#/ && tolower($$7) != $$7) { print ".PHONY: " tolower($$7) "_config"; print tolower($$7)"_config: " $$7 "_config" }' $< >> $@ + + ######################################################################### + ######################################################################### +@@ -799,6 +814,7 @@ clean: + $(obj)tools/dump{env,}image \ + $(obj)tools/mk{env,}image $(obj)tools/mpc86x_clk \ + $(obj)tools/mk{$(BOARD),}spl \ ++ $(obj)tools/mksunxiboot \ + $(obj)tools/mxsboot \ + $(obj)tools/ncb $(obj)tools/ubsha1 \ + $(obj)tools/kernel-doc/docproc \ +@@ -855,6 +871,7 @@ clobber: tidy + @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f + @rm -f $(obj)dts/*.tmp + @rm -f $(obj)spl/u-boot-spl{,-pad}.ais ++ @rm -f $(obj)spl/sun?i-spl.bin + + mrproper \ + distclean: clobber unconfig +diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile +index 0467d00..28aa4e1 100644 +--- a/arch/arm/cpu/armv7/Makefile ++++ b/arch/arm/cpu/armv7/Makefile +@@ -11,8 +11,9 @@ obj-y += cache_v7.o + + obj-y += cpu.o + obj-y += syslib.o ++obj-y += cmd_boot.o + +-ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY),) ++ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI),) + ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y) + obj-y += lowlevel_init.o + endif +diff --git a/arch/arm/cpu/armv7/cmd_boot.c b/arch/arm/cpu/armv7/cmd_boot.c +new file mode 100644 +index 0000000..e5f917e +--- /dev/null ++++ b/arch/arm/cpu/armv7/cmd_boot.c @@ -0,0 +1,36 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom @@ -38,24 +111,71 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/cmd_boot.c u-boot-sunxi-2013.10-sun + return entry(argc, argv); +} +#endif -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/Makefile u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/Makefile ---- u-boot-2013.10/arch/arm/cpu/armv7/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -15,8 +15,9 @@ COBJS += cache_v7.o - - COBJS += cpu.o - COBJS += syslib.o -+COBJS += cmd_boot.o - --ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX),) -+ifneq ($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_SUNXI),) - SOBJS += lowlevel_init.o - endif - -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/board.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/board.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/board.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/board.c 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,148 @@ +diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile +new file mode 100644 +index 0000000..f71a26d +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/Makefile +@@ -0,0 +1,53 @@ ++# ++# (C) Copyright 2012 Henrik Nordstrom ++# ++# Based on some other Makefile ++# (C) Copyright 2000-2003 ++# Wolfgang Denk, DENX Software Engineering, wd@denx.de. ++# ++# See file CREDITS for list of people who contributed to this ++# project. ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation; either version 2 of ++# the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place, Suite 330, Boston, ++# MA 02111-1307 USA ++# ++ ++obj-y += timer.o ++obj-y += dram.o ++obj-y += board.o ++obj-y += clock.o ++obj-y += pinmux.o ++obj-y += watchdog.o ++ifdef DEBUG ++obj-y += early_print.o ++endif ++obj-$(CONFIG_BOARD_POSTCLK_INIT) += postclk_init.o ++obj-$(CONFIG_SYS_SECONDARY_ON) += secondary_init.o ++obj-$(CONFIG_SYS_SECONDARY_ON) += smp.o ++ ++ifndef CONFIG_SPL_BUILD ++obj-y += key.o ++obj-y += cpu_info.o ++ifdef CONFIG_CMD_WATCHDOG ++obj-$(CONFIG_CMD_WATCHDOG) += cmd_watchdog.o ++endif ++endif ++ ++ifdef CONFIG_SPL_BUILD ++ifdef CONFIG_SPL_FEL ++obj-y += start.o ++endif ++endif ++ +diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c +new file mode 100644 +index 0000000..f74ee46 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/board.c +@@ -0,0 +1,154 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom + * @@ -87,6 +207,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/board.c u-boot-sunxi-2013.10- +#include +#include +#include ++#include +#include +#ifdef CONFIG_SPL_BUILD +#include @@ -169,6 +290,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/board.c u-boot-sunxi-2013.10- + + watchdog_init(); + clock_init(); ++ timer_init(); + gpio_init(); + +#ifdef CONFIG_SPL_BUILD @@ -192,22 +314,28 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/board.c u-boot-sunxi-2013.10- +} +#endif + -+#if defined(CONFIG_SUNXI_EMAC) ++#if defined(CONFIG_SUNXI_EMAC) || defined(CONFIG_SUNXI_GMAC) +/* + * Initializes on-chip ethernet controllers. + * to override, implement board_eth_init() + */ +int cpu_eth_init(bd_t *bis) +{ ++#ifdef CONFIG_SUNXI_EMAC + sunxi_emac_initialize(bis); ++#else ++ sunxi_gmac_initialize(bis); ++#endif + + return 0; +} +#endif -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/clock.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/clock.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/clock.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/clock.c 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,189 @@ +diff --git a/arch/arm/cpu/armv7/sunxi/clock.c b/arch/arm/cpu/armv7/sunxi/clock.c +new file mode 100644 +index 0000000..54b8753 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/clock.c +@@ -0,0 +1,194 @@ +/* + * (C) Copyright 2007-2012 + * Allwinner Technology Co., Ltd. @@ -253,6 +381,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/clock.c u-boot-sunxi-2013.10- + sdelay(200); + writel(AXI_DIV_1 << 0 | AHB_DIV_2 << 4 | APB0_DIV_1 << 8 | + CPU_CLK_SRC_PLL1 << 16, &ccm->cpu_ahb_apb0_cfg); ++#ifdef CONFIG_SUN5I ++ /* Power on reset default for PLL6 is 2400 MHz, which is faster then ++ * it can reliable do :| Set it to a 600 MHz instead. */ ++ writel(0x21009911, &ccm->pll6_cfg); ++#endif +#ifdef CONFIG_SUN7I + writel(0x1 << 6 | readl(&ccm->ahb_gate0), &ccm->ahb_gate0); + writel(0x1 << 31 | readl(&ccm->pll6_cfg), &ccm->pll6_cfg); @@ -397,9 +530,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/clock.c u-boot-sunxi-2013.10- + sdelay(20); +} +#endif -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c b/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c +new file mode 100644 +index 0000000..ff93743 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c @@ -0,0 +1,42 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom @@ -443,9 +578,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/cmd_watchdog.c u-boot-sunxi-2 + "Set watchdog [0 - 16]. [17+} disables", + "" +); -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/config.mk u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/config.mk ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/config.mk 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/config.mk 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/config.mk b/arch/arm/cpu/armv7/sunxi/config.mk +new file mode 100644 +index 0000000..9ce48b4 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/config.mk @@ -0,0 +1,8 @@ +# Build a combined spl + u-boot image +ifdef CONFIG_SPL @@ -455,9 +592,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/config.mk u-boot-sunxi-2013.1 +endif +endif +endif -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/cpu_info.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/cpu_info.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/cpu_info.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/cpu_info.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/cpu_info.c b/arch/arm/cpu/armv7/sunxi/cpu_info.c +new file mode 100644 +index 0000000..4154638 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/cpu_info.c @@ -0,0 +1,45 @@ +/* + * (C) Copyright 2007-2011 @@ -504,10 +643,12 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/cpu_info.c u-boot-sunxi-2013. + return 0; +} +#endif -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/dram.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/dram.c 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,673 @@ +diff --git a/arch/arm/cpu/armv7/sunxi/dram.c b/arch/arm/cpu/armv7/sunxi/dram.c +new file mode 100644 +index 0000000..94a3657 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/dram.c +@@ -0,0 +1,679 @@ +/* + * sunxi DRAM controller initialization + * (C) Copyright 2012 Henrik Nordstrom @@ -570,13 +711,13 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + if ((reg_val & CPU_CFG_CHIP_VER_MASK) != + CPU_CFG_CHIP_VER(CPU_CFG_CHIP_REV_A)) { + setbits_le32(&dram->mcr, DRAM_MCR_RESET); -+ sdelay(0x100); ++ udelay(2); + clrbits_le32(&dram->mcr, DRAM_MCR_RESET); + } else +#endif + { + clrbits_le32(&dram->mcr, DRAM_MCR_RESET); -+ sdelay(0x100); ++ udelay(2); + setbits_le32(&dram->mcr, DRAM_MCR_RESET); + } +} @@ -615,13 +756,13 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + clrsetbits_le32(&dram->dllcr[0], 0x3f << 6, + ((phase >> 16) & 0x3f) << 6); + clrsetbits_le32(&dram->dllcr[0], DRAM_DLLCR_NRESET, DRAM_DLLCR_DISABLE); -+ sdelay(0x100); ++ udelay(2); + + clrbits_le32(&dram->dllcr[0], DRAM_DLLCR_NRESET | DRAM_DLLCR_DISABLE); -+ sdelay(0x1000); ++ udelay(22); + + clrsetbits_le32(&dram->dllcr[0], DRAM_DLLCR_DISABLE, DRAM_DLLCR_NRESET); -+ sdelay(0x1000); ++ udelay(22); +} + +/* @@ -651,17 +792,17 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + DRAM_DLLCR_DISABLE); + phase >>= 4; + } -+ sdelay(0x100); ++ udelay(2); + + for (i = 1; i < n; i++) + clrbits_le32(&dram->dllcr[i], DRAM_DLLCR_NRESET | + DRAM_DLLCR_DISABLE); -+ sdelay(0x1000); ++ udelay(22); + + for (i = 1; i < n; i++) + clrsetbits_le32(&dram->dllcr[i], DRAM_DLLCR_DISABLE, + DRAM_DLLCR_NRESET); -+ sdelay(0x1000); ++ udelay(22); +} + +static u32 hpcr_value[32] = { @@ -729,7 +870,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + reg_val &= ~CCM_PLL5_CTRL_VCO_GAIN; /* PLL VCO Gain off */ + reg_val |= CCM_PLL5_CTRL_EN; /* PLL On */ + writel(reg_val, &ccm->pll5_cfg); -+ sdelay(0x100000); ++ udelay(5500); + + setbits_le32(&ccm->pll5_cfg, CCM_PLL5_CTRL_DDR_CLK); + @@ -737,19 +878,25 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + /* reset GPS */ + clrbits_le32(&ccm->gps_clk_cfg, CCM_GPS_CTRL_RESET | CCM_GPS_CTRL_GATE); + setbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_GPS); -+ sdelay(0x20); ++ udelay(1); + clrbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_GPS); +#endif + + /* setup MBUS clock */ + reg_val = CCM_MBUS_CTRL_GATE | -+#ifdef CONFIG_SUN7I ++#if defined(CONFIG_SUN7I) && defined(CONFIG_FAST_MBUS) ++ CCM_MBUS_CTRL_CLK_SRC(CCM_MBUS_CTRL_CLK_SRC_PLL6) | ++ CCM_MBUS_CTRL_N(CCM_MBUS_CTRL_N_X(1)) | ++ CCM_MBUS_CTRL_M(CCM_MBUS_CTRL_M_X(3)); ++#elif defined(CONFIG_SUN7I) && !defined(CONFIG_FAST_MBUS) + CCM_MBUS_CTRL_CLK_SRC(CCM_MBUS_CTRL_CLK_SRC_PLL6) | + CCM_MBUS_CTRL_N(CCM_MBUS_CTRL_N_X(2)) | -+#else -+ CCM_MBUS_CTRL_CLK_SRC(CCM_MBUS_CTRL_CLK_SRC_PLL5) | -+#endif + CCM_MBUS_CTRL_M(CCM_MBUS_CTRL_M_X(2)); ++#else /* defined(CONFIG_SUN5I) */ ++ CCM_MBUS_CTRL_CLK_SRC(CCM_MBUS_CTRL_CLK_SRC_PLL5) | ++ CCM_MBUS_CTRL_N(CCM_MBUS_CTRL_N_X(1)) | ++ CCM_MBUS_CTRL_M(CCM_MBUS_CTRL_M_X(2)); ++#endif + writel(reg_val, &ccm->mbus_clk_cfg); + + /* @@ -761,7 +908,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s +#else + clrbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_SDRAM); +#endif -+ sdelay(0x1000); ++ udelay(22); + + /* then open it */ +#if defined(CONFIG_SUN5I) || defined(CONFIG_SUN7I) @@ -769,7 +916,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s +#else + setbits_le32(&ccm->ahb_gate0, CCM_AHB_GATE_SDRAM); +#endif -+ sdelay(0x1000); ++ udelay(22); +} + +static int dramc_scan_readpipe(void) @@ -817,7 +964,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + 0x4f << 14, + (dqs_dly[clk_i] & 0x4f) << 14); + } -+ sdelay(0x100); ++ udelay(2); + if (dramc_scan_readpipe() == 0) + clk_dqs_count[clk_i]++; + } @@ -870,7 +1017,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + 0x4f << 14, + (dqs_dly[dqs_i] & 0x4f) << 14); + } -+ sdelay(0x100); ++ udelay(2); + if (dramc_scan_readpipe() == 0) { + clk_dqs_count[dqs_i] = 1; + max_val = dqs_i; @@ -892,7 +1039,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + 0x4f << 14, + (dqs_dly[dqs_index] & 0x4f) << 14); + } -+ sdelay(0x100); ++ udelay(2); + return dramc_scan_readpipe(); + } + @@ -900,7 +1047,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + clrbits_le32(&dram->dllcr[0], 0x3f << 6); + for (cr_i = 1; cr_i < 5; cr_i++) + clrbits_le32(&dram->dllcr[cr_i], 0x4f << 14); -+ sdelay(0x100); ++ udelay(2); + + return dramc_scan_readpipe(); +} @@ -967,7 +1114,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s +} +#endif /* SUN5I */ + -+int dramc_init(struct dram_para *para) ++unsigned long dramc_init(struct dram_para *para) +{ + struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE; + u32 reg_val; @@ -975,7 +1122,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + + /* check input dram parameter structure */ + if (!para) -+ return -1; ++ return 0; + + /* setup DRAM relative clock */ + mctl_setup_dram_clock(para->clock); @@ -1059,7 +1206,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + dramc_clock_output_en(1); +#endif + -+ sdelay(0x10); ++ udelay(1); + + while (readl(&dram->ccr) & DRAM_CCR_INIT); + @@ -1135,7 +1282,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + /* check whether command has been executed */ + while (readl(&dram->dcr) & (0x1 << 31)); + -+ sdelay(0x100); ++ udelay(2); + + /* dram pad hold off */ + setbits_le32(&dram->ppwrsctl, 0x16510000); @@ -1147,13 +1294,13 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + + /* check whether command has been executed */ + while (readl(&dram->dcr) & (0x1 << 31)); -+ sdelay(0x100);; ++ udelay(2);; + + /* issue a refresh command */ + clrsetbits_le32(&dram->dcr, 0x1f << 27, 0x13 << 27); + while (readl(&dram->dcr) & (0x1 << 31)); + -+ sdelay(0x100); ++ udelay(2); + } +#endif + @@ -1179,11 +1326,13 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/dram.c u-boot-sunxi-2013.10-s + /* configure all host port */ + mctl_configure_hostport(); + -+ return get_ram_size((long *)PHYS_SDRAM_0, PHYS_SDRAM_0_SIZE); ++ return get_ram_size((unsigned long *)PHYS_SDRAM_0, PHYS_SDRAM_0_SIZE); +} -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/early_print.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/early_print.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/early_print.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/early_print.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/early_print.c b/arch/arm/cpu/armv7/sunxi/early_print.c +new file mode 100644 +index 0000000..fd3a843 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/early_print.c @@ -0,0 +1,65 @@ +/* + * (C) Copyright 2007-2012 @@ -1250,9 +1399,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/early_print.c u-boot-sunxi-20 +} + + -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/key.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/key.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/key.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/key.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/key.c b/arch/arm/cpu/armv7/sunxi/key.c +new file mode 100644 +index 0000000..d825c4c +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/key.c @@ -0,0 +1,70 @@ +/* + * (C) Copyright 2007-2011 @@ -1324,93 +1475,12 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/key.c u-boot-sunxi-2013.10-su + writel(ints, &sunxi_key_base->ints); + return key; +} -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/Makefile u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/Makefile ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,79 @@ -+# -+# (C) Copyright 2012 Henrik Nordstrom -+# -+# Based on some other Makefile -+# (C) Copyright 2000-2003 -+# Wolfgang Denk, DENX Software Engineering, wd@denx.de. -+# -+# See file CREDITS for list of people who contributed to this -+# project. -+# -+# This program is free software; you can redistribute it and/or -+# modify it under the terms of the GNU General Public License as -+# published by the Free Software Foundation; either version 2 of -+# the License, or (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+# MA 02111-1307 USA -+# -+ -+include $(TOPDIR)/config.mk -+ -+LIB = $(obj)lib$(SOC).o -+ -+TARGETS = $(obj).depend $(LIB) -+ -+COBJS += timer.o -+COBJS += dram.o -+COBJS += board.o -+COBJS += clock.o -+COBJS += pinmux.o -+COBJS += watchdog.o -+ifdef DEBUG -+COBJS += early_print.o -+endif -+ifdef CONFIG_BOARD_POSTCLK_INIT -+COBJS += postclk_init.o -+endif -+ifdef CONFIG_SYS_SECONDARY_ON -+COBJS += secondary_init.o -+COBJS += smp.o -+endif -+ -+ifndef CONFIG_SPL_BUILD -+COBJS += key.o -+COBJS += cpu_info.o -+ifdef CONFIG_CMD_WATCHDOG -+COBJS += cmd_watchdog.o -+endif -+endif -+ -+ifdef CONFIG_SPL_BUILD -+ifdef CONFIG_SPL_FEL -+TARGETS += $(obj)start.o -+endif -+endif -+ -+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) -+OBJS := $(addprefix $(obj),$(COBJS) $(COBJS-y) $(SOBJS)) -+ -+all: $(TARGETS) -+ -+$(LIB): $(OBJS) -+ $(call cmd_link_o_target, $(OBJS)) -+ -+######################################################################### -+ -+# defines $(obj).depend target -+include $(SRCTREE)/rules.mk -+ -+sinclude $(obj).depend -+ -+######################################################################### -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/pinmux.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/pinmux.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/pinmux.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/pinmux.c 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,78 @@ +diff --git a/arch/arm/cpu/armv7/sunxi/pinmux.c b/arch/arm/cpu/armv7/sunxi/pinmux.c +new file mode 100644 +index 0000000..56671f6 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/pinmux.c +@@ -0,0 +1,96 @@ +/* + * (C) Copyright 2007-2011 + * Allwinner Technology Co., Ltd. @@ -1472,6 +1542,24 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/pinmux.c u-boot-sunxi-2013.10 + return cfg & 0xf; +} + ++int sunxi_gpio_set_drv(u32 pin, u32 val) ++{ ++ u32 drv; ++ u32 bank = GPIO_BANK(pin); ++ u32 index = GPIO_DRV_INDEX(pin); ++ u32 offset = GPIO_DRV_OFFSET(pin); ++ struct sunxi_gpio *pio = ++ &((struct sunxi_gpio_reg *)SUNXI_PIO_BASE)->gpio_bank[bank]; ++ ++ drv = readl(&pio->drv[0] + index); ++ drv &= ~(0x3 << offset); ++ drv |= val << offset; ++ ++ writel(drv, &pio->drv[0] + index); ++ ++ return 0; ++} ++ +int sunxi_gpio_set_pull(u32 pin, u32 val) +{ + u32 pull; @@ -1482,16 +1570,18 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/pinmux.c u-boot-sunxi-2013.10 + &((struct sunxi_gpio_reg *)SUNXI_PIO_BASE)->gpio_bank[bank]; + + pull = readl(&pio->pull[0] + index); -+ pull &= ~(0xf << offset); ++ pull &= ~(0x3 << offset); + pull |= val << offset; + + writel(pull, &pio->pull[0] + index); + + return 0; +} -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/postclk_init.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/postclk_init.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/postclk_init.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/postclk_init.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/postclk_init.c b/arch/arm/cpu/armv7/sunxi/postclk_init.c +new file mode 100644 +index 0000000..b32ba9a +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/postclk_init.c @@ -0,0 +1,36 @@ +/* + * (C) Copyright 2013 @@ -1529,9 +1619,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/postclk_init.c u-boot-sunxi-2 +#endif + return 0; +} -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/secondary_init.S u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/secondary_init.S ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/secondary_init.S 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/secondary_init.S 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/secondary_init.S b/arch/arm/cpu/armv7/sunxi/secondary_init.S +new file mode 100644 +index 0000000..034acde +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/secondary_init.S @@ -0,0 +1,48 @@ +/* + * A lowlevel_init function that sets up the stack to call a C function to @@ -1581,9 +1673,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/secondary_init.S u-boot-sunxi + bl secondary_start +ENDPROC(secondary_init) + -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/smp.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/smp.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/smp.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/smp.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/smp.c b/arch/arm/cpu/armv7/sunxi/smp.c +new file mode 100644 +index 0000000..59717a2 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/smp.c @@ -0,0 +1,96 @@ +/* + * (C) Copyright 2013 @@ -1681,14 +1775,18 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/smp.c u-boot-sunxi-2013.10-su + printf("Secondary CPU%d power-on\n", i); + } +} -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/start.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/start.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/start.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/start.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/start.c b/arch/arm/cpu/armv7/sunxi/start.c +new file mode 100644 +index 0000000..6b392fa +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/start.c @@ -0,0 +1 @@ +/* Intentionally empty. Only needed to get FEL SPL link line right */ -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/timer.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/timer.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/timer.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/timer.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/timer.c b/arch/arm/cpu/armv7/sunxi/timer.c +new file mode 100644 +index 0000000..c69ed73 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/timer.c @@ -0,0 +1,120 @@ +/* + * (C) Copyright 2007-2011 @@ -1778,7 +1876,7 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/timer.c u-boot-sunxi-2013.10- +/* delay x useconds */ +void __udelay(unsigned long usec) +{ -+ long tmo = usec * (TIMER_CLOCK / 1000) / 1000; ++ long tmo = USEC_TO_COUNT(usec); + ulong now, last = READ_TIMER(); + + while (tmo > 0) { @@ -1810,9 +1908,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/timer.c u-boot-sunxi-2013.10- + tbclk = CONFIG_SYS_HZ; + return tbclk; +} -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds b/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds +new file mode 100644 +index 0000000..cf02300 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds @@ -0,0 +1,59 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) @@ -1873,9 +1973,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds u-boot-sun + /DISCARD/ : { *(.gnu*) } + /DISCARD/ : { *(.note*) } +} -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds b/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds +new file mode 100644 +index 0000000..2a3b497 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds @@ -0,0 +1,69 @@ +/* + * (C) Copyright 2012 @@ -1946,9 +2048,11 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/u-boot-spl.lds u-boot-sunxi-2 + __bss_end = .; + } > .sdram +} -diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/watchdog.c u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/watchdog.c ---- u-boot-2013.10/arch/arm/cpu/armv7/sunxi/watchdog.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/cpu/armv7/sunxi/watchdog.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/cpu/armv7/sunxi/watchdog.c b/arch/arm/cpu/armv7/sunxi/watchdog.c +new file mode 100644 +index 0000000..22245f8 +--- /dev/null ++++ b/arch/arm/cpu/armv7/sunxi/watchdog.c @@ -0,0 +1,96 @@ +/* + * Watchdog driver for the Allwinner sunxi platform. @@ -2046,10 +2150,12 @@ diff -purN u-boot-2013.10/arch/arm/cpu/armv7/sunxi/watchdog.c u-boot-sunxi-2013. + watchdog_set(WDT_OFF); /* no timeout */ +#endif +} -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/clock.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/clock.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/clock.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/clock.h 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,231 @@ +diff --git a/arch/arm/include/asm/arch-sunxi/clock.h b/arch/arm/include/asm/arch-sunxi/clock.h +new file mode 100644 +index 0000000..b39de3a +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/clock.h +@@ -0,0 +1,242 @@ +/* + * (C) Copyright 2007-2011 + * Allwinner Technology Co., Ltd. @@ -2156,6 +2262,8 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/clock.h u-boot-sunxi-2 + u32 mali_clk_cfg; /* 0x154 */ + u8 res7[0x4]; + u32 mbus_clk_cfg; /* 0x15c */ ++ u8 res8[0x4]; ++ u32 gmac_clk_cfg; /* 0x164 */ +}; + +/* apb1 bit field */ @@ -2223,6 +2331,9 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/clock.h u-boot-sunxi-2 +#define AHB_GATE_OFFSET_USB_EHCI0 1 +#define AHB_GATE_OFFSET_USB 0 + ++/* ahb clock gate bit offset (second register) */ ++#define AHB_GATE_OFFSET_GMAC 17 ++ +#define CCM_AHB_GATE_GPS (0x1 << 26) +#define CCM_AHB_GATE_SDRAM (0x1 << 14) +#define CCM_AHB_GATE_DLL (0x1 << 15) @@ -2264,7 +2375,7 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/clock.h u-boot-sunxi-2 +#define CCM_MBUS_CTRL_M_X(n) ((n) - 1) +#define CCM_MBUS_CTRL_N(n) (((n) & 0xf) << 16) +#define CCM_MBUS_CTRL_N_MASK CCM_MBUS_CTRL_N(0xf) -+#define CCM_MBUS_CTRL_N_X(n) ((n) - 1) ++#define CCM_MBUS_CTRL_N_X(n) (((n) >> 3) ? 3 : (((n) >> 2) ? 2 : (((n) >> 1) ? 1 : 0))) +#define CCM_MBUS_CTRL_CLK_SRC(n) (((n) & 0x3) << 24) +#define CCM_MBUS_CTRL_CLK_SRC_MASK CCM_MBUS_CTRL_CLK_SRC(0x3) +#define CCM_MBUS_CTRL_CLK_SRC_HOSC 0x0 @@ -2272,6 +2383,12 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/clock.h u-boot-sunxi-2 +#define CCM_MBUS_CTRL_CLK_SRC_PLL5 0x2 +#define CCM_MBUS_CTRL_GATE (0x1 << 31) + ++#define CCM_GMAC_CTRL_TX_CLK_SRC_MII 0x0 ++#define CCM_GMAC_CTRL_TX_CLK_SRC_EXT_RGMII 0x1 ++#define CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII 0x2 ++#define CCM_GMAC_CTRL_GPIT_MII (0x0 << 2) ++#define CCM_GMAC_CTRL_GPIT_RGMII (0x1 << 2) ++ + +#ifndef __ASSEMBLY__ +int clock_init(void); @@ -2281,85 +2398,12 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/clock.h u-boot-sunxi-2 +#endif + +#endif /* _SUNXI_CLOCK_H */ -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/cpucfg.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/cpucfg.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/cpucfg.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/cpucfg.h 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,71 @@ -+/* -+ * (C) Copyright 2013 -+ * Carl van Schaik -+ * -+ * CPU configuration registers for the sun7i (A20). -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ */ -+ -+#ifndef _SUNXI_CPUCFG_H_ -+#define _SUNXI_CPUCFG_H_ -+ -+#ifndef __ASSEMBLY__ -+ -+struct sunxi_cpu_ctrl { -+ u32 reset_ctrl; -+ u32 cpu_ctrl; -+ u32 status; -+ u32 _res[13]; -+}; -+ -+#define CPU_RESET_SET 0 -+#define CPU_RESET_CLEAR 3 -+ -+#define CPU_STATUS_SMP (1 << 0) -+#define CPU_STATUS_WFE (1 << 1) -+#define CPU_STATUS_WFI (1 << 2) -+ -+struct sunxi_cpucfg { -+ u32 _res1[16]; /* 0x000 */ -+ struct sunxi_cpu_ctrl cpu[2]; /* 0x040 */ -+ u32 _res2[48]; /* 0x0c0 */ -+ u32 _res3; /* 0x180 */ -+ u32 general_ctrl; /* 0x184 */ -+ u32 _res4[2]; /* 0x188 */ -+ u32 event_input; /* 0x190 */ -+ u32 _res5[4]; /* 0x194 */ -+ u32 boot_addr; /* 0x1a4 - also known as PRIVATE_REG */ -+ u32 _res6[2]; /* 0x1a8 */ -+ u32 cpu1_power_clamp; /* 0x1b0 */ -+ u32 cpu1_power_off; /* 0x1b4 */ -+ u32 _res7[10]; /* 0x1b8 */ -+ u32 debug0_ctrl; /* 0x1e0 */ -+ u32 debug1_ctrl; /* 0x1e4 */ -+}; -+ -+#define GENERAL_CTRL_NO_L1_RESET_CPU(x) (1UL << (x)) -+#define GENERAL_CTRL_NO_L2_AUTO_RESET (1UL << 4) -+#define GENERAL_CTRL_L2_RESET_SET (0UL << 5) -+#define GENERAL_CTRL_L2_RESET_CLEAR (1UL << 5) -+#define GENERAL_CTRL_CFGSDISABLE (1UL << 8) -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif /* _SUNXI_CPUCFG_H_ */ -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/cpu.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/cpu.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/cpu.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/cpu.h 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,146 @@ +diff --git a/arch/arm/include/asm/arch-sunxi/cpu.h b/arch/arm/include/asm/arch-sunxi/cpu.h +new file mode 100644 +index 0000000..17facc3 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/cpu.h +@@ -0,0 +1,147 @@ +/* + * (C) Copyright 2007-2011 + * Allwinner Technology Co., Ltd. @@ -2471,6 +2515,7 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/cpu.h u-boot-sunxi-201 + +#define SUNXI_GPS_BASE 0x01c30000 +#define SUNXI_MALI400_BASE 0x01c40000 ++#define SUNXI_GMAC_BASE 0x01c50000 + +/* module sram */ +#define SUNXI_SRAM_C_BASE 0x01d00000 @@ -2506,9 +2551,88 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/cpu.h u-boot-sunxi-201 +#endif /* __ASSEMBLY__ */ + +#endif /* _CPU_H */ -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/dram.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/dram.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/dram.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/dram.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/cpucfg.h b/arch/arm/include/asm/arch-sunxi/cpucfg.h +new file mode 100644 +index 0000000..acc2fcf +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/cpucfg.h +@@ -0,0 +1,71 @@ ++/* ++ * (C) Copyright 2013 ++ * Carl van Schaik ++ * ++ * CPU configuration registers for the sun7i (A20). ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, ++ * MA 02111-1307 USA ++ */ ++ ++#ifndef _SUNXI_CPUCFG_H_ ++#define _SUNXI_CPUCFG_H_ ++ ++#ifndef __ASSEMBLY__ ++ ++struct sunxi_cpu_ctrl { ++ u32 reset_ctrl; ++ u32 cpu_ctrl; ++ u32 status; ++ u32 _res[13]; ++}; ++ ++#define CPU_RESET_SET 0 ++#define CPU_RESET_CLEAR 3 ++ ++#define CPU_STATUS_SMP (1 << 0) ++#define CPU_STATUS_WFE (1 << 1) ++#define CPU_STATUS_WFI (1 << 2) ++ ++struct sunxi_cpucfg { ++ u32 _res1[16]; /* 0x000 */ ++ struct sunxi_cpu_ctrl cpu[2]; /* 0x040 */ ++ u32 _res2[48]; /* 0x0c0 */ ++ u32 _res3; /* 0x180 */ ++ u32 general_ctrl; /* 0x184 */ ++ u32 _res4[2]; /* 0x188 */ ++ u32 event_input; /* 0x190 */ ++ u32 _res5[4]; /* 0x194 */ ++ u32 boot_addr; /* 0x1a4 - also known as PRIVATE_REG */ ++ u32 _res6[2]; /* 0x1a8 */ ++ u32 cpu1_power_clamp; /* 0x1b0 */ ++ u32 cpu1_power_off; /* 0x1b4 */ ++ u32 _res7[10]; /* 0x1b8 */ ++ u32 debug0_ctrl; /* 0x1e0 */ ++ u32 debug1_ctrl; /* 0x1e4 */ ++}; ++ ++#define GENERAL_CTRL_NO_L1_RESET_CPU(x) (1UL << (x)) ++#define GENERAL_CTRL_NO_L2_AUTO_RESET (1UL << 4) ++#define GENERAL_CTRL_L2_RESET_SET (0UL << 5) ++#define GENERAL_CTRL_L2_RESET_CLEAR (1UL << 5) ++#define GENERAL_CTRL_CFGSDISABLE (1UL << 8) ++ ++#endif /* __ASSEMBLY__ */ ++ ++#endif /* _SUNXI_CPUCFG_H_ */ +diff --git a/arch/arm/include/asm/arch-sunxi/dram.h b/arch/arm/include/asm/arch-sunxi/dram.h +new file mode 100644 +index 0000000..d2d18f0 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/dram.h @@ -0,0 +1,191 @@ +/* + * (C) Copyright 2007-2012 @@ -2697,13 +2821,15 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/dram.h u-boot-sunxi-20 + +#define DRAM_CSEL_MAGIC 0x16237495 + -+int sunxi_dram_init(void); -+int dramc_init(struct dram_para *para); ++unsigned long sunxi_dram_init(void); ++unsigned long dramc_init(struct dram_para *para); + +#endif /* _SUNXI_DRAM_H */ -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/early_print.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/early_print.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/early_print.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/early_print.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/early_print.h b/arch/arm/include/asm/arch-sunxi/early_print.h +new file mode 100644 +index 0000000..cd89114 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/early_print.h @@ -0,0 +1,74 @@ +/* + * (C) Copyright 2007-2012 @@ -2779,10 +2905,12 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/early_print.h u-boot-s +#endif /* __ASSEMBLY__ */ + +#endif /* _SUNXI_EARLY_PRINT_H */ -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/gpio.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/gpio.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/gpio.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/gpio.h 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,175 @@ +diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h +new file mode 100644 +index 0000000..79b4f21 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/gpio.h +@@ -0,0 +1,179 @@ +/* + * (C) Copyright 2007-2012 + * Allwinner Technology Co., Ltd. @@ -2856,6 +2984,9 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/gpio.h u-boot-sunxi-20 +#define GPIO_CFG_INDEX(pin) (((pin) & 0x1f) >> 3) +#define GPIO_CFG_OFFSET(pin) ((((pin) & 0x1f) & 0x7) << 2) + ++#define GPIO_DRV_INDEX(pin) (((pin) & 0x1f) >> 4) ++#define GPIO_DRV_OFFSET(pin) ((((pin) & 0x1f) & 0xf) << 1) ++ +#define GPIO_PULL_INDEX(pin) (((pin) & 0x1f) >> 4) +#define GPIO_PULL_OFFSET(pin) ((((pin) & 0x1f) & 0xf) << 1) + @@ -2953,14 +3084,17 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/gpio.h u-boot-sunxi-20 + +int sunxi_gpio_set_cfgpin(u32 pin, u32 val); +int sunxi_gpio_get_cfgpin(u32 pin); ++int sunxi_gpio_set_drv(u32 pin, u32 val); +int sunxi_gpio_set_pull(u32 pin, u32 val); +int name_to_gpio(const char *name); +#define name_to_gpio name_to_gpio + +#endif /* _SUNXI_GPIO_H */ -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/i2c.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/i2c.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/i2c.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/i2c.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/i2c.h b/arch/arm/include/asm/arch-sunxi/i2c.h +new file mode 100644 +index 0000000..b1d55f5 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/i2c.h @@ -0,0 +1,185 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom @@ -3147,9 +3281,11 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/i2c.h u-boot-sunxi-201 +#define TWI_STAT_IDLE 0xf8 + +#endif -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/key.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/key.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/key.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/key.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/key.h b/arch/arm/include/asm/arch-sunxi/key.h +new file mode 100644 +index 0000000..f717787 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/key.h @@ -0,0 +1,53 @@ +/* + * (C) Copyright 2007-2011 @@ -3204,9 +3340,11 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/key.h u-boot-sunxi-201 +u32 sunxi_read_key(void); + +#endif -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/mmc.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/mmc.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/mmc.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/mmc.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/mmc.h b/arch/arm/include/asm/arch-sunxi/mmc.h +new file mode 100644 +index 0000000..639a7fc +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/mmc.h @@ -0,0 +1,66 @@ +/* + * (C) Copyright 2007-2011 @@ -3274,9 +3412,11 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/mmc.h u-boot-sunxi-201 + +int sunxi_mmc_init(int sdc_no); +#endif /* _SUNXI_MMC_H */ -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/smp.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/smp.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/smp.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/smp.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/smp.h b/arch/arm/include/asm/arch-sunxi/smp.h +new file mode 100644 +index 0000000..b7526e7 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/smp.h @@ -0,0 +1,38 @@ +/* + * (C) Copyright 2013 @@ -3316,9 +3456,11 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/smp.h u-boot-sunxi-201 +#endif /* __ASSEMBLY__ */ + +#endif /* _SUNXI_SMP_H_ */ -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/spl.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/spl.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/spl.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/spl.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/spl.h b/arch/arm/include/asm/arch-sunxi/spl.h +new file mode 100644 +index 0000000..6a47d14 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/spl.h @@ -0,0 +1,36 @@ +/* + * This is a copy of omap3/spl.h: @@ -3356,9 +3498,11 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/spl.h u-boot-sunxi-201 +#define BOOT_DEVICE_XIPWAIT 7 +#define BOOT_DEVICE_MMC2_2 0xff +#endif -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/sys_proto.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/sys_proto.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/sys_proto.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/sys_proto.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/sys_proto.h b/arch/arm/include/asm/arch-sunxi/sys_proto.h +new file mode 100644 +index 0000000..78a2b39 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h @@ -0,0 +1,33 @@ +/* + * (C) Copyright 2007-2012 @@ -3393,9 +3537,11 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/sys_proto.h u-boot-sun +void sdelay(unsigned long); + +#endif -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/timer.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/timer.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/timer.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/timer.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/timer.h b/arch/arm/include/asm/arch-sunxi/timer.h +new file mode 100644 +index 0000000..f9d4f4f +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/timer.h @@ -0,0 +1,104 @@ +/* + * (C) Copyright 2007-2011 @@ -3501,9 +3647,11 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/timer.h u-boot-sunxi-2 +#endif /* __ASSEMBLY__ */ + +#endif -diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/watchdog.h u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/watchdog.h ---- u-boot-2013.10/arch/arm/include/asm/arch-sunxi/watchdog.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/arch/arm/include/asm/arch-sunxi/watchdog.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/arch/arm/include/asm/arch-sunxi/watchdog.h b/arch/arm/include/asm/arch-sunxi/watchdog.h +new file mode 100644 +index 0000000..e3a8936 +--- /dev/null ++++ b/arch/arm/include/asm/arch-sunxi/watchdog.h @@ -0,0 +1,35 @@ +/* + * Watchdog driver for the Allwinner sunxi platform. @@ -3540,10 +3688,102 @@ diff -purN u-boot-2013.10/arch/arm/include/asm/arch-sunxi/watchdog.h u-boot-sunx +#endif /* __ASSEMBLY__ */ + +#endif -diff -purN u-boot-2013.10/board/sunxi/board.c u-boot-sunxi-2013.10-sunxi/board/sunxi/board.c ---- u-boot-2013.10/board/sunxi/board.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/board.c 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,161 @@ +diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile +new file mode 100644 +index 0000000..e431653 +--- /dev/null ++++ b/board/sunxi/Makefile +@@ -0,0 +1,84 @@ ++# ++# (C) Copyright 2012 Henrik Nordstrom ++# ++# Based on some other board Makefile ++# ++# (C) Copyright 2000-2003 ++# Wolfgang Denk, DENX Software Engineering, wd@denx.de. ++# ++# See file CREDITS for list of people who contributed to this ++# project. ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation; either version 2 of ++# the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place, Suite 330, Boston, ++# MA 02111-1307 USA ++# ++ ++obj-y += board.o ++obj-$(CONFIG_A10_MID_1GB) += dram_sun4i_360_1024_iow16.o ++obj-$(CONFIG_A10_OLINUXINO_L) += dram_a10_olinuxino_l.o ++obj-$(CONFIG_A10S_OLINUXINO_M) += dram_a10s_olinuxino_m.o ++obj-$(CONFIG_A13_OLINUXINO) += dram_a13_olinuxino.o ++obj-$(CONFIG_A13_OLINUXINOM) += dram_a13_oli_micro.o ++obj-$(CONFIG_A13_MID) += dram_a13_mid.o ++obj-$(CONFIG_A20_OLINUXINO_M) += dram_a20_olinuxino_m.o ++obj-$(CONFIG_AUXTEK_T003) += dram_auxtek_t003.o ++# This is not a typo, uses the same mem settings as the a10s-olinuxino-m ++obj-$(CONFIG_AUXTEK_T004) += dram_a10s_olinuxino_m.o ++obj-$(CONFIG_BA10_TV_BOX) += dram_sun4i_384_1024_iow8.o ++obj-$(CONFIG_COBY_MID7042) += dram_sun4i_408_1024_iow16.o ++obj-$(CONFIG_COBY_MID8042) += dram_sun4i_360_1024_iow16.o ++obj-$(CONFIG_COBY_MID9742) += dram_sun4i_408_1024_iow16.o ++obj-$(CONFIG_MARSBOARD_A10) += dram_sun4i_360_1024_iow16.o ++obj-$(CONFIG_MARSBOARD_A20) += dram_sun4i_360_1024_iow16.o ++obj-$(CONFIG_CUBIEBOARD) += dram_cubieboard.o ++obj-$(CONFIG_CUBIEBOARD_512) += dram_cubieboard_512.o ++obj-$(CONFIG_CUBIEBOARD2) += dram_cubieboard2.o ++obj-$(CONFIG_CUBIETRUCK) += dram_cubietruck.o ++obj-$(CONFIG_DNS_M82) += dram_sun4i_360_1024_iow16.o ++obj-$(CONFIG_EOMA68_A10) += dram_sun4i_360_1024_iow8.o ++obj-$(CONFIG_EOMA68_A20) += dram_eoma68_a20.o ++obj-$(CONFIG_EU3000) += dram_eu3000.o ++obj-$(CONFIG_GOOSEBERRY_A721) += dram_gooseberry_a721.o ++obj-$(CONFIG_H6) += dram_h6.o ++obj-$(CONFIG_HACKBERRY) += dram_hackberry.o ++obj-$(CONFIG_A7HD) += dram_sun4i_360_1024_iow8.o ++obj-$(CONFIG_INTERRA3) += dram_mk802ii_a20.o ++obj-$(CONFIG_INET_86VZ) += dram_a10s_olinuxino_m.o ++obj-$(CONFIG_INET97F_II) += dram_sun4i_408_512.o ++obj-$(CONFIG_INET_K70HC) += dram_inet_k70hc.o ++obj-$(CONFIG_JESURUN_Q5) += dram_sun4i_312_1024_iow8.o ++obj-$(CONFIG_K1001L1C) += dram_a20_olinuxino_m.o ++obj-$(CONFIG_MEFAFEIS_A08) += dram_megafeis_a08.o ++obj-$(CONFIG_MELE_A1000) += dram_sun4i_360_512.o ++obj-$(CONFIG_MELE_A1000G) += dram_sun4i_360_1024_iow8.o ++obj-$(CONFIG_MELE_A3700) += dram_sun4i_360_1024_iow8.o ++obj-$(CONFIG_MINI_X) += dram_sun4i_360_512.o ++obj-$(CONFIG_MINI_X_1GB) += dram_sun4i_360_1024_iow16.o ++obj-$(CONFIG_MINI_X_A10S) += dram_mini_x_a10s.o ++obj-$(CONFIG_MK802) += dram_sun4i_360_512.o ++obj-$(CONFIG_MK802_1GB) += dram_sun4i_360_1024_iow16.o ++obj-$(CONFIG_MK802_A10S) += dram_mk802_a10s.o ++obj-$(CONFIG_MK802II) += dram_sun4i_408_1024_iow8.o ++obj-$(CONFIG_MK802II_A20) += dram_mk802ii_a20.o ++obj-$(CONFIG_PCDUINO) += dram_sun4i_408_1024_iow8.o ++obj-$(CONFIG_PENGPOD700) += dram_sun4i_384_1024_iow8.o ++obj-$(CONFIG_PENGPOD1000) += dram_sun4i_408_1024_iow16.o ++obj-$(CONFIG_POV_PROTAB2) += dram_pov_protab2.o ++obj-$(CONFIG_POV_PROTAB2_XXL) += dram_pov_protab2_xxl.o ++obj-$(CONFIG_R7DONGLE) += dram_r7dongle.o ++obj-$(CONFIG_SANEI_N90) += dram_sanei_n90.o ++obj-$(CONFIG_UHOST_U1A) += dram_sun4i_360_1024_iow8.o ++obj-$(CONFIG_WOBO_I5) += dram_wobo_i5.o ++obj-$(CONFIG_XZPAD700) += dram_xzpad700.o +diff --git a/board/sunxi/board.c b/board/sunxi/board.c +new file mode 100644 +index 0000000..0b048df +--- /dev/null ++++ b/board/sunxi/board.c +@@ -0,0 +1,165 @@ +/* + * (C) Copyright 2012-2013 Henrik Nordstrom + * (C) Copyright 2013 Luke Kenneth Casson Leighton @@ -3619,7 +3859,7 @@ diff -purN u-boot-2013.10/board/sunxi/board.c u-boot-sunxi-2013.10-sunxi/board/s + +int dram_init(void) +{ -+ gd->ram_size = get_ram_size((long *)PHYS_SDRAM_0, PHYS_SDRAM_0_SIZE); ++ gd->ram_size = get_ram_size((unsigned long *)PHYS_SDRAM_0, PHYS_SDRAM_0_SIZE); + + return 0; +} @@ -3640,7 +3880,7 @@ diff -purN u-boot-2013.10/board/sunxi/board.c u-boot-sunxi-2013.10-sunxi/board/s +void sunxi_board_init(void) +{ + int power_failed = 0; -+ int ramsize; ++ unsigned long ramsize; + + printf("DRAM:"); + ramsize = sunxi_dram_init(); @@ -3652,7 +3892,7 @@ diff -purN u-boot-2013.10/board/sunxi/board.c u-boot-sunxi-2013.10-sunxi/board/s + printf(" ?"); + ramsize = sunxi_dram_init(); + } -+ printf(" %d MiB\n", ramsize >> 20); ++ printf(" %lu MiB\n", ramsize >> 20); + if (!ramsize) + hang(); + @@ -3666,7 +3906,11 @@ diff -purN u-boot-2013.10/board/sunxi/board.c u-boot-sunxi-2013.10-sunxi/board/s +#ifdef CONFIG_AXP209_POWER + power_failed |= axp209_init(); + power_failed |= axp209_set_dcdc2(1400); ++#ifdef CONFIG_FAST_MBUS ++ power_failed |= axp209_set_dcdc3(1300); ++#else + power_failed |= axp209_set_dcdc3(1250); ++#endif + power_failed |= axp209_set_ldo2(3000); + power_failed |= axp209_set_ldo3(2800); + power_failed |= axp209_set_ldo4(2800); @@ -3705,9 +3949,48 @@ diff -purN u-boot-2013.10/board/sunxi/board.c u-boot-sunxi-2013.10-sunxi/board/s +#endif + +#endif -diff -purN u-boot-2013.10/board/sunxi/dram_a10s_olinuxino_m.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a10s_olinuxino_m.c ---- u-boot-2013.10/board/sunxi/dram_a10s_olinuxino_m.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a10s_olinuxino_m.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_a10_olinuxino_l.c b/board/sunxi/dram_a10_olinuxino_l.c +new file mode 100644 +index 0000000..24a1bd9 +--- /dev/null ++++ b/board/sunxi/dram_a10_olinuxino_l.c +@@ -0,0 +1,31 @@ ++/* this file is generated, don't edit it yourself */ ++ ++#include ++#include ++ ++static struct dram_para dram_para = { ++ .clock = 480, ++ .type = 3, ++ .rank_num = 1, ++ .density = 4096, ++ .io_width = 16, ++ .bus_width = 16, ++ .cas = 6, ++ .zq = 123, ++ .odt_en = 0, ++ .size = 512, ++ .tpr0 = 0x30926692, ++ .tpr1 = 0x1090, ++ .tpr2 = 0x1a0c8, ++ .tpr3 = 0, ++ .tpr4 = 0, ++ .tpr5 = 0, ++ .emr1 = 0x4, ++ .emr2 = 0, ++ .emr3 = 0, ++}; ++ ++unsigned long sunxi_dram_init(void) ++{ ++ return dramc_init(&dram_para); ++} +diff --git a/board/sunxi/dram_a10s_olinuxino_m.c b/board/sunxi/dram_a10s_olinuxino_m.c +new file mode 100644 +index 0000000..8900539 +--- /dev/null ++++ b/board/sunxi/dram_a10s_olinuxino_m.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -3736,13 +4019,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_a10s_olinuxino_m.c u-boot-sunxi-2013. + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_a13_mid.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a13_mid.c ---- u-boot-2013.10/board/sunxi/dram_a13_mid.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a13_mid.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_a13_mid.c b/board/sunxi/dram_a13_mid.c +new file mode 100644 +index 0000000..bc5cf75 +--- /dev/null ++++ b/board/sunxi/dram_a13_mid.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -3771,13 +4056,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_a13_mid.c u-boot-sunxi-2013.10-sunxi/ + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_a13_oli_micro.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a13_oli_micro.c ---- u-boot-2013.10/board/sunxi/dram_a13_oli_micro.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a13_oli_micro.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_a13_oli_micro.c b/board/sunxi/dram_a13_oli_micro.c +new file mode 100644 +index 0000000..8154ea2 +--- /dev/null ++++ b/board/sunxi/dram_a13_oli_micro.c @@ -0,0 +1,32 @@ +/* this file is generated, don't edit it yourself */ + @@ -3807,13 +4094,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_a13_oli_micro.c u-boot-sunxi-2013.10- + +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_a13_olinuxino.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a13_olinuxino.c ---- u-boot-2013.10/board/sunxi/dram_a13_olinuxino.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a13_olinuxino.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_a13_olinuxino.c b/board/sunxi/dram_a13_olinuxino.c +new file mode 100644 +index 0000000..ca96260 +--- /dev/null ++++ b/board/sunxi/dram_a13_olinuxino.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -3842,13 +4131,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_a13_olinuxino.c u-boot-sunxi-2013.10- + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_a20_olinuxino_m.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a20_olinuxino_m.c ---- u-boot-2013.10/board/sunxi/dram_a20_olinuxino_m.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_a20_olinuxino_m.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_a20_olinuxino_m.c b/board/sunxi/dram_a20_olinuxino_m.c +new file mode 100644 +index 0000000..04e4b1e +--- /dev/null ++++ b/board/sunxi/dram_a20_olinuxino_m.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -3877,13 +4168,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_a20_olinuxino_m.c u-boot-sunxi-2013.1 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_auxtek_t003.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_auxtek_t003.c ---- u-boot-2013.10/board/sunxi/dram_auxtek_t003.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_auxtek_t003.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_auxtek_t003.c b/board/sunxi/dram_auxtek_t003.c +new file mode 100644 +index 0000000..7dc55d2 +--- /dev/null ++++ b/board/sunxi/dram_auxtek_t003.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -3912,13 +4205,52 @@ diff -purN u-boot-2013.10/board/sunxi/dram_auxtek_t003.c u-boot-sunxi-2013.10-su + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_cubieboard2.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_cubieboard2.c ---- u-boot-2013.10/board/sunxi/dram_cubieboard2.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_cubieboard2.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_cubieboard.c b/board/sunxi/dram_cubieboard.c +new file mode 100644 +index 0000000..399028c +--- /dev/null ++++ b/board/sunxi/dram_cubieboard.c +@@ -0,0 +1,31 @@ ++/* this file is generated, don't edit it yourself */ ++ ++#include ++#include ++ ++static struct dram_para dram_para = { ++ .clock = 480, ++ .type = 3, ++ .rank_num = 1, ++ .density = 4096, ++ .io_width = 16, ++ .bus_width = 32, ++ .cas = 6, ++ .zq = 123, ++ .odt_en = 0, ++ .size = 1024, ++ .tpr0 = 0x30926692, ++ .tpr1 = 0x1090, ++ .tpr2 = 0x1a0c8, ++ .tpr3 = 0, ++ .tpr4 = 0, ++ .tpr5 = 0, ++ .emr1 = 0, ++ .emr2 = 0, ++ .emr3 = 0, ++}; ++ ++unsigned long sunxi_dram_init(void) ++{ ++ return dramc_init(&dram_para); ++} +diff --git a/board/sunxi/dram_cubieboard2.c b/board/sunxi/dram_cubieboard2.c +new file mode 100644 +index 0000000..9e75367 +--- /dev/null ++++ b/board/sunxi/dram_cubieboard2.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -3947,13 +4279,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_cubieboard2.c u-boot-sunxi-2013.10-su + .emr3 = 0x0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_cubieboard_512.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_cubieboard_512.c ---- u-boot-2013.10/board/sunxi/dram_cubieboard_512.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_cubieboard_512.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_cubieboard_512.c b/board/sunxi/dram_cubieboard_512.c +new file mode 100644 +index 0000000..9752b83 +--- /dev/null ++++ b/board/sunxi/dram_cubieboard_512.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -3982,48 +4316,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_cubieboard_512.c u-boot-sunxi-2013.10 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_cubieboard.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_cubieboard.c ---- u-boot-2013.10/board/sunxi/dram_cubieboard.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_cubieboard.c 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,31 @@ -+/* this file is generated, don't edit it yourself */ -+ -+#include -+#include -+ -+static struct dram_para dram_para = { -+ .clock = 480, -+ .type = 3, -+ .rank_num = 1, -+ .density = 4096, -+ .io_width = 16, -+ .bus_width = 32, -+ .cas = 6, -+ .zq = 123, -+ .odt_en = 0, -+ .size = 1024, -+ .tpr0 = 0x30926692, -+ .tpr1 = 0x1090, -+ .tpr2 = 0x1a0c8, -+ .tpr3 = 0, -+ .tpr4 = 0, -+ .tpr5 = 0, -+ .emr1 = 0, -+ .emr2 = 0, -+ .emr3 = 0, -+}; -+ -+int sunxi_dram_init(void) -+{ -+ return dramc_init(&dram_para); -+} -diff -purN u-boot-2013.10/board/sunxi/dram_cubietruck.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_cubietruck.c ---- u-boot-2013.10/board/sunxi/dram_cubietruck.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_cubietruck.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_cubietruck.c b/board/sunxi/dram_cubietruck.c +new file mode 100644 +index 0000000..1e7c94a +--- /dev/null ++++ b/board/sunxi/dram_cubietruck.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4052,13 +4353,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_cubietruck.c u-boot-sunxi-2013.10-sun + .emr3 = 0x0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_eoma68_a20.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_eoma68_a20.c ---- u-boot-2013.10/board/sunxi/dram_eoma68_a20.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_eoma68_a20.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_eoma68_a20.c b/board/sunxi/dram_eoma68_a20.c +new file mode 100644 +index 0000000..04e4b1e +--- /dev/null ++++ b/board/sunxi/dram_eoma68_a20.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4087,13 +4390,52 @@ diff -purN u-boot-2013.10/board/sunxi/dram_eoma68_a20.c u-boot-sunxi-2013.10-sun + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_gooseberry_a721.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_gooseberry_a721.c ---- u-boot-2013.10/board/sunxi/dram_gooseberry_a721.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_gooseberry_a721.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_eu3000.c b/board/sunxi/dram_eu3000.c +new file mode 100644 +index 0000000..80f6439 +--- /dev/null ++++ b/board/sunxi/dram_eu3000.c +@@ -0,0 +1,31 @@ ++/* this file is generated, don't edit it yourself */ ++ ++#include "common.h" ++#include ++ ++static struct dram_para dram_para = { ++ .clock = 432, ++ .type = 3, ++ .rank_num = 1, ++ .density = 4096, ++ .io_width = 16, ++ .bus_width = 32, ++ .cas = 9, ++ .zq = 0x7b, ++ .odt_en = 0, ++ .size = 1024, ++ .tpr0 = 0x42d899b7, ++ .tpr1 = 0xa090, ++ .tpr2 = 0x22a00, ++ .tpr3 = 0, ++ .tpr4 = 1, ++ .tpr5 = 0, ++ .emr1 = 0x4, ++ .emr2 = 0x10, ++ .emr3 = 0, ++}; ++ ++unsigned long sunxi_dram_init(void) ++{ ++ return dramc_init(&dram_para); ++} +diff --git a/board/sunxi/dram_gooseberry_a721.c b/board/sunxi/dram_gooseberry_a721.c +new file mode 100644 +index 0000000..a21ba55 +--- /dev/null ++++ b/board/sunxi/dram_gooseberry_a721.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4122,13 +4464,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_gooseberry_a721.c u-boot-sunxi-2013.1 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_h6.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_h6.c ---- u-boot-2013.10/board/sunxi/dram_h6.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_h6.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_h6.c b/board/sunxi/dram_h6.c +new file mode 100644 +index 0000000..148c185 +--- /dev/null ++++ b/board/sunxi/dram_h6.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4157,13 +4501,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_h6.c u-boot-sunxi-2013.10-sunxi/board + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_hackberry.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_hackberry.c ---- u-boot-2013.10/board/sunxi/dram_hackberry.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_hackberry.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_hackberry.c b/board/sunxi/dram_hackberry.c +new file mode 100644 +index 0000000..19b07b8 +--- /dev/null ++++ b/board/sunxi/dram_hackberry.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4192,13 +4538,126 @@ diff -purN u-boot-2013.10/board/sunxi/dram_hackberry.c u-boot-sunxi-2013.10-sunx + .emr3 = 0, +}; + ++unsigned long sunxi_dram_init(void) ++{ ++ return dramc_init(&dram_para); ++} +diff --git a/board/sunxi/dram_inet_k70hc.c b/board/sunxi/dram_inet_k70hc.c +new file mode 100644 +index 0000000..d5ddc13 +--- /dev/null ++++ b/board/sunxi/dram_inet_k70hc.c +@@ -0,0 +1,31 @@ ++/* this file is generated, don't edit it yourself */ ++ ++#include ++#include ++ ++static struct dram_para dram_para = { ++ .clock = 384, ++ .type = 3, ++ .rank_num = 1, ++ .density = 4096, ++ .io_width = 16, ++ .bus_width = 32, ++ .cas = 9, ++ .zq = 0x12331a7f, ++ .odt_en = 0, ++ .size = 1024, ++ .tpr0 = 0x42d899b7, ++ .tpr1 = 0xa090, ++ .tpr2 = 0x22a00, ++ .tpr3 = 0, ++ .tpr4 = 1, ++ .tpr5 = 0, ++ .emr1 = 0x4, ++ .emr2 = 0x10, ++ .emr3 = 0, ++}; ++ ++unsigned long sunxi_dram_init(void) ++{ ++ return dramc_init(&dram_para); ++} +diff --git a/board/sunxi/dram_megafeis_a08.c b/board/sunxi/dram_megafeis_a08.c +new file mode 100644 +index 0000000..4e7cf81 +--- /dev/null ++++ b/board/sunxi/dram_megafeis_a08.c +@@ -0,0 +1,31 @@ ++/* this file is generated, don't edit it yourself */ ++ ++#include ++#include ++ ++static struct dram_para dram_para = { ++ .clock = 432, ++ .type = 3, ++ .rank_num = 1, ++ .density = 4096, ++ .io_width = 16, ++ .bus_width = 16, ++ .cas = 9, ++ .zq = 123, ++ .odt_en = 0, ++ .size = 512, ++ .tpr0 = 0x42d899b7, ++ .tpr1 = 0xa090, ++ .tpr2 = 0x22a00, ++ .tpr3 = 0, ++ .tpr4 = 0, ++ .tpr5 = 0, ++ .emr1 = 0, ++ .emr2 = 0x10, ++ .emr3 = 0, ++}; ++ +int sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_mk802_a10s.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_mk802_a10s.c ---- u-boot-2013.10/board/sunxi/dram_mk802_a10s.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_mk802_a10s.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_mini_x_a10s.c b/board/sunxi/dram_mini_x_a10s.c +new file mode 100644 +index 0000000..172eab3 +--- /dev/null ++++ b/board/sunxi/dram_mini_x_a10s.c +@@ -0,0 +1,31 @@ ++/* this file is generated, don't edit it yourself */ ++ ++#include ++#include ++ ++static struct dram_para dram_para = { ++ .clock = 432, ++ .type = 3, ++ .rank_num = 1, ++ .density = 2048, ++ .io_width = 16, ++ .bus_width = 32, ++ .cas = 9, ++ .zq = 123, ++ .odt_en = 0, ++ .size = 1024, ++ .tpr0 = 0x42d899b7, ++ .tpr1 = 0xa090, ++ .tpr2 = 0x22a00, ++ .tpr3 = 0, ++ .tpr4 = 0, ++ .tpr5 = 0, ++ .emr1 = 0, ++ .emr2 = 0x10, ++ .emr3 = 0, ++}; ++ ++int sunxi_dram_init(void) ++{ ++ return dramc_init(&dram_para); ++} +diff --git a/board/sunxi/dram_mk802_a10s.c b/board/sunxi/dram_mk802_a10s.c +new file mode 100644 +index 0000000..9fe0965 +--- /dev/null ++++ b/board/sunxi/dram_mk802_a10s.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4227,13 +4686,52 @@ diff -purN u-boot-2013.10/board/sunxi/dram_mk802_a10s.c u-boot-sunxi-2013.10-sun + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_pov_protab2.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_pov_protab2.c ---- u-boot-2013.10/board/sunxi/dram_pov_protab2.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_pov_protab2.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_mk802ii_a20.c b/board/sunxi/dram_mk802ii_a20.c +new file mode 100644 +index 0000000..dc0323e +--- /dev/null ++++ b/board/sunxi/dram_mk802ii_a20.c +@@ -0,0 +1,31 @@ ++/* this file is generated, don't edit it yourself */ ++ ++#include "common.h" ++#include ++ ++static struct dram_para dram_para = { ++ .clock = 360, ++ .type = 3, ++ .rank_num = 1, ++ .density = 4096, ++ .io_width = 16, ++ .bus_width = 32, ++ .cas = 9, ++ .zq = 0x7f, ++ .odt_en = 0, ++ .size = 1024, ++ .tpr0 = 0x42d899b7, ++ .tpr1 = 0xa090, ++ .tpr2 = 0x22a00, ++ .tpr3 = 0, ++ .tpr4 = 0, ++ .tpr5 = 0, ++ .emr1 = 0x4, ++ .emr2 = 0x10, ++ .emr3 = 0, ++}; ++ ++unsigned long sunxi_dram_init(void) ++{ ++ return dramc_init(&dram_para); ++} +diff --git a/board/sunxi/dram_pov_protab2.c b/board/sunxi/dram_pov_protab2.c +new file mode 100644 +index 0000000..3774ff8 +--- /dev/null ++++ b/board/sunxi/dram_pov_protab2.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4262,13 +4760,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_pov_protab2.c u-boot-sunxi-2013.10-su + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_pov_protab2_xxl.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_pov_protab2_xxl.c ---- u-boot-2013.10/board/sunxi/dram_pov_protab2_xxl.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_pov_protab2_xxl.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_pov_protab2_xxl.c b/board/sunxi/dram_pov_protab2_xxl.c +new file mode 100644 +index 0000000..1b65cd1 +--- /dev/null ++++ b/board/sunxi/dram_pov_protab2_xxl.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4297,13 +4797,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_pov_protab2_xxl.c u-boot-sunxi-2013.1 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_r7dongle.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_r7dongle.c ---- u-boot-2013.10/board/sunxi/dram_r7dongle.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_r7dongle.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_r7dongle.c b/board/sunxi/dram_r7dongle.c +new file mode 100644 +index 0000000..59343cb +--- /dev/null ++++ b/board/sunxi/dram_r7dongle.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4332,14 +4834,16 @@ diff -purN u-boot-2013.10/board/sunxi/dram_r7dongle.c u-boot-sunxi-2013.10-sunxi + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_sanei_n90.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sanei_n90.c ---- u-boot-2013.10/board/sunxi/dram_sanei_n90.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sanei_n90.c 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,31 @@ +diff --git a/board/sunxi/dram_sanei_n90.c b/board/sunxi/dram_sanei_n90.c +new file mode 100644 +index 0000000..43c39f2 +--- /dev/null ++++ b/board/sunxi/dram_sanei_n90.c +@@ -0,0 +1,30 @@ +/* this file is generated, don't edit it yourself */ + +#include @@ -4366,14 +4870,52 @@ diff -purN u-boot-2013.10/board/sunxi/dram_sanei_n90.c u-boot-sunxi-2013.10-sunx + .emr2 = 0, + .emr3 = 0, +}; -+ -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_360_1024_iow16.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_360_1024_iow16.c ---- u-boot-2013.10/board/sunxi/dram_sun4i_360_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_360_1024_iow16.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_sun4i_312_1024_iow8.c b/board/sunxi/dram_sun4i_312_1024_iow8.c +new file mode 100644 +index 0000000..d5e4f1f +--- /dev/null ++++ b/board/sunxi/dram_sun4i_312_1024_iow8.c +@@ -0,0 +1,31 @@ ++/* this file is generated, don't edit it yourself */ ++ ++#include ++#include ++ ++static struct dram_para dram_para = { ++ .clock = 312, ++ .type = 3, ++ .rank_num = 1, ++ .density = 2048, ++ .io_width = 8, ++ .bus_width = 32, ++ .cas = 6, ++ .zq = 123, ++ .odt_en = 0, ++ .size = 1024, ++ .tpr0 = 0x30926692, ++ .tpr1 = 0x1090, ++ .tpr2 = 0x1a0c8, ++ .tpr3 = 0, ++ .tpr4 = 0, ++ .tpr5 = 0, ++ .emr1 = 0, ++ .emr2 = 0, ++ .emr3 = 0, ++}; ++ ++unsigned long sunxi_dram_init(void) ++{ ++ return dramc_init(&dram_para); ++} +diff --git a/board/sunxi/dram_sun4i_360_1024_iow16.c b/board/sunxi/dram_sun4i_360_1024_iow16.c +new file mode 100644 +index 0000000..3763713 +--- /dev/null ++++ b/board/sunxi/dram_sun4i_360_1024_iow16.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4402,13 +4944,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_360_1024_iow16.c u-boot-sunxi-2 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_360_1024_iow8.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_360_1024_iow8.c ---- u-boot-2013.10/board/sunxi/dram_sun4i_360_1024_iow8.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_360_1024_iow8.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_sun4i_360_1024_iow8.c b/board/sunxi/dram_sun4i_360_1024_iow8.c +new file mode 100644 +index 0000000..2a5c9ed +--- /dev/null ++++ b/board/sunxi/dram_sun4i_360_1024_iow8.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4437,13 +4981,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_360_1024_iow8.c u-boot-sunxi-20 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_360_512.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_360_512.c ---- u-boot-2013.10/board/sunxi/dram_sun4i_360_512.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_360_512.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_sun4i_360_512.c b/board/sunxi/dram_sun4i_360_512.c +new file mode 100644 +index 0000000..48aa6e2 +--- /dev/null ++++ b/board/sunxi/dram_sun4i_360_512.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4472,13 +5018,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_360_512.c u-boot-sunxi-2013.10- + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_384_1024_iow8.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_384_1024_iow8.c ---- u-boot-2013.10/board/sunxi/dram_sun4i_384_1024_iow8.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_384_1024_iow8.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_sun4i_384_1024_iow8.c b/board/sunxi/dram_sun4i_384_1024_iow8.c +new file mode 100644 +index 0000000..b0fcc55 +--- /dev/null ++++ b/board/sunxi/dram_sun4i_384_1024_iow8.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4507,13 +5055,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_384_1024_iow8.c u-boot-sunxi-20 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_408_1024_iow16.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_408_1024_iow16.c ---- u-boot-2013.10/board/sunxi/dram_sun4i_408_1024_iow16.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_408_1024_iow16.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_sun4i_408_1024_iow16.c b/board/sunxi/dram_sun4i_408_1024_iow16.c +new file mode 100644 +index 0000000..1bc9f73 +--- /dev/null ++++ b/board/sunxi/dram_sun4i_408_1024_iow16.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4542,13 +5092,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_408_1024_iow16.c u-boot-sunxi-2 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_408_1024_iow8.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_408_1024_iow8.c ---- u-boot-2013.10/board/sunxi/dram_sun4i_408_1024_iow8.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_408_1024_iow8.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_sun4i_408_1024_iow8.c b/board/sunxi/dram_sun4i_408_1024_iow8.c +new file mode 100644 +index 0000000..e9ae84f +--- /dev/null ++++ b/board/sunxi/dram_sun4i_408_1024_iow8.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4577,13 +5129,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_408_1024_iow8.c u-boot-sunxi-20 + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_408_512.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_408_512.c ---- u-boot-2013.10/board/sunxi/dram_sun4i_408_512.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_sun4i_408_512.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_sun4i_408_512.c b/board/sunxi/dram_sun4i_408_512.c +new file mode 100644 +index 0000000..ec0ac15 +--- /dev/null ++++ b/board/sunxi/dram_sun4i_408_512.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4612,13 +5166,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_sun4i_408_512.c u-boot-sunxi-2013.10- + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_wobo_i5.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_wobo_i5.c ---- u-boot-2013.10/board/sunxi/dram_wobo_i5.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_wobo_i5.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_wobo_i5.c b/board/sunxi/dram_wobo_i5.c +new file mode 100644 +index 0000000..6717303 +--- /dev/null ++++ b/board/sunxi/dram_wobo_i5.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4647,13 +5203,15 @@ diff -purN u-boot-2013.10/board/sunxi/dram_wobo_i5.c u-boot-sunxi-2013.10-sunxi/ + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/dram_xzpad700.c u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_xzpad700.c ---- u-boot-2013.10/board/sunxi/dram_xzpad700.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/dram_xzpad700.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/board/sunxi/dram_xzpad700.c b/board/sunxi/dram_xzpad700.c +new file mode 100644 +index 0000000..b04ea9a +--- /dev/null ++++ b/board/sunxi/dram_xzpad700.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + @@ -4682,118 +5240,20 @@ diff -purN u-boot-2013.10/board/sunxi/dram_xzpad700.c u-boot-sunxi-2013.10-sunxi + .emr3 = 0, +}; + -+int sunxi_dram_init(void) ++unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -diff -purN u-boot-2013.10/board/sunxi/Makefile u-boot-sunxi-2013.10-sunxi/board/sunxi/Makefile ---- u-boot-2013.10/board/sunxi/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/board/sunxi/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,96 @@ -+# -+# (C) Copyright 2012 Henrik Nordstrom -+# -+# Based on some other board Makefile -+# -+# (C) Copyright 2000-2003 -+# Wolfgang Denk, DENX Software Engineering, wd@denx.de. -+# -+# See file CREDITS for list of people who contributed to this -+# project. -+# -+# This program is free software; you can redistribute it and/or -+# modify it under the terms of the GNU General Public License as -+# published by the Free Software Foundation; either version 2 of -+# the License, or (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+# MA 02111-1307 USA -+# -+ -+include $(TOPDIR)/config.mk -+ -+LIB := $(obj)lib$(BOARD).o -+ -+COBJS-y := board.o -+COBJS-$(CONFIG_A10_MID_1GB) += dram_sun4i_360_1024_iow16.o -+COBJS-$(CONFIG_A10S_OLINUXINO_M) += dram_a10s_olinuxino_m.o -+COBJS-$(CONFIG_A13_OLINUXINO) += dram_a13_olinuxino.o -+COBJS-$(CONFIG_A13_OLINUXINOM) += dram_a13_oli_micro.o -+COBJS-$(CONFIG_A13_MID) += dram_a13_mid.o -+COBJS-$(CONFIG_A20_OLINUXINO_M) += dram_a20_olinuxino_m.o -+COBJS-$(CONFIG_AUXTEK_T003) += dram_auxtek_t003.o -+# This is not a typo, uses the same mem settings as the a10s-olinuxino-m -+COBJS-$(CONFIG_AUXTEK_T004) += dram_a10s_olinuxino_m.o -+COBJS-$(CONFIG_BA10_TV_BOX) += dram_sun4i_384_1024_iow8.o -+COBJS-$(CONFIG_COBY_MID7042) += dram_sun4i_408_1024_iow16.o -+COBJS-$(CONFIG_COBY_MID8042) += dram_sun4i_360_1024_iow16.o -+COBJS-$(CONFIG_COBY_MID9742) += dram_sun4i_408_1024_iow16.o -+COBJS-$(CONFIG_MARSBOARD_A10) += dram_sun4i_360_1024_iow16.o -+COBJS-$(CONFIG_MARSBOARD_A20) += dram_sun4i_360_1024_iow16.o -+COBJS-$(CONFIG_CUBIEBOARD) += dram_cubieboard.o -+COBJS-$(CONFIG_CUBIEBOARD_512) += dram_cubieboard_512.o -+COBJS-$(CONFIG_CUBIEBOARD2) += dram_cubieboard2.o -+COBJS-$(CONFIG_CUBIETRUCK) += dram_cubietruck.o -+COBJS-$(CONFIG_DNS_M82) += dram_sun4i_360_1024_iow16.o -+COBJS-$(CONFIG_EOMA68_A10) += dram_sun4i_360_1024_iow8.o -+COBJS-$(CONFIG_EOMA68_A20) += dram_eoma68_a20.o -+COBJS-$(CONFIG_GOOSEBERRY_A721) += dram_gooseberry_a721.o -+COBJS-$(CONFIG_H6) += dram_h6.o -+COBJS-$(CONFIG_HACKBERRY) += dram_hackberry.o -+COBJS-$(CONFIG_A7HD) += dram_sun4i_360_1024_iow8.o -+COBJS-$(CONFIG_INET97F_II) += dram_sun4i_408_512.o -+COBJS-$(CONFIG_MELE_A1000) += dram_sun4i_360_512.o -+COBJS-$(CONFIG_MELE_A1000G) += dram_sun4i_360_1024_iow8.o -+COBJS-$(CONFIG_MELE_A3700) += dram_sun4i_360_1024_iow8.o -+COBJS-$(CONFIG_MINI_X) += dram_sun4i_360_512.o -+COBJS-$(CONFIG_MINI_X_1GB) += dram_sun4i_360_1024_iow16.o -+COBJS-$(CONFIG_MK802) += dram_sun4i_360_512.o -+COBJS-$(CONFIG_MK802_1GB) += dram_sun4i_360_1024_iow16.o -+COBJS-$(CONFIG_MK802_A10S) += dram_mk802_a10s.o -+COBJS-$(CONFIG_MK802II) += dram_sun4i_408_1024_iow8.o -+COBJS-$(CONFIG_PCDUINO) += dram_sun4i_408_1024_iow8.o -+COBJS-$(CONFIG_PENGPOD700) += dram_sun4i_384_1024_iow8.o -+COBJS-$(CONFIG_PENGPOD1000) += dram_sun4i_408_1024_iow16.o -+COBJS-$(CONFIG_POV_PROTAB2) += dram_pov_protab2.o -+COBJS-$(CONFIG_POV_PROTAB2_XXL) += dram_pov_protab2_xxl.o -+COBJS-$(CONFIG_R7DONGLE) += dram_r7dongle.o -+COBJS-$(CONFIG_SANEI_N90) += dram_sanei_n90.o -+COBJS-$(CONFIG_UHOST_U1A) += dram_sun4i_360_1024_iow8.o -+COBJS-$(CONFIG_WOBO_I5) += dram_wobo_i5.o -+COBJS-$(CONFIG_XZPAD700) += dram_xzpad700.o -+ -+COBJS := $(COBJS-y) -+SRCS := $(COBJS:.o=.c) -+OBJS := $(addprefix $(obj),$(COBJS)) -+ -+all: $(LIB) -+ -+$(LIB): $(obj).depend $(OBJS) -+ $(call cmd_link_o_target, $(OBJS)) -+ -+######################################################################### -+ -+# defines $(obj).depend target -+include $(SRCTREE)/rules.mk -+ -+sinclude $(obj).depend -+ -+######################################################################## -diff -purN u-boot-2013.10/boards.cfg u-boot-sunxi-2013.10-sunxi/boards.cfg ---- u-boot-2013.10/boards.cfg 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/boards.cfg 2013-11-25 23:20:38.000000000 +0100 -@@ -340,6 +340,69 @@ Active arm armv7 rmobi - Active arm armv7 s5pc1xx samsung goni s5p_goni - Minkyu Kang +diff --git a/boards.cfg b/boards.cfg +index a8336cc..7eaefe9 100644 +--- a/boards.cfg ++++ b/boards.cfg +@@ -353,6 +353,80 @@ Active arm armv7 rmobile renesas koelsch + Active arm armv7 s5pc1xx samsung goni s5p_goni - Mateusz Zalega Active arm armv7 s5pc1xx samsung smdkc100 smdkc100 - Minkyu Kang Active arm armv7 socfpga altera socfpga socfpga_cyclone5 - - +Active arm armv7 sunxi - sunxi A10_MID_1GB sun4i:A10_MID_1GB,SPL - ++Active arm armv7 sunxi - sunxi A10-OLinuXino-Lime sun4i:A10_OLINUXINO_L,STATUSLED=226,SPL,SUNXI_EMAC - +Active arm armv7 sunxi - sunxi A10s-OLinuXino-M sun5i:A10S_OLINUXINO_M,STATUSLED=131,AXP152_POWER,CONS_INDEX=1,SPL,SUNXI_EMAC - +Active arm armv7 sunxi - sunxi A10s-OLinuXino-M_FEL sun5i:A10S_OLINUXINO_M,STATUSLED=131,AXP152_POWER,CONS_INDEX=1,SPL_FEL,SUNXI_EMAC - +Active arm armv7 sunxi - sunxi A13-OLinuXino sun5i:A13_OLINUXINO,SPL,STATUSLED=201,CONS_INDEX=2 - @@ -4811,10 +5271,10 @@ diff -purN u-boot-2013.10/boards.cfg u-boot-sunxi-2013.10-sunxi/boards.cfg +Active arm armv7 sunxi - sunxi Coby_MID8042 sun4i:COBY_MID8042,SPL - +Active arm armv7 sunxi - sunxi Coby_MID9742 sun4i:COBY_MID9742,SPL - +Active arm armv7 sunxi - sunxi Cubieboard sun4i:CUBIEBOARD,SPL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 - -+Active arm armv7 sunxi - sunxi Cubieboard2 sun7i:CUBIEBOARD2,SPL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 - -+Active arm armv7 sunxi - sunxi Cubieboard2_FEL sun7i:CUBIEBOARD2,SPL_FEL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 - -+Active arm armv7 sunxi - sunxi Cubietruck sun7i:CUBIETRUCK,SPL,SUNXI_EMAC,STATUSLED=245,STATUSLED1=244,STATUSLED2=235,STATUSLED3=231 - -+Active arm armv7 sunxi - sunxi Cubietruck_FEL sun7i:CUBIETRUCK,SPL_FEL,SUNXI_EMAC,STATUSLED=245,STATUSLED1=244,STATUSLED2=235,STATUSLED3=231 - ++Active arm armv7 sunxi - sunxi Cubieboard2 sun7i:CUBIEBOARD2,SPL,SUNXI_GMAC,STATUSLED=244,STATUSLED1=245,FAST_MBUS - ++Active arm armv7 sunxi - sunxi Cubieboard2_FEL sun7i:CUBIEBOARD2,SPL_FEL,SUNXI_GMAC,STATUSLED=244,STATUSLED1=245,FAST_MBUS - ++Active arm armv7 sunxi - sunxi Cubietruck sun7i:CUBIETRUCK,SPL,SUNXI_GMAC,RGMII,STATUSLED=245,STATUSLED1=244,STATUSLED2=235,STATUSLED3=231,FAST_MBUS - ++Active arm armv7 sunxi - sunxi Cubietruck_FEL sun7i:CUBIETRUCK,SPL_FEL,SUNXI_GMAC,RGMII,STATUSLED=245,STATUSLED1=244,STATUSLED2=235,STATUSLED3=231,FAST_MBUS - +Active arm armv7 sunxi - sunxi Cubieboard_512 sun4i:CUBIEBOARD_512,SPL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 - +Active arm armv7 sunxi - sunxi Cubieboard_FEL sun4i:CUBIEBOARD,SPL_FEL,SUNXI_EMAC,STATUSLED=244,STATUSLED1=245 - +Active arm armv7 sunxi - sunxi DNS_M82 sun4i:DNS_M82,SPL - @@ -4822,23 +5282,33 @@ diff -purN u-boot-2013.10/boards.cfg u-boot-sunxi-2013.10-sunxi/boards.cfg +Active arm armv7 sunxi - sunxi EOMA68_A10_FEL sun4i:EOMA68_A10,SPL_FEL,MMC_SUNXI_SLOT=3,SUNXI_EMAC - +Active arm armv7 sunxi - sunxi EOMA68_A20 sun7i:EOMA68_A20,SPL,MMC_SUNXI_SLOT=3,SUNXI_EMAC - +Active arm armv7 sunxi - sunxi EOMA68_A20_FEL sun7i:EOMA68_A20,SPL_FEL,MMC_SUNXI_SLOT=3,SUNXI_EMAC - ++Active arm armv7 sunxi - sunxi EU3000 sun7i:EU3000,SPL - +Active arm armv7 sunxi - sunxi Gooseberry_A721 sun4i:GOOSEBERRY_A721,SPL - +Active arm armv7 sunxi - sunxi H6 sun4i:H6,SPL - +Active arm armv7 sunxi - sunxi Hackberry sun4i:HACKBERRY,SPL - +Active arm armv7 sunxi - sunxi Hyundai_A7HD sun4i:A7HD,SPL - ++Active arm armv7 sunxi - sunxi Interra-3 sun7i:INTERRA3,SPL,SUNXI_GMAC,FAST_MBUS,MMC_SUNXI_SLOT=2 - ++Active arm armv7 sunxi - sunxi INet_86VZ sun5i:INET_86VZ,SPL - ++Active arm armv7 sunxi - sunxi INet_86VZ_FEL sun5i:INET_86VZ,SPL_FEL,UART0_PORT_F - +Active arm armv7 sunxi - sunxi INet97F-II sun4i:INET97F_II,SPL - ++Active arm armv7 sunxi - sunxi INet_K70HC sun7i:INET_K70HC,SPL - ++Active arm armv7 sunxi - sunxi Jesurun-Q5 sun4i:JESURUN_Q5,SPL,SUNXI_EMAC,STATUSLED=244 - ++Active arm armv7 sunxi - sunxi K1001L1C sun7i:K1001L1C,SPL - +Active arm armv7 sunxi - sunxi Marsboard_A10 sun4i:MARSBOARD_A10,SPL,SUNXI_EMAC,NO_AXP - +Active arm armv7 sunxi - sunxi Marsboard_A20 sun7i:MARSBOARD_A20,SPL,SUNXI_EMAC,NO_AXP - +Active arm armv7 sunxi - sunxi Marsboard_A20_debug sun7i:MARSBOARD_A20,SPL,SUNXI_EMAC,NO_AXP,SYS_SECONDARY_ON - ++Active arm armv7 sunxi - sunxi Megafeis_A08 sun5i:MEFAFEIS_A08,SPL - +Active arm armv7 sunxi - sunxi Mele_A1000 sun4i:MELE_A1000,SPL,SUNXI_EMAC,STATUSLED=234 - +Active arm armv7 sunxi - sunxi Mele_A1000_FEL sun4i:MELE_A1000,SPL_FEL,SUNXI_EMAC,STATUSLED=234 - +Active arm armv7 sunxi - sunxi Mele_A1000G sun4i:MELE_A1000G,SPL,SUNXI_EMAC,STATUSLED=234 - +Active arm armv7 sunxi - sunxi Mele_A3700 sun4i:MELE_A3700,SPL,SUNXI_EMAC,STATUSLED=234 - +Active arm armv7 sunxi - sunxi Mini-X sun4i:MINI_X,SPL - +Active arm armv7 sunxi - sunxi Mini-X-1Gb sun4i:MINI_X_1GB,SPL - ++Active arm armv7 sunxi - sunxi Mini-X_A10s sun5i:MINI_X_A10S,SPL - +Active arm armv7 sunxi - sunxi mk802 sun4i:MK802,SPL,NO_AXP - +Active arm armv7 sunxi - sunxi mk802-1gb sun4i:MK802_1GB,SPL,NO_AXP - +Active arm armv7 sunxi - sunxi mk802_a10s sun5i:MK802_A10S,SPL,AXP152_POWER,STATUSLED=34 - ++Active arm armv7 sunxi - sunxi mk802ii_A20 sun7i:MK802II_A20,SPL - +Active arm armv7 sunxi - sunxi mk802ii sun4i:MK802II,SPL - +Active arm armv7 sunxi - sunxi pcDuino sun4i:PCDUINO,SPL,SUNXI_EMAC - +Active arm armv7 sunxi - sunxi pengpod1000 sun4i:PENGPOD1000,SPL - @@ -4859,9 +5329,10 @@ diff -purN u-boot-2013.10/boards.cfg u-boot-sunxi-2013.10-sunxi/boards.cfg Active arm armv7 u8500 st-ericsson snowball snowball - Mathieu Poirier Active arm armv7 u8500 st-ericsson u8500 u8500_href - - Active arm armv7 vf610 freescale vf610twr vf610twr vf610twr:IMX_CONFIG=board/freescale/vf610twr/imximage.cfg Alison Wang -diff -purN u-boot-2013.10/common/cmd_gpio.c u-boot-sunxi-2013.10-sunxi/common/cmd_gpio.c ---- u-boot-2013.10/common/cmd_gpio.c 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/common/cmd_gpio.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/common/cmd_gpio.c b/common/cmd_gpio.c +index 47eee89..d551415 100644 +--- a/common/cmd_gpio.c ++++ b/common/cmd_gpio.c @@ -20,6 +20,7 @@ enum gpio_cmd { GPIO_SET, GPIO_CLEAR, @@ -4870,7 +5341,7 @@ diff -purN u-boot-2013.10/common/cmd_gpio.c u-boot-sunxi-2013.10-sunxi/common/cm }; static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -@@ -48,6 +49,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int +@@ -48,6 +49,7 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) case 's': sub_cmd = GPIO_SET; break; case 'c': sub_cmd = GPIO_CLEAR; break; case 't': sub_cmd = GPIO_TOGGLE; break; @@ -4878,7 +5349,7 @@ diff -purN u-boot-2013.10/common/cmd_gpio.c u-boot-sunxi-2013.10-sunxi/common/cm default: goto show_usage; } -@@ -66,6 +68,13 @@ static int do_gpio(cmd_tbl_t *cmdtp, int +@@ -66,6 +68,13 @@ static int do_gpio(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (sub_cmd == GPIO_INPUT) { gpio_direction_input(gpio); value = gpio_get_value(gpio); @@ -4892,10 +5363,68 @@ diff -purN u-boot-2013.10/common/cmd_gpio.c u-boot-sunxi-2013.10-sunxi/common/cm } else { switch (sub_cmd) { case GPIO_SET: value = 1; break; -diff -purN u-boot-2013.10/common/spl/spl_mmc.c u-boot-sunxi-2013.10-sunxi/common/spl/spl_mmc.c ---- u-boot-2013.10/common/spl/spl_mmc.c 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/common/spl/spl_mmc.c 2013-11-25 23:20:38.000000000 +0100 -@@ -30,8 +30,10 @@ static int mmc_load_image_raw(struct mmc +diff --git a/common/memsize.c b/common/memsize.c +index 73b92c8..617907d 100644 +--- a/common/memsize.c ++++ b/common/memsize.c +@@ -21,16 +21,16 @@ + * the actually available RAM size between addresses `base' and + * `base + maxsize'. + */ +-long get_ram_size(long *base, long maxsize) ++unsigned long get_ram_size(unsigned long *base, unsigned long maxsize) + { +- volatile long *addr; +- long save[32]; +- long cnt; +- long val; +- long size; +- int i = 0; ++ volatile unsigned long *addr; ++ unsigned long save[32]; ++ unsigned long cnt; ++ unsigned long val; ++ unsigned long size; ++ int i = 0; + +- for (cnt = (maxsize / sizeof (long)) >> 1; cnt > 0; cnt >>= 1) { ++ for (cnt = (maxsize / sizeof (unsigned long)) >> 1; cnt > 0; cnt >>= 1) { + addr = base + cnt; /* pointer arith! */ + sync (); + save[i++] = *addr; +@@ -50,7 +50,7 @@ long get_ram_size(long *base, long maxsize) + */ + sync (); + *addr = save[i]; +- for (cnt = 1; cnt < maxsize / sizeof(long); cnt <<= 1) { ++ for (cnt = 1; cnt < maxsize / sizeof(unsigned long); cnt <<= 1) { + addr = base + cnt; + sync (); + *addr = save[--i]; +@@ -58,15 +58,15 @@ long get_ram_size(long *base, long maxsize) + return (0); + } + +- for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) { ++ for (cnt = 1; cnt < maxsize / sizeof (unsigned long); cnt <<= 1) { + addr = base + cnt; /* pointer arith! */ + val = *addr; + *addr = save[--i]; + if (val != ~cnt) { +- size = cnt * sizeof (long); ++ size = cnt * sizeof (unsigned long); + /* Restore the original data before leaving the function. + */ +- for (cnt <<= 1; cnt < maxsize / sizeof (long); cnt <<= 1) { ++ for (cnt <<= 1; cnt < maxsize / sizeof (unsigned long); cnt <<= 1) { + addr = base + cnt; + *addr = save[--i]; + } +diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c +index fc2f226..e20b19e 100644 +--- a/common/spl/spl_mmc.c ++++ b/common/spl/spl_mmc.c +@@ -30,8 +30,10 @@ static int mmc_load_image_raw(struct mmc *mmc, unsigned long sector) if (err == 0) goto end; @@ -4907,20 +5436,20 @@ diff -purN u-boot-2013.10/common/spl/spl_mmc.c u-boot-sunxi-2013.10-sunxi/common spl_parse_image_header(header); -diff -purN u-boot-2013.10/drivers/gpio/Makefile u-boot-sunxi-2013.10-sunxi/drivers/gpio/Makefile ---- u-boot-2013.10/drivers/gpio/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/drivers/gpio/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -34,6 +34,7 @@ COBJS-$(CONFIG_S3C2440_GPIO) += s3c2440_ - COBJS-$(CONFIG_XILINX_GPIO) += xilinx_gpio.o - COBJS-$(CONFIG_ADI_GPIO2) += adi_gpio2.o - COBJS-$(CONFIG_TCA642X) += tca642x.o -+COBJS-$(CONFIG_SUNXI_GPIO) += sunxi_gpio.o - - COBJS := $(COBJS-y) - SRCS := $(COBJS:.o=.c) -diff -purN u-boot-2013.10/drivers/gpio/sunxi_gpio.c u-boot-sunxi-2013.10-sunxi/drivers/gpio/sunxi_gpio.c ---- u-boot-2013.10/drivers/gpio/sunxi_gpio.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/drivers/gpio/sunxi_gpio.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile +index b903c45..ba6b98e 100644 +--- a/drivers/gpio/Makefile ++++ b/drivers/gpio/Makefile +@@ -31,3 +31,4 @@ obj-$(CONFIG_XILINX_GPIO) += xilinx_gpio.o + obj-$(CONFIG_ADI_GPIO2) += adi_gpio2.o + obj-$(CONFIG_TCA642X) += tca642x.o + oby-$(CONFIG_SX151X) += sx151x.o ++obj-$(CONFIG_SUNXI_GPIO) += sunxi_gpio.o +diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c +new file mode 100644 +index 0000000..b3686f4 +--- /dev/null ++++ b/drivers/gpio/sunxi_gpio.c @@ -0,0 +1,120 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom @@ -5042,20 +5571,23 @@ diff -purN u-boot-2013.10/drivers/gpio/sunxi_gpio.c u-boot-sunxi-2013.10-sunxi/d + return -1; + return group * 32 + pin; +} -diff -purN u-boot-2013.10/drivers/i2c/Makefile u-boot-sunxi-2013.10-sunxi/drivers/i2c/Makefile ---- u-boot-2013.10/drivers/i2c/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/drivers/i2c/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -25,6 +25,7 @@ COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c - COBJS-$(CONFIG_U8500_I2C) += u8500_i2c.o - COBJS-$(CONFIG_SH_I2C) += sh_i2c.o - COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o -+COBJS-$(CONFIG_SUNXI_I2C) += sunxi_i2c.o - COBJS-$(CONFIG_SYS_I2C) += i2c_core.o - COBJS-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o - COBJS-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o -diff -purN u-boot-2013.10/drivers/i2c/sunxi_i2c.c u-boot-sunxi-2013.10-sunxi/drivers/i2c/sunxi_i2c.c ---- u-boot-2013.10/drivers/i2c/sunxi_i2c.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/drivers/i2c/sunxi_i2c.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile +index fa3a875..2a44db4 100644 +--- a/drivers/i2c/Makefile ++++ b/drivers/i2c/Makefile +@@ -15,6 +15,7 @@ obj-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o + obj-$(CONFIG_TSI108_I2C) += tsi108_i2c.o + obj-$(CONFIG_U8500_I2C) += u8500_i2c.o + obj-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o ++obj-$(CONFIG_SUNXI_I2C) += sunxi_i2c.o + obj-$(CONFIG_SYS_I2C) += i2c_core.o + obj-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o + obj-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o +diff --git a/drivers/i2c/sunxi_i2c.c b/drivers/i2c/sunxi_i2c.c +new file mode 100644 +index 0000000..2d690ec +--- /dev/null ++++ b/drivers/i2c/sunxi_i2c.c @@ -0,0 +1,276 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom @@ -5333,20 +5865,23 @@ diff -purN u-boot-2013.10/drivers/i2c/sunxi_i2c.c u-boot-sunxi-2013.10-sunxi/dri + + return rc; +} -diff -purN u-boot-2013.10/drivers/mmc/Makefile u-boot-sunxi-2013.10-sunxi/drivers/mmc/Makefile ---- u-boot-2013.10/drivers/mmc/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/drivers/mmc/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -31,6 +31,7 @@ COBJS-$(CONFIG_SPEAR_SDHCI) += spear_sdh - COBJS-$(CONFIG_TEGRA_MMC) += tegra_mmc.o - COBJS-$(CONFIG_DWMMC) += dw_mmc.o - COBJS-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o -+COBJS-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o - COBJS-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o +diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile +index e793ed9..c695841 100644 +--- a/drivers/mmc/Makefile ++++ b/drivers/mmc/Makefile +@@ -27,6 +27,7 @@ obj-$(CONFIG_SPEAR_SDHCI) += spear_sdhci.o + obj-$(CONFIG_TEGRA_MMC) += tegra_mmc.o + obj-$(CONFIG_DWMMC) += dw_mmc.o + obj-$(CONFIG_EXYNOS_DWMMC) += exynos_dw_mmc.o ++obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o + obj-$(CONFIG_ZYNQ_SDHCI) += zynq_sdhci.o + obj-$(CONFIG_SOCFPGA_DWMMC) += socfpga_dw_mmc.o ifdef CONFIG_SPL_BUILD - COBJS-$(CONFIG_SPL_MMC_BOOT) += fsl_esdhc_spl.o -diff -purN u-boot-2013.10/drivers/mmc/sunxi_mmc.c u-boot-sunxi-2013.10-sunxi/drivers/mmc/sunxi_mmc.c ---- u-boot-2013.10/drivers/mmc/sunxi_mmc.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/drivers/mmc/sunxi_mmc.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c +new file mode 100755 +index 0000000..be5f301 +--- /dev/null ++++ b/drivers/mmc/sunxi_mmc.c @@ -0,0 +1,660 @@ +/* + * (C) Copyright 2007-2011 @@ -6008,1075 +6543,485 @@ diff -purN u-boot-2013.10/drivers/mmc/sunxi_mmc.c u-boot-sunxi-2013.10-sunxi/dri + + return 0; +} -diff -purN u-boot-2013.10/drivers/net/Makefile u-boot-sunxi-2013.10-sunxi/drivers/net/Makefile ---- u-boot-2013.10/drivers/net/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/drivers/net/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -54,7 +54,7 @@ COBJS-$(CONFIG_RTL8169) += rtl8169.o - COBJS-$(CONFIG_SH_ETHER) += sh_eth.o - COBJS-$(CONFIG_SMC91111) += smc91111.o - COBJS-$(CONFIG_SMC911X) += smc911x.o --COBJS-$(CONFIG_SUNXI_WEMAC) += sunxi_wemac.o -+COBJS-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o - COBJS-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o - COBJS-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o - COBJS-$(CONFIG_DRIVER_TI_CPSW) += cpsw.o -diff -purN u-boot-2013.10/drivers/net/sunxi_emac.c u-boot-sunxi-2013.10-sunxi/drivers/net/sunxi_emac.c ---- u-boot-2013.10/drivers/net/sunxi_emac.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/drivers/net/sunxi_emac.c 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,521 @@ -+/* -+ * sunxi_emac.c -- Allwinner A10 ethernet driver -+ * -+ * (C) Copyright 2012, Stefan Roese -+ * -+ * SPDX-License-Identifier: GPL-2.0+ -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* EMAC register */ -+struct emac_regs { -+ u32 ctl; /* 0x00 */ -+ u32 tx_mode; /* 0x04 */ -+ u32 tx_flow; /* 0x08 */ -+ u32 tx_ctl0; /* 0x0c */ -+ u32 tx_ctl1; /* 0x10 */ -+ u32 tx_ins; /* 0x14 */ -+ u32 tx_pl0; /* 0x18 */ -+ u32 tx_pl1; /* 0x1c */ -+ u32 tx_sta; /* 0x20 */ -+ u32 tx_io_data; /* 0x24 */ -+ u32 tx_io_data1;/* 0x28 */ -+ u32 tx_tsvl0; /* 0x2c */ -+ u32 tx_tsvh0; /* 0x30 */ -+ u32 tx_tsvl1; /* 0x34 */ -+ u32 tx_tsvh1; /* 0x38 */ -+ u32 rx_ctl; /* 0x3c */ -+ u32 rx_hash0; /* 0x40 */ -+ u32 rx_hash1; /* 0x44 */ -+ u32 rx_sta; /* 0x48 */ -+ u32 rx_io_data; /* 0x4c */ -+ u32 rx_fbc; /* 0x50 */ -+ u32 int_ctl; /* 0x54 */ -+ u32 int_sta; /* 0x58 */ -+ u32 mac_ctl0; /* 0x5c */ -+ u32 mac_ctl1; /* 0x60 */ -+ u32 mac_ipgt; /* 0x64 */ -+ u32 mac_ipgr; /* 0x68 */ -+ u32 mac_clrt; /* 0x6c */ -+ u32 mac_maxf; /* 0x70 */ -+ u32 mac_supp; /* 0x74 */ -+ u32 mac_test; /* 0x78 */ -+ u32 mac_mcfg; /* 0x7c */ -+ u32 mac_mcmd; /* 0x80 */ -+ u32 mac_madr; /* 0x84 */ -+ u32 mac_mwtd; /* 0x88 */ -+ u32 mac_mrdd; /* 0x8c */ -+ u32 mac_mind; /* 0x90 */ -+ u32 mac_ssrr; /* 0x94 */ -+ u32 mac_a0; /* 0x98 */ -+ u32 mac_a1; /* 0x9c */ -+}; -+ -+/* SRAMC register */ -+struct sunxi_sramc_regs { -+ u32 ctrl0; -+ u32 ctrl1; -+}; -+ -+/* 0: Disable 1: Aborted frame enable(default) */ -+#define EMAC_TX_AB_M (0x1 << 0) -+/* 0: CPU 1: DMA(default) */ -+#define EMAC_TX_TM (0x1 << 1) -+ -+#define EMAC_TX_SETUP (0) -+ -+/* 0: DRQ asserted 1: DRQ automatically(default) */ -+#define EMAC_RX_DRQ_MODE (0x1 << 1) -+/* 0: CPU 1: DMA(default) */ -+#define EMAC_RX_TM (0x1 << 2) -+/* 0: Normal(default) 1: Pass all Frames */ -+#define EMAC_RX_PA (0x1 << 4) -+/* 0: Normal(default) 1: Pass Control Frames */ -+#define EMAC_RX_PCF (0x1 << 5) -+/* 0: Normal(default) 1: Pass Frames with CRC Error */ -+#define EMAC_RX_PCRCE (0x1 << 6) -+/* 0: Normal(default) 1: Pass Frames with Length Error */ -+#define EMAC_RX_PLE (0x1 << 7) -+/* 0: Normal 1: Pass Frames length out of range(default) */ -+#define EMAC_RX_POR (0x1 << 8) -+/* 0: Not accept 1: Accept unicast Packets(default) */ -+#define EMAC_RX_UCAD (0x1 << 16) -+/* 0: Normal(default) 1: DA Filtering */ -+#define EMAC_RX_DAF (0x1 << 17) -+/* 0: Not accept 1: Accept multicast Packets(default) */ -+#define EMAC_RX_MCO (0x1 << 20) -+/* 0: Disable(default) 1: Enable Hash filter */ -+#define EMAC_RX_MHF (0x1 << 21) -+/* 0: Not accept 1: Accept Broadcast Packets(default) */ -+#define EMAC_RX_BCO (0x1 << 22) -+/* 0: Disable(default) 1: Enable SA Filtering */ -+#define EMAC_RX_SAF (0x1 << 24) -+/* 0: Normal(default) 1: Inverse Filtering */ -+#define EMAC_RX_SAIF (0x1 << 25) -+ -+#define EMAC_RX_SETUP (EMAC_RX_POR | EMAC_RX_UCAD | EMAC_RX_DAF | \ -+ EMAC_RX_MCO | EMAC_RX_BCO) -+ -+/* 0: Disable 1: Enable Receive Flow Control(default) */ -+#define EMAC_MAC_CTL0_RFC (0x1 << 2) -+/* 0: Disable 1: Enable Transmit Flow Control(default) */ -+#define EMAC_MAC_CTL0_TFC (0x1 << 3) -+ -+#define EMAC_MAC_CTL0_SETUP (EMAC_MAC_CTL0_RFC | EMAC_MAC_CTL0_TFC) -+ -+/* 0: Disable 1: Enable MAC Frame Length Checking(default) */ -+#define EMAC_MAC_CTL1_FLC (0x1 << 1) -+/* 0: Disable(default) 1: Enable Huge Frame */ -+#define EMAC_MAC_CTL1_HF (0x1 << 2) -+/* 0: Disable(default) 1: Enable MAC Delayed CRC */ -+#define EMAC_MAC_CTL1_DCRC (0x1 << 3) -+/* 0: Disable 1: Enable MAC CRC(default) */ -+#define EMAC_MAC_CTL1_CRC (0x1 << 4) -+/* 0: Disable 1: Enable MAC PAD Short frames(default) */ -+#define EMAC_MAC_CTL1_PC (0x1 << 5) -+/* 0: Disable(default) 1: Enable MAC PAD Short frames and append CRC */ -+#define EMAC_MAC_CTL1_VC (0x1 << 6) -+/* 0: Disable(default) 1: Enable MAC auto detect Short frames */ -+#define EMAC_MAC_CTL1_ADP (0x1 << 7) -+/* 0: Disable(default) 1: Enable */ -+#define EMAC_MAC_CTL1_PRE (0x1 << 8) -+/* 0: Disable(default) 1: Enable */ -+#define EMAC_MAC_CTL1_LPE (0x1 << 9) -+/* 0: Disable(default) 1: Enable no back off */ -+#define EMAC_MAC_CTL1_NB (0x1 << 12) -+/* 0: Disable(default) 1: Enable */ -+#define EMAC_MAC_CTL1_BNB (0x1 << 13) -+/* 0: Disable(default) 1: Enable */ -+#define EMAC_MAC_CTL1_ED (0x1 << 14) -+ -+#define EMAC_MAC_CTL1_SETUP (EMAC_MAC_CTL1_FLC | EMAC_MAC_CTL1_CRC | \ -+ EMAC_MAC_CTL1_PC) -+ -+#define EMAC_MAC_IPGT 0x15 -+ -+#define EMAC_MAC_NBTB_IPG1 0xc -+#define EMAC_MAC_NBTB_IPG2 0x12 -+ -+#define EMAC_MAC_CW 0x37 -+#define EMAC_MAC_RM 0xf -+ -+#define EMAC_MAC_MFL 0x0600 -+ -+/* Receive status */ -+#define EMAC_CRCERR (0x1 << 4) -+#define EMAC_LENERR (0x3 << 5) -+ -+#define DMA_CPU_TRRESHOLD 2000 -+ -+struct emac_eth_dev { -+ u32 speed; -+ u32 duplex; -+ u32 phy_configured; -+ int link_printed; -+}; -+ -+struct emac_rxhdr { -+ s16 rx_len; -+ u16 rx_status; -+}; -+ -+static void emac_inblk_32bit(void *reg, void *data, int count) -+{ -+ int cnt = (count + 3) >> 2; -+ -+ if (cnt) { -+ u32 *buf = data; -+ -+ do { -+ u32 x = readl(reg); -+ *buf++ = x; -+ } while (--cnt); -+ } -+} -+ -+static void emac_outblk_32bit(void *reg, void *data, int count) -+{ -+ int cnt = (count + 3) >> 2; -+ -+ if (cnt) { -+ const u32 *buf = data; -+ -+ do { -+ writel(*buf++, reg); -+ } while (--cnt); -+ } -+} -+ -+/* Read a word from phyxcer */ -+static int emac_phy_read(const char *devname, unsigned char addr, -+ unsigned char reg, unsigned short *value) -+{ -+ struct eth_device *dev = eth_get_dev_by_name(devname); -+ struct emac_regs *regs = (struct emac_regs *)dev->iobase; -+ -+ /* issue the phy address and reg */ -+ writel(addr << 8 | reg, ®s->mac_madr); -+ -+ /* pull up the phy io line */ -+ writel(0x1, ®s->mac_mcmd); -+ -+ /* Wait read complete */ -+ mdelay(1); -+ -+ /* push down the phy io line */ -+ writel(0x0, ®s->mac_mcmd); -+ -+ /* and write data */ -+ *value = readl(®s->mac_mrdd); -+ -+ return 0; -+} -+ -+/* Write a word to phyxcer */ -+static int emac_phy_write(const char *devname, unsigned char addr, -+ unsigned char reg, unsigned short value) -+{ -+ struct eth_device *dev = eth_get_dev_by_name(devname); -+ struct emac_regs *regs = (struct emac_regs *)dev->iobase; -+ -+ /* issue the phy address and reg */ -+ writel(addr << 8 | reg, ®s->mac_madr); -+ -+ /* pull up the phy io line */ -+ writel(0x1, ®s->mac_mcmd); -+ -+ /* Wait write complete */ -+ mdelay(1); -+ -+ /* push down the phy io line */ -+ writel(0x0, ®s->mac_mcmd); -+ -+ /* and write data */ -+ writel(value, ®s->mac_mwtd); -+ -+ return 0; -+} -+ -+static void emac_setup(struct eth_device *dev) -+{ -+ struct emac_regs *regs = (struct emac_regs *)dev->iobase; -+ u32 reg_val; -+ u16 phy_val; -+ u32 duplex_flag; -+ -+ /* Set up TX */ -+ writel(EMAC_TX_SETUP, ®s->tx_mode); -+ -+ /* Set up RX */ -+ writel(EMAC_RX_SETUP, ®s->rx_ctl); -+ -+ /* Set MAC */ -+ /* Set MAC CTL0 */ -+ writel(EMAC_MAC_CTL0_SETUP, ®s->mac_ctl0); -+ -+ /* Set MAC CTL1 */ -+ emac_phy_read(dev->name, 1, 0, &phy_val); -+ debug("PHY SETUP, reg 0 value: %x\n", phy_val); -+ duplex_flag = !!(phy_val & (1 << 8)); -+ -+ reg_val = 0; -+ if (duplex_flag) -+ reg_val = (0x1 << 0); -+ writel(EMAC_MAC_CTL1_SETUP | reg_val, ®s->mac_ctl1); -+ -+ /* Set up IPGT */ -+ writel(EMAC_MAC_IPGT, ®s->mac_ipgt); -+ -+ /* Set up IPGR */ -+ writel(EMAC_MAC_NBTB_IPG2 | (EMAC_MAC_NBTB_IPG1 << 8), ®s->mac_ipgr); -+ -+ /* Set up Collison window */ -+ writel(EMAC_MAC_RM | (EMAC_MAC_CW << 8), ®s->mac_clrt); -+ -+ /* Set up Max Frame Length */ -+ writel(EMAC_MAC_MFL, ®s->mac_maxf); -+} -+ -+static void emac_reset(struct eth_device *dev) -+{ -+ struct emac_regs *regs = (struct emac_regs *)dev->iobase; -+ -+ debug("resetting device\n"); -+ -+ /* RESET device */ -+ writel(0, ®s->ctl); -+ udelay(200); -+ -+ writel(1, ®s->ctl); -+ udelay(200); -+} -+ -+static int sunxi_emac_eth_init(struct eth_device *dev, bd_t *bd) -+{ -+ struct emac_regs *regs = (struct emac_regs *)dev->iobase; -+ struct emac_eth_dev *priv = dev->priv; -+ u16 phy_reg; -+ -+ /* Init EMAC */ -+ -+ /* Flush RX FIFO */ -+ setbits_le32(®s->rx_ctl, 0x8); -+ udelay(1); -+ -+ /* Init MAC */ -+ -+ /* Soft reset MAC */ -+ clrbits_le32(®s->mac_ctl0, 0x1 << 15); -+ -+ /* Clear RX counter */ -+ writel(0x0, ®s->rx_fbc); -+ udelay(1); -+ -+ /* Set up EMAC */ -+ emac_setup(dev); -+ -+ writel(dev->enetaddr[0] << 16 | dev->enetaddr[1] << 8 | -+ dev->enetaddr[2], ®s->mac_a1); -+ writel(dev->enetaddr[3] << 16 | dev->enetaddr[4] << 8 | -+ dev->enetaddr[5], ®s->mac_a0); -+ -+ mdelay(1); -+ -+ emac_reset(dev); -+ -+ /* PHY POWER UP */ -+ emac_phy_read(dev->name, 1, 0, &phy_reg); -+ emac_phy_write(dev->name, 1, 0, phy_reg & (~(0x1 << 11))); -+ mdelay(1); -+ -+ emac_phy_read(dev->name, 1, 0, &phy_reg); -+ -+ priv->speed = miiphy_speed(dev->name, 0); -+ priv->duplex = miiphy_duplex(dev->name, 0); -+ -+ /* Print link status only once */ -+ if (!priv->link_printed) { -+ printf("ENET Speed is %d Mbps - %s duplex connection\n", -+ priv->speed, (priv->duplex == HALF) ? "HALF" : "FULL"); -+ priv->link_printed = 1; -+ } -+ -+ /* Set EMAC SPEED depend on PHY */ -+ clrsetbits_le32(®s->mac_supp, 1 << 8, -+ ((phy_reg & (0x1 << 13)) >> 13) << 8); -+ -+ /* Set duplex depend on phy */ -+ clrsetbits_le32(®s->mac_ctl1, 1 << 0, -+ ((phy_reg & (0x1 << 8)) >> 8) << 0); -+ -+ /* Enable RX/TX */ -+ setbits_le32(®s->ctl, 0x7); -+ -+ return 0; -+} -+ -+static void sunxi_emac_eth_halt(struct eth_device *dev) -+{ -+ /* Nothing to do here */ -+} -+ -+static int sunxi_emac_eth_recv(struct eth_device *dev) -+{ -+ struct emac_regs *regs = (struct emac_regs *)dev->iobase; -+ struct emac_rxhdr rxhdr; -+ u32 rxcount; -+ u32 reg_val; -+ int rx_len; -+ int rx_status; -+ int good_packet; -+ -+ /* Check packet ready or not */ -+ -+ /* Race warning: The first packet might arrive with -+ * the interrupts disabled, but the second will fix -+ */ -+ rxcount = readl(®s->rx_fbc); -+ if (!rxcount) { -+ /* Had one stuck? */ -+ rxcount = readl(®s->rx_fbc); -+ if (!rxcount) -+ return 0; -+ } -+ -+ reg_val = readl(®s->rx_io_data); -+ if (reg_val != 0x0143414d) { -+ /* Disable RX */ -+ clrbits_le32(®s->ctl, 0x1 << 2); -+ -+ /* Flush RX FIFO */ -+ setbits_le32(®s->rx_ctl, 0x1 << 3); -+ while (readl(®s->rx_ctl) & (0x1 << 3)) -+ ; -+ -+ /* Enable RX */ -+ setbits_le32(®s->ctl, 0x1 << 2); -+ -+ return 0; -+ } -+ -+ /* A packet ready now -+ * Get status/length -+ */ -+ good_packet = 1; -+ -+ emac_inblk_32bit(®s->rx_io_data, &rxhdr, sizeof(rxhdr)); -+ -+ rx_len = rxhdr.rx_len; -+ rx_status = rxhdr.rx_status; -+ -+ /* Packet Status check */ -+ if (rx_len < 0x40) { -+ good_packet = 0; -+ debug("RX: Bad Packet (runt)\n"); -+ } -+ -+ /* rx_status is identical to RSR register. */ -+ if (0 & rx_status & (EMAC_CRCERR | EMAC_LENERR)) { -+ good_packet = 0; -+ if (rx_status & EMAC_CRCERR) -+ printf("crc error\n"); -+ if (rx_status & EMAC_LENERR) -+ printf("length error\n"); -+ } -+ -+ /* Move data from EMAC */ -+ if (good_packet) { -+ if (rx_len > DMA_CPU_TRRESHOLD) { -+ printf("Received packet is too big (len=%d)\n", rx_len); -+ } else { -+ emac_inblk_32bit((void *)®s->rx_io_data, -+ NetRxPackets[0], rx_len); -+ -+ /* Pass to upper layer */ -+ NetReceive(NetRxPackets[0], rx_len); -+ return rx_len; -+ } -+ } -+ -+ return 0; -+} -+ -+static int sunxi_emac_eth_send(struct eth_device *dev, void *packet, int len) -+{ -+ struct emac_regs *regs = (struct emac_regs *)dev->iobase; -+ -+ /* Select channel 0 */ -+ writel(0, ®s->tx_ins); -+ -+ /* Write packet */ -+ emac_outblk_32bit((void *)®s->tx_io_data, packet, len); -+ -+ /* Set TX len */ -+ writel(len, ®s->tx_pl0); -+ -+ /* Start translate from fifo to phy */ -+ setbits_le32(®s->tx_ctl0, 1); -+ -+ return 0; -+} -+ -+int sunxi_emac_initialize(void) -+{ -+ struct sunxi_ccm_reg *const ccm = -+ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; -+ struct sunxi_sramc_regs *sram = -+ (struct sunxi_sramc_regs *)SUNXI_SRAMC_BASE; -+ struct emac_regs *regs = -+ (struct emac_regs *)SUNXI_EMAC_BASE; -+ struct eth_device *dev; -+ struct emac_eth_dev *priv; -+ int pin; -+ -+ dev = malloc(sizeof(*dev)); -+ if (dev == NULL) -+ return -ENOMEM; -+ -+ priv = (struct emac_eth_dev *)malloc(sizeof(struct emac_eth_dev)); -+ if (!priv) { -+ free(dev); -+ return -ENOMEM; -+ } -+ -+ memset(dev, 0, sizeof(*dev)); -+ memset(priv, 0, sizeof(struct emac_eth_dev)); -+ -+ /* Map SRAM to EMAC */ -+ setbits_le32(&sram->ctrl1, 0x5 << 2); -+ -+ /* Configure pin mux settings for MII Ethernet */ -+ for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(17); pin++) -+ sunxi_gpio_set_cfgpin(pin, 2); -+ -+ /* Set up clock gating */ -+ setbits_le32(&ccm->ahb_gate0, 0x1 << AHB_GATE_OFFSET_EMAC); -+ -+ /* Set MII clock */ -+ clrsetbits_le32(®s->mac_mcfg, 0xf << 2, 0xd << 2); -+ -+ dev->iobase = (int)regs; -+ dev->priv = priv; -+ dev->init = sunxi_emac_eth_init; -+ dev->halt = sunxi_emac_eth_halt; -+ dev->send = sunxi_emac_eth_send; -+ dev->recv = sunxi_emac_eth_recv; -+ strcpy(dev->name, "emac"); -+ -+ eth_register(dev); -+ -+ miiphy_register(dev->name, emac_phy_read, emac_phy_write); -+ -+ return 0; -+} -diff -purN u-boot-2013.10/drivers/net/sunxi_wemac.c u-boot-sunxi-2013.10-sunxi/drivers/net/sunxi_wemac.c ---- u-boot-2013.10/drivers/net/sunxi_wemac.c 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/drivers/net/sunxi_wemac.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,525 +0,0 @@ --/* +diff --git a/drivers/net/Makefile b/drivers/net/Makefile +index 7f9ce90..136479d 100644 +--- a/drivers/net/Makefile ++++ b/drivers/net/Makefile +@@ -50,7 +50,8 @@ obj-$(CONFIG_RTL8169) += rtl8169.o + obj-$(CONFIG_SH_ETHER) += sh_eth.o + obj-$(CONFIG_SMC91111) += smc91111.o + obj-$(CONFIG_SMC911X) += smc911x.o +-obj-$(CONFIG_SUNXI_WEMAC) += sunxi_wemac.o ++obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o ++obj-$(CONFIG_SUNXI_GMAC) += sunxi_gmac.o + obj-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o + obj-$(CONFIG_TSEC_ENET) += tsec.o fsl_mdio.o + obj-$(CONFIG_DRIVER_TI_CPSW) += cpsw.o +diff --git a/drivers/net/designware.c b/drivers/net/designware.c +index 22155b4..865abe1 100644 +--- a/drivers/net/designware.c ++++ b/drivers/net/designware.c +@@ -154,7 +154,7 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis) + /* Resore the HW MAC address as it has been lost during MAC reset */ + dw_write_hwaddr(dev); + +- writel(FIXEDBURST | PRIORXTX_41 | BURST_16, ++ writel(FIXEDBURST | PRIORXTX_41 | BURST_8, + &dma_p->busmode); + + writel(readl(&dma_p->opmode) | FLUSHTXFIFO | STOREFORWARD | +diff --git a/drivers/net/sunxi_wemac.c b/drivers/net/sunxi_emac.c +similarity index 78% +rename from drivers/net/sunxi_wemac.c +rename to drivers/net/sunxi_emac.c +index 699a381..0cadf89 100644 +--- a/drivers/net/sunxi_wemac.c ++++ b/drivers/net/sunxi_emac.c +@@ -1,5 +1,5 @@ + /* - * sunxi_wemac.c -- Allwinner A10 ethernet driver -- * -- * (C) Copyright 2012, Stefan Roese -- * -- * SPDX-License-Identifier: GPL-2.0+ -- */ -- --#include --#include ++ * sunxi_emac.c -- Allwinner A10 ethernet driver + * + * (C) Copyright 2012, Stefan Roese + * +@@ -7,16 +7,16 @@ + */ + + #include ++#include + #include -#include --#include + #include -#include --#include --#include --#include -- --/* EMAC register */ ++#include + #include + #include + #include + + /* EMAC register */ -struct wemac_regs { -- u32 ctl; /* 0x00 */ -- u32 tx_mode; /* 0x04 */ -- u32 tx_flow; /* 0x08 */ -- u32 tx_ctl0; /* 0x0c */ -- u32 tx_ctl1; /* 0x10 */ -- u32 tx_ins; /* 0x14 */ -- u32 tx_pl0; /* 0x18 */ -- u32 tx_pl1; /* 0x1c */ -- u32 tx_sta; /* 0x20 */ -- u32 tx_io_data; /* 0x24 */ ++struct emac_regs { + u32 ctl; /* 0x00 */ + u32 tx_mode; /* 0x04 */ + u32 tx_flow; /* 0x08 */ +@@ -27,7 +27,7 @@ struct wemac_regs { + u32 tx_pl1; /* 0x1c */ + u32 tx_sta; /* 0x20 */ + u32 tx_io_data; /* 0x24 */ - u32 tx_io_data1; /* 0x28 */ -- u32 tx_tsvl0; /* 0x2c */ -- u32 tx_tsvh0; /* 0x30 */ -- u32 tx_tsvl1; /* 0x34 */ -- u32 tx_tsvh1; /* 0x38 */ -- u32 rx_ctl; /* 0x3c */ -- u32 rx_hash0; /* 0x40 */ -- u32 rx_hash1; /* 0x44 */ -- u32 rx_sta; /* 0x48 */ -- u32 rx_io_data; /* 0x4c */ -- u32 rx_fbc; /* 0x50 */ -- u32 int_ctl; /* 0x54 */ -- u32 int_sta; /* 0x58 */ -- u32 mac_ctl0; /* 0x5c */ -- u32 mac_ctl1; /* 0x60 */ -- u32 mac_ipgt; /* 0x64 */ -- u32 mac_ipgr; /* 0x68 */ -- u32 mac_clrt; /* 0x6c */ -- u32 mac_maxf; /* 0x70 */ -- u32 mac_supp; /* 0x74 */ -- u32 mac_test; /* 0x78 */ -- u32 mac_mcfg; /* 0x7c */ -- u32 mac_mcmd; /* 0x80 */ -- u32 mac_madr; /* 0x84 */ -- u32 mac_mwtd; /* 0x88 */ -- u32 mac_mrdd; /* 0x8c */ -- u32 mac_mind; /* 0x90 */ -- u32 mac_ssrr; /* 0x94 */ -- u32 mac_a0; /* 0x98 */ -- u32 mac_a1; /* 0x9c */ --}; -- --/* SRAMC register */ --struct sunxi_sramc_regs { -- u32 ctrl0; -- u32 ctrl1; --}; -- --/* 0: Disable 1: Aborted frame enable(default) */ --#define EMAC_TX_AB_M (0x1 << 0) --/* 0: CPU 1: DMA(default) */ --#define EMAC_TX_TM (0x1 << 1) -- --#define EMAC_TX_SETUP (0) -- --/* 0: DRQ asserted 1: DRQ automatically(default) */ --#define EMAC_RX_DRQ_MODE (0x1 << 1) --/* 0: CPU 1: DMA(default) */ --#define EMAC_RX_TM (0x1 << 2) --/* 0: Normal(default) 1: Pass all Frames */ --#define EMAC_RX_PA (0x1 << 4) --/* 0: Normal(default) 1: Pass Control Frames */ --#define EMAC_RX_PCF (0x1 << 5) --/* 0: Normal(default) 1: Pass Frames with CRC Error */ --#define EMAC_RX_PCRCE (0x1 << 6) --/* 0: Normal(default) 1: Pass Frames with Length Error */ --#define EMAC_RX_PLE (0x1 << 7) --/* 0: Normal 1: Pass Frames length out of range(default) */ --#define EMAC_RX_POR (0x1 << 8) --/* 0: Not accept 1: Accept unicast Packets(default) */ --#define EMAC_RX_UCAD (0x1 << 16) --/* 0: Normal(default) 1: DA Filtering */ --#define EMAC_RX_DAF (0x1 << 17) --/* 0: Not accept 1: Accept multicast Packets(default) */ --#define EMAC_RX_MCO (0x1 << 20) --/* 0: Disable(default) 1: Enable Hash filter */ --#define EMAC_RX_MHF (0x1 << 21) --/* 0: Not accept 1: Accept Broadcast Packets(default) */ --#define EMAC_RX_BCO (0x1 << 22) --/* 0: Disable(default) 1: Enable SA Filtering */ --#define EMAC_RX_SAF (0x1 << 24) --/* 0: Normal(default) 1: Inverse Filtering */ --#define EMAC_RX_SAIF (0x1 << 25) -- --#define EMAC_RX_SETUP (EMAC_RX_POR | EMAC_RX_UCAD | EMAC_RX_DAF | \ -- EMAC_RX_MCO | EMAC_RX_BCO) -- --/* 0: Disable 1: Enable Receive Flow Control(default) */ --#define EMAC_MAC_CTL0_RFC (0x1 << 2) --/* 0: Disable 1: Enable Transmit Flow Control(default) */ --#define EMAC_MAC_CTL0_TFC (0x1 << 3) -- --#define EMAC_MAC_CTL0_SETUP (EMAC_MAC_CTL0_RFC | EMAC_MAC_CTL0_TFC) -- --/* 0: Disable 1: Enable MAC Frame Length Checking(default) */ --#define EMAC_MAC_CTL1_FLC (0x1 << 1) --/* 0: Disable(default) 1: Enable Huge Frame */ --#define EMAC_MAC_CTL1_HF (0x1 << 2) --/* 0: Disable(default) 1: Enable MAC Delayed CRC */ --#define EMAC_MAC_CTL1_DCRC (0x1 << 3) --/* 0: Disable 1: Enable MAC CRC(default) */ --#define EMAC_MAC_CTL1_CRC (0x1 << 4) --/* 0: Disable 1: Enable MAC PAD Short frames(default) */ --#define EMAC_MAC_CTL1_PC (0x1 << 5) --/* 0: Disable(default) 1: Enable MAC PAD Short frames and append CRC */ --#define EMAC_MAC_CTL1_VC (0x1 << 6) --/* 0: Disable(default) 1: Enable MAC auto detect Short frames */ --#define EMAC_MAC_CTL1_ADP (0x1 << 7) --/* 0: Disable(default) 1: Enable */ --#define EMAC_MAC_CTL1_PRE (0x1 << 8) --/* 0: Disable(default) 1: Enable */ --#define EMAC_MAC_CTL1_LPE (0x1 << 9) --/* 0: Disable(default) 1: Enable no back off */ --#define EMAC_MAC_CTL1_NB (0x1 << 12) --/* 0: Disable(default) 1: Enable */ --#define EMAC_MAC_CTL1_BNB (0x1 << 13) --/* 0: Disable(default) 1: Enable */ --#define EMAC_MAC_CTL1_ED (0x1 << 14) -- --#define EMAC_MAC_CTL1_SETUP (EMAC_MAC_CTL1_FLC | EMAC_MAC_CTL1_CRC | \ -- EMAC_MAC_CTL1_PC) -- --#define EMAC_MAC_IPGT 0x15 -- ++ u32 tx_io_data1;/* 0x28 */ + u32 tx_tsvl0; /* 0x2c */ + u32 tx_tsvh0; /* 0x30 */ + u32 tx_tsvl1; /* 0x34 */ +@@ -141,33 +141,33 @@ struct sunxi_sramc_regs { + + #define EMAC_MAC_IPGT 0x15 + -#define EMAC_MAC_NBTB_IPG1 0xC --#define EMAC_MAC_NBTB_IPG2 0x12 -- --#define EMAC_MAC_CW 0x37 ++#define EMAC_MAC_NBTB_IPG1 0xc + #define EMAC_MAC_NBTB_IPG2 0x12 + + #define EMAC_MAC_CW 0x37 -#define EMAC_MAC_RM 0xF -- --#define EMAC_MAC_MFL 0x0600 -- --/* Receive status */ ++#define EMAC_MAC_RM 0xf + + #define EMAC_MAC_MFL 0x0600 + + /* Receive status */ -#define EMAC_CRCERR (1 << 4) -#define EMAC_LENERR (3 << 5) -- --#define DMA_CPU_TRRESHOLD 2000 -- ++#define EMAC_CRCERR (0x1 << 4) ++#define EMAC_LENERR (0x3 << 5) + + #define DMA_CPU_TRRESHOLD 2000 + -struct wemac_eth_dev { -- u32 speed; -- u32 duplex; -- u32 phy_configured; -- int link_printed; --}; -- ++struct emac_eth_dev { + u32 speed; + u32 duplex; + u32 phy_configured; + int link_printed; + }; + -struct wemac_rxhdr { -- s16 rx_len; -- u16 rx_status; --}; -- ++struct emac_rxhdr { + s16 rx_len; + u16 rx_status; + }; + -static void wemac_inblk_32bit(void *reg, void *data, int count) --{ -- int cnt = (count + 3) >> 2; -- -- if (cnt) { -- u32 *buf = data; -- -- do { -- u32 x = readl(reg); -- *buf++ = x; -- } while (--cnt); -- } --} -- ++static void emac_inblk_32bit(void *reg, void *data, int count) + { + int cnt = (count + 3) >> 2; + +@@ -181,7 +181,7 @@ static void wemac_inblk_32bit(void *reg, void *data, int count) + } + } + -static void wemac_outblk_32bit(void *reg, void *data, int count) --{ -- int cnt = (count + 3) >> 2; -- -- if (cnt) { -- const u32 *buf = data; -- -- do { -- writel(*buf++, reg); -- } while (--cnt); -- } --} -- ++static void emac_outblk_32bit(void *reg, void *data, int count) + { + int cnt = (count + 3) >> 2; + +@@ -194,14 +194,12 @@ static void wemac_outblk_32bit(void *reg, void *data, int count) + } + } + -/* - * Read a word from phyxcer - */ -static int wemac_phy_read(const char *devname, unsigned char addr, -- unsigned char reg, unsigned short *value) --{ -- struct eth_device *dev = eth_get_dev_by_name(devname); ++/* Read a word from phyxcer */ ++static int emac_phy_read(const char *devname, unsigned char addr, + unsigned char reg, unsigned short *value) + { + struct eth_device *dev = eth_get_dev_by_name(devname); - struct wemac_regs *regs = (struct wemac_regs *)dev->iobase; -- -- /* issue the phy address and reg */ -- writel(addr << 8 | reg, ®s->mac_madr); -- -- /* pull up the phy io line */ -- writel(0x1, ®s->mac_mcmd); -- -- /* Wait read complete */ -- mdelay(1); -- -- /* push down the phy io line */ -- writel(0x0, ®s->mac_mcmd); -- -- /* and write data */ -- *value = readl(®s->mac_mrdd); -- -- return 0; --} -- ++ struct emac_regs *regs = (struct emac_regs *)dev->iobase; + + /* issue the phy address and reg */ + writel(addr << 8 | reg, ®s->mac_madr); +@@ -221,14 +219,12 @@ static int wemac_phy_read(const char *devname, unsigned char addr, + return 0; + } + -/* - * Write a word to phyxcer - */ -static int wemac_phy_write(const char *devname, unsigned char addr, -- unsigned char reg, unsigned short value) --{ -- struct eth_device *dev = eth_get_dev_by_name(devname); ++/* Write a word to phyxcer */ ++static int emac_phy_write(const char *devname, unsigned char addr, + unsigned char reg, unsigned short value) + { + struct eth_device *dev = eth_get_dev_by_name(devname); - struct wemac_regs *regs = (struct wemac_regs *)dev->iobase; -- -- /* issue the phy address and reg */ -- writel(addr << 8 | reg, ®s->mac_madr); -- -- /* pull up the phy io line */ -- writel(0x1, ®s->mac_mcmd); -- -- /* Wait write complete */ -- mdelay(1); -- -- /* push down the phy io line */ -- writel(0x0, ®s->mac_mcmd); -- -- /* and write data */ -- writel(value, ®s->mac_mwtd); -- -- return 0; --} -- --static void emac_setup(struct eth_device *dev) --{ ++ struct emac_regs *regs = (struct emac_regs *)dev->iobase; + + /* issue the phy address and reg */ + writel(addr << 8 | reg, ®s->mac_madr); +@@ -250,7 +246,7 @@ static int wemac_phy_write(const char *devname, unsigned char addr, + + static void emac_setup(struct eth_device *dev) + { - struct wemac_regs *regs = (struct wemac_regs *)dev->iobase; -- u32 reg_val; -- u16 phy_val; -- u32 duplex_flag; -- -- /* Set up TX */ -- writel(EMAC_TX_SETUP, ®s->tx_mode); -- -- /* Set up RX */ -- writel(EMAC_RX_SETUP, ®s->rx_ctl); -- -- /* Set MAC */ -- /* Set MAC CTL0 */ -- writel(EMAC_MAC_CTL0_SETUP, ®s->mac_ctl0); -- -- /* Set MAC CTL1 */ ++ struct emac_regs *regs = (struct emac_regs *)dev->iobase; + u32 reg_val; + u16 phy_val; + u32 duplex_flag; +@@ -266,7 +262,7 @@ static void emac_setup(struct eth_device *dev) + writel(EMAC_MAC_CTL0_SETUP, ®s->mac_ctl0); + + /* Set MAC CTL1 */ - wemac_phy_read(dev->name, 1, 0, &phy_val); -- debug("PHY SETUP, reg 0 value: %x\n", phy_val); -- duplex_flag = !!(phy_val & (1 << 8)); -- -- reg_val = 0; -- if (duplex_flag) -- reg_val = (0x1 << 0); -- writel(EMAC_MAC_CTL1_SETUP | reg_val, ®s->mac_ctl1); -- -- /* Set up IPGT */ -- writel(EMAC_MAC_IPGT, ®s->mac_ipgt); -- -- /* Set up IPGR */ -- writel(EMAC_MAC_NBTB_IPG2 | (EMAC_MAC_NBTB_IPG1 << 8), ®s->mac_ipgr); -- -- /* Set up Collison window */ -- writel(EMAC_MAC_RM | (EMAC_MAC_CW << 8), ®s->mac_clrt); -- -- /* Set up Max Frame Length */ -- writel(EMAC_MAC_MFL, ®s->mac_maxf); --} -- ++ emac_phy_read(dev->name, 1, 0, &phy_val); + debug("PHY SETUP, reg 0 value: %x\n", phy_val); + duplex_flag = !!(phy_val & (1 << 8)); + +@@ -288,9 +284,9 @@ static void emac_setup(struct eth_device *dev) + writel(EMAC_MAC_MFL, ®s->mac_maxf); + } + -static void wemac_reset(struct eth_device *dev) --{ ++static void emac_reset(struct eth_device *dev) + { - struct wemac_regs *regs = (struct wemac_regs *)dev->iobase; -- -- debug("resetting device\n"); -- -- /* RESET device */ -- writel(0, ®s->ctl); -- udelay(200); -- -- writel(1, ®s->ctl); -- udelay(200); --} -- ++ struct emac_regs *regs = (struct emac_regs *)dev->iobase; + + debug("resetting device\n"); + +@@ -302,10 +298,10 @@ static void wemac_reset(struct eth_device *dev) + udelay(200); + } + -static int sunxi_wemac_eth_init(struct eth_device *dev, bd_t *bd) --{ ++static int sunxi_emac_eth_init(struct eth_device *dev, bd_t *bd) + { - struct wemac_regs *regs = (struct wemac_regs *)dev->iobase; - struct wemac_eth_dev *priv = dev->priv; -- u16 phy_reg; -- -- /* Init EMAC */ -- -- /* Flush RX FIFO */ -- setbits_le32(®s->rx_ctl, 0x8); -- udelay(1); -- -- /* Init MAC */ -- -- /* Soft reset MAC */ ++ struct emac_regs *regs = (struct emac_regs *)dev->iobase; ++ struct emac_eth_dev *priv = dev->priv; + u16 phy_reg; + + /* Init EMAC */ +@@ -317,10 +313,7 @@ static int sunxi_wemac_eth_init(struct eth_device *dev, bd_t *bd) + /* Init MAC */ + + /* Soft reset MAC */ - clrbits_le32(®s->mac_ctl0, 1 << 15); - - /* Set MII clock */ - clrsetbits_le32(®s->mac_mcfg, 0xf << 2, 0xd << 2); -- -- /* Clear RX counter */ -- writel(0x0, ®s->rx_fbc); -- udelay(1); -- -- /* Set up EMAC */ -- emac_setup(dev); -- -- writel(dev->enetaddr[0] << 16 | dev->enetaddr[1] << 8 | -- dev->enetaddr[2], ®s->mac_a1); -- writel(dev->enetaddr[3] << 16 | dev->enetaddr[4] << 8 | -- dev->enetaddr[5], ®s->mac_a0); -- -- mdelay(1); -- ++ clrbits_le32(®s->mac_ctl0, 0x1 << 15); + + /* Clear RX counter */ + writel(0x0, ®s->rx_fbc); +@@ -336,14 +329,14 @@ static int sunxi_wemac_eth_init(struct eth_device *dev, bd_t *bd) + + mdelay(1); + - wemac_reset(dev); -- -- /* PHY POWER UP */ ++ emac_reset(dev); + + /* PHY POWER UP */ - wemac_phy_read(dev->name, 1, 0, &phy_reg); - wemac_phy_write(dev->name, 1, 0, phy_reg & (~(1 << 11))); -- mdelay(1); -- ++ emac_phy_read(dev->name, 1, 0, &phy_reg); ++ emac_phy_write(dev->name, 1, 0, phy_reg & (~(0x1 << 11))); + mdelay(1); + - wemac_phy_read(dev->name, 1, 0, &phy_reg); -- -- priv->speed = miiphy_speed(dev->name, 0); -- priv->duplex = miiphy_duplex(dev->name, 0); -- -- /* Print link status only once */ -- if (!priv->link_printed) { -- printf("ENET Speed is %d Mbps - %s duplex connection\n", -- priv->speed, (priv->duplex == HALF) ? "HALF" : "FULL"); -- priv->link_printed = 1; -- } -- -- /* Set EMAC SPEED depend on PHY */ -- clrsetbits_le32(®s->mac_supp, 1 << 8, ++ emac_phy_read(dev->name, 1, 0, &phy_reg); + + priv->speed = miiphy_speed(dev->name, 0); + priv->duplex = miiphy_duplex(dev->name, 0); +@@ -357,11 +350,11 @@ static int sunxi_wemac_eth_init(struct eth_device *dev, bd_t *bd) + + /* Set EMAC SPEED depend on PHY */ + clrsetbits_le32(®s->mac_supp, 1 << 8, - ((phy_reg & (1 << 13)) >> 13) << 8); -- -- /* Set duplex depend on phy */ -- clrsetbits_le32(®s->mac_ctl1, 1 << 0, ++ ((phy_reg & (0x1 << 13)) >> 13) << 8); + + /* Set duplex depend on phy */ + clrsetbits_le32(®s->mac_ctl1, 1 << 0, - ((phy_reg & (1 << 8)) >> 8) << 0); -- -- /* Enable RX/TX */ -- setbits_le32(®s->ctl, 0x7); -- -- return 0; --} -- ++ ((phy_reg & (0x1 << 8)) >> 8) << 0); + + /* Enable RX/TX */ + setbits_le32(®s->ctl, 0x7); +@@ -369,15 +362,15 @@ static int sunxi_wemac_eth_init(struct eth_device *dev, bd_t *bd) + return 0; + } + -static void sunxi_wemac_eth_halt(struct eth_device *dev) --{ -- /* Nothing to do here */ --} -- ++static void sunxi_emac_eth_halt(struct eth_device *dev) + { + /* Nothing to do here */ + } + -static int sunxi_wemac_eth_recv(struct eth_device *dev) --{ ++static int sunxi_emac_eth_recv(struct eth_device *dev) + { - struct wemac_regs *regs = (struct wemac_regs *)dev->iobase; - struct wemac_rxhdr rxhdr; -- u32 rxcount; -- u32 reg_val; -- int rx_len; -- int rx_status; -- int good_packet; -- -- /* Check packet ready or not */ -- ++ struct emac_regs *regs = (struct emac_regs *)dev->iobase; ++ struct emac_rxhdr rxhdr; + u32 rxcount; + u32 reg_val; + int rx_len; +@@ -386,8 +379,7 @@ static int sunxi_wemac_eth_recv(struct eth_device *dev) + + /* Check packet ready or not */ + - /* - * Race warning: The first packet might arrive with -- * the interrupts disabled, but the second will fix -- */ -- rxcount = readl(®s->rx_fbc); -- if (!rxcount) { -- /* Had one stuck? */ -- rxcount = readl(®s->rx_fbc); -- if (!rxcount) -- return 0; -- } -- -- reg_val = readl(®s->rx_io_data); -- if (reg_val != 0x0143414d) { -- /* Disable RX */ ++ /* Race warning: The first packet might arrive with + * the interrupts disabled, but the second will fix + */ + rxcount = readl(®s->rx_fbc); +@@ -401,26 +393,25 @@ static int sunxi_wemac_eth_recv(struct eth_device *dev) + reg_val = readl(®s->rx_io_data); + if (reg_val != 0x0143414d) { + /* Disable RX */ - clrbits_le32(®s->ctl, 1 << 2); -- -- /* Flush RX FIFO */ ++ clrbits_le32(®s->ctl, 0x1 << 2); + + /* Flush RX FIFO */ - setbits_le32(®s->rx_ctl, 1 << 3); - while (readl(®s->rx_ctl) & (1 << 3)) -- ; -- -- /* Enable RX */ ++ setbits_le32(®s->rx_ctl, 0x1 << 3); ++ while (readl(®s->rx_ctl) & (0x1 << 3)) + ; + + /* Enable RX */ - setbits_le32(®s->ctl, 1 << 2); -- -- return 0; -- } -- ++ setbits_le32(®s->ctl, 0x1 << 2); + + return 0; + } + - /* - * A packet ready now -- * Get status/length -- */ -- good_packet = 1; -- ++ /* A packet ready now + * Get status/length + */ + good_packet = 1; + - wemac_inblk_32bit(®s->rx_io_data, &rxhdr, sizeof(rxhdr)); -- -- rx_len = rxhdr.rx_len; -- rx_status = rxhdr.rx_status; -- -- /* Packet Status check */ -- if (rx_len < 0x40) { -- good_packet = 0; -- debug("RX: Bad Packet (runt)\n"); -- } -- -- /* rx_status is identical to RSR register. */ -- if (0 & rx_status & (EMAC_CRCERR | EMAC_LENERR)) { -- good_packet = 0; -- if (rx_status & EMAC_CRCERR) -- printf("crc error\n"); -- if (rx_status & EMAC_LENERR) -- printf("length error\n"); -- } -- ++ emac_inblk_32bit(®s->rx_io_data, &rxhdr, sizeof(rxhdr)); + + rx_len = rxhdr.rx_len; + rx_status = rxhdr.rx_status; +@@ -440,13 +431,13 @@ static int sunxi_wemac_eth_recv(struct eth_device *dev) + printf("length error\n"); + } + - /* Move data from WEMAC */ -- if (good_packet) { -- if (rx_len > DMA_CPU_TRRESHOLD) { -- printf("Received packet is too big (len=%d)\n", rx_len); -- } else { ++ /* Move data from EMAC */ + if (good_packet) { + if (rx_len > DMA_CPU_TRRESHOLD) { + printf("Received packet is too big (len=%d)\n", rx_len); + } else { - wemac_inblk_32bit((void *)®s->rx_io_data, - NetRxPackets[0], rx_len); -- -- /* Pass to upper layer */ -- NetReceive(NetRxPackets[0], rx_len); -- return rx_len; -- } -- } -- -- return 0; --} -- ++ emac_inblk_32bit((void *)®s->rx_io_data, ++ NetRxPackets[0], rx_len); + + /* Pass to upper layer */ + NetReceive(NetRxPackets[0], rx_len); +@@ -457,15 +448,15 @@ static int sunxi_wemac_eth_recv(struct eth_device *dev) + return 0; + } + -static int sunxi_wemac_eth_send(struct eth_device *dev, void *packet, int len) --{ ++static int sunxi_emac_eth_send(struct eth_device *dev, void *packet, int len) + { - struct wemac_regs *regs = (struct wemac_regs *)dev->iobase; -- -- /* Select channel 0 */ -- writel(0, ®s->tx_ins); -- -- /* Write packet */ ++ struct emac_regs *regs = (struct emac_regs *)dev->iobase; + + /* Select channel 0 */ + writel(0, ®s->tx_ins); + + /* Write packet */ - wemac_outblk_32bit((void *)®s->tx_io_data, packet, len); -- -- /* Set TX len */ -- writel(len, ®s->tx_pl0); -- -- /* Start translate from fifo to phy */ -- setbits_le32(®s->tx_ctl0, 1); -- -- return 0; --} -- ++ emac_outblk_32bit((void *)®s->tx_io_data, packet, len); + + /* Set TX len */ + writel(len, ®s->tx_pl0); +@@ -476,28 +467,30 @@ static int sunxi_wemac_eth_send(struct eth_device *dev, void *packet, int len) + return 0; + } + -int sunxi_wemac_initialize(void) --{ -- struct sunxi_ccm_reg *const ccm = -- (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; -- struct sunxi_sramc_regs *sram = -- (struct sunxi_sramc_regs *)SUNXI_SRAMC_BASE; -- struct eth_device *dev; ++int sunxi_emac_initialize(void) + { + struct sunxi_ccm_reg *const ccm = + (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; + struct sunxi_sramc_regs *sram = + (struct sunxi_sramc_regs *)SUNXI_SRAMC_BASE; ++ struct emac_regs *regs = ++ (struct emac_regs *)SUNXI_EMAC_BASE; + struct eth_device *dev; - struct wemac_eth_dev *priv; -- int pin; -- -- dev = malloc(sizeof(*dev)); -- if (dev == NULL) -- return -ENOMEM; -- ++ struct emac_eth_dev *priv; + int pin; + + dev = malloc(sizeof(*dev)); + if (dev == NULL) + return -ENOMEM; + - priv = (struct wemac_eth_dev *)malloc(sizeof(struct wemac_eth_dev)); -- if (!priv) { -- free(dev); -- return -ENOMEM; -- } -- -- memset(dev, 0, sizeof(*dev)); ++ priv = (struct emac_eth_dev *)malloc(sizeof(struct emac_eth_dev)); + if (!priv) { + free(dev); + return -ENOMEM; + } + + memset(dev, 0, sizeof(*dev)); - memset(priv, 0, sizeof(struct wemac_eth_dev)); -- -- /* Map SRAM to EMAC */ -- setbits_le32(&sram->ctrl1, 0x5 << 2); -- -- /* Configure pin mux settings for MII Ethernet */ -- for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(17); pin++) -- sunxi_gpio_set_cfgpin(pin, 2); -- -- /* Set up clock gating */ ++ memset(priv, 0, sizeof(struct emac_eth_dev)); + + /* Map SRAM to EMAC */ + setbits_le32(&sram->ctrl1, 0x5 << 2); +@@ -507,19 +500,22 @@ int sunxi_wemac_initialize(void) + sunxi_gpio_set_cfgpin(pin, 2); + + /* Set up clock gating */ - setbits_le32(&ccm->ahb_gate0, 1 << AHB_GATE_OFFSET_EMAC); -- ++ setbits_le32(&ccm->ahb_gate0, 0x1 << AHB_GATE_OFFSET_EMAC); ++ ++ /* Set MII clock */ ++ clrsetbits_le32(®s->mac_mcfg, 0xf << 2, 0xd << 2); + - dev->iobase = SUNXI_EMAC_BASE; -- dev->priv = priv; ++ dev->iobase = (int)regs; + dev->priv = priv; - dev->init = sunxi_wemac_eth_init; - dev->halt = sunxi_wemac_eth_halt; - dev->send = sunxi_wemac_eth_send; - dev->recv = sunxi_wemac_eth_recv; - strcpy(dev->name, "wemac"); -- -- eth_register(dev); -- ++ dev->init = sunxi_emac_eth_init; ++ dev->halt = sunxi_emac_eth_halt; ++ dev->send = sunxi_emac_eth_send; ++ dev->recv = sunxi_emac_eth_recv; ++ strcpy(dev->name, "emac"); + + eth_register(dev); + - miiphy_register(dev->name, wemac_phy_read, wemac_phy_write); -- -- return 0; --} -diff -purN u-boot-2013.10/drivers/power/axp152.c u-boot-sunxi-2013.10-sunxi/drivers/power/axp152.c ---- u-boot-2013.10/drivers/power/axp152.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/drivers/power/axp152.c 2013-11-25 23:20:38.000000000 +0100 ++ miiphy_register(dev->name, emac_phy_read, emac_phy_write); + + return 0; + } +diff --git a/drivers/net/sunxi_gmac.c b/drivers/net/sunxi_gmac.c +new file mode 100644 +index 0000000..b8b9016 +--- /dev/null ++++ b/drivers/net/sunxi_gmac.c +@@ -0,0 +1,45 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++int sunxi_gmac_initialize(bd_t *bis) ++{ ++ int pin; ++ struct sunxi_ccm_reg *const ccm = ++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; ++ ++ /* Set up clock gating */ ++ setbits_le32(&ccm->ahb_gate1, 0x1 << AHB_GATE_OFFSET_GMAC); ++ ++ /* Set MII clock */ ++#ifdef CONFIG_RGMII ++ setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII | ++ CCM_GMAC_CTRL_GPIT_RGMII); ++#else ++ setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_MII | ++ CCM_GMAC_CTRL_GPIT_MII); ++#endif ++ ++ /* Configure pin mux settings for GMAC */ ++ for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) { ++#ifdef CONFIG_RGMII ++ /* skip unused pins in RGMII mode */ ++ if (pin == SUNXI_GPA(9) || pin == SUNXI_GPA(14)) ++ continue; ++#endif ++ sunxi_gpio_set_cfgpin(pin, 5); ++ sunxi_gpio_set_drv(pin, 3); ++ } ++ ++#ifdef CONFIG_RGMII ++ designware_initialize(0, SUNXI_GMAC_BASE, 0x1, PHY_INTERFACE_MODE_RGMII); ++#else ++ designware_initialize(0, SUNXI_GMAC_BASE, 0x1, PHY_INTERFACE_MODE_MII); ++#endif ++ ++ return 0; ++} +diff --git a/drivers/power/Makefile b/drivers/power/Makefile +index 53ff97d..dc64e4d 100644 +--- a/drivers/power/Makefile ++++ b/drivers/power/Makefile +@@ -5,6 +5,8 @@ + # SPDX-License-Identifier: GPL-2.0+ + # + ++obj-$(CONFIG_AXP152_POWER) += axp152.o ++obj-$(CONFIG_AXP209_POWER) += axp209.o + obj-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o + obj-$(CONFIG_FTPMU010_POWER) += ftpmu010.o + obj-$(CONFIG_TPS6586X_POWER) += tps6586x.o +diff --git a/drivers/power/axp152.c b/drivers/power/axp152.c +new file mode 100644 +index 0000000..0e3653b +--- /dev/null ++++ b/drivers/power/axp152.c @@ -0,0 +1,138 @@ +/* + * (C) Copyright 2012 @@ -7216,9 +7161,11 @@ diff -purN u-boot-2013.10/drivers/power/axp152.c u-boot-sunxi-2013.10-sunxi/driv + return -1; + return 0; +} -diff -purN u-boot-2013.10/drivers/power/axp209.c u-boot-sunxi-2013.10-sunxi/drivers/power/axp209.c ---- u-boot-2013.10/drivers/power/axp209.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/drivers/power/axp209.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/drivers/power/axp209.c b/drivers/power/axp209.c +new file mode 100644 +index 0000000..87cbb78 +--- /dev/null ++++ b/drivers/power/axp209.c @@ -0,0 +1,215 @@ +/* + * (C) Copyright 2012 @@ -7435,21 +7382,10 @@ diff -purN u-boot-2013.10/drivers/power/axp209.c u-boot-sunxi-2013.10-sunxi/driv + axp209_write(AXP209_IRQ_STATUS5, AXP209_IRQ5_PEK_DOWN); + return v & AXP209_IRQ5_PEK_DOWN; +} -diff -purN u-boot-2013.10/drivers/power/Makefile u-boot-sunxi-2013.10-sunxi/drivers/power/Makefile ---- u-boot-2013.10/drivers/power/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/drivers/power/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -9,6 +9,8 @@ include $(TOPDIR)/config.mk - - LIB := $(obj)libpower.o - -+COBJS-$(CONFIG_AXP152_POWER) += axp152.o -+COBJS-$(CONFIG_AXP209_POWER) += axp209.o - COBJS-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o - COBJS-$(CONFIG_FTPMU010_POWER) += ftpmu010.o - COBJS-$(CONFIG_TPS6586X_POWER) += tps6586x.o -diff -purN u-boot-2013.10/drivers/serial/arm_dcc.c u-boot-sunxi-2013.10-sunxi/drivers/serial/arm_dcc.c ---- u-boot-2013.10/drivers/serial/arm_dcc.c 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/drivers/serial/arm_dcc.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/drivers/serial/arm_dcc.c b/drivers/serial/arm_dcc.c +index 5dfb02f..b0f8b41 100644 +--- a/drivers/serial/arm_dcc.c ++++ b/drivers/serial/arm_dcc.c @@ -29,7 +29,7 @@ #include #include @@ -7459,9 +7395,11 @@ diff -purN u-boot-2013.10/drivers/serial/arm_dcc.c u-boot-sunxi-2013.10-sunxi/dr /* * ARMV6 */ -diff -purN u-boot-2013.10/include/axp152.h u-boot-sunxi-2013.10-sunxi/include/axp152.h ---- u-boot-2013.10/include/axp152.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/include/axp152.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/include/axp152.h b/include/axp152.h +new file mode 100644 +index 0000000..a6ddf54 +--- /dev/null ++++ b/include/axp152.h @@ -0,0 +1,27 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom @@ -7490,9 +7428,11 @@ diff -purN u-boot-2013.10/include/axp152.h u-boot-sunxi-2013.10-sunxi/include/ax +int axp152_set_ldo2(int mvolt); +void axp152_poweroff(void); +int axp152_init(void); -diff -purN u-boot-2013.10/include/axp209.h u-boot-sunxi-2013.10-sunxi/include/axp209.h ---- u-boot-2013.10/include/axp209.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/include/axp209.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/include/axp209.h b/include/axp209.h +new file mode 100644 +index 0000000..3fffad9 +--- /dev/null ++++ b/include/axp209.h @@ -0,0 +1,31 @@ +/* + * (C) Copyright 2012 Henrik Nordstrom @@ -7525,10 +7465,24 @@ diff -purN u-boot-2013.10/include/axp209.h u-boot-sunxi-2013.10-sunxi/include/ax +extern int axp209_init(void); +extern int axp209_poweron_by_dc(void); +extern int axp209_power_button(void); -diff -purN u-boot-2013.10/include/config_fallbacks.h u-boot-sunxi-2013.10-sunxi/include/config_fallbacks.h ---- u-boot-2013.10/include/config_fallbacks.h 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/include/config_fallbacks.h 2013-11-25 23:20:38.000000000 +0100 -@@ -53,4 +53,8 @@ +diff --git a/include/common.h b/include/common.h +index d49c514..58b68b6 100644 +--- a/include/common.h ++++ b/include/common.h +@@ -453,7 +453,7 @@ const char *symbol_lookup(unsigned long addr, unsigned long *caddr); + void api_init (void); + + /* common/memsize.c */ +-long get_ram_size (long *, long); ++unsigned long get_ram_size (unsigned long *, unsigned long); + + /* $(BOARD)/$(BOARD).c */ + void reset_phy (void); +diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h +index d8339b2..5f9f8bc 100644 +--- a/include/config_fallbacks.h ++++ b/include/config_fallbacks.h +@@ -55,6 +55,10 @@ #define HAVE_BLOCK_DEVICE #endif @@ -7536,10 +7490,14 @@ diff -purN u-boot-2013.10/include/config_fallbacks.h u-boot-sunxi-2013.10-sunxi/ +#define CONFIG_SYS_BOARD_NAME CONFIG_SYS_TARGET +#endif + - #endif /* __CONFIG_FALLBACKS_H */ -diff -purN u-boot-2013.10/include/configs/sun4i.h u-boot-sunxi-2013.10-sunxi/include/configs/sun4i.h ---- u-boot-2013.10/include/configs/sun4i.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/include/configs/sun4i.h 2013-11-25 23:20:38.000000000 +0100 + #ifndef CONFIG_SYS_PROMPT + #define CONFIG_SYS_PROMPT "=> " + #endif +diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h +new file mode 100644 +index 0000000..025e138 +--- /dev/null ++++ b/include/configs/sun4i.h @@ -0,0 +1,41 @@ +/* + * (C) Copyright 2012-2013 Henrik Nordstrom @@ -7582,9 +7540,11 @@ diff -purN u-boot-2013.10/include/configs/sun4i.h u-boot-sunxi-2013.10-sunxi/inc +#include + +#endif /* __CONFIG_H */ -diff -purN u-boot-2013.10/include/configs/sun5i.h u-boot-sunxi-2013.10-sunxi/include/configs/sun5i.h ---- u-boot-2013.10/include/configs/sun5i.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/include/configs/sun5i.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/include/configs/sun5i.h b/include/configs/sun5i.h +new file mode 100644 +index 0000000..87e2349 +--- /dev/null ++++ b/include/configs/sun5i.h @@ -0,0 +1,41 @@ +/* + * (C) Copyright 2012-2013 Henrik Nordstrom @@ -7627,9 +7587,11 @@ diff -purN u-boot-2013.10/include/configs/sun5i.h u-boot-sunxi-2013.10-sunxi/inc +#include + +#endif /* __CONFIG_H */ -diff -purN u-boot-2013.10/include/configs/sun7i.h u-boot-sunxi-2013.10-sunxi/include/configs/sun7i.h ---- u-boot-2013.10/include/configs/sun7i.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/include/configs/sun7i.h 2013-11-25 23:20:38.000000000 +0100 +diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h +new file mode 100644 +index 0000000..a6ede2a +--- /dev/null ++++ b/include/configs/sun7i.h @@ -0,0 +1,46 @@ +/* + * (C) Copyright 2012-2013 Henrik Nordstrom @@ -7677,10 +7639,12 @@ diff -purN u-boot-2013.10/include/configs/sun7i.h u-boot-sunxi-2013.10-sunxi/inc +#include + +#endif /* __CONFIG_H */ -diff -purN u-boot-2013.10/include/configs/sunxi-common.h u-boot-sunxi-2013.10-sunxi/include/configs/sunxi-common.h ---- u-boot-2013.10/include/configs/sunxi-common.h 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/include/configs/sunxi-common.h 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,461 @@ +diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h +new file mode 100644 +index 0000000..a0c41ac +--- /dev/null ++++ b/include/configs/sunxi-common.h +@@ -0,0 +1,476 @@ +/* + * (C) Copyright 2012-2012 Henrik Nordstrom + * @@ -7757,7 +7721,11 @@ diff -purN u-boot-2013.10/include/configs/sunxi-common.h u-boot-sunxi-2013.10-su +/* A10 has 1 banks of DRAM, we use only bank 1 in U-Boot */ +#define CONFIG_NR_DRAM_BANKS 1 +#define PHYS_SDRAM_0 CONFIG_SYS_SDRAM_BASE -+#define PHYS_SDRAM_0_SIZE 0x40000000 ++#ifdef CONFIG_SUN7I ++#define PHYS_SDRAM_0_SIZE 0x80000000 /* 2 GiB */ ++#else ++#define PHYS_SDRAM_0_SIZE 0x40000000 /* 1 GiB */ ++#endif +#if 0 +/* Nand config */ +#define CONFIG_NAND @@ -7892,6 +7860,7 @@ diff -purN u-boot-2013.10/include/configs/sunxi-common.h u-boot-sunxi-2013.10-su + "kernel=uImage\0" \ + "bootenv=uEnv.txt\0" \ + "bootscr=boot.scr\0" \ ++ "script=script.bin\0" \ + "loadbootscr=" \ + "fatload $device $partition $scriptaddr ${bootscr}" \ + " || " \ @@ -7910,19 +7879,19 @@ diff -purN u-boot-2013.10/include/configs/sunxi-common.h u-boot-sunxi-2013.10-su + "if "\ + "bootpath=/boot/" \ + " && " \ -+ "ext2load $device $partition 0x43000000 ${bootpath}script.bin" \ ++ "ext2load $device $partition 0x43000000 ${bootpath}${script}" \ + " && " \ + "ext2load $device $partition 0x48000000 ${bootpath}${kernel}" \ + ";then true; elif " \ + "bootpath=/" \ + " && " \ -+ "fatload $device $partition 0x43000000 script.bin" \ ++ "fatload $device $partition 0x43000000 ${script}" \ + " && " \ + "fatload $device $partition 0x48000000 ${kernel}" \ + ";then true; elif " \ + "bootpath=/" \ + " && " \ -+ "ext2load $device $partition 0x43000000 ${bootpath}script.bin" \ ++ "ext2load $device $partition 0x43000000 ${bootpath}${script}" \ + " && " \ + "ext2load $device $partition 0x48000000 ${bootpath}${kernel}" \ + ";then true; else "\ @@ -8109,6 +8078,16 @@ diff -purN u-boot-2013.10/include/configs/sunxi-common.h u-boot-sunxi-2013.10-su +#define CONFIG_CMD_NET +#endif + ++#ifdef CONFIG_SUNXI_GMAC ++#define CONFIG_DESIGNWARE_ETH /* GMAC can use designware driver */ ++#define CONFIG_DW_AUTONEG ++#define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ ++#define CONFIG_SYS_DCACHE_OFF /* dw driver doesn't support dcache */ ++#define CONFIG_MII /* MII PHY management */ ++#define CONFIG_CMD_MII ++#define CONFIG_CMD_NET ++#endif ++ +#ifdef CONFIG_CMD_NET +#define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP @@ -8142,77 +8121,25 @@ diff -purN u-boot-2013.10/include/configs/sunxi-common.h u-boot-sunxi-2013.10-su +#endif + +#endif /* _SUNXI_COMMON_CONFIG_H */ -diff -purN u-boot-2013.10/include/netdev.h u-boot-sunxi-2013.10-sunxi/include/netdev.h ---- u-boot-2013.10/include/netdev.h 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/include/netdev.h 2013-11-25 23:20:38.000000000 +0100 -@@ -79,7 +79,7 @@ int sh_eth_initialize(bd_t *bis); +diff --git a/include/netdev.h b/include/netdev.h +index 47fa80d..300664e 100644 +--- a/include/netdev.h ++++ b/include/netdev.h +@@ -79,7 +79,8 @@ int sh_eth_initialize(bd_t *bis); int skge_initialize(bd_t *bis); int smc91111_initialize(u8 dev_num, int base_addr); int smc911x_initialize(u8 dev_num, int base_addr); -int sunxi_wemac_initialize(bd_t *bis); +int sunxi_emac_initialize(bd_t *bis); ++int sunxi_gmac_initialize(bd_t *bis); int tsi108_eth_initialize(bd_t *bis); int uec_standard_init(bd_t *bis); int uli526x_initialize(bd_t *bis); -diff -purN u-boot-2013.10/Makefile u-boot-sunxi-2013.10-sunxi/Makefile ---- u-boot-2013.10/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -543,6 +543,16 @@ $(obj)u-boot.spr: $(obj)u-boot.img $(obj - conv=notrunc 2>/dev/null - cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img > $@ - -+# sunxi: Combined object with SPL U-Boot with sunxi header (sunxi-spl.bin) -+# and the full-blown U-Boot attached to it -+$(obj)u-boot-sunxi-with-spl.bin: $(obj)spl/sunxi-spl.bin $(obj)u-boot.img -+ tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_SPL_PAD_TO) \ -+ of=$(obj)spl/sunxi-spl-pad.bin 2>/dev/null -+ dd if=$(obj)spl/sunxi-spl.bin of=$(obj)spl/sunxi-spl-pad.bin \ -+ conv=notrunc 2>/dev/null -+ cat $(obj)spl/sunxi-spl-pad.bin $(obj)u-boot.img > $@ -+ rm $(obj)spl/sunxi-spl-pad.bin -+ - ifneq ($(CONFIG_TEGRA),) - $(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin - $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SYS_TEXT_BASE) -O binary $(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin -@@ -626,6 +636,9 @@ $(obj)spl/u-boot-spl.bin: $(SUBDIR_TOOLS - $(obj)tpl/u-boot-tpl.bin: $(SUBDIR_TOOLS) depend - $(MAKE) -C spl all CONFIG_TPL_BUILD=y - -+$(obj)spl/sunxi-spl.bin: $(SUBDIR_TOOLS) depend -+ $(MAKE) -C spl all -+ - updater: - $(MAKE) -C tools/updater all - -@@ -840,6 +853,8 @@ unconfig: - sinclude $(obj).boards.depend - $(obj).boards.depend: boards.cfg - @awk '(NF && $$1 !~ /^#/) { print $$7 ": " $$7 "_config; $$(MAKE)" }' $< > $@ -+ @awk '(NF && $$1 !~ /^#/ && tolower($$7) != $$7) { print tolower($$7) ": " $$7 "_config; $$(MAKE)" }' $< >> $@ -+ @awk '(NF && $$1 !~ /^#/ && tolower($$7) != $$7) { print ".PHONY: " tolower($$7) "_config"; print tolower($$7)"_config: " $$7 "_config" }' $< >> $@ - - # - # Functions to generate common board directory names -@@ -869,6 +884,7 @@ clean: - $(obj)tools/gen_eth_addr $(obj)tools/img2srec \ - $(obj)tools/mk{env,}image $(obj)tools/mpc86x_clk \ - $(obj)tools/mk{$(BOARD),}spl \ -+ $(obj)tools/mksunxiboot \ - $(obj)tools/mxsboot \ - $(obj)tools/ncb $(obj)tools/ubsha1 \ - $(obj)tools/kernel-doc/docproc \ -@@ -930,6 +946,7 @@ clobber: tidy - @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f - @rm -f $(obj)dts/*.tmp - @rm -f $(obj)spl/u-boot-spl{,-pad}.ais -+ @rm -f $(obj)spl/sun?i-spl.bin - - mrproper \ - distclean: clobber unconfig -diff -purN u-boot-2013.10/mkconfig u-boot-sunxi-2013.10-sunxi/mkconfig ---- u-boot-2013.10/mkconfig 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/mkconfig 2013-11-25 23:20:38.000000000 +0100 -@@ -167,6 +167,7 @@ done +diff --git a/mkconfig b/mkconfig +index b96c81f..8ce67a9 100755 +--- a/mkconfig ++++ b/mkconfig +@@ -172,6 +172,7 @@ done echo "#define CONFIG_SYS_ARCH \"${arch}\"" >> config.h echo "#define CONFIG_SYS_CPU \"${cpu}\"" >> config.h echo "#define CONFIG_SYS_BOARD \"${board}\"" >> config.h @@ -8220,16 +8147,11 @@ diff -purN u-boot-2013.10/mkconfig u-boot-sunxi-2013.10-sunxi/mkconfig [ "${vendor}" ] && echo "#define CONFIG_SYS_VENDOR \"${vendor}\"" >> config.h -diff -purN u-boot-2013.10/snapshot.commit u-boot-sunxi-2013.10-sunxi/snapshot.commit ---- u-boot-2013.10/snapshot.commit 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/snapshot.commit 2013-11-25 23:20:38.000000000 +0100 -@@ -1 +1 @@ --183acb700378a8cfc5d50a01a65de93fb2c24586 Wed, 16 Oct 2013 13:08:12 -0400 -+$Format:%H %cD$ -diff -purN u-boot-2013.10/spl/Makefile u-boot-sunxi-2013.10-sunxi/spl/Makefile ---- u-boot-2013.10/spl/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/spl/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -181,6 +181,12 @@ ifdef CONFIG_SAMSUNG +diff --git a/spl/Makefile b/spl/Makefile +index 5e5472d..436b952 100644 +--- a/spl/Makefile ++++ b/spl/Makefile +@@ -152,6 +152,12 @@ ifdef CONFIG_SAMSUNG ALL-y += $(obj)$(BOARD)-spl.bin endif @@ -8242,8 +8164,8 @@ diff -purN u-boot-2013.10/spl/Makefile u-boot-sunxi-2013.10-sunxi/spl/Makefile all: $(ALL-y) ifdef CONFIG_SAMSUNG -@@ -189,6 +195,12 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl - $(obj)u-boot-spl.bin $(obj)$(BOARD)-spl.bin +@@ -164,6 +170,12 @@ $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin + $(OBJTREE)/tools/mk$(BOARD)spl $(VAR_SIZE_PARAM) $< $@ endif +ifdef CONFIG_SUNXI @@ -8253,31 +8175,33 @@ diff -purN u-boot-2013.10/spl/Makefile u-boot-sunxi-2013.10-sunxi/spl/Makefile +endif + $(obj)$(SPL_BIN).bin: $(obj)$(SPL_BIN) - $(OBJCOPY) $(OBJCFLAGS) -O binary $< $@ + $(OBJCOPY) $(OBJCFLAGS) $(SPL_OBJCFLAGS) -O binary $< $@ -diff -purN u-boot-2013.10/tools/.gitignore u-boot-sunxi-2013.10-sunxi/tools/.gitignore ---- u-boot-2013.10/tools/.gitignore 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/tools/.gitignore 2013-11-25 23:20:38.000000000 +0100 -@@ -7,6 +7,7 @@ +diff --git a/tools/.gitignore b/tools/.gitignore +index cd2f041..2fdc9bd 100644 +--- a/tools/.gitignore ++++ b/tools/.gitignore +@@ -8,6 +8,7 @@ /mkimage /mpc86x_clk /mxsboot +/mksunxiboot /ncb - /ncp /proftool -diff -purN u-boot-2013.10/tools/Makefile u-boot-sunxi-2013.10-sunxi/tools/Makefile ---- u-boot-2013.10/tools/Makefile 2013-10-16 19:08:12.000000000 +0200 -+++ u-boot-sunxi-2013.10-sunxi/tools/Makefile 2013-11-25 23:20:38.000000000 +0100 -@@ -54,6 +54,7 @@ BIN_FILES-y += mkenvimage$(SFX) - BIN_FILES-y += mkimage$(SFX) + /relocate-rela +diff --git a/tools/Makefile b/tools/Makefile +index 328cea3..3eb46e6 100644 +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -56,6 +56,7 @@ BIN_FILES-y += mkimage$(SFX) BIN_FILES-$(CONFIG_EXYNOS5250) += mk$(BOARD)spl$(SFX) + BIN_FILES-$(CONFIG_EXYNOS5420) += mk$(BOARD)spl$(SFX) BIN_FILES-$(CONFIG_MX23) += mxsboot$(SFX) +BIN_FILES-$(CONFIG_SUNXI) += mksunxiboot$(SFX) BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX) BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX) BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX) -@@ -91,6 +92,7 @@ OBJ_FILES-$(CONFIG_EXYNOS5250) += mkexyn +@@ -97,6 +98,7 @@ OBJ_FILES-$(CONFIG_EXYNOS_SPL) += mkexynosspl.o OBJ_FILES-$(CONFIG_KIRKWOOD) += kwboot.o OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o OBJ_FILES-$(CONFIG_MX23) += mxsboot.o @@ -8285,7 +8209,7 @@ diff -purN u-boot-2013.10/tools/Makefile u-boot-sunxi-2013.10-sunxi/tools/Makefi OBJ_FILES-$(CONFIG_MX28) += mxsboot.o OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o -@@ -235,6 +237,10 @@ $(obj)mpc86x_clk$(SFX): $(obj)mpc86x_clk +@@ -266,6 +268,10 @@ $(obj)mpc86x_clk$(SFX): $(obj)mpc86x_clk.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@ @@ -8296,9 +8220,30 @@ diff -purN u-boot-2013.10/tools/Makefile u-boot-sunxi-2013.10-sunxi/tools/Makefi $(obj)mxsboot$(SFX): $(obj)mxsboot.o $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ $(HOSTSTRIP) $@ -diff -purN u-boot-2013.10/tools/mksunxiboot.c u-boot-sunxi-2013.10-sunxi/tools/mksunxiboot.c ---- u-boot-2013.10/tools/mksunxiboot.c 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/tools/mksunxiboot.c 2013-11-25 23:20:38.000000000 +0100 +diff --git a/tools/mksunxiboot.README b/tools/mksunxiboot.README +new file mode 100644 +index 0000000..5838778 +--- /dev/null ++++ b/tools/mksunxiboot.README +@@ -0,0 +1,13 @@ ++This program make a arm binary file can be loaded by Allwinner A10 and related ++chips from storage media such as nand and mmc. ++ ++More information about A10 boot, please refer to ++http://rhombus-tech.net/allwinner_a10/a10_boot_process/ ++ ++To compile this program, just type make, you will get 'mksunxiboot'. ++ ++To use it, ++$./mksunxiboot u-boot.bin u-boot-mmc.bin ++then you can write it to a mmc card with dd. ++$sudo dd if=u-boot-mmc.bin of=/dev/sdb bs=1024 seek=8 ++then insert your mmc card to your A10 tablet, you can boot from mmc card. +diff --git a/tools/mksunxiboot.c b/tools/mksunxiboot.c +new file mode 100644 +index 0000000..bc41912 +--- /dev/null ++++ b/tools/mksunxiboot.c @@ -0,0 +1,163 @@ +/* + * (C) Copyright 2007-2011 @@ -8463,20 +8408,3 @@ diff -purN u-boot-2013.10/tools/mksunxiboot.c u-boot-sunxi-2013.10-sunxi/tools/m + + return EXIT_SUCCESS; +} -diff -purN u-boot-2013.10/tools/mksunxiboot.README u-boot-sunxi-2013.10-sunxi/tools/mksunxiboot.README ---- u-boot-2013.10/tools/mksunxiboot.README 1970-01-01 01:00:00.000000000 +0100 -+++ u-boot-sunxi-2013.10-sunxi/tools/mksunxiboot.README 2013-11-25 23:20:38.000000000 +0100 -@@ -0,0 +1,13 @@ -+This program make a arm binary file can be loaded by Allwinner A10 and related -+chips from storage media such as nand and mmc. -+ -+More information about A10 boot, please refer to -+http://rhombus-tech.net/allwinner_a10/a10_boot_process/ -+ -+To compile this program, just type make, you will get 'mksunxiboot'. -+ -+To use it, -+$./mksunxiboot u-boot.bin u-boot-mmc.bin -+then you can write it to a mmc card with dd. -+$sudo dd if=u-boot-mmc.bin of=/dev/sdb bs=1024 seek=8 -+then insert your mmc card to your A10 tablet, you can boot from mmc card.