/* * Collect memory ranges */
top = FSP_LOWMEM_BASE;
while (!end_of_hob(hdr)) {
- if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+ if (hdr->type == HOB_TYPE_RES_DESC) {
res_desc = (struct hob_res_desc *)hdr;
if (res_desc->type == RES_SYS_MEM) {
phys_start = res_desc->phys_start;
/* Collect memory ranges */
top = FSP_HIGHMEM_BASE;
while (!end_of_hob(hdr)) {
- if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+ if (hdr->type == HOB_TYPE_RES_DESC) {
res_desc = (struct hob_res_desc *)hdr;
if (res_desc->type == RES_SYS_MEM) {
phys_start = res_desc->phys_start;
/* Collect memory ranges */
while (!end_of_hob(hdr)) {
- if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+ if (hdr->type == HOB_TYPE_RES_DESC) {
res_desc = (struct hob_res_desc *)hdr;
if (res_desc->type == RES_MEM_RESERVED) {
if (compare_guid(&res_desc->owner, guid)) {
return base;
}
-const struct hob_header *fsp_get_next_hob(u16 type, const void *hob_list)
+const struct hob_header *fsp_get_next_hob(uint type, const void *hob_list)
{
const struct hob_header *hdr;
/* Parse the HOB list until end of list or matching type is found */
while (!end_of_hob(hdr)) {
- if (get_hob_type(hdr) == type)
+ if (hdr->type == type)
return hdr;
hdr = get_next_hob(hdr);
hdr = gd->arch.hob_list;
while (!end_of_hob(hdr)) {
- if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+ if (hdr->type == HOB_TYPE_RES_DESC) {
res_desc = (struct hob_res_desc *)hdr;
if (res_desc->type == RES_SYS_MEM ||
res_desc->type == RES_MEM_RESERVED) {
hdr = gd->arch.hob_list;
while (!end_of_hob(hdr)) {
- if (get_hob_type(hdr) == HOB_TYPE_RES_DESC) {
+ if (hdr->type == HOB_TYPE_RES_DESC) {
res_desc = (struct hob_res_desc *)hdr;
entries[num_entries].addr = res_desc->phys_start;
entries[num_entries].size = res_desc->len;
/* GUID specific data goes here */
};
-/**
- * get_hob_type() - return the type of a HOB
- *
- * This macro returns the type field from the HOB header for the
- * HOB specified by hob.
- *
- * @hob: A pointer to a HOB.
- *
- * @return: HOB type.
- */
-static inline u16 get_hob_type(const struct hob_header *hdr)
-{
- return hdr->type;
-}
-
-/**
- * get_hob_length() - return the length, in bytes, of a HOB
- *
- * This macro returns the len field from the HOB header for the
- * HOB specified by hob.
- *
- * @hob: A pointer to a HOB.
- *
- * @return: HOB length.
- */
-static inline u16 get_hob_length(const struct hob_header *hdr)
-{
- return hdr->len;
-}
-
/**
* get_next_hob() - return a pointer to the next HOB in the HOB list
*
*/
static inline const struct hob_header *get_next_hob(const struct hob_header *hdr)
{
- return (const struct hob_header *)((u32)hdr + get_hob_length(hdr));
+ return (const struct hob_header *)((u32)hdr + hdr->len);
}
/**
*/
static inline bool end_of_hob(const struct hob_header *hdr)
{
- return get_hob_type(hdr) == HOB_TYPE_EOH;
+ return hdr->type == HOB_TYPE_EOH;
}
/**
*/
static inline u16 get_guid_hob_data_size(const struct hob_header *hdr)
{
- return get_hob_length(hdr) - sizeof(struct hob_guid);
+ return hdr->len - sizeof(struct hob_guid);
}
/* FSP specific GUID HOB definitions */
*
* @retval: A HOB object with matching type; Otherwise NULL.
*/
-const struct hob_header *fsp_get_next_hob(u16 type, const void *hob_list);
+const struct hob_header *fsp_get_next_hob(uint type, const void *hob_list);
/**
* Returns the next instance of the matched GUID HOB from the starting HOB.
int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
const struct hob_header *hdr;
- u16 type;
+ uint type;
char *desc;
int i = 0;
printf("----|----------|---------------------|----------------\n");
while (!end_of_hob(hdr)) {
printf("%-3d | %08x | ", i, (unsigned int)hdr);
- type = get_hob_type(hdr);
+ type = hdr->type;
if (type == HOB_TYPE_UNUSED)
desc = "*Unused*";
else if (type == HOB_TYPE_EOH)
desc = hob_type[type];
else
desc = "*Invalid Type*";
- printf("%-19s | %-15d\n", desc, get_hob_length(hdr));
+ printf("%-19s | %-15d\n", desc, hdr->len);
hdr = get_next_hob(hdr);
i++;
}