Skip to content

Commit

Permalink
Merge Official Source
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
  • Loading branch information
1715173329 committed Jul 5, 2023
2 parents 3f4a88d + eb8cae5 commit 7125dd1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions target/linux/bcm63xx/dts/bcm6362-netgear-dgnd3700-v2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
compatible = "brcm,wfi";
label = "wfi";
reg = <0x0004000 0x1c7c000>;
brcm,cferam = "cfe";
};

partition@1c80000 {
Expand Down
16 changes: 14 additions & 2 deletions target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_bcm_wfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#define CFERAM_NAME "cferam"
#define CFERAM_NAME_LEN (sizeof(CFERAM_NAME) - 1)
#define CFERAM_NAME_MAX_LEN 32
#define KERNEL_NAME "vmlinux.lz"
#define KERNEL_NAME_LEN (sizeof(KERNEL_NAME) - 1)
#define OPENWRT_NAME "1-openwrt"
Expand Down Expand Up @@ -157,17 +158,28 @@ static int parse_bcm_wfi(struct mtd_info *master,
const struct mtd_partition **pparts,
uint8_t *buf, loff_t off, loff_t size, bool cfe_part)
{
struct device_node *mtd_node;
struct mtd_partition *parts;
loff_t cfe_off, kernel_off, rootfs_off;
unsigned int num_parts = BCM_WFI_PARTS, cur_part = 0;
const char *cferam_name = CFERAM_NAME;
size_t cferam_name_len;
int ret;

mtd_node = mtd_get_of_node(master);
if (mtd_node)
of_property_read_string(mtd_node, "brcm,cferam", &cferam_name);

cferam_name_len = strnlen(cferam_name, CFERAM_NAME_MAX_LEN);
if (cferam_name_len > 0)
cferam_name_len--;

if (cfe_part) {
num_parts++;
cfe_off = off;

ret = jffs2_find_file(master, buf, CFERAM_NAME,
CFERAM_NAME_LEN, &cfe_off,
ret = jffs2_find_file(master, buf, cferam_name,
cferam_name_len, &cfe_off,
size - (cfe_off - off), NULL, NULL);
if (ret)
return ret;
Expand Down

0 comments on commit 7125dd1

Please sign in to comment.