mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
powerpc, 8xx: Simplifying check_CPU()
All complex case have been removed and we now only support MPC866 and MPC885 families. So check_CPU() can be made a lot simpler. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
This commit is contained in:

committed by
Tom Rini

parent
f3603b4382
commit
36d3260756
@ -34,19 +34,11 @@
|
|||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
static char *cpu_warning = "\n " \
|
|
||||||
"*** Warning: CPU Core has Silicon Bugs -- Check the Errata ***";
|
|
||||||
|
|
||||||
static int check_CPU(long clock, uint pvr, uint immr)
|
static int check_CPU(long clock, uint pvr, uint immr)
|
||||||
{
|
{
|
||||||
char *id_str =
|
|
||||||
NULL;
|
|
||||||
immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
|
immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
|
||||||
uint k, m;
|
uint k;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
char pre = 'X';
|
|
||||||
char *mid = "xx";
|
|
||||||
char *suf;
|
|
||||||
|
|
||||||
/* the highest 16 bits should be 0x0050 for a 860 */
|
/* the highest 16 bits should be 0x0050 for a 860 */
|
||||||
|
|
||||||
@ -55,8 +47,6 @@ static int check_CPU(long clock, uint pvr, uint immr)
|
|||||||
|
|
||||||
k = (immr << 16) |
|
k = (immr << 16) |
|
||||||
in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
|
in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]);
|
||||||
m = 0;
|
|
||||||
suf = "";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some boards use sockets so different CPUs can be used.
|
* Some boards use sockets so different CPUs can be used.
|
||||||
@ -65,32 +55,20 @@ static int check_CPU(long clock, uint pvr, uint immr)
|
|||||||
switch (k) {
|
switch (k) {
|
||||||
/* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
|
/* MPC866P/MPC866T/MPC859T/MPC859DSL/MPC852T */
|
||||||
case 0x08010004: /* Rev. A.0 */
|
case 0x08010004: /* Rev. A.0 */
|
||||||
suf = "A";
|
printf("MPC866xxxZPnnA");
|
||||||
/* fall through */
|
|
||||||
case 0x08000003: /* Rev. 0.3 */
|
|
||||||
pre = 'M'; m = 1;
|
|
||||||
if (id_str == NULL)
|
|
||||||
id_str =
|
|
||||||
"PC866x"; /* Unknown chip from MPC866 family */
|
|
||||||
break;
|
break;
|
||||||
case 0x09000000:
|
case 0x08000003: /* Rev. 0.3 */
|
||||||
pre = 'M'; mid = suf = ""; m = 1;
|
printf("MPC866xxxZPnn");
|
||||||
if (id_str == NULL)
|
break;
|
||||||
id_str = "PC885"; /* 870/875/880/885 */
|
case 0x09000000: /* 870/875/880/885 */
|
||||||
|
puts("MPC885ZPnn");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
suf = NULL;
|
printf("unknown MPC86x (0x%08x)", k);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id_str == NULL)
|
|
||||||
id_str = "PC86x"; /* Unknown 86x chip */
|
|
||||||
if (suf)
|
|
||||||
printf("%c%s%sZPnn%s", pre, id_str, mid, suf);
|
|
||||||
else
|
|
||||||
printf("unknown M%s (0x%08x)", id_str, k);
|
|
||||||
|
|
||||||
printf(" at %s MHz: ", strmhz(buf, clock));
|
printf(" at %s MHz: ", strmhz(buf, clock));
|
||||||
|
|
||||||
print_size(checkicache(), " I-Cache ");
|
print_size(checkicache(), " I-Cache ");
|
||||||
@ -102,9 +80,6 @@ static int check_CPU(long clock, uint pvr, uint immr)
|
|||||||
if (in_be32(&immap->im_cpm.cp_fec.fec_addr_low) == 0x12345678)
|
if (in_be32(&immap->im_cpm.cp_fec.fec_addr_low) == 0x12345678)
|
||||||
printf(" FEC present");
|
printf(" FEC present");
|
||||||
|
|
||||||
if (!m)
|
|
||||||
puts(cpu_warning);
|
|
||||||
|
|
||||||
putc('\n');
|
putc('\n');
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user