/* Copyright Motorola, Inc. 1993, 1994, 1999, 2000 ALL RIGHTS RESERVED You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE so long as this entire notice is retained without alteration in any modified and/or redistributed versions, and that such modified versions are clearly identified as such. No licenses are granted by implication, estoppel or otherwise under any patents or trademarks of Motorola, Inc. The SOFTWARE is provided on an "AS IS" basis and without warranty. To the maximum extent permitted by applicable law, MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY ACCOMPANYING WRITTEN MATERIALS. To the maximum extent permitted by applicable law, IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. Motorola assumes no responsibility for the maintenance and support of the SOFTWARE. */ /* l2_decoder.c decode the L2CR register * * make this file with the following command: * cc l2_decoder.c -o l2_decoder * or * gcc l2_decoder.c -o l2_decoder * * invoke it with l2_decoder * * Two modes: * 1) Full display all set and unset values When requested type in 'f' or 'F' * 2) Set value display only display set values When requested type in any other key including blank * * mo 2/29/00 * */ main() { #define L2E 0x80000000 #define L2PE 0x40000000 #define L2SIZ 0x30000000 #define L2CLK 0x0e000000 #define L2RAM 0x01800000 #define L2DO 0x00400000 #define L2I 0x00200000 #define L2CTL 0x00100000 #define L2WT 0x00080000 #define L2TS 0x00040000 #define L2OH 0x00030000 #define L2SL 0x00008000 #define L2DF 0x00004000 #define L2BYP 0x00002000 #define L2IP 0x00000001 unsigned int l2cr; unsigned int temp; char getchoice; int choice; int counter,i; char type[20]; printf("L2 Cache Register Decoder - MPC750 Only\n"); printf("Enter the L2CR values and display the meaning\n"); printf("Full Display (f) or Display only Set Values (any key)?\n"); scanf("%c",&getchoice); if(getchoice == 'f' || getchoice == 'F') choice = 1; else choice = 0; printf(" Format: description: hex value (without leading 0x)\n s.a. abcdefab"); printf("Please enter the L2CR value in hex\n0x"); scanf("%x",&l2cr); printf("Decoding the L2CR = 0x%x\n",l2cr); /* L2CR decoder */ temp = (l2cr & L2E) >> ( 31-0); printf(" L2E is %x, L2 cache %s\n",temp,(temp ? "Enabled":"Disabled")); temp = (l2cr & L2PE) >> ( 31-1); printf(" L2PE is %x, Parity %s\n",temp,(temp ? "Enabled":"Disabled")); temp = (l2cr & L2SIZ) >> ( 31-3); printf(" L2SIZ is %x, L2 Size",temp); switch ( temp ) { case 0: printf(" Reserved - DO NOT USE\n"); break; case 1: printf(" 256 KByte\n"); break; case 2: printf(" 512 KByte\n"); break; case 3: printf(" 1 MByte\n"); break; default: printf(" Invalid\n"); } temp = (l2cr & L2CLK) >> ( 31-6); printf(" L2CLK is %x, L2 Clock ratio and DLL",temp); switch ( temp ) { case 0: printf(" Disabled\n"); break; case 1: printf(" Divide by 1.0\n"); break; case 2: printf(" Divide by 1.5\n"); break; case 3: printf(" Reserved - DO NOT USE\n"); break; case 4: printf(" Divide by 2.0\n"); break; case 5: printf(" Divide by 2.5\n"); break; case 6: printf(" Divide by 3.0\n"); break; case 7: printf(" Reserved - DO NOT USE\n"); break; default: printf(" Invalid\n"); } temp = (l2cr & L2RAM) >> ( 31-8); printf(" L2RAM is %x, L2 RAM type",temp); switch ( temp ) { case 0: printf(" Flowthrough Reg-Buffer burst SRAM\n"); break; case 1: printf(" RESERVED -- DO NOT USE\n"); break; case 2: printf(" Pipelined Reg-Reg burst SRAM\n"); break; case 3: printf(" Pipelined Reg-Reg late write SRAM\n"); break; default: printf(" Invalid\n"); } temp = (l2cr & L2DO) >> ( 31-9); if(!(choice == 0 && temp == 0)) printf(" L2DO is %x, L2 Data Only %s\n",temp,(temp ? "Set":"Unset")); temp = (l2cr & L2I) >> ( 31-10); if(!(choice == 0 && temp == 0)) printf(" L2I is %x, L2 Global Invalidate %s\n",temp,(temp ? "Set":"Unset")); temp = (l2cr & L2CTL) >> ( 31-11); if(!(choice == 0 && temp == 0)) printf(" L2CTL is %x, L2 RAM Control %s\n",temp,(temp ? "Set":"Unset")); temp = (l2cr & L2WT) >> ( 31-12); if(!(choice == 0 && temp == 0)) printf(" L2WT is %x, L2 Write Through %s\n",temp,(temp ? "Set":"Unset")); temp = (l2cr & L2OH) >> ( 31-15); printf(" L2OH is %x, L2 Output Hold",temp); switch ( temp ) { case 0: printf(" 0.5 nS\n"); break; case 1: printf(" 1.0 nS\n"); break; case 2: printf(" Reserved - DO NOT USE\n"); break; case 3: printf(" Reserved - DO NOT USE\n"); break; default: printf(" Invalid\n"); } temp = (l2cr & L2SL) >> ( 31-16); if(!(choice == 0 && temp == 0)) printf(" L2SL is %x, L2 DLL slow %s\n",temp,(temp ? "Set":"Unset")); temp = (l2cr & L2DF) >> ( 31-17); if(!(choice == 0 && temp == 0)) printf(" L2DF is %x, L2 Differential Clock %s\n",temp,(temp ? "Set":"Unset")); temp = (l2cr & L2BYP) >> ( 31-18); if(!(choice == 0 && temp == 0)) printf(" L2BYP is %x, L2 DLL Bypass %s\n",temp,(temp ? "Set":"Unset")); temp = (l2cr & L2IP) >> ( 31-31); if(!(choice == 0 && temp == 0)) printf(" L2IP is %x, L2 Global Invalidate in Progress %s\n",temp,(temp ? "Set":"Unset")); }