uboot 移植之gd_t,bd_t

2024-01-21 19:18
文章标签 uboot 移植 bd gd

本文主要是介绍uboot 移植之gd_t,bd_t,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

gd_t定义在uboot/include/asm-arm/global_data.h
/** (C) Copyright 2002* Wolfgang Denk, DENX Software Engineering, wd@denx.de.** See file CREDITS for list of people who contributed to this* project.** This program is free software; you can redistribute it and/or* modify it under the terms of the GNU General Public License as* published by the Free Software Foundation; either version 2 of* the License, or (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with this program; if not, write to the Free Software* Foundation, Inc., 59 Temple Place, Suite 330, Boston,* MA 02111-1307 USA*/#ifndef	__ASM_GBL_DATA_H
#define __ASM_GBL_DATA_H
/** The following data structure is placed in some memory wich is* available very early after boot (like DPRAM on MPC8xx/MPC82xx, or* some locked parts of the data cache) to allow for a minimum set of* global variables during system initialization (until we have set* up the memory controller so that we can use RAM).** Keep it *SMALL* and remember to set CONFIG_SYS_GBL_DATA_SIZE > sizeof(gd_t)*/typedef	struct	global_data {bd_t		*bd;unsigned long	flags;unsigned long	baudrate;unsigned long	have_console;	/* serial_init() was called */unsigned long	env_addr;	/* Address  of Environment struct */unsigned long	env_valid;	/* Checksum of Environment valid? */unsigned long	fb_base;	/* base address of frame buffer */
#ifdef CONFIG_VFDunsigned char	vfd_type;	/* display type */
#endif
#if 0unsigned long	cpu_clk;	/* CPU clock in Hz!		*/unsigned long	bus_clk;phys_size_t	ram_size;	/* RAM size */unsigned long	reset_status;	/* reset status register at boot */
#endifvoid		**jt;		/* jump table */
} gd_t;/** Global Data Flags*/
#define	GD_FLG_RELOC	0x00001		/* Code was relocated to RAM		*/
#define	GD_FLG_DEVINIT	0x00002		/* Devices have been initialized	*/
#define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
#define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
#define	GD_FLG_POSTSTOP	0x00010		/* POST seqeunce aborted		*/
#define	GD_FLG_LOGINIT	0x00020		/* Log Buffer has been initialized	*/
#define GD_FLG_DISABLE_CONSOLE	0x00040		/* Disable console (in & out)	 */#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")//#endif /* __ASM_GBL_DATA_H */

bd_t定义在uboot/include/asm-arm/u-boot.h
/** (C) Copyright 2002* Sysgo Real-Time Solutions, GmbH <www.elinos.com>* Marius Groeger <mgroeger@sysgo.de>** (C) Copyright 2002* Sysgo Real-Time Solutions, GmbH <www.elinos.com>* Alex Zuepke <azu@sysgo.de>** See file CREDITS for list of people who contributed to this* project.** This program is free software; you can redistribute it and/or* modify it under the terms of the GNU General Public License as* published by the Free Software Foundation; either version 2 of* the License, or (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with this program; if not, write to the Free Software* Foundation, Inc., 59 Temple Place, Suite 330, Boston,* MA 02111-1307 USA********************************************************************** NOTE: This header file defines an interface to U-Boot. Including* this (unmodified) header file in another file is considered normal* use of U-Boot, and does *not* fall under the heading of "derived* work".*********************************************************************/#ifndef _U_BOOT_H_
#define _U_BOOT_H_	1typedef struct bd_info {int			bi_baudrate;	/* serial console baudrate */unsigned long	bi_ip_addr;	/* IP Address */struct environment_s	       *bi_env;ulong	        bi_arch_number;	/* unique id for this board */ulong	        bi_boot_params;	/* where this board expects params */struct				/* RAM configuration */{ulong start;ulong size;}			bi_dram[CONFIG_NR_DRAM_BANKS];
} bd_t;#define bi_env_data bi_env->data
#define bi_env_crc  bi_env->crc#endif	/* _U_BOOT_H_ */
可参考
http://hi.baidu.com/shaoyi1110/blog/item/5246f5d1e0ac93123bf3cf56.html

这篇关于uboot 移植之gd_t,bd_t的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/630563

相关文章

FreeRTOS-基本介绍和移植STM32

FreeRTOS-基本介绍和STM32移植 一、裸机开发和操作系统开发介绍二、任务调度和任务状态介绍2.1 任务调度2.1.1 抢占式调度2.1.2 时间片调度 2.2 任务状态 三、FreeRTOS源码和移植STM323.1 FreeRTOS源码3.2 FreeRTOS移植STM323.2.1 代码移植3.2.2 时钟中断配置 一、裸机开发和操作系统开发介绍 裸机:前后台系

RT-Thread(Nano版本)的快速移植(基于NUCLEO-F446RE)

目录 概述 1 RT-Thread 1.1 RT-Thread的版本  1.2 认识Nano版本 2 STM32F446U上移植RT-Thread  2.1 STM32Cube创建工程 2.2 移植RT-Thread 2.2.1 安装RT-Thread Packet  2.2.2 加载RT-Thread 2.2.3 匹配相关接口 2.2.3.1 初次编译代码  2.2.3.

libmad音频解码库-Linux交叉编译移植

下载并解压libmad-0.15.1b.tar.gz 下载链接:https://downloads.sourceforge.net/mad/libmad-0.15.1b.tar.gz $tar -xvf libmad-0.15.1b.tar.gz$cd libmad-0.15.1b 1、先执行下面的命令:这条命令是为了适配高版本的gcc,因为高版本的gcc已经将-fforce-mem去除了:

arm linux lua移植

lua: lua home 1.下载lua源码 lua下载 lua-5.3.4.tar.gz 2.解压: tar xvf lua-5.3.4.tar.gz 3.修改makefile and luaconf.h $修改 lua-5.3.4/Makefile #INSTALL_TOP= /usr/local INSTALL_TOP= $(shell pwd)/out #修改安装目录(当前目录/o

PHP 最全编译安装 gd 库

安装gd依赖库   freetype wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.gztar jxvf freetype-2.4.0.tar.gzcd freetype-2.4.0./configure --prefix=/usr/local/freetypemake && make in

c++ error: redefinition of ‘struct ac::bd’ struct ac::bd:fg

#include <iostream> #include <stdio.h> class ac {     public:         class bd; }; class ac::bd {     public:         struct fg; }; struct ac::bd:fg {     int a = 1; }; int main() {     return 0;

笔记整理—uboot番外(6)针对x210的网卡说明

对于x210而言,在三星中与九鼎官方的uboot都默认使用了二号串口。详见CONFIG_SERIALn(n=1~4)。         更改串口后,应先插回原串口,进行iROM打印,内部iNnad校验核失败的信息,之后再插入其串口进行启动。         修改CCONFIG_NETMASK等多个宏可以修改默认的网络环境。在进行完成修改后,如果依旧没进行改变,则应对iNand

s3c2440---PWM使用之蜂鸣器驱动移植

一、蜂鸣器驱动介绍 1.1.什么是蜂鸣器               蜂鸣器是一种简单的声响发生器,常用于电子产品中作为警示或提醒作用。其基本原理是通过交替改变直流电的电压方向来产生声音,一般使用交替电流产生声音会比较稳定。 1.2.蜂鸣器的类别 1.有源蜂鸣器 1)结构原理 有源蜂鸣器内部自带振荡源,只需接通电源即可发声。内部电路会自动产生一定频率的振荡信号,从而驱动蜂鸣器发声。

PetaLinux Linux Uboot 源码路径

在很早以前的版本,直接在创建的工程下面就可以找到内核源码和uboot源码。后面的版本采用的是网络下载编译,诸如2018.3 编译完成自动删除,如果想保留,可以在创建的工程下面 $ vim ./project-spec/meta-user/conf/petalinuxbsp.conf 加入RM_WORK_EXCLUDE += "linux-xlnx"RM_WORK_EXCLUDE += "u

【GD32】---- 移植工程模板及点灯测试

1 新建模板文件夹 新建一个名叫03_GD32TemplateProject的文件夹,用于建造工程模板 2 移植官方库文件 在模板文件夹里新建5个文件夹,分别存放官方库文件和系统驱动文件 01_main 存放main函数 02_Startup 存放系统启动文件 03_System 存放官方的系统文件 04_Firmware_PeripheralDriver 存放官方