linux/drivers/firmware/broadcom/bcm47xx_nvram.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * BCM947xx nvram variable access
 *
 * Copyright (C) 2005 Broadcom Corporation
 * Copyright (C) 2006 Felix Fietkau <[email protected]>
 * Copyright (C) 2010-2012 Hauke Mehrtens <[email protected]>
 */

#include <linux/io.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/mtd/mtd.h>
#include <linux/bcm47xx_nvram.h>

#define NVRAM_MAGIC
#define NVRAM_SPACE
#define NVRAM_MAX_GPIO_ENTRIES
#define NVRAM_MAX_GPIO_VALUE_LEN

#define FLASH_MIN

struct nvram_header {};

static char nvram_buf[NVRAM_SPACE];
static size_t nvram_len;
static const u32 nvram_sizes[] =;

/**
 * bcm47xx_nvram_is_valid - check for a valid NVRAM at specified memory
 */
static bool bcm47xx_nvram_is_valid(void __iomem *nvram)
{}

/**
 * bcm47xx_nvram_copy - copy NVRAM to internal buffer
 */
static void bcm47xx_nvram_copy(void __iomem *nvram_start, size_t res_size)
{}

/**
 * bcm47xx_nvram_find_and_copy - find NVRAM on flash mapping & copy it
 */
static int bcm47xx_nvram_find_and_copy(void __iomem *flash_start, size_t res_size)
{}

int bcm47xx_nvram_init_from_iomem(void __iomem *nvram_start, size_t res_size)
{}
EXPORT_SYMBOL_GPL();

/*
 * On bcm47xx we need access to the NVRAM very early, so we can't use mtd
 * subsystem to access flash. We can't even use platform device / driver to
 * store memory offset.
 * To handle this we provide following symbol. It's supposed to be called as
 * soon as we get info about flash device, before any NVRAM entry is needed.
 */
int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
{}

static int nvram_init(void)
{}

int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len)
{}
EXPORT_SYMBOL();

int bcm47xx_nvram_gpio_pin(const char *name)
{}
EXPORT_SYMBOL();

char *bcm47xx_nvram_get_contents(size_t *nvram_size)
{}
EXPORT_SYMBOL();