1 /* 2 * drivers/amlogic/media/common/firmware/firmware.h 3 * 4 * Copyright (C) 2016 Amlogic, Inc. All rights reserved. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 * more details. 15 * 16 */ 17 18 #ifndef __VIDEO_FIRMWARE_PRIV_HEAD_ 19 #define __VIDEO_FIRMWARE_PRIV_HEAD_ 20 #include <linux/types.h> 21 #include <linux/init.h> 22 #include <linux/module.h> 23 #include <linux/cdev.h> 24 #include "firmware_type.h" 25 26 struct fw_mgr_s { 27 struct list_head fw_head; 28 struct list_head files_head; 29 spinlock_t lock; 30 int cur_cpu; 31 }; 32 33 struct fw_files_s { 34 struct list_head node; 35 int fw_type; 36 int file_type; 37 char name[32]; 38 char path[64]; 39 }; 40 41 struct ucode_file_info_s { 42 int fw_type; 43 int file_type; 44 const char *name; 45 }; 46 47 struct fw_info_s { 48 struct list_head node; 49 char name[32]; 50 char src_from[32]; 51 int file_type; 52 unsigned int format; 53 struct firmware_s *data; 54 }; 55 56 struct fw_head_s { 57 int magic; 58 int checksum; 59 char name[32]; 60 char cpu[16]; 61 char format[32]; 62 char version[32]; 63 char maker[32]; 64 char date[32]; 65 char commit[16]; 66 int data_size; 67 unsigned int time; 68 char change_id[16]; 69 int duplicate; 70 char dup_from[16]; 71 char reserved[92]; 72 }; 73 74 struct firmware_s { 75 union { 76 struct fw_head_s head; 77 char buf[512]; 78 }; 79 char data[0]; 80 }; 81 82 struct package_head_s { 83 int magic; 84 int size; 85 int checksum; 86 int total; 87 int version; 88 char reserved[128]; 89 }; 90 91 struct package_s { 92 union { 93 struct package_head_s head; 94 char buf[256]; 95 }; 96 char data[0]; 97 }; 98 99 struct info_head_s { 100 char name[32]; 101 char format[32]; 102 char cpu[32]; 103 int length; 104 }; 105 106 struct package_info_s { 107 union { 108 struct info_head_s head; 109 char buf[256]; 110 }; 111 char data[0]; 112 }; 113 114 struct fw_dev_s { 115 struct cdev cdev; 116 struct device *dev; 117 dev_t dev_no; 118 }; 119 120 #endif 121