brintos

brintos / linux-shallow public Read only

0
0
Text · 3.8 KiB · 80f3c47 Raw
104 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Aic94xx SAS/SATA driver hardware interface header file.4 *5 * Copyright (C) 2005 Adaptec, Inc.  All rights reserved.6 * Copyright (C) 2005 Gilbert Wu <gilbert_wu@adaptec.com>7 */8#ifndef _AIC94XX_SDS_H_9#define _AIC94XX_SDS_H_10 11enum {12	FLASH_METHOD_UNKNOWN,13	FLASH_METHOD_A,14	FLASH_METHOD_B15};16 17#define FLASH_MANUF_ID_AMD              0x0118#define FLASH_MANUF_ID_ST               0x2019#define FLASH_MANUF_ID_FUJITSU          0x0420#define FLASH_MANUF_ID_MACRONIX         0xC221#define FLASH_MANUF_ID_INTEL            0x8922#define FLASH_MANUF_ID_UNKNOWN          0xFF23 24#define FLASH_DEV_ID_AM29LV008BT        0x3E25#define FLASH_DEV_ID_AM29LV800DT        0xDA26#define FLASH_DEV_ID_STM29W800DT        0xD727#define FLASH_DEV_ID_STM29LV640         0xDE28#define FLASH_DEV_ID_STM29008           0xEA29#define FLASH_DEV_ID_MBM29LV800TE       0xDA30#define FLASH_DEV_ID_MBM29DL800TA       0x4A31#define FLASH_DEV_ID_MBM29LV008TA       0x3E32#define FLASH_DEV_ID_AM29LV640MT        0x7E33#define FLASH_DEV_ID_AM29F800B          0xD634#define FLASH_DEV_ID_MX29LV800BT        0xDA35#define FLASH_DEV_ID_MX29LV008CT        0xDA36#define FLASH_DEV_ID_I28LV00TAT         0x3E37#define FLASH_DEV_ID_UNKNOWN            0xFF38 39/* status bit mask values */40#define FLASH_STATUS_BIT_MASK_DQ6       0x4041#define FLASH_STATUS_BIT_MASK_DQ5       0x2042#define FLASH_STATUS_BIT_MASK_DQ2       0x0443 44/* minimum value in micro seconds needed for checking status */45#define FLASH_STATUS_ERASE_DELAY_COUNT  5046#define FLASH_STATUS_WRITE_DELAY_COUNT  2547 48#define FLASH_SECTOR_SIZE               0x01000049#define FLASH_SECTOR_SIZE_MASK          0xffff000050 51#define FLASH_OK                        0x00000052#define FAIL_OPEN_BIOS_FILE             0x00010053#define FAIL_CHECK_PCI_ID               0x00020054#define FAIL_CHECK_SUM                  0x00030055#define FAIL_UNKNOWN                    0x00040056#define FAIL_VERIFY                     0x00050057#define FAIL_RESET_FLASH                0x00060058#define FAIL_FIND_FLASH_ID              0x00070059#define FAIL_ERASE_FLASH                0x00080060#define FAIL_WRITE_FLASH                0x00090061#define FAIL_FILE_SIZE                  0x000a0062#define FAIL_PARAMETERS                 0x000b0063#define FAIL_OUT_MEMORY                 0x000c0064#define FLASH_IN_PROGRESS               0x00100065 66struct controller_id {67	u32 vendor;     /* PCI Vendor ID */68	u32 device;     /* PCI Device ID */69	u32 sub_vendor; /* PCI Subvendor ID */70	u32 sub_device; /* PCI Subdevice ID */71};72 73struct image_info {74	u32 ImageId;       /* Identifies the image */75	u32 ImageOffset;   /* Offset the beginning of the file */76	u32 ImageLength;   /* length of the image */77	u32 ImageChecksum; /* Image checksum */78	u32 ImageVersion;  /* Version of the image, could be build number */79};80 81struct bios_file_header {82	u8 signature[32]; /* Signature/Cookie to identify the file */83	u32 checksum;	  /*Entire file checksum with this field zero */84	u32 antidote;	  /* Entire file checksum with this field 0xFFFFFFFF */85	struct controller_id contrl_id; /*PCI id to identify the controller */86	u32 filelen;      /*Length of the entire file*/87	u32 chunk_num;	  /*The chunk/part number for multiple Image files */88	u32 total_chunks; /*Total number of chunks/parts in the image file */89	u32 num_images;   /* Number of images in the file */90	u32 build_num;    /* Build number of this image */91	struct image_info image_header;92};93 94int asd_verify_flash_seg(struct asd_ha_struct *asd_ha,95		const void *src, u32 dest_offset, u32 bytes_to_verify);96int asd_write_flash_seg(struct asd_ha_struct *asd_ha,97		const void *src, u32 dest_offset, u32 bytes_to_write);98int asd_chk_write_status(struct asd_ha_struct *asd_ha,99		u32 sector_addr, u8 erase_flag);100int asd_check_flash_type(struct asd_ha_struct *asd_ha);101int asd_erase_nv_sector(struct asd_ha_struct *asd_ha,102		u32 flash_addr, u32 size);103#endif104