Skip to contentSkip to conversation

sunxi_nand_spl: Rename SPL_NAND_SUNXI to NAND_SUNXI

PATCH New Hans de Goede 4 participants 18 messages Aug 22, 2015 – Sep 26, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 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.

---
 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(-)
board/sunxi/board.c +1 -1
index d411e96..9c855f6 100644
@@ -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;
drivers/mtd/nand/Kconfig +9 -9
index 5f456c9..c331f66 100644
@@ -56,6 +56,14 @@ config SYS_NAND_VF610_NFC_60_ECC_BYTES
 
 endchoice
 
+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
@@ -85,18 +93,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.
drivers/mtd/nand/Makefile +1 -1
index 46dce72..c3bd0f7 100644
@@ -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
@@ -75,5 +74,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
include/configs/sunxi-common.h +1 -1
index 3735afb..519c99c 100644
@@ -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
Signature · 1 line
2.4.3
#1 lore raw

PATCH 2/4 sunxi_nand_spl: Remove NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END

We only ever use syndrome mode for the partitions which contain the SPL, as that is required for the BROM to be able to read the SPL.

Instead of using some arbritray limit for deciding whether or not to use syndrome, be smart and check if u-boot-dtb.bin is directly behind the SPL, if it is not then it is on its own partition and we should not use syndrome.

Note the reason why we only use syndrome mode is because it comes with weaker randomization, introducing a risc for more bit errors, so we want to avoid it when possible.

---
 drivers/mtd/nand/Kconfig          | 8 --------
 drivers/mtd/nand/sunxi_nand_spl.c | 8 ++++++--
 2 files changed, 6 insertions(+), 10 deletions(-)
drivers/mtd/nand/Kconfig +0 -8
index c331f66..c65951e 100644
@@ -93,14 +93,6 @@ config SPL_NAND_DENALI
 	  This is a small implementation of the Denali NAND controller
 	  for use on SPL.
 
-config NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END
-	hex "Size of syndrome partitions in sunxi NAND"
-	default 0x400000
-	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.
-
 endif
 
 endmenu
drivers/mtd/nand/sunxi_nand_spl.c +6 -2
index ebab2ed..0505424 100644
@@ -355,8 +355,12 @@ int nand_spl_load_image(uint32_t offs, unsigned int size, void *dest)
 		2 * 1024 * 1024 + CONFIG_SYS_NAND_U_BOOT_OFFS,
 		4 * 1024 * 1024 + CONFIG_SYS_NAND_U_BOOT_OFFS,
 	};
-	int syndrome = offs < CONFIG_NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END;
-	int i;
+	int i, syndrome;
+
+	if (CONFIG_SYS_NAND_U_BOOT_OFFS == CONFIG_SPL_PAD_TO)
+		syndrome = 1; /* u-boot-dtb.bin appended to SPL */
+	else
+		syndrome = 0; /* u-boot-dtb.bin on its own partition */
 
 	if (offs == CONFIG_SYS_NAND_U_BOOT_OFFS) {
 		for (i = 0; i < ARRAY_SIZE(boot_offsets); i++) {
Signature · 1 line
2.4.3
#2 lore raw

PATCH 2/4 sunxi_nand_spl: Remove NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END

Quoted 10 lines · Hans de Goede

We only ever use syndrome mode for the partitions which contain the SPL, as that is required for the BROM to be able to read the SPL.

Instead of using some arbritray limit for deciding whether or not to use syndrome, be smart and check if u-boot-dtb.bin is directly behind the SPL, if it is not then it is on its own partition and we should not use syndrome.

Note the reason why we only use syndrome mode is because it comes with weaker randomization,

"...why we only use syndrome mode for the SPL is because..."

Quoted 1 line

introducing a risc for more bit errors,

risk

drivers/mtd/nand/sunxi_nand_spl.c int nand_spl_load_image(uint32_t offs, unsigned int size, void *dest) · line 363

Quoted 8 lines
drivers/mtd/nand/sunxi_nand_spl.c +6 -2
-     int syndrome = offs < CONFIG_NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END;
-     int i;
+     int i, syndrome;
+
+     if (CONFIG_SYS_NAND_U_BOOT_OFFS == CONFIG_SPL_PAD_TO)
+             syndrome = 1; /* u-boot-dtb.bin appended to SPL */
+     else
+             syndrome = 0; /* u-boot-dtb.bin on its own partition */

Is it not possible for a separate partition to begin at CONFIG_SPL_PAD_TO, or would padding not be used in that case?

-Scott

#3 lore raw

PATCH 2/4 sunxi_nand_spl: Remove NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END

Hi,

Quoted 9 lines · Scott Wood
Quoted 8 lines · Hans de Goede

We only ever use syndrome mode for the partitions which contain the SPL, as that is required for the BROM to be able to read the SPL.

Instead of using some arbritray limit for deciding whether or not to use syndrome, be smart and check if u-boot-dtb.bin is directly behind the SPL, if it is not then it is on its own partition and we should not use syndrome.

Quoted 8 lines
Quoted 2 lines

Note the reason why we only use syndrome mode is because it comes with weaker randomization,

"...why we only use syndrome mode for the SPL is because..."

Quoted 1 line

introducing a risc for more bit errors,

risk

Will fix.

Quoted 11 lines

drivers/mtd/nand/sunxi_nand_spl.c int nand_spl_load_image(uint32_t offs, unsigned int size, void *dest) · line 363

Quoted 8 lines
drivers/mtd/nand/sunxi_nand_spl.c +6 -2
-     int syndrome = offs < CONFIG_NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END;
-     int i;
+     int i, syndrome;
+
+     if (CONFIG_SYS_NAND_U_BOOT_OFFS == CONFIG_SPL_PAD_TO)
+             syndrome = 1; /* u-boot-dtb.bin appended to SPL */
+     else
+             syndrome = 0; /* u-boot-dtb.bin on its own partition */

Is it not possible for a separate partition to begin at CONFIG_SPL_PAD_TO, or would padding not be used in that case?

CONFIG_SPL_PAD_TO always is 32k on sunxi, partitions must be on an eraseblock boundary and eraseblocks are always much larger then 32k, so this cannot happen.

Regards,

Hans

#4 lore raw

PATCH 2/4 sunxi_nand_spl: Remove NAND_SUNXI_SPL_SYNDROME_PARTITIONS_END

Quoted 20 lines · Hans de Goede

Hi,

Quoted 17 lines · Scott Wood
Quoted 15 lines · Hans de Goede

We only ever use syndrome mode for the partitions which contain the SPL,
as that is required for the BROM to be able to read the SPL.

Instead of using some arbritray limit for deciding whether or not to
use syndrome, be smart and check if u-boot-dtb.bin is directly behind
the SPL, if it is not then it is on its own partition and we should not
use syndrome.

Note the reason why we only use syndrome mode is because it comes with
weaker randomization,

Quoted 7 lines
Quoted 5 lines

"...why we only use syndrome mode for the SPL is because..."

Quoted 1 line

introducing a risc for more bit errors,

risk

Will fix.

With that: Acked-by: Ian Campbell <[email protected]>

#5 lore raw

PATCH 3/4 mtd: nand: Make CONFIG_SYS_NAND_U_BOOT_OFFS configurable through Kconfig

In reply to Hans de Goede

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.

---
 drivers/mtd/nand/Kconfig       | 9 +++++++++
 include/configs/sunxi-common.h | 1 -
 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/mtd/nand/Kconfig +9 -0
index c65951e..a58fa7e 100644
@@ -85,6 +85,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
include/configs/sunxi-common.h +0 -1
index 519c99c..5c65a89 100644
@@ -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 */
Signature · 1 line
2.4.3
#6 lore raw

PATCH 3/4 mtd: nand: Make CONFIG_SYS_NAND_U_BOOT_OFFS configurable through Kconfig

Quoted 8 lines · Hans de Goede

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.

Quoted 4 lines

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.

For the sunxi side:

(But needs MTD custodian's more, I guess that is Scott?)

#7 lore raw

PATCH 3/4 mtd: nand: Make CONFIG_SYS_NAND_U_BOOT_OFFS configurable through Kconfig

Quoted 12 lines · Ian Campbell
Quoted 11 lines · Hans de Goede

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.

Quoted 6 lines
Quoted 1 line

For the sunxi side:

(But needs MTD custodian's more, I guess that is Scott?)

...but note that this is one of the symbols that can never be kconfigized for the boards that use TPL, so long as SPLs can't have their own config.

I'm also not looking forward to such symbols growing a huge list of boards in the depends field. I'm not sure what the answer is here.

-Scott

#8 lore raw

PATCH 3/4 mtd: nand: Make CONFIG_SYS_NAND_U_BOOT_OFFS configurable through Kconfig

Hi,

Quoted 18 lines · Scott Wood
Quoted 17 lines · Ian Campbell
Quoted 8 lines · Hans de Goede

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.

Quoted 4 lines

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.

For the sunxi side:

Quoted 6 lines
Quoted 1 line

(But needs MTD custodian's more, I guess that is Scott?)

...but note that this is one of the symbols that can never be kconfigized for the boards that use TPL, so long as SPLs can't have their own config.

Hmm, maybe we beed to have 2 values for it then:
CONFIG_SYS_NAND_SPL_U_BOOT_OFFS
CONFIG_SYS_NAND_TPL_U_BOOT_OFFS

And select which one to use depending we are building the SPL or the TPL, then both could go to Kconfig

Quoted 2 lines

I'm also not looking forward to such symbols growing a huge list of boards in the depends field. I'm not sure what the answer is here.

See above, if we do something like that, then at one point in time we can choose to put in some effort to convert the remaining boards, and just drop the depends.

Regards,

Hans

#9 lore raw

PATCH 4/4 sunxi: Add inet97fv2_defconfig

In reply to Hans de Goede

The inet97fv2 is a board found in the first generation of cheap allwinner A10 based 7" tablets.

Note that this patch does not add a dts file as we already have one from our dts syncs with the kernel.

---
 board/sunxi/MAINTAINERS     |  3 ++-
 configs/inet97fv2_defconfig | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 configs/inet97fv2_defconfig
board/sunxi/MAINTAINERS +2 -1
index de99fe1..46a78bd 100644
@@ -8,9 +8,9 @@ F:	configs/ba10_tv_box_defconfig
 F:	configs/Chuwi_V7_CW0825_defconfig
 F:	configs/Cubieboard_defconfig
 F:	configs/Hyundai_A7HD_defconfig
+F:	configs/inet97fv2_defconfig
 F:	configs/jesurun_q5_defconfig
 F:	configs/Mele_A1000_defconfig
-F:	configs/Mele_A1000G_quad_defconfig
 F:	configs/Mele_M3_defconfig
 F:	configs/Mini-X_defconfig
 F:	configs/mk802_defconfig
@@ -26,6 +26,7 @@ F:	configs/r7-tv-dongle_defconfig
 F:	configs/UTOO_P66_defconfig
 F:	include/configs/sun6i.h
 F:	configs/CSQ_CS908_defconfig
+F:	configs/Mele_A1000G_quad_defconfig
 F:	configs/Mele_M9_defconfig
 F:	include/configs/sun7i.h
 F:	configs/A20-OLinuXino_MICRO_defconfig
configs/inet97fv2_defconfig new file +20 -0
new file mode 100644
index 0000000..d7ddee1
@@ -0,0 +1,20 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN4I=y
+CONFIG_DRAM_CLK=408
+CONFIG_DRAM_EMR1=4
+CONFIG_USB0_VBUS_PIN="PB9"
+CONFIG_USB0_VBUS_DET="PH5"
+CONFIG_USB0_ID_DET="PH4"
+CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:24,pclk_khz:33000,le:45,ri:209,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_POWER="PH8"
+CONFIG_VIDEO_LCD_BL_EN="PH7"
+CONFIG_VIDEO_LCD_BL_PWM="PB2"
+CONFIG_USB_MUSB_HOST=y
+CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-inet97fv2"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP209_POWER"
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
Signature · 1 line
2.4.3
#10 lore raw

PATCH 4/4 sunxi: Add inet97fv2_defconfig

Quoted 2 lines · Hans de Goede

-F: configs/Mele_A1000G_quad_defconfig

[...]

Quoted 1 line

+F: configs/Mele_A1000G_quad_defconfig

Unintentional?

Without that move: Acked-by: Ian Campbell <[email protected]>

#11 lore raw

PATCH 4/4 sunxi: Add inet97fv2_defconfig

Hi,

Quoted 8 lines · Ian Campbell
Quoted 2 lines · Hans de Goede

-F: configs/Mele_A1000G_quad_defconfig

[...]

Quoted 1 line

+F: configs/Mele_A1000G_quad_defconfig

Unintentional?

Nope intentional, the boards under my name are sorted by family, then alphabetically, so first all sun4i boards, then all sun5i, etc.

This one was in the wrong place.

But you're right this does not belong here, I'll move this to a separate patch.

Quoted 1 line

Without that move: Acked-by: Ian Campbell <[email protected]>

Regards,

Hans

#12 lore raw

PATCH 4/4 sunxi: Add inet97fv2_defconfig

Quoted 12 lines · Hans de Goede

Hi,

Quoted 8 lines · Ian Campbell
Quoted 2 lines · Hans de Goede

-F: configs/Mele_A1000G_quad_defconfig

[...]

Quoted 1 line

+F: configs/Mele_A1000G_quad_defconfig

Unintentional?

Quoted 8 lines

Nope intentional, the boards under my name are sorted by family, then alphabetically, so first all sun4i boards, then all sun5i, etc.

This one was in the wrong place.

But you're right this does not belong here, I'll move this to a separate patch.

Such a patch: Acked-by: Ian Campbell <[email protected]>

(or this one with the move mentioned in the commit log would be oto)

Quoted 8 lines
Quoted 2 lines

Without that move: Acked-by: Ian Campbell <[email protected]>

Regards,

Hans

#13 lore raw

PATCH 1/4 sunxi_nand_spl: Rename SPL_NAND_SUNXI to NAND_SUNXI

In reply to Hans de Goede
Quoted 11 lines · Hans de Goede

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.

#14 lore raw

PATCH 1/4 sunxi_nand_spl: Rename SPL_NAND_SUNXIto NAND_SUNXI

In reply to Hans de Goede

Hans de Goede <hdegoede <at> redhat.com> writes:

Hey Hans,

Quoted 23 lines

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 <hdegoede <at> redhat.com>
---
 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(-)
board/sunxi/board.c +0 -0
index d411e96..9c855f6 100644

board/sunxi/board.c int dram_init(void) · line 111

Quoted 6 lines
board/sunxi/board.c +1 -1
 <at>  <at>  -108,7 +108,7  <at>  <at>  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)

While I agree this being a good way forward, the latest (and probably this change included) break nand support entirely and cause link errors when enabeling sunxi nand.

sunxi-bsp/u-boot-sunxi/drivers/mtd/nand/nand.c:104: undefined reference to `board_nand_init' (which is from board/sunxi/board.c:144)

I think it's wise (for now) to remove the && defined(CONFIG_SPL_BUILD) and re-add this guard later.

By removing we atleast can still build u-boot with nand support (thus opening the option of testing and patches for users) and don't break previously working systems.

#15 lore raw

PATCH 1/4 sunxi_nand_spl: Rename SPL_NAND_SUNXIto NAND_SUNXI

Bah gmane!

Adding Hans and Ian to the CC list.

Quoted 49 lines · Olliver Schinagl

Hans de Goede <hdegoede <at> redhat.com> writes:

Hey Hans,

Quoted 22 lines

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 <hdegoede <at> redhat.com>
---
  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(-)
board/sunxi/board.c +0 -0
index d411e96..9c855f6 100644

board/sunxi/board.c int dram_init(void) · line 111

Quoted 6 lines
board/sunxi/board.c +1 -1
  <at>  <at>  -108,7 +108,7  <at>  <at>  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)

While I agree this being a good way forward, the latest (and probably this change included) break nand support entirely and cause link errors when enabeling sunxi nand.

sunxi-bsp/u-boot-sunxi/drivers/mtd/nand/nand.c:104: undefined reference to `board_nand_init' (which is from board/sunxi/board.c:144)

I think it's wise (for now) to remove the && defined(CONFIG_SPL_BUILD) and re-add this guard later.

By removing we atleast can still build u-boot with nand support (thus opening the option of testing and patches for users) and don't break previously working systems.

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#16 lore raw

PATCH 1/4 sunxi_nand_spl: Rename SPL_NAND_SUNXIto NAND_SUNXI

In reply to Olliver Schinagl

Hi,

Quoted 40 lines · Olliver Schinagl

Hans de Goede <hdegoede <at> redhat.com> writes:

Hey Hans,

Quoted 23 lines

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 <hdegoede <at> redhat.com>
---
  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(-)
board/sunxi/board.c +0 -0
index d411e96..9c855f6 100644

board/sunxi/board.c int dram_init(void) · line 111

Quoted 6 lines
board/sunxi/board.c +1 -1
  <at>  <at>  -108,7 +108,7  <at>  <at>  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)

While I agree this being a good way forward, the latest (and probably this change included) break nand support entirely and cause link errors when enabeling sunxi nand.

sunxi-bsp/u-boot-sunxi/drivers/mtd/nand/nand.c:104: undefined reference to `board_nand_init' (which is from board/sunxi/board.c:144)

Quoted 6 lines

I think it's wise (for now) to remove the && defined(CONFIG_SPL_BUILD) and re-add this guard later.

By removing we atleast can still build u-boot with nand support (thus opening the option of testing and patches for users) and don't break previously working systems.

I just tried to set CONFIG_NAND_SUNXI=y in q8_a13_tablet_defconfig and did a build with the latest master and this works fine for me ...

Regards,

Hans

#17 lore raw

PATCH 1/4 sunxi_nand_spl: Rename SPL_NAND_SUNXIto NAND_SUNXI

Hey Hans,

Quoted 49 lines · Hans de Goede

Hi,

Quoted 46 lines · Olliver Schinagl

Hans de Goede <hdegoede <at> redhat.com> writes:

Hey Hans,

Quoted 23 lines

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 <hdegoede <at> redhat.com>
---
  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(-)
board/sunxi/board.c +0 -0
index d411e96..9c855f6 100644

board/sunxi/board.c int dram_init(void) · line 111

Quoted 6 lines
board/sunxi/board.c +1 -1
  <at>  <at>  -108,7 +108,7  <at> <at>  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)

While I agree this being a good way forward, the latest (and probably this
change included) break nand support entirely and cause link errors when enabeling sunxi nand.

sunxi-bsp/u-boot-sunxi/drivers/mtd/nand/nand.c:104: undefined reference to
`board_nand_init' (which is from board/sunxi/board.c:144)

I think it's wise (for now) to remove the &&
defined(CONFIG_SPL_BUILD) and
re-add this guard later.

Quoted 7 lines
Quoted 3 lines

By removing we atleast can still build u-boot with nand support (thus opening the option of testing and patches for users) and don't break previously working systems.

I just tried to set CONFIG_NAND_SUNXI=y in q8_a13_tablet_defconfig and did a build with the latest master and this works fine for me ...

it failed when enabeling nand, but you've been doing some work there so should be okay again now.

Quoted 3 lines

Regards,

Hans