[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] New cookie for ColdFire MCUs
New changes in the new cookie proposal.
- Information about the units present in the ColdFire
is shown as a bit mask instead of a char for each unit.
- 3 bytes magic number 0x4d4346 (MCF) is placed as
the first member of the struct to identity it.
/*
* Structure pointed by the '_MCF' cookie's value
* Values defined below taken from ColdFire Family Programmer's Reference
* Manual (CFPRM). Section 1.10 Hardware Configuration Information
*/
/* ColdFire core version */
#define MCF_V1 1
#define MCF_V2 2
#define MCF_V3 3
#define MCF_V4 4
#define MCF_V5 5
/* Instruction-Set Architecture (ISA) revision level */
#define MCF_ISA_A 0
#define MCF_ISA_B 1
#define MCF_ISA_C 2
#define MCF_ISA_A_PLUS 8
/* Debug module revision number */
#define MCF_DEBUG_A 0
#define MCF_DEBUG_B 1
#define MCF_DEBUG_C 2
#define MCF_DEBUG_D 3
#define MCF_DEBUG_E 4
#define MCF_DEBUG_B_PLUS 9
#define MCF_DEBUG_D_PLUS 11
#define MCF_DEBUG_D_PLUS_PST 15
/* Bit mask for units, set when present */
#define MCF_UNITS_MAC 1
#define MCF_UNITS_DIV 2
#define MCF_UNITS_EMAC 4
#define MCF_UNITS_FPU 8
#define MCF_UNITS_MMU 16
#define MCF_VALUE_UNKNOWN -1
typedef struct {
BYTE magic[3]; /* Magic number 0x4d4346 (MCF), identifies this struct */
#define COOKIE_MCF_VERSION 1
UBYTE version; /* This struct version */
BYTE device_name[16]; /* Part number or chip name */
BYTE core; /* ColdFire core version number */
BYTE revision; /* Processor revision number */
ULONG units; /* Bit mask. b0: MAC, b1: DIV, b2: EMAC, b3: FPU, b4: MMU */
BYTE isa; /* Instruction-Set Architecture (ISA) revision level */
BYTE debug; /* Debug module revision */
WORD sysbus_frequency; /* System bus frequency in Mhz */
} MCF_COOKIE;
2016-01-17 17:57 GMT+01:00 David Gálvez <dgalvez75@gmail.com>:
> For people not following EmuTOS mailing:
>
> It has been discussed the creation of a new cookie ("_MCF") for
> obtaining information about the ColdFire's MCU capabilities. The value
> of this cookie is a pointer to the structure below.
>
> Please don't hesitate to give your opinion if you see something that
> you don't like or if you'd like to add anything.
>
>
> /*
> * Values defined below taken from ColdFire Family Programmer's Reference
> * Manual (CFPRM). Section 1.10 Hardware Configuration Information
> */
>
> /* ColdFire core version */
> #define MCF_V1 1
> #define MCF_V2 2
> #define MCF_V3 3
> #define MCF_V4 4
> #define MCF_V5 5
>
> /* Instruction-Set Architecture (ISA) revision level */
> #define MCF_ISA_A 0
> #define MCF_ISA_B 1
> #define MCF_ISA_C 2
> #define MCF_ISA_A_PLUS 8
>
> /* Debug module revision number */
> #define MCF_DEBUG_A 0
> #define MCF_DEBUG_B 1
> #define MCF_DEBUG_C 2
> #define MCF_DEBUG_D 3
> #define MCF_DEBUG_E 4
> #define MCF_DEBUG_B_PLUS 9
> #define MCF_DEBUG_D_PLUS 11
> #define MCF_DEBUG_D_PLUS_PST 15
>
> #define MCF_VALUE_UNKNOWN -1
>
> typedef struct {
> #define COOKIE_MCF_VERSION 1
> UBYTE version; /* This struct version */
> BYTE device_name[16]; /* Part number or chip name */
> BYTE core; /* ColdFire core version number */
> BYTE revision; /* Processor revision number */
> BYTE mac; /* MAC present? (TRUE / FALSE) */
> BYTE div; /* Divider present? (TRUE / FALSE) */
> BYTE emac; /* EMAC present? (TRUE / FALSE) */
> BYTE fpu; /* FPU present? (TRUE / FALSE) */
> BYTE mmu; /* MMU present? (TRUE / FALSE) */
> BYTE isa; /* Instruction-Set Architecture (ISA)
> revision level */
> BYTE debug; /* Debug module revision */
> WORD sysbus_frequency; /* System bus frequency */
> } MCF_COOKIE;