![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <commonlib/helpers.h>
#include <spi_flash.h>
#include <spi-generic.h>
#include <delay.h>
#include <lib.h>
#include "spi_flash_internal.h"
#include "spi_winbond.h"
Go to the source code of this file.
Data Structures | |
union | status_reg1 |
union | status_reg2 |
struct | status_regs |
Functions | |
static void | winbond_bpbits_to_region (const size_t granularity, const u8 bp, bool tb, const bool cmp, const size_t flash_size, struct region *out) |
static int | winbond_get_write_protection (const struct spi_flash *flash, const struct region *region) |
static int | winbond_flash_cmd_status (const struct spi_flash *flash, const u16 mask, const u16 val, const bool non_volatile) |
Common method to write some bit of the status register 1 & 2 at the same time. More... | |
static int | winbond_set_write_protection (const struct spi_flash *flash, const struct region *region, const enum spi_flash_status_reg_lockdown mode) |
Variables | |
static const struct spi_flash_part_id | flash_table [] |
static const struct spi_flash_protection_ops | spi_flash_protection_ops |
const struct spi_flash_vendor_info | spi_flash_winbond_vi |
|
static |
Definition at line 238 of file winbond.c.
References MIN, region::offset, and region::size.
Referenced by winbond_get_write_protection().
|
static |
Common method to write some bit of the status register 1 & 2 at the same time.
Only change bits that are one in @mask. Compare the final result to make sure that the register isn't locked.
mask | The bits that are affected by @val |
val | The bits to write |
non_volatile | Make setting permanent |
Definition at line 337 of file winbond.c.
References BIOS_DEBUG, BIOS_ERR, CMD_VOLATILE_SREG_WREN, CMD_W25_RDSR, CMD_W25_RDSR2, CMD_W25_WREN, CMD_W25_WRSR, mask, NULL, printk, spi_flash::spi, spi_flash_cmd(), spi_flash_cmd_wait_ready(), spi_flash_cmd_write(), udelay(), val, and WINBOND_FLASH_TIMEOUT.
|
static |
Definition at line 267 of file winbond.c.
References BIOS_DEBUG, status_reg1::bp, status_reg1::bp3, status_reg1::bp4, CMD_W25_RDSR2, status_reg2::cmp, params, spi_flash::part, printk, region_end(), region_is_subregion(), region_offset(), region_sz(), status_reg1::sec, spi_flash::size, spi_flash::spi, spi_flash_cmd(), spi_flash::status_cmd, status_reg1::tb, status_reg1::u, status_reg2::u, and winbond_bpbits_to_region().
|
static |
|
static |
|
static |
const struct spi_flash_vendor_info spi_flash_winbond_vi |