/* Read the 440SPe MQ controller to get size of system memory. */ #define DCRN_MQ0_B0BAS 0x40 #define DCRN_MQ0_B1BAS 0x41 #define DCRN_MQ0_B2BAS 0x42 #define DCRN_MQ0_B3BAS 0x43
/* open coded because I'm paranoid about invalid values */ switch ((bas >> 4) & 0xFFF) { case 0: return 0; case 0xffc: return base + 0x000800000ull; case 0xff8: return base + 0x001000000ull; case 0xff0: return base + 0x002000000ull; case 0xfe0: return base + 0x004000000ull; case 0xfc0: return base + 0x008000000ull; case 0xf80: return base + 0x010000000ull; case 0xf00: return base + 0x020000000ull; case 0xe00: return base + 0x040000000ull; case 0xc00: return base + 0x080000000ull; case 0x800: return base + 0x100000000ull;
}
printf("Memory BAS value 0x%08x unsupported !\n", bas); return 0;
}
/* Ultimately, we should directly construct the memory node * so we are able to handle holes in the memory address space
*/
banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B0BAS)); if (banktop > memsize)
memsize = banktop;
banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B1BAS)); if (banktop > memsize)
memsize = banktop;
banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B2BAS)); if (banktop > memsize)
memsize = banktop;
banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B3BAS)); if (banktop > memsize)
memsize = banktop;
/* * Some U-Boot versions set the number of chipselects to two * for Sequoia/Rainier boards while they only have one chipselect * hardwired. Hardcode the number of chipselects to one * for sequioa/rainer board models or read the actual value * from the memory controller register DDR0_10 otherwise.
*/ staticinline u32 ibm4xx_denali_get_cs(void)
{ void *devp; char model[64];
u32 val, cs;
devp = finddevice("/"); if (!devp) goto read_cs;
if (getprop(devp, "model", model, sizeof(model)) <= 0) goto read_cs;
model[sizeof(model)-1] = 0;
if (!strcmp(model, "amcc,sequoia") ||
!strcmp(model, "amcc,rainier")) return 1;
read_cs: /* get CS value */
val = SDRAM0_READ(DDR0_10);
val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT);
cs = 0; while (val) { if (val & 0x1)
cs++;
val = val >> 1;
} return cs;
}
#define EMAC_RESET 0x20000000 void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)
{ /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't * do this for us
*/ if (emac0)
*emac0 = EMAC_RESET; if (emac1)
*emac1 = EMAC_RESET;
mtdcr(DCRN_MAL0_CFG, MAL_RESET); while (mfdcr(DCRN_MAL0_CFG) & MAL_RESET)
; /* loop until reset takes effect */
}
/* Read 4xx EBC bus bridge registers to get mappings of the peripheral
* banks into the OPB address space */ void ibm4xx_fixup_ebc_ranges(constchar *ebc)
{ void *devp;
u32 bxcr;
u32 ranges[EBC_NUM_BANKS*4];
u32 *p = ranges; int i;
for (i = 0; i < EBC_NUM_BANKS; i++) {
mtdcr(DCRN_EBC0_CFGADDR, EBC_BXCR(i));
bxcr = mfdcr(DCRN_EBC0_CFGDATA);
if (sys0 & CPC0_SYS0_BYPASS) { /* Bypass system PLL */
cpu = plb = sys_clk;
} else { if (sys0 & CPC0_SYS0_EXTSL) /* PerClk */
m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv; else /* CPU clock */
m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
cpu = sys_clk * m / CPC0_SYS0_FWDVA(sys0);
plb = sys_clk * m / CPC0_SYS0_FWDVB(sys0);
}
opb = plb / opdv;
ebc = opb / epdv;
/* FIXME: Check if this is for all 440GP, or just Ebony */ if ((mfpvr() & 0xf0000fff) == 0x40000440) /* Rev. B 440GP, use external system clock */
tb = sys_clk; else /* Rev. C 440GP, errata force us to use internal clock */
tb = cpu;
/* serial clocks need fixup based on int/ext */
eplike_fixup_uart_clk(0, "/plb/opb/serial@40000200", ser_clk, plb_clk);
eplike_fixup_uart_clk(1, "/plb/opb/serial@40000300", ser_clk, plb_clk);
}
/* serial clocks need fixup based on int/ext */
eplike_fixup_uart_clk(0, "/plb/opb/serial@f0000200", ser_clk, plb_clk);
eplike_fixup_uart_clk(1, "/plb/opb/serial@f0000300", ser_clk, plb_clk);
eplike_fixup_uart_clk(2, "/plb/opb/serial@f0000600", ser_clk, plb_clk);
}
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.