I am working on uboot [v2018.07][https://gitlab.denx.de/u-boot/u-boot/-/tree/v2018.07] on beagleboneblack. For my implementation, I have to read boot device on startup as it can be booted from emmc or sd card.
I was looking into a method **omap_sys_boot_device(void)** declared [here] [https://gitlab.denx.de/u-boot/u-boot/-/blob/v2018.07/arch/arm/include/asm/omap_common.h#L833]. While loading the environment in **env_load(void**) method defined [here][https://gitlab.denx.de/u-boot/u-boot/-/blob/v2018.07/env/env.c#L183], I added few lines
$this->bbcode_second_pass_code('', ' u32 boot_device;
boot_device = omap_sys_boot_device();
printf ("Boot device is 0x%x", boot_device);')
to read the boot_device. I did include the header file where omap_sys_boot_device(void) is declared. But there are multiple definitions of this method in boot.c files inside this [directory][https://gitlab.denx.de/u-boot/u-boot/-/tree/v2018.07/arch/arm/mach-omap2] (in folder omap3, 4 and 5 and in boot-common.c file as well). Beagleboneblack has arm cortex-a8 cpu which is used by omap3. What should I change in by implementation so that calls the correct omap_sys_boot_device(void) definition. Right now, it is calling omap_sys_boot_device(void) inside boot-common.c and is always returning BOOT_DEVICE_NONE, I also checked it by adding some logs in these defintions.