1*5eb24fbdSCédric Le Goater /* 2*5eb24fbdSCédric Le Goater * M25P80 Serial Flash Discoverable Parameter (SFDP) 3*5eb24fbdSCédric Le Goater * 4*5eb24fbdSCédric Le Goater * Copyright (c) 2020, IBM Corporation. 5*5eb24fbdSCédric Le Goater * 6*5eb24fbdSCédric Le Goater * This code is licensed under the GPL version 2 or later. See the 7*5eb24fbdSCédric Le Goater * COPYING file in the top-level directory. 8*5eb24fbdSCédric Le Goater */ 9*5eb24fbdSCédric Le Goater 10*5eb24fbdSCédric Le Goater #include "qemu/osdep.h" 11*5eb24fbdSCédric Le Goater #include "qemu/host-utils.h" 12*5eb24fbdSCédric Le Goater #include "m25p80_sfdp.h" 13*5eb24fbdSCédric Le Goater 14*5eb24fbdSCédric Le Goater #define define_sfdp_read(model) \ 15*5eb24fbdSCédric Le Goater uint8_t m25p80_sfdp_##model(uint32_t addr) \ 16*5eb24fbdSCédric Le Goater { \ 17*5eb24fbdSCédric Le Goater assert(is_power_of_2(sizeof(sfdp_##model))); \ 18*5eb24fbdSCédric Le Goater return sfdp_##model[addr & (sizeof(sfdp_##model) - 1)]; \ 19*5eb24fbdSCédric Le Goater } 20*5eb24fbdSCédric Le Goater 21*5eb24fbdSCédric Le Goater /* 22*5eb24fbdSCédric Le Goater * Micron 23*5eb24fbdSCédric Le Goater */ 24*5eb24fbdSCédric Le Goater static const uint8_t sfdp_n25q256a[] = { 25*5eb24fbdSCédric Le Goater 0x53, 0x46, 0x44, 0x50, 0x00, 0x01, 0x00, 0xff, 26*5eb24fbdSCédric Le Goater 0x00, 0x00, 0x01, 0x09, 0x30, 0x00, 0x00, 0xff, 27*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 28*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 29*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 30*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 31*5eb24fbdSCédric Le Goater 0xe5, 0x20, 0xfb, 0xff, 0xff, 0xff, 0xff, 0x0f, 32*5eb24fbdSCédric Le Goater 0x29, 0xeb, 0x27, 0x6b, 0x08, 0x3b, 0x27, 0xbb, 33*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x27, 0xbb, 34*5eb24fbdSCédric Le Goater 0xff, 0xff, 0x29, 0xeb, 0x0c, 0x20, 0x10, 0xd8, 35*5eb24fbdSCédric Le Goater 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 36*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 37*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 38*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 39*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 40*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 41*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 42*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 43*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 44*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 45*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 46*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 47*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 48*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 49*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 50*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 51*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 52*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 53*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 54*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 55*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 56*5eb24fbdSCédric Le Goater 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 57*5eb24fbdSCédric Le Goater }; 58*5eb24fbdSCédric Le Goater define_sfdp_read(n25q256a); 59