This function is strange at the moment in that it takes a header pointer
but then accesses the cbfs_s global. Currently clients have their own priv
pointer, so update the function to take that as a parameter instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
#include <malloc.h>
#include <asm/byteorder.h>
#include <malloc.h>
#include <asm/byteorder.h>
+/* Offset of master header from the start of a coreboot ROM */
+#define MASTER_HDR_OFFSET 0x38
+
static const u32 good_magic = 0x4f524243;
static const u8 good_file_magic[] = "LARCHIVE";
static const u32 good_magic = 0x4f524243;
static const u8 good_file_magic[] = "LARCHIVE";
-static int cbfs_load_header_ptr(struct cbfs_priv *priv, ulong base,
- struct cbfs_header *header)
+static int cbfs_load_header_ptr(struct cbfs_priv *priv, ulong base)
+ struct cbfs_header *header = &priv->header;
struct cbfs_header *header_in_rom;
header_in_rom = (struct cbfs_header *)base;
struct cbfs_header *header_in_rom;
header_in_rom = (struct cbfs_header *)base;
* valid. Assume that a master header appears at the start, at offset
* 0x38.
*/
* valid. Assume that a master header appears at the start, at offset
* 0x38.
*/
- ret = cbfs_load_header_ptr(priv, base + 0x38, &priv->header);
+ ret = cbfs_load_header_ptr(priv, base + MASTER_HDR_OFFSET);