typedef struct
{
- unsigned int id; // Protocol identifier ("EDBG" on the wire)
- unsigned char service; // Service identifier
- unsigned char flags; // Flags (see defs below)
- unsigned char seqNum; // For detection of dropped packets
- unsigned char cmd; // For administrative messages
- unsigned char data[1]; // Cmd specific data starts here (format is determined by
- // Cmd, len is determined by UDP packet size)
+ unsigned int id; // Protocol identifier ("EDBG" on the wire)
+ unsigned char service; // Service identifier
+ unsigned char flags; // Flags (see defs below)
+ unsigned char seqNum; // For detection of dropped packets
+ unsigned char cmd; // For administrative messages
+ unsigned char data[1]; // Cmd specific data starts here (format is determined by
+ // Cmd, len is determined by UDP packet size)
} eth_dbg_hdr;
#define OFFSETOF(s,m) ((unsigned int)&(((s*)0)->m))
unsigned char versionMinor; // Bootloader version
unsigned short macAddr[3]; // Ether address of device (net byte order)
unsigned int ipAddr; // IP address of device (net byte order)
- char platformId[17]; // Platform Id string (NULL terminated)
- char deviceName[17]; // Device name string (NULL terminated). Should include
+ char platformId[17]; // Platform Id string (NULL terminated)
+ char deviceName[17]; // Device name string (NULL terminated). Should include
// platform and number based on Ether address (e.g. Odo42, CEPCLS2346, etc)
- unsigned char cpuId; // CPU identifier (upper nibble = type)
+ unsigned char cpuId; // CPU identifier (upper nibble = type)
// The following fields were added in CE 3.0 Platform Builder release
- unsigned char bootmeVer; // BOOTME Version.
+ unsigned char bootmeVer; // BOOTME Version.
// Must be in the range 2 -> EDBG_CURRENT_BOOTME_VERSION, or
// remaining fields will be ignored by Eshell and defaults will be used.
- unsigned int bootFlags; // Boot Flags
+ unsigned int bootFlags; // Boot Flags
unsigned short downloadPort; // Download Port (net byte order) (0 -> EDBG_DOWNLOAD_PORT)
- unsigned short svcPort; // Service Port (net byte order) (0 -> EDBG_SVC_PORT)
+ unsigned short svcPort; // Service Port (net byte order) (0 -> EDBG_SVC_PORT)
} edbg_bootme_data;
// Packet size
typedef struct
{
unsigned char sign[CE_BIN_SIGN_LEN];
- unsigned int rtiPhysAddr;
- unsigned int rtiPhysLen;
+ unsigned long rtiPhysAddr;
+ unsigned long rtiPhysLen;
} ce_bin_hdr;
typedef struct
{
- unsigned int physAddr;
- unsigned int physLen;
- unsigned int chkSum;
+ unsigned long physAddr;
+ unsigned long physLen;
+ unsigned long chkSum;
unsigned char data[1];
} ce_bin_entry;
// CE ROM image structures
#define ROM_SIGNATURE_OFFSET 0x40 // Offset from the image's physfirst address to the ROM signature.
-#define ROM_SIGNATURE 0x43454345 // Signature
+#define ROM_SIGNATURE 0x43454345 // Signature
#define ROM_TOC_POINTER_OFFSET 0x44 // Offset from the image's physfirst address to the TOC pointer.
#define ROM_TOC_OFFSET_OFFSET 0x48 // Offset from the image's physfirst address to the TOC offset (from physfirst).
typedef struct
{
- unsigned int dllfirst; // first DLL address
- unsigned int dlllast; // last DLL address
- unsigned int physfirst; // first physical address
- unsigned int physlast; // highest physical address
- unsigned int nummods; // number of TOCentry's
- unsigned int ramStart; // start of RAM
- unsigned int ramFree; // start of RAM free space
- unsigned int ramEnd; // end of RAM
+ unsigned int dllfirst; // first DLL address
+ unsigned int dlllast; // last DLL address
+ unsigned int physfirst; // first physical address
+ unsigned int physlast; // highest physical address
+ unsigned int nummods; // number of TOCentry's
+ unsigned int ramStart; // start of RAM
+ unsigned int ramFree; // start of RAM free space
+ unsigned int ramEnd; // end of RAM
unsigned int copyEntries; // number of copy section entries
- unsigned int copyOffset; // offset to copy section
- unsigned int profileLen; // length of PROFentries RAM
+ unsigned int copyOffset; // offset to copy section
+ unsigned int profileLen; // length of PROFentries RAM
unsigned int profileOffset; // offset to PROFentries
- unsigned int numfiles; // number of FILES
+ unsigned int numfiles; // number of FILES
unsigned int kernelFlags; // optional kernel flags from ROMFLAGS .bib config option
unsigned int fsRamPercent; // Percentage of RAM used for filesystem
// from FSRAMPERCENT .bib config option
// byte 2 = #4K chunks/Mbyte of RAM for filesystem 4-6Mbytes 0-255
// byte 3 = #4K chunks/Mbyte of RAM for filesystem > 6Mbytes 0-255
- unsigned int drivglobStart; // device driver global starting address
- unsigned int drivglobLen; // device driver global length
- unsigned short cpuType; // CPU (machine) Type
- unsigned short miscFlags; // Miscellaneous flags
- void* extensions; // pointer to ROM Header extensions
- unsigned int trackingStart; // tracking memory starting address
- unsigned int trackingLen; // tracking memory ending address
+ unsigned int drivglobStart; // device driver global starting address
+ unsigned int drivglobLen; // device driver global length
+ unsigned short cpuType; // CPU (machine) Type
+ unsigned short miscFlags; // Miscellaneous flags
+ void* extensions; // pointer to ROM Header extensions
+ unsigned int trackingStart; // tracking memory starting address
+ unsigned int trackingLen; // tracking memory ending address
} ce_rom_hdr;
// Win32 FILETIME strcuture
typedef struct
{
- unsigned int loDateTime;
- unsigned int hiDateTime;
+ unsigned int loDateTime;
+ unsigned int hiDateTime;
} ce_file_time;
// Table Of Contents entry structure
typedef struct
{
- unsigned int fileAttributes;
- ce_file_time fileTime;
- unsigned int fileSize;
- char* fileName;
- unsigned int e32Offset; // Offset to E32 structure
- unsigned int o32Offset; // Offset to O32 structure
- unsigned int loadOffset; // MODULE load buffer offset
+ unsigned int fileAttributes;
+ ce_file_time fileTime;
+ unsigned int fileSize;
+ char* fileName;
+ unsigned int e32Offset; // Offset to E32 structure
+ unsigned int o32Offset; // Offset to O32 structure
+ unsigned int loadOffset; // MODULE load buffer offset
} ce_toc_entry;
typedef struct
-{ /* Extra information header block */
- unsigned int rva; /* Virtual relative address of info */
- unsigned int size; /* Size of information block */
+{ /* Extra information header block */
+ unsigned int rva; /* Virtual relative address of info */
+ unsigned int size; /* Size of information block */
} e32_info;
#define ROM_EXTRA 9
typedef struct
{
- unsigned short e32_objcnt; /* Number of memory objects */
- unsigned short e32_imageflags; /* Image flags */
- unsigned int e32_entryrva; /* Relative virt. addr. of entry point */
- unsigned int e32_vbase; /* Virtual base address of module */
- unsigned short e32_subsysmajor;/* The subsystem major version number */
- unsigned short e32_subsysminor;/* The subsystem minor version number */
- unsigned int e32_stackmax; /* Maximum stack size */
- unsigned int e32_vsize; /* Virtual size of the entire image */
- unsigned int e32_sect14rva; /* section 14 rva */
- unsigned int e32_sect14size; /* section 14 size */
- unsigned int e32_timestamp; /* Time EXE/DLL was created/modified */
- e32_info e32_unit[ ROM_EXTRA ]; /* Array of extra info units */
- unsigned short e32_subsys; /* The subsystem type */
+ unsigned short e32_objcnt; /* Number of memory objects */
+ unsigned short e32_imageflags; /* Image flags */
+ unsigned int e32_entryrva; /* Relative virt. addr. of entry point */
+ unsigned int e32_vbase; /* Virtual base address of module */
+ unsigned short e32_subsysmajor;/* The subsystem major version number */
+ unsigned short e32_subsysminor;/* The subsystem minor version number */
+ unsigned int e32_stackmax; /* Maximum stack size */
+ unsigned int e32_vsize; /* Virtual size of the entire image */
+ unsigned int e32_sect14rva; /* section 14 rva */
+ unsigned int e32_sect14size; /* section 14 size */
+ unsigned int e32_timestamp; /* Time EXE/DLL was created/modified */
+ e32_info e32_unit[ ROM_EXTRA ]; /* Array of extra info units */
+ unsigned short e32_subsys; /* The subsystem type */
} e32_rom;
#pragma pack(1)
// OS config msg
-#define EDBG_FL_DBGMSG 0x01 // Debug messages
-#define EDBG_FL_PPSH 0x02 // Text shell
-#define EDBG_FL_KDBG 0x04 // Kernel debugger
-#define EDBG_FL_CLEANBOOT 0x08 // Force a clean boot
+#define EDBG_FL_DBGMSG 0x01 // Debug messages
+#define EDBG_FL_PPSH 0x02 // Text shell
+#define EDBG_FL_KDBG 0x04 // Kernel debugger
+#define EDBG_FL_CLEANBOOT 0x08 // Force a clean boot
typedef struct
{
- unsigned char flags; // Flags that will be used to determine what features are
- // enabled over ethernet (saved in driver globals by bootloader)
+ unsigned char flags; // Flags that will be used to determine what features are
+ // enabled over ethernet (saved in driver globals by bootloader)
unsigned char kitlTransport; // Tells KITL which transport to start
// The following specify addressing info, only valid if the corresponding
#pragma pack(4)
-typedef struct {
- unsigned long signature;
- unsigned short oalVersion;
- unsigned short bspVersion;
+typedef struct
+{
+ unsigned long signature;
+ unsigned short oalVersion;
+ unsigned short bspVersion;
} OAL_ARGS_HEADER;
typedef struct _DEVICE_LOCATION
// Byte string for Id field (note - must not conflict with valid TFTP
// opcodes (0-5), as we share the download port with TFTP)
-#define EDBG_ID 0x47424445 // "EDBG"
+#define EDBG_ID 0x47424445 // "EDBG"
// Defs for reserved values of the Service field
// Service Ids from 3-FE are used for user apps
-#define NUM_DFLT_EDBG_SERVICES 3
+#define NUM_DFLT_EDBG_SERVICES 3
// Size of send and receive windows (except for stop and wait mode)
// The window size can be negotiated up to this amount if a client provides
// enough memory.
-#define EDBG_MAX_WINDOW_SIZE 16
+#define EDBG_MAX_WINDOW_SIZE 16
// Max size for an EDBG frame. Based on ethernet MTU - protocol overhead.
// Limited to one MTU because we don't do IP fragmentation on device.
-#define EDBG_MAX_DATA_SIZE 1446
+#define EDBG_MAX_DATA_SIZE 1446
// Defs for Flags field.
-#define EDBG_FL_FROM_DEV 0x01 // Set if message is from the device
-#define EDBG_FL_NACK 0x02 // Set if frame is a nack
-#define EDBG_FL_ACK 0x04 // Set if frame is an ack
-#define EDBG_FL_SYNC 0x08 // Can be used to reset sequence # to 0
-#define EDBG_FL_ADMIN_RESP 0x10 // For admin messages, indicate whether this is a response
+#define EDBG_FL_FROM_DEV 0x01 // Set if message is from the device
+#define EDBG_FL_NACK 0x02 // Set if frame is a nack
+#define EDBG_FL_ACK 0x04 // Set if frame is an ack
+#define EDBG_FL_SYNC 0x08 // Can be used to reset sequence # to 0
+#define EDBG_FL_ADMIN_RESP 0x10 // For admin messages, indicate whether this is a response
// Definitions for Cmd field (used for administrative messages)
// Msgs from device
// Msgs from PC
#define EDBG_CMD_SETDEBUG 1 // Used to set debug zones on device (TBD)
#define EDBG_CMD_JUMPIMG 2 // Command to tell bootloader to jump to existing
- // flash or RAM image. Data is same as CMD_OS_CONFIG.
+ // flash or RAM image. Data is same as CMD_OS_CONFIG.
#define EDBG_CMD_OS_CONFIG 3 // Configure OS for debug ethernet services
#define EDBG_CMD_QUERYINFO 4 // "Ping" device, and return information (same fmt as bootme)
#define EDBG_CMD_RESET 5 // Command to have platform perform SW reset (e.g. so it
- // can be reprogrammed). Support for this command is
- // processor dependant, and may not be implemented
- // on all platforms (requires HW mods for Odo).
+ // can be reprogrammed). Support for this command is
+ // processor dependant, and may not be implemented
+ // on all platforms (requires HW mods for Odo).
// Msgs from device or PC
#define EDBG_CMD_SVC_CONFIG 6
#define EDBG_CMD_SVC_DATA 7
#define EDBG_CMD_DEBUGBREAK 8 // Break into debugger
// Structures for Data portion of EDBG packets
-#define EDBG_MAX_DEV_NAMELEN 16
+#define EDBG_MAX_DEV_NAMELEN 16
// BOOTME message - Devices broadcast this message when booted to request configuration
#define EDBG_CURRENT_BOOTME_VERSION 2
//
// Always download image
-#define EDBG_BOOTFLAG_FORCE_DOWNLOAD 0x00000001
+#define EDBG_BOOTFLAG_FORCE_DOWNLOAD 0x00000001
// Support passive-kitl
-#define EDBG_CAPS_PASSIVEKITL 0x00010000
+#define EDBG_CAPS_PASSIVEKITL 0x00010000
// Defs for CPUId
#define EDBG_CPU_TYPE_SHX 0x10