[U-Boot] [PATCH 4/4] Support NAND and OneNAND memories on the OMAP3 EVM.
Wolfgang Denk
wd at denx.de
Tue May 26 23:14:12 CEST 2009
Dear Josh Karabin,
In message <dc17cf9cca7ecf905d67dfa04deb6536608c9cf0.1243367498.git.gkarabi n at vocollect.com> you wrote:
> This change detects the boot configuration of an OMAP3 device,
> and uses that information on OMAP3 EVM builds to support
> NAND or OneNAND.
>
> Signed-off-by: Josh Karabin <gkarabin at vocollect.com>
> ---
> board/omap3/evm/evm.c | 24 +++++++++++
> board/omap3/evm/evm.h | 4 +-
> cpu/arm_cortexa8/omap3/mem.c | 71 ++++++++++++++++++++------------
> include/asm-arm/arch-omap3/sys_proto.h | 2 +-
> include/configs/omap3_evm.h | 4 ++
> 5 files changed, 76 insertions(+), 29 deletions(-)
>
> diff --git a/board/omap3/evm/evm.c b/board/omap3/evm/evm.c
> index c008c2e..e30e83f 100644
> --- a/board/omap3/evm/evm.c
> +++ b/board/omap3/evm/evm.c
> @@ -34,6 +34,8 @@
> #include <asm/arch/sys_proto.h>
> #include <i2c.h>
> #include <asm/mach-types.h>
> +#include <environment.h>
> +#include <command.h>
> #include "evm.h"
>
> /*
> @@ -43,8 +45,30 @@
> int board_init(void)
> {
> DECLARE_GLOBAL_DATA_PTR;
> +#if defined(CONFIG_ENV_IS_IN_ONENAND) && defined(CONFIG_ENV_IS_IN_NAND)
> + int flash_type;
> + cmd_tbl_t *cmdtp;
>
> + flash_type = gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
> +
> + switch (flash_type) {
> + case PISMO1_NAND:
> + env_object_ptr = &env_object_nand;
> + onenand_disable_init();
> + cmdtp = find_cmd("onenand");
> + cmdtp->name = NULL;
> + break;
> + case PISMO1_ONENAND:
> + env_object_ptr = &env_object_onenand;
> + nand_disable_init();
> + cmdtp = find_cmd("nand");
> + cmdtp->name = NULL;
> + break;
> + }
In the end we will have tons of FOO_disable_init() functions for all
kinds of FOO; Maybe we can just have one common disable_cmd() function
and supply it with a parameter instead?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Children begin by loving their parents. After a time they judge them.
Rarely, if ever, do they forgive them. - Oscar Wilde
More information about the U-Boot
mailing list