uuu
uuu (Universal Update Utility), mfgtools 3.0
 
Loading...
Searching...
No Matches
rominfo.h
Go to the documentation of this file.
1/*
2* Copyright 2018 NXP.
3*
4* Redistribution and use in source and binary forms, with or without modification,
5* are permitted provided that the following conditions are met:
6*
7* Redistributions of source code must retain the above copyright notice, this
8* list of conditions and the following disclaimer.
9*
10* Redistributions in binary form must reproduce the above copyright notice, this
11* list of conditions and the following disclaimer in the documentation and/or
12* other materials provided with the distribution.
13*
14* Neither the name of the NXP Semiconductor nor the names of its
15* contributors may be used to endorse or promote products derived from this
16* software without specific prior written permission.
17*
18* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28* POSSIBILITY OF SUCH DAMAGE.
29*
30*/
31
32#pragma once
33
34#include <cstdint>
35#include <memory>
36#include <string>
37
38class ConfigItem;
39class FileBuffer;
40class DataBuffer;
41
42constexpr uint32_t ROM_INFO_HID = 0x1;
43constexpr uint32_t ROM_INFO_HID_MX23 = 0x2;
44constexpr uint32_t ROM_INFO_HID_MX50 = 0x4;
45constexpr uint32_t ROM_INFO_HID_MX6 = 0x8;
46constexpr uint32_t ROM_INFO_HID_SKIP_DCD = 0x10;
47constexpr uint32_t ROM_INFO_HID_MX8_MULTI_IMAGE = 0x20;
48constexpr uint32_t ROM_INFO_HID_MX8_STREAM = 0x40;
49constexpr uint32_t ROM_INFO_HID_UID_STRING = 0x80;
50// Omitted value: 0x100
51// Omitted value: 0x200
52constexpr uint32_t ROM_INFO_HID_NO_CMD = 0x400;
53constexpr uint32_t ROM_INFO_SPL_JUMP = 0x800;
54constexpr uint32_t ROM_INFO_HID_EP1 = 0x1000;
55constexpr uint32_t ROM_INFO_HID_PACK_SIZE_1020 = 0x2000;
56constexpr uint32_t ROM_INFO_HID_SDP_NO_MAX_PER_TRANS = 0x4000;
57constexpr uint32_t ROM_INFO_AUTO_SCAN_UBOOT_POS = 0x8000;
58constexpr uint32_t ROM_INFO_HID_ROMAPI = 0x10000;
59constexpr uint32_t ROM_INFO_NEED_BAREBOX_FULL_IMAGE = 0x20000;
60
62{
63 const char * m_name;
64 uint32_t free_addr;
65 uint32_t flags;
67};
68
69const ROM_INFO * search_rom_info(const std::string &s);
70const ROM_INFO * search_rom_info(const ConfigItem *item);
71
72size_t GetContainerActualSize(std::shared_ptr<DataBuffer> p, size_t offset, bool bROMAPI=false, bool skipspl=false);
73size_t GetFlashHeaderSize(std::shared_ptr<DataBuffer> p, size_t offset = 0);
74
Definition config.h:39
Definition buffer.h:111
Definition buffer.h:164
constexpr uint32_t ROM_INFO_AUTO_SCAN_UBOOT_POS
Definition rominfo.h:57
constexpr uint32_t ROM_INFO_HID_PACK_SIZE_1020
Definition rominfo.h:55
constexpr uint32_t ROM_INFO_HID_SKIP_DCD
Definition rominfo.h:46
constexpr uint32_t ROM_INFO_HID_MX23
Definition rominfo.h:43
constexpr uint32_t ROM_INFO_HID_ROMAPI
Definition rominfo.h:58
constexpr uint32_t ROM_INFO_HID_SDP_NO_MAX_PER_TRANS
Definition rominfo.h:56
size_t GetFlashHeaderSize(std::shared_ptr< DataBuffer > p, size_t offset=0)
size_t GetContainerActualSize(std::shared_ptr< DataBuffer > p, size_t offset, bool bROMAPI=false, bool skipspl=false)
constexpr uint32_t ROM_INFO_HID_MX8_MULTI_IMAGE
Definition rominfo.h:47
constexpr uint32_t ROM_INFO_HID
Definition rominfo.h:42
constexpr uint32_t ROM_INFO_NEED_BAREBOX_FULL_IMAGE
Definition rominfo.h:59
constexpr uint32_t ROM_INFO_HID_NO_CMD
Definition rominfo.h:52
constexpr uint32_t ROM_INFO_SPL_JUMP
Definition rominfo.h:53
constexpr uint32_t ROM_INFO_HID_MX8_STREAM
Definition rominfo.h:48
constexpr uint32_t ROM_INFO_HID_MX50
Definition rominfo.h:44
constexpr uint32_t ROM_INFO_HID_MX6
Definition rominfo.h:45
const ROM_INFO * search_rom_info(const std::string &s)
Definition rominfo.cpp:62
constexpr uint32_t ROM_INFO_HID_EP1
Definition rominfo.h:54
constexpr uint32_t ROM_INFO_HID_UID_STRING
Definition rominfo.h:49
Definition rominfo.h:62
uint32_t flags
Definition rominfo.h:65
const char * m_name
Definition rominfo.h:63
int serial_idx
Definition rominfo.h:66
uint32_t free_addr
Definition rominfo.h:64