From cf73639d32ebe9f53a4244f81cfd66c39f0e66eb Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 4 May 2012 10:30:16 +0200 Subject: km/common: add support for second flash Add support for a second flash. By default, a single flash chip is set up: - called 'boot' - mtd name for ubi 'ubi0' MTDIDS and MTDPARTS may be overwritten to add a second flash. The 'ubiattach' command is featured in two versions: - if CONFIG_KM_UBI_PARTITION_NAME_APP is not defined: this is the version as up to now - if CONFIG_KM_UBI_PARTITION_NAME_APP is defined: a check on 'actual_bank' will be done to determine the flash to boot from. Use CONFIG_KM_UBI_PARTITION_NAME_BOOT and CONFIG_KM_UBI_PARTITION_NAME_APP to define where to put the bootloader and the applications. Example: In the board config do: ... snip ... "boot:" \ "768k(u-boot)," \ "128k(env)," \ "128k(envred)," \ "-(" CONFIG_KM_UBI_PARTITION_NAME_BOOT ");" \ "app:" \ "-(" CONFIG_KM_UBI_PARTITION_NAME_APP ");" ... snap ... You may also need to enable the second flash: ... snip ... /* additional featured for COGE5 */ ... snap ... Signed-off-by: Andreas Huber cc: Kim Phillips cc: Valentin Longchamp cc: Gerlando Falauto Signed-off-by: Holger Brunck Signed-off-by: Kim Phillips --- include/configs/km/km_arm.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'include/configs/km/km_arm.h') diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h index c73a10c..011f838 100644 --- a/include/configs/km/km_arm.h +++ b/include/configs/km/km_arm.h @@ -229,11 +229,15 @@ int get_scl(void); #define FLASH_GPIO_PIN 0x00010000 -#define MTDIDS_DEFAULT "nand0=orion_nand" -/* test-only: partitioning needs some tuning, this is just for tests */ -#define MTDPARTS_DEFAULT "mtdparts=" \ - "orion_nand:" \ - "-(" CONFIG_KM_UBI_PARTITION_NAME ")" +#ifndef MTDIDS_DEFAULT +# define MTDIDS_DEFAULT "nand0=orion_nand" +#endif /* MTDIDS_DEFAULT */ + +#ifndef MTDPARTS_DEFAULT +# define MTDPARTS_DEFAULT "mtdparts=" \ + "orion_nand:" \ + "-(" CONFIG_KM_UBI_PARTITION_NAME_BOOT ");" +#endif /* MTDPARTS_DEFAULT */ #define CONFIG_KM_DEF_ENV_UPDATE \ "update=" \ @@ -257,7 +261,6 @@ int get_scl(void); "" #if defined(CONFIG_SYS_NO_FLASH) -#define CONFIG_KM_UBI_PARTITION_NAME "ubi0" #undef CONFIG_FLASH_CFI_MTD #undef CONFIG_JFFS2_CMDLINE #endif -- cgit v1.1