github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/pkg/flash/op/op.go (about) 1 // Copyright 2021 the u-root Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Package op contains available SPI opcodes. The opcode is typically sent at 6 // the beginning of a SPI transaction. 7 package op 8 9 const ( 10 // PageProgram programs a page on the flash chip. 11 PageProgram byte = 0x02 12 // Read reads from the flash chip. 13 Read byte = 0x03 14 // WriteDisable disables writing. 15 WriteDisable byte = 0x04 16 // ReadStatus reads the status register. 17 ReadStatus byte = 0x05 18 // WriteEnable enables writing. 19 WriteEnable byte = 0x06 20 // SectorErase erases a sector to the value 0xff. 21 SectorErase byte = 0x20 22 // ReadSFDP reads from the SFDP. 23 ReadSFDP byte = 0x5a 24 // ReadID reads the JEDEC ID. 25 ReadJEDECID byte = 0x9f 26 // Enter4BA enters 4-byte addressing mode. 27 Enter4BA byte = 0xb7 28 // BlockErase erases a block to the value 0xff. 29 BlockErase byte = 0xd8 30 // Exit4BA exits 4-byte addressing mode. 31 Exit4BA byte = 0xe9 32 )