2 * Copyright (C) 2006,2007 Gabor Juhos
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
15 * Firmware file format:
18 * [<block descriptor 0>]
20 * [<block descriptor n>]
21 * <null block descriptor>
29 #define MYLO_MAGIC_FIRMWARE 0x4C594D00
30 #define MYLO_MAGIC_20021103 0x20021103
31 #define MYLO_MAGIC_20021107 0x20021107
33 #define MYLO_MAGIC_SYSSETUP MYLO_MAGIC_20021107
34 #define MYLO_MAGIC_PARTITIONS MYLO_MAGIC_20021103
36 /* Vendor ID's (seems to be same as the PCI vendor ID's) */
37 #define VENID_COMPEX 0x11F6
39 /* Devices based on the ADM5120 */
40 #define DEVID_COMPEX_NP27G 0x0078
41 #define DEVID_COMPEX_NP28G 0x044C
42 #define DEVID_COMPEX_NP28GHS 0x044E
43 #define DEVID_COMPEX_WP54Gv1C 0x0514
44 #define DEVID_COMPEX_WP54G 0x0515
45 #define DEVID_COMPEX_WP54AG 0x0546
46 #define DEVID_COMPEX_WPP54AG 0x0550
47 #define DEVID_COMPEX_WPP54G 0x0555
49 /* Devices based on the IXP422 */
50 #define DEVID_COMPEX_WP18 0x047E
51 #define DEVID_COMPEX_NP18A 0x0489
54 #define DEVID_COMPEX_NP26G8M 0x03E8
55 #define DEVID_COMPEX_NP26G16M 0x03E9
57 struct mylo_fw_header
{
58 uint32_t magic
; /* must be MYLO_MAGIC_MYLO */
59 uint32_t crc
; /* CRC of the whole firmware */
60 uint32_t res0
; /* unknown/unused */
61 uint32_t res1
; /* unknown/unused */
62 uint16_t vid
; /* vendor ID */
63 uint16_t did
; /* device ID */
64 uint16_t svid
; /* sub vendor ID */
65 uint16_t sdid
; /* sub device ID */
66 uint32_t rev
; /* device revision */
67 uint32_t fwhi
; /* FIXME: firmware version high? */
68 uint32_t fwlo
; /* FIXME: firmware version low? */
69 uint32_t flags
; /* firmware flags */
72 #define FW_FLAG_BOARD_PARAMS_WP 0x01 /* board parameters are write protected */
73 #define FW_FLAG_BOOT_SECTOR_WE 0x02 /* enable of write boot sectors (below 64K) */
75 struct mylo_fw_blockdesc
{
76 uint32_t type
; /* block type */
77 uint32_t addr
; /* relative address to flash start */
78 uint32_t dlen
; /* size of block data in bytes */
79 uint32_t blen
; /* total size of block in bytes */
82 #define FW_DESC_TYPE_UNUSED 0
83 #define FW_DESC_TYPE_USED 1
85 struct mylo_partition
{
86 uint16_t flags
; /* partition flags */
87 uint16_t type
; /* type of the partition */
88 uint32_t addr
; /* relative address of the partition from the
90 uint32_t size
; /* size of the partition in bytes */
91 uint32_t param
; /* if this is the active partition, the
92 MyLoader load code to this address */
95 #define PARTITION_FLAG_ACTIVE 0x8000 /* this is the active partition,
96 * MyLoader loads firmware from here */
97 #define PARTITION_FLAG_ISRAM 0x2000 /* FIXME: this is a RAM partition? */
98 #define PARTIIION_FLAG_RAMLOAD 0x1000 /* FIXME: load this partition into the RAM? */
99 #define PARTITION_FLAG_PRELOAD 0x0800 /* the partition data preloaded to RAM
100 * before decompression */
101 #define PARTITION_FLAG_HAVEHDR 0x0002 /* the partition data have a header */
103 #define PARTITION_TYPE_FREE 0
104 #define PARTITION_TYPE_USED 1
106 #define MYLO_MAX_PARTITIONS 8 /* maximum number of partitions in the
109 struct mylo_partition_table
{
110 uint32_t magic
; /* must be 0x20021103 */
111 uint32_t res0
; /* unknown/unused */
112 uint32_t res1
; /* unknown/unused */
113 uint32_t res2
; /* unknown/unused */
114 struct mylo_partition partitions
[MYLO_MAX_PARTITIONS
];
117 struct mylo_partition_header
{
118 uint32_t len
; /* length of the partition data */
119 uint32_t crc
; /* CRC value of the partition data */
122 struct mylo_system_params
{
127 uint16_t vid
; /* Vendor ID */
128 uint16_t did
; /* Device ID */
129 uint16_t svid
; /* Sub Vendor ID */
130 uint16_t sdid
; /* Sub Device ID */
131 uint32_t rev
; /* device revision */
141 struct mylo_eth_addr
{
146 #define MYLO_ETHADDR_COUNT 8 /* maximum number of ethernet address
147 in the board parameters */
149 struct mylo_board_params
{
154 struct mylo_eth_addr addr
[MYLO_ETHADDR_COUNT
];
157 #endif /* _MYLOADER_H_*/