资源简介
基于TQ3358的u-boot移植,支持SD启动。
代码片段和文件信息
/*
* (C) Copyright 2007 Semihalf
*
* Written by: Rafal Jaworowski
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include
#include
#include
#include
#include
#include
#include
#include “api_private.h“
#define DEBUG
#undef DEBUG
/*****************************************************************************
*
* This is the API core.
*
* API_ functions are part of U-Boot code and constitute the lowest level
* calls:
*
* - they know what values they need as arguments
* - their direct return value pertains to the API_ “shell“ itself (0 on
* success some error code otherwise)
* - if the call returns a value it is buried within arguments
*
****************************************************************************/
#ifdef DEBUG
#define debugf(fmt args...) do { printf(“%s(): “ __func__); printf(fmt ##args); } while (0)
#else
#define debugf(fmt args...)
#endif
typedef int (*cfp_t)(va_list argp);
static int calls_no;
/*
* pseudo signature:
*
* int API_getc(int *c)
*/
static int API_getc(va_list ap)
{
int *c;
if ((c = (int *)va_arg(ap u_int32_t)) == NULL)
return API_EINVAL;
*c = getc();
return 0;
}
/*
* pseudo signature:
*
* int API_tstc(int *c)
*/
static int API_tstc(va_list ap)
{
int *t;
if ((t = (int *)va_arg(ap u_int32_t)) == NULL)
return API_EINVAL;
*t = tstc();
return 0;
}
/*
* pseudo signature:
*
* int API_putc(char *ch)
*/
static int API_putc(va_list ap)
{
char *c;
if ((c = (char *)va_arg(ap u_int32_t)) == NULL)
return API_EINVAL;
putc(*c);
return 0;
}
/*
* pseudo signature:
*
* int API_puts(char **s)
*/
static int API_puts(va_list ap)
{
char *s;
if ((s = (char *)va_arg(ap u_int32_t)) == NULL)
return API_EINVAL;
puts(s);
return 0;
}
/*
* pseudo signature:
*
* int API_reset(void)
*/
static int API_reset(va_list ap)
{
do_reset(NULL 0 0 NULL);
/* NOT REACHED */
return 0;
}
/*
* pseudo signature:
*
* int API_get_sys_info(struct sys_info *si)
*
* fill out the sys_info struct containing selected parameters about the
* machine
*/
static int API_get_sys_info(va_list ap)
{
struct sys_info *si;
si = (struct sys_info *)va_arg(ap u_int32_t);
if (si == NULL)
return API_ENOMEM;
return (platform_sys_info(si)) ? 0 : API_ENODEV;
}
/*
* pseudo signature:
*
* int API_udelay(unsigned long *udelay)
*/
static int API_udelay(va_list ap)
{
unsigned long *d;
if ((d = (unsigned long *)va_arg(ap u_int32_t)) == NULL)
return API_EINVAL;
udelay(*d);
return 0;
}
/*
* pseudo signature:
*
* int API_get_timer(unsigned long *current unsigned long *base)
*/
static int API_get_timer(va_list ap)
{
unsigned long *base *cur;
cur = (unsigned long *)va_arg(ap u_int32_t);
if (cur == NULL)
return API_EINVAL;
base = (unsigned long *)va_arg(ap u_int32_t);
if (base == NULL)
return API_EINVAL;
*cur = get_timer(*base);
return 0;
}
/****
- 上一篇:保研简历、证明材料、个人陈述、推荐信等合集.rar
- 下一篇:vlc0.8.6i版本
相关资源
- 详细Smart210 uboot移植手册
-
TP-li
nk 941n v6原厂固件Web直刷不死u - PXA270 uboot 源码.rar
- u-boot-2012.10移植全记录基于s3c2440
- u-boot2017.01启动过程分析.pdf
- ZYNQ开发全过程概览
-
rali
nk.bin(hg255d网页刷uboot所需固件 - 深入了解uboot
- petalinux编译uboot、kernel、rootfs方法
- linux系统移植嵌入式linux系统:内核、
- 路由器最后所有的不死UBOOT。150427版。
- FS4412系统移植uboot移植实验代码
- Tiny6410 mlc2 uboot
- 支持tiny4412-1506的uboot
- uboot_tiny4412_0929.tar.gz
- u-boot-2017.07移植到s5pv210教程(含对应
- wndr3800(ch)刷不死uboot,解锁boot区分
- TP-WR720N 路由器固件 大合集共14个 op
- uboot for mini2440
- TIny4412 uboot
- tiny6410 uboot代码145866
- itop4412 UBOOT源代码
- tiny6410 uboot代码
- uboot代码详细分析完整88页版.pdf
- 史上最详细最全面的uboot启动过程分析
- Uboot-1.1.2 for PXA270源码分析.pdf
- uboot启动流程的详细分析
- UBOOT代码详细分析88页PDF
- linux下为SD卡烧写uboot.bin的原理与方法
- 一步步教你移植uboot(超精华版).r
评论
共有 条评论