u-boot errors for beagle..

Hi,
I am working on u-boot-1.3.2 for beagle board. I have u-boot-1.1.4 for
beagle board and after adding the code for beagle board in u-
boot-1.3.2, I compiled that code and so many errors occured. to make
this code error free I added some macro definitions (#define
CFG_REDUNDAND_ENVIRONMENT , #define CONFIG_SOFT_I2C, #define I2C_READ,
#define I2C_ACTIVE,#define CFG_CMD_I2C,#define CFG_CMD_NAND etc.) in
include/configs/omap3530beagle.h file. one line contains #include
<cmd_confdefs.h> in this file, but it is not found at compilation. I
changed prototype of mmc_read and mmc2info functions in cpu/omap3/
mmc.c according to header file. after doing this I got following
errors.

the code given below is part of the file board/omap3530beagle/mem.c

uchar(*boot_env_get_char_spec) (int index);
int (*boot_env_init) (void);
int (*boot_saveenv) (void);
void (*boot_env_relocate_spec) (void);
/* 16 bit NAND */
extern uchar nand_env_get_char_spec(int index);
extern int nand_env_init(void);
extern int nand_saveenv(void);
extern void nand_env_relocate_spec(void);
extern char *nand_env_name_spec;

#ifdef ENV_IS_VARIABLE
        boot_env_get_char_spec = nand_env_get_char_spec;
        boot_env_init = nand_env_init;
        boot_saveenv = nand_saveenv
        boot_env_relocate_spec = nand_env_relocate_spec;
        env_ptr = 0; */ /* This gets filled elsewhere!! */
        env_name_spec = nand_env_name_spec;

#endif

errors occured at compilation--

board/omap3530beagle/libomap3530beagle.a(mem.o): In function
`gpmc_init':
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_env_name_spec'
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_env_get_char_spec'
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_env_init'
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_saveenv'
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_env_relocate_spec'
make: *** [u-boot] Error 1

If this code is compiled without following lines then no error is
there .

#ifdef ENV_IS_VARIABLE
        boot_env_get_char_spec = nand_env_get_char_spec;
        boot_env_init = nand_env_init;
        boot_saveenv = nand_saveenv
        boot_env_relocate_spec = nand_env_relocate_spec;
        env_ptr = 0; */ /* This gets filled elsewhere!! */
        env_name_spec = nand_env_name_spec;

#endif

When I define these function in the same file(board/omap3530beagle/
mem.c) then no error is there and if I define these functions in a
different file(I tried in common/env_flash.c) then it says multiple
diffinitions of function env_get_char_spec (which is different from
these functions). env_get_char_spec function is defined in board/
omap3530beagle/mem.c and common/env_flash.c(difinitions are different
at both places). I think these functions should be defined in a
different file as it seems from keyword extern. can anyone suggest me
how these errors can be removed..

thank you

I'm not all that familiar with u-boot 1.3.2, but it looks like you are
just having generic function pointer issues.

Hi,
I am working on u-boot-1.3.2 for beagle board. I have u-boot-1.1.4 for
beagle board and after adding the code for beagle board in u-
boot-1.3.2, I compiled that code and so many errors occured. to make
this code error free I added some macro definitions (#define
CFG_REDUNDAND_ENVIRONMENT , #define CONFIG_SOFT_I2C, #define I2C_READ,
#define I2C_ACTIVE,#define CFG_CMD_I2C,#define CFG_CMD_NAND etc.) in
include/configs/omap3530beagle.h file. one line contains #include
<cmd_confdefs.h> in this file, but it is not found at compilation. I
changed prototype of mmc_read and mmc2info functions in cpu/omap3/
mmc.c according to header file. after doing this I got following
errors.

the code given below is part of the file board/omap3530beagle/mem.c

uchar(*boot_env_get_char_spec) (int index);
int (*boot_env_init) (void);
int (*boot_saveenv) (void);
void (*boot_env_relocate_spec) (void);
/* 16 bit NAND */
extern uchar nand_env_get_char_spec(int index);
extern int nand_env_init(void);
extern int nand_saveenv(void);
extern void nand_env_relocate_spec(void);
extern char *nand_env_name_spec;

#ifdef ENV_IS_VARIABLE
boot_env_get_char_spec = nand_env_get_char_spec;
boot_env_init = nand_env_init;
boot_saveenv = nand_saveenv
boot_env_relocate_spec = nand_env_relocate_spec;
env_ptr = 0; */ /* This gets filled elsewhere!! */

Where is the opening for the comment that is closed in the line
above? This looks like a syntax error to me right away.

    env\_name\_spec = nand\_env\_name\_spec;

#endif

errors occured at compilation--

board/omap3530beagle/libomap3530beagle.a(mem.o): In function
`gpmc_init':
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_env_name_spec'
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_env_get_char_spec'
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_env_init'
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_saveenv'
/home/nitcbeagle/orig_u-boot1/board/omap3530beagle/mem.c:693:
undefined reference to `nand_env_relocate_spec'
make: *** [u-boot] Error 1

If this code is compiled without following lines then no error is
there .

#ifdef ENV_IS_VARIABLE
boot_env_get_char_spec = nand_env_get_char_spec;
boot_env_init = nand_env_init;
boot_saveenv = nand_saveenv
boot_env_relocate_spec = nand_env_relocate_spec;
env_ptr = 0; */ /* This gets filled elsewhere!! */
env_name_spec = nand_env_name_spec;

#endif

When I define these function in the same file(board/omap3530beagle/
mem.c) then no error is there

By "these functions", you mean the nand_ functions, correct?

and if I define these functions in a
different file(I tried in common/env_flash.c) then it says multiple
diffinitions of function env_get_char_spec (which is different from
these functions).

So, you are defining the function pointers, not the functions?!?

env_get_char_spec function is defined in board/
omap3530beagle/mem.c and common/env_flash.c(difinitions are different
at both places). I think these functions should be defined in a
different file as it seems from keyword extern. can anyone suggest me
how these errors can be removed..

thank you

Maybe you should send a link to the gitweb view of the sources you are
compiling so that we know exactly what you are looking at as a
starting point before you apply your patches.

I think there have been a lot of changes in the NAND area in u-bbot
since that rev. It would be best to work against u-boot git and get
the patches submitted upstream. The ARM custodian job has been split
up, so it should be easier to get patches reviewed now, I hope.

Philip