/openbmc/qemu/hw/rtc/ |
H A D | m48t59.c | 2 * QEMU M48T59 and M48T08 NVRAM emulation for PPC PREP and Sparc platforms 93 M48t59State *NVRAM = opaque; in alarm_cb() local 95 qemu_set_irq(NVRAM->IRQ, 1); in alarm_cb() 96 if ((NVRAM->buffer[0x1FF5] & 0x80) == 0 && in alarm_cb() 97 (NVRAM->buffer[0x1FF4] & 0x80) == 0 && in alarm_cb() 98 (NVRAM->buffer[0x1FF3] & 0x80) == 0 && in alarm_cb() 99 (NVRAM->buffer[0x1FF2] & 0x80) == 0) { in alarm_cb() 101 qemu_get_timedate(&tm, NVRAM->time_offset); in alarm_cb() 107 next_time = qemu_timedate_diff(&tm) - NVRAM->time_offset; in alarm_cb() 108 } else if ((NVRAM->buffer[0x1FF5] & 0x80) != 0 && in alarm_cb() [all …]
|
H A D | ds1338.c | 2 * MAXIM DS1338 I2C RTC+NVRAM 21 /* Size of NVRAM including both the user-accessible area and the 40 uint8_t nvram[NVRAM_SIZE]; member 53 VMSTATE_UINT8_ARRAY(nvram, DS1338State, NVRAM_SIZE), 67 s->nvram[0] = to_bcd(now.tm_sec); in capture_current_time() 68 s->nvram[1] = to_bcd(now.tm_min); in capture_current_time() 69 if (s->nvram[2] & HOURS_12) { in capture_current_time() 75 s->nvram[2] = HOURS_12 | to_bcd(tmp); in capture_current_time() 77 s->nvram[2] = HOURS_12 | HOURS_PM | to_bcd(tmp - 12); in capture_current_time() 80 s->nvram[2] = to_bcd(now.tm_hour); in capture_current_time() [all …]
|
H A D | m48t59-internal.h | 2 * QEMU M48T59 and M48T08 NVRAM emulation (common header) 32 * PPC platform there is also a nvram lock function. 54 /* NVRAM storage */ 58 /* NVRAM storage */ 63 uint32_t m48t59_read(M48t59State *NVRAM, uint32_t addr); 64 void m48t59_write(M48t59State *NVRAM, uint32_t addr, uint32_t val); 65 void m48t59_reset_common(M48t59State *NVRAM); 68 static inline void m48t59_toggle_lock(M48t59State *NVRAM, int lock) in m48t59_toggle_lock() argument 70 NVRAM->lock ^= 1 << lock; in m48t59_toggle_lock()
|
/openbmc/qemu/hw/nvram/ |
H A D | spapr_nvram.c | 2 * QEMU sPAPR NVRAM emulation 36 #include "hw/nvram/chrp_nvram.h" 51 #define TYPE_VIO_SPAPR_NVRAM "spapr-nvram" 63 SpaprNvram *nvram = spapr->nvram; in OBJECT_DECLARE_SIMPLE_TYPE() local 72 if (!nvram) { in OBJECT_DECLARE_SIMPLE_TYPE() 83 || ((offset + len) > nvram->size)) { in OBJECT_DECLARE_SIMPLE_TYPE() 89 assert(nvram->buf); in OBJECT_DECLARE_SIMPLE_TYPE() 92 memcpy(membuf, nvram->buf + offset, len); in OBJECT_DECLARE_SIMPLE_TYPE() 104 SpaprNvram *nvram = spapr->nvram; in rtas_nvram_store() local 114 if (!nvram) { in rtas_nvram_store() [all …]
|
H A D | mac_nvram.c | 2 * PowerMac NVRAM emulation 28 #include "hw/nvram/chrp_nvram.h" 29 #include "hw/nvram/mac_nvram.h" 42 /* macio style NVRAM device */ 53 error_report("%s: write of NVRAM data to backing store failed", in macio_nvram_writeb() 108 "could not get length of nvram backing image"); in macio_nvram_realizefn() 112 "invalid size nvram backing image"); in macio_nvram_realizefn() 120 error_setg(errp, "can't read-nvram contents"); in macio_nvram_realizefn() 126 "macio-nvram", s->size << s->it_shift); in macio_nvram_realizefn() 168 /* Set up a system OpenBIOS NVRAM partition */ [all …]
|
/openbmc/linux/drivers/scsi/sym53c8xx_2/ |
H A D | sym_nvram.c | 21 * NVRAM detection and reading. 35 * Get host setup from NVRAM. 37 void sym_nvram_setup_host(struct Scsi_Host *shost, struct sym_hcb *np, struct sym_nvram *nvram) in sym_nvram_setup_host() argument 41 * and miscellaneous host flags from NVRAM. in sym_nvram_setup_host() 43 switch (nvram->type) { in sym_nvram_setup_host() 45 if (!(nvram->data.Symbios.flags & SYMBIOS_PARITY_ENABLE)) in sym_nvram_setup_host() 47 np->myaddr = nvram->data.Symbios.host_id & 0x0f; in sym_nvram_setup_host() 48 if (nvram->data.Symbios.flags & SYMBIOS_VERBOSE_MSGS) in sym_nvram_setup_host() 50 if (nvram->data.Symbios.flags1 & SYMBIOS_SCAN_HI_LO) in sym_nvram_setup_host() 52 if (nvram->data.Symbios.flags2 & SYMBIOS_AVOID_BUS_RESET) in sym_nvram_setup_host() [all …]
|
/openbmc/qemu/hw/ppc/ |
H A D | prep.c | 75 /* NVRAM helpers */ 76 static inline uint32_t nvram_read(Nvram *nvram, uint32_t addr) in nvram_read() argument 78 NvramClass *k = NVRAM_GET_CLASS(nvram); in nvram_read() 79 return (k->read)(nvram, addr); in nvram_read() 82 static inline void nvram_write(Nvram *nvram, uint32_t addr, uint32_t val) in nvram_write() argument 84 NvramClass *k = NVRAM_GET_CLASS(nvram); in nvram_write() 85 (k->write)(nvram, addr, val); in nvram_write() 88 static void NVRAM_set_byte(Nvram *nvram, uint32_t addr, uint8_t value) in NVRAM_set_byte() argument 90 nvram_write(nvram, addr, value); in NVRAM_set_byte() 93 static uint8_t NVRAM_get_byte(Nvram *nvram, uint32_t addr) in NVRAM_get_byte() argument [all …]
|
/openbmc/linux/include/linux/ |
H A D | bcm963xx_nvram.h | 11 * Broadcom BCM963xx SoC board nvram data structure. 13 * The nvram structure varies in size depending on the SoC board version. Use 51 #define BCM963XX_NVRAM_NAND_PART_OFFSET(nvram, part) \ argument 52 bcm963xx_nvram_nand_part_offset(nvram, BCM963XX_NVRAM_NAND_PART_ ##part) 55 const struct bcm963xx_nvram *nvram, in bcm963xx_nvram_nand_part_offset() argument 58 return nvram->nand_part_offset[part] * SZ_1K; in bcm963xx_nvram_nand_part_offset() 61 #define BCM963XX_NVRAM_NAND_PART_SIZE(nvram, part) \ argument 62 bcm963xx_nvram_nand_part_size(nvram, BCM963XX_NVRAM_NAND_PART_ ##part) 65 const struct bcm963xx_nvram *nvram, in bcm963xx_nvram_nand_part_size() argument 68 return nvram->nand_part_size[part] * SZ_1K; in bcm963xx_nvram_nand_part_size() [all …]
|
H A D | nvram.h | 6 #include <uapi/linux/nvram.h> 13 * struct nvram_ops - NVRAM functionality made available to drivers 14 * @read: validate checksum (if any) then load a range of bytes from NVRAM 15 * @write: store a range of bytes to NVRAM then update checksum (if any) 16 * @read_byte: load a single byte from NVRAM 17 * @write_byte: store a single byte to NVRAM 18 * @get_size: return the fixed number of bytes in the NVRAM 20 * Architectures which provide an nvram ops struct need not implement all 21 * of these methods. If the NVRAM hardware can be accessed only one byte 23 * If the NVRAM has a checksum (and it is to be checked) the .read and
|
/openbmc/linux/drivers/char/ |
H A D | nvram.c | 12 * "NVRAM" (NV stands for non-volatile). 14 * The data are supplied as a (seekable) character device, /dev/nvram. The 19 * Checksums over the NVRAM contents are managed by this driver. In case of a 21 * to a sane state either by ioctl(NVRAM_INIT) (clear whole NVRAM) or 35 #include <linux/nvram.h> 53 #include <asm/nvram.h> 71 * purpose memory in the NVRAM - that is to say, they all add the 72 * NVRAM_FIRST_BYTE offset. Pass them offsets into NVRAM as if you did not 219 * The are the file operation function for user access to /dev/nvram 288 pr_warn("nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n"); in nvram_misc_ioctl() [all …]
|
/openbmc/linux/arch/m68k/atari/ |
H A D | nvram.c | 3 * CMOS/NV-RAM driver for Atari. Adapted from drivers/char/nvram.c. 15 #include <linux/nvram.h> 26 * purpose memory in the NVRAM - that is to say, they all add the 27 * NVRAM_FIRST_BYTE offset. Pass them offsets into NVRAM as if you did not 178 static void atari_nvram_proc_read(unsigned char *nvram, struct seq_file *seq, in atari_nvram_proc_read() argument 193 if (nvram[1] == boot_prefs[i].val) { in atari_nvram_proc_read() 198 seq_printf(seq, "0x%02x (undefined)\n", nvram[1]); in atari_nvram_proc_read() 201 (nvram[16] & 0x80) ? "on" : "off"); in atari_nvram_proc_read() 203 if (nvram[16] & 0x80) in atari_nvram_proc_read() 204 seq_printf(seq, "%d\n", nvram[16] & 7); in atari_nvram_proc_read() [all …]
|
/openbmc/linux/drivers/net/wireless/broadcom/brcm80211/brcmfmac/ |
H A D | firmware.c | 40 * @nvram: output buffer with parse result. 48 * @boardrev_found: nvram contains boardrev information. 54 u8 *nvram; member 67 * is_nvram_char() - check if char is a valid one for NVRAM entry 160 memcpy(&nvp->nvram[nvp->nvram_len], skv, cplen); in brcmf_nvram_handle_value() 162 nvp->nvram[nvp->nvram_len] = '\0'; in brcmf_nvram_handle_value() 223 nvp->nvram = kzalloc(size, GFP_KERNEL); in brcmf_init_nvram_parser() 224 if (!nvp->nvram) in brcmf_init_nvram_parser() 232 /* brcmf_fw_strip_multi_v1 :Some nvram files contain settings for multiple 234 * which data is to be returned. v1 is the version where nvram is stored [all …]
|
/openbmc/linux/drivers/firmware/broadcom/ |
H A D | bcm47xx_nvram.c | 3 * BCM947xx nvram variable access 38 * bcm47xx_nvram_is_valid - check for a valid NVRAM at specified memory 40 static bool bcm47xx_nvram_is_valid(void __iomem *nvram) in bcm47xx_nvram_is_valid() argument 42 return ((struct nvram_header *)nvram)->magic == NVRAM_MAGIC; in bcm47xx_nvram_is_valid() 46 * bcm47xx_nvram_copy - copy NVRAM to internal buffer 55 pr_err("The nvram size according to the header seems to be bigger than the partition on flash\n"); in bcm47xx_nvram_copy() 59 …pr_err("nvram on flash (%zu bytes) is bigger than the reserved space in memory, will just copy the… in bcm47xx_nvram_copy() 70 * bcm47xx_nvram_find_and_copy - find NVRAM on flash mapping & copy it 79 pr_warn("nvram already initialized\n"); in bcm47xx_nvram_find_and_copy() 83 /* TODO: when nvram is on nand flash check for bad blocks first. */ in bcm47xx_nvram_find_and_copy() [all …]
|
/openbmc/linux/arch/mips/bcm63xx/ |
H A D | nvram.c | 24 static struct bcm963xx_nvram nvram; variable 32 /* extract nvram data */ in bcm63xx_nvram_init() 33 memcpy(&nvram, addr, BCM963XX_NVRAM_V5_SIZE); in bcm63xx_nvram_init() 36 if (bcm963xx_nvram_checksum(&nvram, &expected_crc, &crc)) in bcm63xx_nvram_init() 37 pr_warn("nvram checksum failed, contents may be invalid (expected %08x, got %08x)\n", in bcm63xx_nvram_init() 40 /* Cable modems have a different NVRAM which is embedded in the eCos in bcm63xx_nvram_init() 45 memcpy(nvram.mac_addr_base, hcs_mac_addr, ETH_ALEN); in bcm63xx_nvram_init() 46 nvram.mac_addr_count = 2; in bcm63xx_nvram_init() 52 return nvram.name; in bcm63xx_nvram_get_name() 61 if (mac_addr_used >= nvram.mac_addr_count) { in bcm63xx_nvram_get_mac_address() [all …]
|
/openbmc/linux/drivers/mtd/parsers/ |
H A D | bcm63xxpart.c | 52 struct bcm963xx_nvram *nvram) in bcm63xx_read_nvram() argument 58 /* extract nvram data */ in bcm63xx_read_nvram() 60 &retlen, (void *)nvram); in bcm63xx_read_nvram() 64 ret = bcm963xx_nvram_checksum(nvram, &expected_crc, &actual_crc); in bcm63xx_read_nvram() 66 pr_warn("nvram checksum failed, contents may be invalid (expected %08x, got %08x)\n", in bcm63xx_read_nvram() 69 if (!nvram->psi_size) in bcm63xx_read_nvram() 70 nvram->psi_size = BCM963XX_DEFAULT_PSI_SIZE; in bcm63xx_read_nvram() 81 const struct mtd_partition **pparts, struct bcm963xx_nvram *nvram) in bcm63xx_parse_cfe_nor_partitions() argument 93 nvramlen = nvram->psi_size * SZ_1K; in bcm63xx_parse_cfe_nor_partitions() 106 parts[curpart].name = "nvram"; in bcm63xx_parse_cfe_nor_partitions() [all …]
|
/openbmc/qemu/include/hw/rtc/ |
H A D | m48t59.h | 2 * QEMU M48T59 and M48T08 NVRAM emulation 32 #define TYPE_NVRAM "nvram" 35 DECLARE_CLASS_CHECKERS(NvramClass, NVRAM, 37 #define NVRAM(obj) \ macro 38 INTERFACE_CHECK(Nvram, (obj), TYPE_NVRAM) 40 typedef struct Nvram Nvram; typedef 45 uint32_t (*read)(Nvram *obj, uint32_t addr); 46 void (*write)(Nvram *obj, uint32_t addr, uint32_t val); 47 void (*toggle_lock)(Nvram *obj, int lock);
|
/openbmc/linux/arch/mips/include/asm/mach-bcm63xx/ |
H A D | bcm63xx_nvram.h | 8 * bcm63xx_nvram_init() - initializes nvram 9 * @nvram: address of the nvram data 11 * Initialized the local nvram copy from the target address and checks 14 void bcm63xx_nvram_init(void *nvram); 17 * bcm63xx_nvram_get_name() - returns the board name according to nvram 19 * Returns the board name field from nvram. Note that it might not be 28 * Registers and returns a mac address from the allocated macs from nvram.
|
/openbmc/linux/Documentation/devicetree/bindings/nvmem/ |
H A D | brcm,nvram.yaml | 4 $id: http://devicetree.org/schemas/nvmem/brcm,nvram.yaml# 7 title: Broadcom's NVRAM 10 Broadcom's NVRAM is a structure containing device specific environment 14 NVRAM can be accessed on Broadcom BCM47xx MIPS and Northstar ARM Cortex-A9 17 NVRAM variables can be defined as NVMEM device subnodes. 27 const: brcm,nvram 67 nvram@1eff0000 { 68 compatible = "brcm,nvram";
|
/openbmc/linux/arch/powerpc/platforms/powermac/ |
H A D | nvram.c | 11 #include <linux/nvram.h> 24 #include <asm/nvram.h> 41 /* On Core99, nvram is either a sharp, a micron or an AMD flash */ 52 /* CHRP NVRAM header */ 287 DBG("nvram: Sharp/Micron Erasing bank %d...\n", bank); in sm_erase_bank() 294 printk(KERN_ERR "nvram: Sharp/Micron flash erase timeout !\n"); in sm_erase_bank() 305 printk(KERN_ERR "nvram: Sharp/Micron flash erase failed !\n"); in sm_erase_bank() 318 DBG("nvram: Sharp/Micron Writing bank %d...\n", bank); in sm_write_bank() 327 printk(KERN_ERR "nvram: Sharp/Micron flash write timeout !\n"); in sm_write_bank() 339 printk(KERN_ERR "nvram: Sharp/Micron flash write failed !\n"); in sm_write_bank() [all …]
|
/openbmc/linux/arch/powerpc/platforms/chrp/ |
H A D | nvram.c | 5 * /dev/nvram driver for PPC 69 struct device_node *nvram; in chrp_nvram_init() local 73 nvram = of_find_node_by_type(NULL, "nvram"); in chrp_nvram_init() 74 if (nvram == NULL) in chrp_nvram_init() 77 nbytes_p = of_get_property(nvram, "#bytes", &proplen); in chrp_nvram_init() 79 of_node_put(nvram); in chrp_nvram_init() 85 printk(KERN_INFO "CHRP nvram contains %u bytes\n", nvram_size); in chrp_nvram_init() 86 of_node_put(nvram); in chrp_nvram_init()
|
/openbmc/linux/arch/powerpc/platforms/pseries/ |
H A D | nvram.c | 5 * /dev/nvram driver for PPC64 17 #include <asm/nvram.h> 130 * We need to buffer the error logs into nvram to ensure that we have 150 * Reads nvram for error log for at most 'length' 203 /* Scan nvram for partitions */ in pseries_nvram_init_log_partitions() 214 struct device_node *nvram; in pSeries_nvram_init() local 218 nvram = of_find_node_by_type(NULL, "nvram"); in pSeries_nvram_init() 219 if (nvram == NULL) in pSeries_nvram_init() 222 nbytes_p = of_get_property(nvram, "#bytes", &proplen); in pSeries_nvram_init() 224 of_node_put(nvram); in pSeries_nvram_init() [all …]
|
/openbmc/pldm/oem/ibm/service_files/scripts/ |
H A D | create-NVRAM-cksum-file | 3 if [ -f /var/lib/pldm/PHYP-NVRAM-CKSUM ]; then 4 …mv /var/lib/pldm/PHYP-NVRAM-CKSUM /var/lib/phosphor-software-manager/hostfw/nvram/PHYP-NVRAM-CKSUM; 6 truncate -s 16 /var/lib/phosphor-software-manager/hostfw/nvram/PHYP-NVRAM-CKSUM
|
H A D | create-NVRAM-file | 3 if [ -f /var/lib/pldm/PHYP-NVRAM ]; then 4 mv /var/lib/pldm/PHYP-NVRAM /var/lib/phosphor-software-manager/hostfw/nvram/PHYP-NVRAM; 6 truncate -s $((1024 * 145408)) /var/lib/phosphor-software-manager/hostfw/nvram/PHYP-NVRAM
|
/openbmc/linux/arch/powerpc/sysdev/ |
H A D | mmio_nvram.c | 3 * memory mapped NVRAM 18 #include <asm/nvram.h> 104 nvram_node = of_find_node_by_type(NULL, "nvram"); in mmio_nvram_init() 106 nvram_node = of_find_compatible_node(NULL, NULL, "nvram"); in mmio_nvram_init() 108 printk(KERN_WARNING "nvram: no node found in device-tree\n"); in mmio_nvram_init() 114 printk(KERN_WARNING "nvram: failed to get address (err %d)\n", in mmio_nvram_init() 121 printk(KERN_WARNING "nvram: address or length is 0\n"); in mmio_nvram_init() 128 printk(KERN_WARNING "nvram: failed to ioremap\n"); in mmio_nvram_init() 133 printk(KERN_INFO "mmio NVRAM, %luk at 0x%lx mapped to %p\n", in mmio_nvram_init()
|
/openbmc/linux/arch/powerpc/include/asm/ |
H A D | nvram.h | 3 * NVRAM definitions and access functions. 11 #include <uapi/asm/nvram.h> 70 /* Return partition offset in nvram */ 77 /* Initialize NVRAM OS partition */ 80 /* Initialize NVRAM oops partition */ 83 /* Read a NVRAM partition */ 88 /* Write to NVRAM OS partition */
|