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