Skip to content
Snippets Groups Projects
Commit d68e4ba9 authored by Ronny Nilsson's avatar Ronny Nilsson
Browse files

brcm_fw_tool: Add backward compatibility with Broadcom 5.02L.03 and Iopsys 4,...

brcm_fw_tool: Add backward compatibility with Broadcom 5.02L.03 and Iopsys 4, which doesn't have pureUBI.
parent df597574
No related branches found
No related tags found
No related merge requests found
......@@ -18,14 +18,25 @@ CFLAGS += -I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bc
CFLAGS += -L$(STAGING_DIR)/usr/lib/
CFLAGS += -L$(STAGING_DIR_ROOT)/usr/lib
LIBS += -lbcm_flashutil -lbcm_boardctl -lbcm_util -lsys_util -lgen_util -lubi
obj := brcm_fw_tool.o jffs2.o crc32.o image-jffs2.o
# Backward compatibility with Broadcom 5.02L.03 and
# Iopsys 4, which doesn't have pureUBI.
ifneq ($(wildcard $(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx/iopsys_pureUBI.h),)
CFLAGS += -DWITH_PUREUBI=1
LIBS += -lbcm_flashutil -lbcm_boardctl -lbcm_util -lsys_util -lgen_util -lubi
obj += image-ubi.o
$(info Including pureUBI support)
else
CFLAGS += -DWITH_PUREUBI=0
$(info Skipping pureUBI support)
endif
%.o: %.c Makefile
$(TARGET_CC_NOCACHE) -c $(CFLAGS) -o $@ $<
obj := brcm_fw_tool.o jffs2.o crc32.o image-jffs2.o image-ubi.o
brcm_fw_tool: $(obj)
$(TARGET_CC_NOCACHE) $(CFLAGS) -o $@ $^ $(LIBS)
......
......@@ -123,6 +123,11 @@ typedef struct _bcm_tag_bccfe {
/* IOCTL file descriptor */
int fd = 0;
const char ubiStr3[] = "metadata";
char ubiStr2[] = NAND_CFE_RAM_NAME;
char ubiStr1[] = "committed";
static int board_ioctl(int ioctl_id, int action, int hex, char* string_buf, int string_buf_len, int offset) {
BOARD_IOCTL_PARMS IoctlParms;
IoctlParms.string = string_buf;
......
......@@ -82,9 +82,6 @@ struct metaInfo_t {
//-------------------------------------------------------------
const char ubiStr3[] = "metadata";
char ubiStr2[] = NAND_CFE_RAM_NAME;
char ubiStr1[] = "committed";
char *tmpMetaBlob; // Path to a temporary file.
static libubi_t libubi;
static struct ubi_info ubInfo; // General UBI information in the system
......
#ifndef IMAGE_UBI_H
#define IMAGE_UBI_H
#if defined WITH_PUREUBI && WITH_PUREUBI == 1
#include "iopsys_pureUBI.h"
#endif
//-------------------------------------------------------------
extern const char ubiStr3[];
extern char ubiStr2[];
extern char ubiStr1[];
//-------------------------------------------------------------
int gen_image_ubi(char *sequence_number);
// Backward compatibility with Broadcom 5.02L.03 and
// Iopsys 4, which doesn't have pureUBI.
#if defined WITH_PUREUBI && WITH_PUREUBI == 1
int gen_image_ubi(char *sequence_number);
#else
static int gen_image_ubi(char *sequence_number) { return -1; }
#endif
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment