[U-Boot] Help defining an address in the environment

Hello,
I'm trying to define an address value in the U-Boot environment and my issue is the macro needs expended and arithmetic done before stringification. I'm finding this to be difficult to define using just the preprocessor. Below is the code showing what I'm trying to do.
Some other headers define a base address and some offsets:
============ CODE ============= #define IIM_BASE_ADDR 0x63F98000 /* define in different header */ #define IIM_BANK_AREA_1_OFFSET 0x00000C00 /* define in different header */
#define IIM_MAC_OCTET_1 (IIM_BASE_ADDR + IIM_BANK_AREA_1_OFFSET + 0x24) /* IIM, bank 1, row 9 */
#define xstr(s) str(s) #define str(s) #s
.....
#define CONFIG_EXTRA_ENV_SETTINGS \ "octet_addr=" xstr(IIM_MAC_OCTET_1) "\0" \
============CODE END ==========
What I want is for the 'octet_addr' variable to equal '0x63F98C24', so I could use it with 'itest' to do a check, but what I get is 'octet_addr' equals '(IIM_BASE_ADDR + IIM_BANK_AREA_1_OFFSET + 0x24)'. I'm not seeing a way to do what I want with just macros and the preprocessor. Is there a way I could define some environment variable from inside a function?
Thanks for any help.
-Michael
participants (1)
-
John, Michael