From 21d4d37aaf06acc6d274751b9f54492696606a50 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sat, 15 Aug 2015 09:38:22 +0200 Subject: sunxi_nand_spl: Fix CONFIG_SPL_NAND_SUNXI handling CONFIG_SPL_NAND_SUPPORT gets used via IS_ENABLED so it must be defined to 1, rather then just being defined. While at remove 2 other unused NAND related defines from sunxi-common.h. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- include/configs/sunxi-common.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'include') diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 1abf73c3117..3735afbafc0 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -138,15 +138,10 @@ #define CONFIG_SERIAL_TAG #if defined(CONFIG_SPL_NAND_SUNXI) -#define CONFIG_SPL_NAND_DRIVERS -#define CONFIG_SPL_NAND_SUPPORT - -#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000 +#define CONFIG_SPL_NAND_SUPPORT 1 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x008000 - #endif - /* mmc config */ #if !defined(CONFIG_UART0_PORT_F) #define CONFIG_MMC -- cgit v1.3.1 From e5268616878690037474ff36cb6efb350b5e1061 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 16 Aug 2015 14:48:22 +0200 Subject: sunxi_nand_spl: Rename SPL_NAND_SUNXI to NAND_SUNXI We eventually want to add full nand support, since it makes no sense to build SPL with nand support and u-boot without, or the other way around, a single option will suffice. Renaming the Kconfig option now makes things easier when we add full nand support in the future. The "obj-$(CONFIG_NAND_SUNXI) += sunxi_nand_spl.o" is moved to an "ifdef CONFIG_SPL_BUILD" block in the Makefile. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/board.c | 2 +- drivers/mtd/nand/Kconfig | 18 +++++++++--------- drivers/mtd/nand/Makefile | 2 +- include/configs/sunxi-common.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/board/sunxi/board.c b/board/sunxi/board.c index d411e96c761..9c855f604d6 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -108,7 +108,7 @@ int dram_init(void) return 0; } -#if defined(CONFIG_SPL_NAND_SUNXI) && defined(CONFIG_SPL_BUILD) +#if defined(CONFIG_NAND_SUNXI) && defined(CONFIG_SPL_BUILD) static void nand_pinmux_setup(void) { unsigned int pin; diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 09c9668e104..1d08d28d0e5 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -63,6 +63,14 @@ config NAND_PXA3XX This enables the driver for the NAND flash device found on PXA3xx processors (NFCv1) and also on Armada 370/XP (NFCv2). +config NAND_SUNXI + bool "Support for NAND on Allwinner SoCs in SPL" + depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I + select SYS_NAND_SELF_INIT + ---help--- + Enable support for NAND. This option allows SPL to read from + sunxi NAND using DMA transfers. + comment "Generic NAND options" # Enhance depends when converting drivers to Kconfig which use this config @@ -92,18 +100,10 @@ config SPL_NAND_DENALI This is a small implementation of the Denali NAND controller for use on SPL. -config SPL_NAND_SUNXI - bool "Support for NAND on Allwinner SoCs in SPL" - depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I - select SYS_NAND_SELF_INIT - ---help--- - Enable support for NAND. This option allows SPL to read from - sunxi NAND using DMA transfers. - config NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END hex "Size of syndrome partitions in sunxi NAND" default 0x400000 - depends on SPL_NAND_SUNXI + depends on NAND_SUNXI ---help--- End address for boot partitions on NAND. Those partitions have a different random seed that has to match the sunxi BROM setting. diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index 64d1675d0a9..71c1a519e97 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -12,7 +12,6 @@ NORMAL_DRIVERS=y endif obj-$(CONFIG_SPL_NAND_AM33XX_BCH) += am335x_spl_bch.o -obj-$(CONFIG_SPL_NAND_SUNXI) += sunxi_nand_spl.o obj-$(CONFIG_SPL_NAND_DENALI) += denali_spl.o obj-$(CONFIG_SPL_NAND_DOCG4) += docg4_spl.o obj-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o @@ -77,5 +76,6 @@ obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_spl.o obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_spl.o obj-$(CONFIG_NAND_MXC) += mxc_nand_spl.o obj-$(CONFIG_NAND_MXS) += mxs_nand_spl.o mxs_nand.o +obj-$(CONFIG_NAND_SUNXI) += sunxi_nand_spl.o endif # drivers diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 3735afbafc0..519c99cdaa5 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -137,7 +137,7 @@ #define CONFIG_INITRD_TAG #define CONFIG_SERIAL_TAG -#if defined(CONFIG_SPL_NAND_SUNXI) +#ifdef CONFIG_NAND_SUNXI #define CONFIG_SPL_NAND_SUPPORT 1 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x008000 #endif -- cgit v1.3.1 From d90ba790d8ae40c39d9e359dc71df16911b7bdb3 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 21 Aug 2015 21:49:51 +0200 Subject: mtd: nand: Make CONFIG_SYS_NAND_U_BOOT_OFFS configurable through Kconfig Make CONFIG_SYS_NAND_U_BOOT_OFFS configurable through Kconfig, just like SYS_NAND_BUSWIDTH_16BIT this is only enabled on some SoCs using depends, to avoid double defining it for SoCs which have not yet moved to Kconfig for this. Having this in Kconfig is useful because this is something which may differ from one board to the other even when using the same SoC. Signed-off-by: Hans de Goede Acked-by: Ian Campbell Acked-by: Scott Wood --- drivers/mtd/nand/Kconfig | 9 +++++++++ include/configs/sunxi-common.h | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index c34c234cc18..9a74064c98b 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -92,6 +92,15 @@ config SYS_NAND_BUSWIDTH_16BIT not available while configuring controller. So a static CONFIG_NAND_xx is needed to know the device's bus-width in advance. +# Enhance depends when converting drivers to Kconfig which use this config +config SYS_NAND_U_BOOT_OFFS + hex "Location in NAND to read U-Boot from" + default 0x8000 if NAND_SUNXI + depends on NAND_SUNXI + help + Set the offset from the start of the nand where u-boot should be + loaded from. + if SPL config SPL_NAND_DENALI diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 519c99cdaa5..5c65a89c4a8 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -139,7 +139,6 @@ #ifdef CONFIG_NAND_SUNXI #define CONFIG_SPL_NAND_SUPPORT 1 -#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x008000 #endif /* mmc config */ -- cgit v1.3.1 From fa5e102019e28a5936e52d6aa9f5624cf1744a35 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 27 Jul 2015 16:21:26 +0200 Subject: sunxi: increase SYS_MONITOR_LEN Signed-off-by: Boris Brezillon Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- include/configs/sunxi-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 5c65a89c4a8..48cc4ed6f62 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -179,7 +179,7 @@ #define CONFIG_SYS_NO_FLASH -#define CONFIG_SYS_MONITOR_LEN (512 << 10) /* 512 KiB */ +#define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */ #define CONFIG_IDENT_STRING " Allwinner Technology" #define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ -- cgit v1.3.1