/* * Copyright 2010, Cypress Semiconductor Corporation. * Copyright (C) 2010-2011, Samsung Electronics Co. Ltd. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301, USA. * */ #include #ifndef _CYPRESS_TOUCHKEY_FIRMWARE_H__ #define _CYPRESS_TOUCHKEY_FIRMWARE_H__ struct issp_vector { u16 num_bits; u8 data[]; }; static const struct issp_vector tsync_enable = { .data = { 0xDE, 0xE2, 0x1F, 0x7F, 0x02, 0x7D, 0xC4, 0x09, 0xF7, 0x00, 0x1F, 0xDE, 0xE0, 0x1C }, .num_bits = 110, }; static const struct issp_vector tsync_disable = { .data = { 0xDE, 0xE2, 0x1F, 0x71, 0x00, 0x7D, 0xFC, 0x01, 0xF7, 0x00, 0x1F, 0xDE, 0xE0, 0x1C }, .num_bits = 110, }; static const struct issp_vector id_setup_1 = { .data = { 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xEE, 0x21, 0xF7, 0xF0, 0x27, 0xDC, 0x40, 0x9F, 0x70, 0x01, 0xFD, 0xEE, 0x01, 0xE7, 0xC1, 0xD7, 0x9F, 0x20, 0x7E, 0x7D, 0x88, 0x7D, 0xEE, 0x21, 0xF7, 0xF0, 0x07, 0xDC, 0x40, 0x1F, 0x70, 0x01, 0xFD, 0xEE, 0x01, 0xF7, 0xA0, 0x1F, 0xDE, 0xA0, 0x1F, 0x7B, 0x00, 0x7D, 0xE0, 0x13, 0xF7, 0xC0, 0x07, 0xDF, 0x28, 0x1F, 0x7D, 0x18, 0x7D, 0xFE, 0x25, 0xC0 }, .num_bits = 594, }; static const struct issp_vector set_block_num = { .data = { 0x9f, 0x40, 0x1c }, .num_bits = 11, }; static const struct issp_vector read_write_setup = { .data = { 0xde, 0xf0, 0x1f, 0x78, 0x00, 0x7d, 0xa0, 0x03, 0xc0 }, .num_bits = 66, }; static const struct issp_vector erase = { .data = { 0xde, 0xe2, 0x1f, 0x7f, 0x02, 0x7d, 0xc4, 0x09, 0xf7, 0x00, 0x1f, 0x9f, 0x07, 0x5e, 0x7c, 0x85, 0xfd, 0xfc, 0x01, 0xf7, 0x10, 0x07, 0xdc, 0x00, 0x7f, 0x7b, 0x80, 0x7d, 0xe0, 0x0b, 0xf7, 0xa0, 0x1f, 0xd7, 0xa0, 0x1f, 0x7b, 0x04, 0x7d, 0xf0, 0x01, 0xf7, 0xc9, 0x87, 0xdf, 0x48, 0x1f, 0x7f, 0x89, 0x70 }, .num_bits = 396, }; static const struct issp_vector secure = { .data = { 0xde, 0xe2, 0x1f, 0x7f, 0x02, 0x7d, 0xc4, 0x09, 0xf7, 0x00, 0x1f, 0x9f, 0x07, 0x5e, 0x7c, 0x81, 0xf9, 0xf7, 0x01, 0xf7, 0xf0, 0x07, 0xdc, 0x40, 0x1f, 0x70, 0x01, 0xfd, 0xee, 0x01, 0xf6, 0xa0, 0x0f, 0xde, 0x80, 0x7f, 0x7a, 0x80, 0x7d, 0xec, 0x01, 0xf7, 0x80, 0x27, 0xdf, 0x00, 0x1f, 0x7c, 0xa0, 0x7d, 0xf4, 0x61, 0xf7, 0xf8, 0x97 }, .num_bits = 440, }; static const struct issp_vector read_security_setup = { .data = { 0xde, 0xe2, 0x1f, 0x60, 0x88, 0x7d, 0x84, 0x21, 0xf7, 0xb8, 0x07 }, .num_bits = 88, }; static const struct issp_vector read_security_pt1 = { .data = { 0xde, 0xe2, 0x1f, 0x72, 0x87, 0x7d, 0xca, 0x01, 0xf7, 0x28 }, .num_bits = 78, }; static const struct issp_vector read_security_pt1_end = { .data = { 0xfb, 0x94, 0x03, 0x80 }, .num_bits = 25, }; static const struct issp_vector read_security_pt2 = { .data = { 0xde, 0xe0, 0x1f, 0x7a, 0x01, 0xfd, 0xea, 0x01, 0xf7, 0xb0, 0x07, 0xdf, 0x0b, 0xbf, 0x7c, 0xf2, 0xfd, 0xf4, 0x61, 0xf7, 0xb8, 0x87, 0xdf, 0xe2, 0x5c }, .num_bits = 198, }; static const struct issp_vector read_security_pt3 = { .data = { 0xde, 0xe0, 0x1f, 0x7a, 0x01, 0xfd, 0xea, 0x01, 0xf7, 0xb0, 0x07, 0xdf, 0x0a, 0x7f, 0x7c, 0xc0 }, .num_bits = 122, }; static const struct issp_vector read_security_pt3_end = { .data = { 0xfb, 0xe8, 0xc3, 0xef, 0xf1, 0x2e }, .num_bits = 47, }; static const struct issp_vector checksum_setup = { .data = { 0xde, 0xe2, 0x1f, 0x7f, 0x02, 0x7d, 0xc4, 0x09, 0xf7, 0x00, 0x1f, 0x9f, 0x07, 0x5e, 0x7c, 0x81, 0xf9, 0xf4, 0x01, 0xf7, 0xf0, 0x07, 0xdc, 0x40, 0x1f, 0x70, 0x01, 0xfd, 0xee, 0x01, 0xf7, 0xa0, 0x1f, 0xde, 0xa0, 0x1f, 0x7b, 0x00, 0x7d, 0xe0, 0x0f, 0xf7, 0xc0, 0x07, 0xdf, 0x28, 0x1f, 0x7d, 0x18, 0x7d, 0xfe, 0x25, 0xc0 }, .num_bits = 418, }; static const struct issp_vector program_and_verify = { .data = { 0xde, 0xe2, 0x1f, 0x7f, 0x02, 0x7d, 0xc4, 0x09, 0xf7, 0x00, 0x1f, 0x9f, 0x07, 0x5e, 0x7c, 0x81, 0xf9, 0xf7, 0x01, 0xf7, 0xf0, 0x07, 0xdc, 0x40, 0x1f, 0x70, 0x01, 0xfd, 0xee, 0x01, 0xf6, 0xa0, 0x0f, 0xde, 0x80, 0x7f, 0x7a, 0x80, 0x7d, 0xec, 0x01, 0xf7, 0x80, 0x57, 0xdf, 0x00, 0x1f, 0x7c, 0xa0, 0x7d, 0xf4, 0x61, 0xf7, 0xf8, 0x97 }, .num_bits = 440, }; static const struct issp_vector read_id_v1 = { .data = { 0xBF, 0x00 }, .num_bits = 11, }; static const struct issp_vector wait_and_poll_end = { .data = { 0x00, 0x00, 0x00, 0x00 }, .num_bits = 30, }; static const struct issp_vector read_checksum_v1 = { .data = { 0xBF, 0x20 }, .num_bits = 11, }; static const struct issp_vector read_checksum_v2 = { .data = { 0xDF, 0x80 }, .num_bits = 12, }; #define BLOCK_SIZE 128 #define BLOCKS_PER_BANK 64 #define SECURITY_BYTES_PER_BANK 64 #define TRANSITION_TIMEOUT 0x100000 #endif /* _CYPRESS_TOUCHKEY_FIRMWARE_H__ */