1 /* $NetBSD: cfi_0002.h,v 1.3 2024/02/09 22:08:35 andvar Exp $ */ 2 /*- 3 * Copyright (c) 2011 The NetBSD Foundation, Inc. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to The NetBSD Foundation 7 * by Cliff Neighbors. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 #ifndef _DEV_NOR_CFI_0002_H_ 32 #define _DEV_NOR_CFI_0002_H_ 33 34 /* 35 * CFI Primary Vendor-specific Extended Query structure 36 * AMD/Fujitsu Extended Command Set 0002 37 */ 38 struct cmdset_0002_query_data { 39 uint8_t pri[3]; /* { 'P', 'R', 'I' } */ 40 uint8_t version_maj; /* major version number (ASCII) */ 41 uint8_t version_min; /* minor version number (ASCII) */ 42 uint8_t asupt; /* Si rev., addr-sensitive unlock */ 43 uint8_t erase_susp; /* erase-suspend */ 44 uint8_t sector_prot; /* sector protect */ 45 uint8_t tmp_sector_unprot; /* temporary sector unprotect */ 46 uint8_t sector_prot_scheme; /* sector protect scheme */ 47 uint8_t simul_op; /* simultaneous operation */ 48 uint8_t burst_mode_type; /* burst mode type */ 49 uint8_t page_mode_type; /* page mode type */ 50 uint8_t acc_min; /* Acc supply min voltage */ 51 uint8_t acc_max; /* Acc supply max voltage */ 52 uint8_t wp_prot; /* WP# protection */ 53 uint8_t prog_susp; /* program suspend */ 54 uint8_t unlock_bypass; /* unlock bypass */ 55 uint8_t sss_size; /* secured silicon sector size (1<<N) */ 56 uint8_t soft_feat; /* software features */ 57 uint8_t page_size; /* page size (1<<N) */ 58 uint8_t erase_susp_time_max; /* erase susp. timeout max, 1<<N usec */ 59 uint8_t prog_susp_time_max; /* prog. susp. timeout max, 1<<N usec */ 60 uint8_t embhwrst_time_max; /* emb hw rst timeout max, 1<<N usec */ 61 uint8_t hwrst_time_max; /* !emb hw rst timeout max, 1<<N usec */ 62 }; 63 64 /* forward references for prototype(s) */ 65 struct nor_softc; 66 struct cfi; 67 struct nor_chip; 68 struct cfi_chip; 69 70 extern void cfi_0002_init(struct nor_softc * const, struct cfi * const, 71 struct nor_chip * const); 72 extern void cfi_0002_print(device_t, struct cfi * const); 73 74 #endif /* _DEV_NOR_CFI_0002_H_ */ 75