X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=board%2Famcc%2Fsequoia%2Fsequoia.c;h=ba365aea3188e33a5b0f26dc2025206e94746454;hb=18d156eb37c90fadc8ec7a81a3b89176161f85b7;hp=ccf6f0c8039bdceb9de6727d60017655888ab72a;hpb=fb883a521e04437acfe989de3e152b2e4866856b;p=oweals%2Fu-boot.git diff --git a/board/amcc/sequoia/sequoia.c b/board/amcc/sequoia/sequoia.c index ccf6f0c803..ba365aea31 100644 --- a/board/amcc/sequoia/sequoia.c +++ b/board/amcc/sequoia/sequoia.c @@ -31,11 +31,13 @@ DECLARE_GLOBAL_DATA_PTR; extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */ +ulong flash_get_size (ulong base, int banknum); + int board_early_init_f(void) { - unsigned long sdr0_cust0; - unsigned long sdr0_pfc1, sdr0_pfc2; - register uint reg; + u32 sdr0_cust0; + u32 sdr0_pfc1, sdr0_pfc2; + u32 reg; mtdcr(ebccfga, xbcfg); mtdcr(ebccfgd, 0xb8400000); @@ -140,6 +142,7 @@ int misc_init_r(void) { uint pbcr; int size_val = 0; + u32 reg; #ifdef CONFIG_440EPX unsigned long usb2d0cr = 0; unsigned long usb2phy0cr, usb2h0cr = 0; @@ -152,6 +155,11 @@ int misc_init_r(void) */ /* Re-do sizing to get full correct info */ + + /* adjust flash start and offset */ + gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize; + gd->bd->bi_flashoffset = 0; + #if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL) mtdcr(ebccfga, pb3cr); #else @@ -192,9 +200,10 @@ int misc_init_r(void) #endif mtdcr(ebccfgd, pbcr); - /* adjust flash start and offset */ - gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize; - gd->bd->bi_flashoffset = 0; + /* + * Re-check to get correct base address + */ + flash_get_size(gd->bd->bi_flashstart, 0); #ifdef CFG_ENV_IS_IN_FLASH /* Monitor protection ON by default */ @@ -327,18 +336,37 @@ int misc_init_r(void) } #endif /* CONFIG_440EPX */ + mfsdr(SDR0_SRST1, reg); /* enable security/kasumi engines */ + reg &= ~(SDR0_SRST1_CRYP0 | SDR0_SRST1_KASU0); + mtsdr(SDR0_SRST1, reg); + + /* + * Clear PLB4A0_ACR[WRP] + * This fix will make the MAL burst disabling patch for the Linux + * EMAC driver obsolete. + */ + reg = mfdcr(plb4_acr) & ~PLB4_ACR_WRP; + mtdcr(plb4_acr, reg); + return 0; } int checkboard(void) { char *s = getenv("serial#"); + u8 rev; + u8 val; #ifdef CONFIG_440EPX printf("Board: Sequoia - AMCC PPC440EPx Evaluation Board"); #else printf("Board: Rainier - AMCC PPC440GRx Evaluation Board"); #endif + + rev = in8(CFG_BCSR_BASE + 0); + val = in8(CFG_BCSR_BASE + 5) & 0x01; + printf(", Rev. %X, PCI=%d MHz", rev, val ? 66 : 33); + if (s != NULL) { puts(", serial# "); puts(s);