mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-18 10:54:37 +00:00
common: board_r: Drop initr_api wrapper
Add a return value to api_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
0154858039
commit
ce41e73523
4 changed files with 15 additions and 14 deletions
|
@ -642,7 +642,7 @@ int syscall(int call, int *retval, ...)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void api_init(void)
|
int api_init(void)
|
||||||
{
|
{
|
||||||
struct api_signature *sig;
|
struct api_signature *sig;
|
||||||
|
|
||||||
|
@ -679,7 +679,7 @@ void api_init(void)
|
||||||
sig = malloc(sizeof(struct api_signature));
|
sig = malloc(sizeof(struct api_signature));
|
||||||
if (sig == NULL) {
|
if (sig == NULL) {
|
||||||
printf("API: could not allocate memory for the signature!\n");
|
printf("API: could not allocate memory for the signature!\n");
|
||||||
return;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
env_set_hex("api_address", (unsigned long)sig);
|
env_set_hex("api_address", (unsigned long)sig);
|
||||||
|
@ -691,6 +691,8 @@ void api_init(void)
|
||||||
sig->checksum = crc32(0, (unsigned char *)sig,
|
sig->checksum = crc32(0, (unsigned char *)sig,
|
||||||
sizeof(struct api_signature));
|
sizeof(struct api_signature));
|
||||||
debugf("syscall entry: 0x%lX\n", (unsigned long)sig->syscall);
|
debugf("syscall entry: 0x%lX\n", (unsigned long)sig->syscall);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long size,
|
void platform_set_mr(struct sys_info *si, unsigned long start, unsigned long size,
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#ifndef _API_PRIVATE_H_
|
#ifndef _API_PRIVATE_H_
|
||||||
#define _API_PRIVATE_H_
|
#define _API_PRIVATE_H_
|
||||||
|
|
||||||
void api_init(void);
|
int api_init(void);
|
||||||
void platform_set_mr(struct sys_info *, unsigned long, unsigned long, int);
|
void platform_set_mr(struct sys_info *, unsigned long, unsigned long, int);
|
||||||
int platform_sys_info(struct sys_info *);
|
int platform_sys_info(struct sys_info *);
|
||||||
|
|
||||||
|
|
|
@ -490,15 +490,6 @@ static int initr_malloc_bootparams(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_API)
|
|
||||||
static int initr_api(void)
|
|
||||||
{
|
|
||||||
/* Initialize API */
|
|
||||||
api_init();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_NET
|
#ifdef CONFIG_CMD_NET
|
||||||
static int initr_ethaddr(void)
|
static int initr_ethaddr(void)
|
||||||
{
|
{
|
||||||
|
@ -753,7 +744,7 @@ static init_fnc_t init_sequence_r[] = {
|
||||||
stdio_add_devices,
|
stdio_add_devices,
|
||||||
jumptable_init,
|
jumptable_init,
|
||||||
#ifdef CONFIG_API
|
#ifdef CONFIG_API
|
||||||
initr_api,
|
api_init,
|
||||||
#endif
|
#endif
|
||||||
console_init_r, /* fully init console as a device */
|
console_init_r, /* fully init console as a device */
|
||||||
#ifdef CONFIG_DISPLAY_BOARDINFO_LATE
|
#ifdef CONFIG_DISPLAY_BOARDINFO_LATE
|
||||||
|
|
|
@ -7,6 +7,14 @@
|
||||||
#ifndef __API_H
|
#ifndef __API_H
|
||||||
#define __API_H
|
#define __API_H
|
||||||
|
|
||||||
void api_init(void);
|
/**
|
||||||
|
* api_init() - Initialize API for external applications
|
||||||
|
*
|
||||||
|
* Initialize API for external (standalone) applications running on top of
|
||||||
|
* U-Boot. It is called during the generic post-relocation init sequence.
|
||||||
|
*
|
||||||
|
* Return: 0 if OK
|
||||||
|
*/
|
||||||
|
int api_init(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue