Skip to contentSkip to conversation

Add MTD and UBI support to ast-g5

PATCH Applied Adriana Kobylak 3 participants 9 messages Aug 16, 2017 – Aug 24, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add MTD and UBI support to ast-g5

Add MTD and UBI support to the default g5 include, conditioned to having MTDPARTS_DEFAULT defined.

This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot.

---
 include/configs/ast-g5-ncsi.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/ast-g5-ncsi.h +10 -0
index 12d6684..b126e6e 100644
@@ -28,4 +28,14 @@
 
 #define CONFIG_HW_WATCHDOG
 
+/* MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
 #endif	/* __AST_G5_NCSI_CONFIG_H */
Signature · 1 line
1.8.2.2
#1 lore raw
Quoted 2 lines · Adriana Kobylak

Add MTD and UBI support to the default g5 include, conditioned to having MTDPARTS_DEFAULT defined.

Can you explain what we're planning on using mtdparts for? As I understand it this is for specifying the mtd partitions on the command line.

Are you proposing to move away from the device tree description?

Quoted 2 lines

This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot.

Do you have numbers? It's good to keep track in case we need to go back and save space in the future.

Quoted 10 lines
---
 include/configs/ast-g5-ncsi.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/ast-g5-ncsi.h +0 -0
index 12d6684..b126e6e 100644

include/configs/ast-g5-ncsi.h line 34

Quoted 7 lines
include/configs/ast-g5-ncsi.h +4 -0
@@ -28,4 +28,14 @@
 
 #define CONFIG_HW_WATCHDOG
 
+/* MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI

I thought Milton mentioned today that we didn't need to enable the UBI command in u-boot, but I may have misunderstood.

Quoted 10 lines
include/configs/ast-g5-ncsi.h +6 -1
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
 #endif /* __AST_G5_NCSI_CONFIG_H */
--

1.8.2.2

author
#2 lore raw

Thanks Joel, answers inline below.

Quoted 10 lines · Joel Stanley
Quoted 2 lines · Adriana Kobylak

Add MTD and UBI support to the default g5 include, conditioned to having MTDPARTS_DEFAULT defined.

Can you explain what we're planning on using mtdparts for? As I understand it this is for specifying the mtd partitions on the command line.

Are you proposing to move away from the device tree description?

mtdparts is needed by u-boot to find the kernel in a ubi volume, for example the u-boot command "ubi part" requires it.
Implementing the device tree in u-boot could be a future possibility but the current version of u-boot in openbmc can't read from any other chips besides the bmc, so we need to duplicate the device tree layout of the bmc chip in u-boot for now.

Quoted 6 lines
Quoted 3 lines

This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot.

Do you have numbers? It's good to keep track in case we need to go back and save space in the future.

After you mentioned that you saw u-boot increasing by 122kB with an earlier patch, I removed UBIFS since it wasn't needed, bringing the increase down by 50kB. The new size is 302kB (increase of 72kB over current size).

Quoted 14 lines
Quoted 14 lines
---
 include/configs/ast-g5-ncsi.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
include/configs/ast-g5-ncsi.h +0 -0
index 12d6684..b126e6e 100644
@@ -28,4 +28,14 @@
 
 #define CONFIG_HW_WATCHDOG
 
Quoted 7 lines

include/configs/ast-g5-ncsi.h line 34

Quoted 4 lines
include/configs/ast-g5-ncsi.h +4 -0
+/* MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI

I thought Milton mentioned today that we didn't need to enable the UBI command in u-boot, but I may have misunderstood.

It is needed since the kernel is in ubi volume.

Quoted 11 lines
Quoted 11 lines
include/configs/ast-g5-ncsi.h +6 -1
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
 #endif /* __AST_G5_NCSI_CONFIG_H */
--

1.8.2.2

#3 lore raw
In reply to Adriana Kobylak

include/configs/ast-g5-ncsi.h

Quoted 16 lines · Adriana Kobylak

Add MTD and UBI support to the default g5 include, conditioned to having MTDPARTS_DEFAULT defined.

This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot.

---
 include/configs/ast-g5-ncsi.h | 10 ++++++++++

 1 file changed, 10 insertions(+)

include/configs/ast-g5- renamed from include/configs/ast-g5-ncsi.h +0 -0

ncsi.h
index 12d6684..b126e6e 100644

include/configs/ast-g5-ncsi.h +0 -0

I suggest we make this common to all platforms to reduce the configuration headache. Putting the #defines in ast-g5-ncsi doesn't isolate the change to Witherspoon, and I think we should avoid further fragmentation e.g. by introducing a Witherspoon-specific configuration.

If other platforms need to recover the extra space required we can deal with that on an as-needed basis in the future.

Cheers,

Andrew

Quoted 15 lines
include/configs/ast-g5-ncsi.h +0 -0
@@ -28,4 +28,14 @@


 #define CONFIG_HW_WATCHDOG

include/configs/ast-g5-ncsi.h +10 -0
+/* MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+

 #endif /* __AST_G5_NCSI_CONFIG_H */

#4 lore raw

Re: [PATCH u-boot v2016.07-aspeed-openbmc] Add optional MTD and UBI support to ast-g4 and ast-g5

Add MTD and UBI support conditioned to having MTDPARTS_DEFAULT defined. This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot by about 70kB.

---
 include/configs/ast-g4-ncsi.h | 10 ++++++++++
 include/configs/ast-g4-phy.h  | 10 ++++++++++
 include/configs/ast-g5-ncsi.h | 10 ++++++++++
 include/configs/ast-g5-phy.h  | 10 ++++++++++
 4 files changed, 40 insertions(+)
include/configs/ast-g4-ncsi.h +10 -0
index 8191dfc..0ba5a43 100644
@@ -26,4 +26,14 @@
 #define CONFIG_CPU_420			1
 #define CONFIG_DRAM_528			1
 
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
 #endif	/* __AST_G4_NCSI_CONFIG_H */
include/configs/ast-g4-phy.h +10 -0
index baa522f..8b26fa6 100644
@@ -28,4 +28,14 @@
 #define CONFIG_CPU_420			1
 #define CONFIG_DRAM_528			1
 
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
 #endif	/* __AST_G4_NCSI_CONFIG_H */
include/configs/ast-g5-ncsi.h +10 -0
index 12d6684..167835f 100644
@@ -28,4 +28,14 @@
 
 #define CONFIG_HW_WATCHDOG
 
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
 #endif	/* __AST_G5_NCSI_CONFIG_H */
include/configs/ast-g5-phy.h +10 -0
index 62ddb84..c3e2552 100644
@@ -30,4 +30,14 @@
 /* platform.S */
 #define	CONFIG_DRAM_ECC_SIZE		0x10000000
 
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
 #endif	/* __AST_G5_PHY_CONFIG_H */
Signature · 1 line
1.8.2.2
#5 lore raw

Re: [PATCH u-boot v2016.07-aspeed-openbmc] Add optional MTD and UBI support to ast-g4 and ast-g5

Quoted 11 lines · Adriana Kobylak

Add MTD and UBI support conditioned to having MTDPARTS_DEFAULT defined. This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot by about 70kB.

Quoted 1 line

---
 include/configs/ast-g4-ncsi.h | 10 ++++++++++
 include/configs/ast-g4-phy.h  | 10 ++++++++++
 include/configs/ast-g5-ncsi.h | 10 ++++++++++
 include/configs/ast-g5-phy.h  | 10 ++++++++++

 4 files changed, 40 insertions(+)

So my understanding is instead of duplicating the additions we can put the them once in include/configs/ast-common.h:

    $ grep 'ast-common.h' include/configs/ast*
    include/configs/ast-g4-ncsi.h:#include <configs/ast-common.h>
    include/configs/ast-g4-phy.h:#include <configs/ast-common.h>
    include/configs/ast-g5-ncsi.h:#include <configs/ast-common.h>
    include/configs/ast-g5-phy.h:#include <configs/ast-common.h>

Sorry for the back-and-forth, but I think that would be a cleaner solution.

Cheers,

Andrew

Quoted 77 lines
include/configs/ast-g4-ncsi.h +0 -0
index 8191dfc..0ba5a43 100644
@@ -26,4 +26,14 @@
Quoted 2 lines

 #define CONFIG_CPU_420 1
 #define CONFIG_DRAM_528 1

include/configs/ast-g4-ncsi.h +10 -0
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

 #endif /* __AST_G4_NCSI_CONFIG_H */

include/configs/ast-g4-phy.h +0 -0
index baa522f..8b26fa6 100644
@@ -28,4 +28,14 @@
Quoted 2 lines

 #define CONFIG_CPU_420 1
 #define CONFIG_DRAM_528 1

include/configs/ast-g4-phy.h +10 -0
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

 #endif /* __AST_G4_NCSI_CONFIG_H */

include/configs/ast-g5-ncsi.h +0 -0
index 12d6684..167835f 100644
@@ -28,4 +28,14 @@


 #define CONFIG_HW_WATCHDOG

include/configs/ast-g5-ncsi.h +10 -0
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

 #endif /* __AST_G5_NCSI_CONFIG_H */

include/configs/ast-g5-phy.h +0 -0
index 62ddb84..c3e2552 100644
@@ -30,4 +30,14 @@
  /* platform.S */
Quoted 1 line
Quoted 1 line

 #define CONFIG_DRAM_ECC_SIZE 0x10000000

include/configs/ast-g5-phy.h +10 -0
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

 #endif /* __AST_G5_PHY_CONFIG_H */

#6 lore raw

Re: [PATCH u-boot v2016.07-aspeed-openbmc] Add optional MTD and UBI support to ast-common

Add MTD and UBI support conditioned to having MTDPARTS_DEFAULT defined. This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot by about 70kB.

---
 include/configs/ast-common.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
include/configs/ast-common.h +12 -0
index 110c780..29551ef 100644
@@ -84,6 +84,18 @@
 #define CONFIG_SYS_MAXARGS		16
 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
 
+/*
+ * Optional MTD and UBI support
+ */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
 #define CONFIG_BOOTARGS			"console=ttyS4,115200n8 root=/dev/ram rw"
 
 #define CONFIG_AST_SPI_NOR    /* AST SPI NOR Flash */
Signature · 1 line
1.8.2.2
#7 lore raw

Re: [PATCH u-boot v2016.07-aspeed-openbmc] Add optional MTD and UBI support to ast-common

Quoted 5 lines · Adriana Kobylak

Add MTD and UBI support conditioned to having MTDPARTS_DEFAULT defined. This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot by about 70kB.

Applied to v2016.07-aspeed-openbmc.

Thanks,

Andrew

Quoted 27 lines

---
 include/configs/ast-common.h | 12 ++++++++++++

 1 file changed, 12 insertions(+)
include/configs/ast-common.h +0 -0
index 110c780..29551ef 100644
@@ -84,6 +84,18 @@
Quoted 2 lines

 #define CONFIG_SYS_MAXARGS 16
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE

include/configs/ast-common.h +12 -0
+/*
+ * Optional MTD and UBI support
+ */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

 #define CONFIG_BOOTARGS "console=ttyS4,115200n8 root=/dev/ram rw"


 #define CONFIG_AST_SPI_NOR    /* AST SPI NOR Flash */

#8 lore raw

Re: [PATCH u-boot v2016.07-aspeed-openbmc] Add optional MTD and UBI support to ast-g4 and ast-g5

In reply to Andrew Jeffery
Quoted 19 lines · Andrew Jeffery
Quoted 11 lines · Adriana Kobylak

Add MTD and UBI support conditioned to having MTDPARTS_DEFAULT defined. This allows platforms to enable this support if desired without adding it by default since it increases the size of u-boot by about 70kB.

Quoted 1 line
---
 include/configs/ast-g4-ncsi.h | 10 ++++++++++
 include/configs/ast-g4-phy.h  | 10 ++++++++++
 include/configs/ast-g5-ncsi.h | 10 ++++++++++
 include/configs/ast-g5-phy.h  | 10 ++++++++++
 4 files changed, 40 insertions(+)

So my understanding is instead of duplicating the additions we can put the them once in include/configs/ast-common.h:

Quoted 9 lines
   $ grep 'ast-common.h' include/configs/ast*
   include/configs/ast-g4-ncsi.h:#include <configs/ast-common.h>
   include/configs/ast-g4-phy.h:#include <configs/ast-common.h>
   include/configs/ast-g5-ncsi.h:#include <configs/ast-common.h>
   include/configs/ast-g5-phy.h:#include <configs/ast-common.h>

Sorry for the back-and-forth, but I think that would be a cleaner solution.

Yep, agree. Thanks Andrew for the feedback, better to do it right the first time. Will be sending a new patch in a min.

Quoted 81 lines

Cheers,

Andrew

Quoted 77 lines
include/configs/ast-g4-ncsi.h +0 -0
index 8191dfc..0ba5a43 100644
@@ -26,4 +26,14 @@
Quoted 2 lines

#define CONFIG_CPU_420 1
#define CONFIG_DRAM_528 1

include/configs/ast-g4-ncsi.h +10 -0
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

#endif /* __AST_G4_NCSI_CONFIG_H */

include/configs/ast-g4-phy.h +0 -0
index baa522f..8b26fa6 100644
@@ -28,4 +28,14 @@
Quoted 2 lines

#define CONFIG_CPU_420 1
#define CONFIG_DRAM_528 1

include/configs/ast-g4-phy.h +10 -0
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

#endif /* __AST_G4_NCSI_CONFIG_H */

include/configs/ast-g5-ncsi.h +10 -0
index 12d6684..167835f 100644
@@ -28,4 +28,14 @@
 
 #define CONFIG_HW_WATCHDOG
 
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

#endif /* __AST_G5_NCSI_CONFIG_H */

include/configs/ast-g5-phy.h +0 -0
index 62ddb84..c3e2552 100644
@@ -30,4 +30,14 @@
 /* platform.S */
Quoted 1 line
Quoted 1 line

#define CONFIG_DRAM_ECC_SIZE 0x10000000

include/configs/ast-g5-phy.h +10 -0
+/* Optional MTD and UBI */
+#ifdef MTDPARTS_DEFAULT
+#define CONFIG_FLASH_CFI_MTD
+#define CONFIG_CMD_UBI
+#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+#endif
+
Quoted 1 line

#endif /* __AST_G5_PHY_CONFIG_H */