ppc4xx: Rework 440GX UIC handling
PATCH 3/3 ppc4xx: Rework 440GX UIC handling
This patch reworks the 440GX interrupt handling so that the common 4xx code can be used. The 440GX is an exception to all other 4xx variants by having the cascading interrupt vectors not on UIC0 but on a special UIC named UICB0 (UIC Base 0). With this patch now, U-Boot references the 440GX UICB0 when UIC0 is selected. And the common 4xx interrupt handling is simpler without any 440GX special cases.
Also some additional cleanup to cpu/ppc4xx/interrupt.c is done.
--- board/amcc/ocotea/ocotea.c | 50 +++++++++++------- board/amcc/taishan/taishan.c | 50 +++++++++++------- board/prodrive/alpr/alpr.c | 50 +++++++++++------- board/sandburst/karef/karef.c | 50 +++++++++++------- board/sandburst/metrobox/metrobox.c | 50 +++++++++++------- board/xpedite1k/xpedite1k.c | 50 +++++++++++------- cpu/ppc4xx/4xx_enet.c | 9 ++- cpu/ppc4xx/cpu_init.c | 17 +++++- cpu/ppc4xx/interrupts.c | 97 ++++++----------------------------- include/asm-ppc/ppc4xx-uic.h | 93 +++++++++++++++++---------------- 10 files changed, 270 insertions(+), 246 deletions(-)
board/amcc/ocotea/ocotea.c +31 -19
@@ -147,36 +147,48 @@ int board_early_init_f (void)/*-------------------------------------------------------------------- * Setup the interrupt controller polarities, triggers, etc. *-------------------------------------------------------------------*/ -mtdcr (uic0sr,0xffffffff );/* clear all */ -mtdcr (uic0er,0x00000000 );/* disable all */ -mtdcr (uic0cr,0x00000009 );/* SMI & UIC1 crit are critical */ -mtdcr (uic0pr,0xfffffe13 );/* per ref-board manual */ -mtdcr (uic0tr,0x01c00008 );/* per ref-board manual */ -mtdcr (uic0vr,0x00000001 );/* int31 highest, base=0x000 */ -mtdcr (uic0sr,0xffffffff );/* clear all */ - +/* +* Because of the interrupt handling rework to handle 440GX interrupts +* with the common code, we needed to change names of the UIC registers. +* Here the new relationship: +* +* U-Boot name 440GX name +* ----------------------- +* UIC0 UICB0 +* UIC1 UIC0 +* UIC2 UIC1 +* UIC3 UIC2 +*/ mtdcr (uic1sr,0xffffffff );/* clear all */ mtdcr (uic1er,0x00000000 );/* disable all */ -mtdcr (uic1cr,0x00000000 );/* all non-critical */ -mtdcr (uic1pr,0xffffe0ff );/* per ref-board manual */ -mtdcr (uic1tr,0x00ffc000 );/* per ref-board manual */ +mtdcr (uic1cr,0x00000009 );/* SMI & UIC1 crit are critical */ +mtdcr (uic1pr,0xfffffe13 );/* per ref-board manual */ +mtdcr (uic1tr,0x01c00008 );/* per ref-board manual */ mtdcr (uic1vr,0x00000001 );/* int31 highest, base=0x000 */ mtdcr (uic1sr,0xffffffff );/* clear all */ mtdcr (uic2sr,0xffffffff );/* clear all */ mtdcr (uic2er,0x00000000 );/* disable all */ mtdcr (uic2cr,0x00000000 );/* all non-critical */ -mtdcr (uic2pr,0xffffffff );/* per ref-board manual */ -mtdcr (uic2tr,0x00ff8c0f );/* per ref-board manual */ +mtdcr (uic2pr,0xffffe0ff );/* per ref-board manual */ +mtdcr (uic2tr,0x00ffc000 );/* per ref-board manual */ mtdcr (uic2vr,0x00000001 );/* int31 highest, base=0x000 */ mtdcr (uic2sr,0xffffffff );/* clear all */ -mtdcr (uicb0sr,0xfc000000 );/* clear all */ -mtdcr (uicb0er,0x00000000 );/* disable all */ -mtdcr (uicb0cr,0x00000000 );/* all non-critical */ -mtdcr (uicb0pr,0xfc000000 );/* */ -mtdcr (uicb0tr,0x00000000 );/* */ -mtdcr (uicb0vr,0x00000001 );/* */ +mtdcr (uic3sr,0xffffffff );/* clear all */ +mtdcr (uic3er,0x00000000 );/* disable all */ +mtdcr (uic3cr,0x00000000 );/* all non-critical */ +mtdcr (uic3pr,0xffffffff );/* per ref-board manual */ +mtdcr (uic3tr,0x00ff8c0f );/* per ref-board manual */ +mtdcr (uic3vr,0x00000001 );/* int31 highest, base=0x000 */ +mtdcr (uic3sr,0xffffffff );/* clear all */ + +mtdcr (uic0sr,0xfc000000 );/* clear all */ +mtdcr (uic0er,0x00000000 );/* disable all */ +mtdcr (uic0cr,0x00000000 );/* all non-critical */ +mtdcr (uic0pr,0xfc000000 );/* */ +mtdcr (uic0tr,0x00000000 );/* */ +mtdcr (uic0vr,0x00000001 );/* */ mfsdr (sdr_mfr, mfr); mfr &= ~SDR0_MFR_ECS_MASK ;/* mtsdr(sdr_mfr, mfr); */
board/amcc/taishan/taishan.c +31 -19
67 lines not on this page · raw message
board/prodrive/alpr/alpr.c +31 -19
67 lines not on this page · raw message
board/sandburst/karef/karef.c +31 -19
67 lines not on this page · raw message
board/sandburst/metrobox/metrobox.c +31 -19
67 lines not on this page · raw message
board/xpedite1k/xpedite1k.c +31 -19
67 lines not on this page · raw message
cpu/ppc4xx/4xx_enet.c +6 -3
@@ -169,12 +169,15 @@* UIC. Only exception is 440GX where the EMAC interrupts are * spread over two UIC's! */ +#if defined(CONFIG_440GX ) +#define UIC_BASE_MAL UIC1_DCR_BASE +#define UIC_BASE_MAL_ERR UIC2_DCR_BASE +#define UIC_BASE_EMAC UIC2_DCR_BASE +#define UIC_BASE_EMAC_B UIC3_DCR_BASE +#else #define UIC_BASE_MAL (UIC0_DCR_BASE + (UIC_NR(VECNUM_MAL_TXEOB) * 0x10))#define UIC_BASE_MAL_ERR (UIC0_DCR_BASE + (UIC_NR(VECNUM_MAL_SERR) * 0x10))#define UIC_BASE_EMAC (UIC0_DCR_BASE + (UIC_NR(ETH_IRQ_NUM(0)) * 0x10)) -#if defined(CONFIG_440GX ) -#define UIC_BASE_EMAC_B (UIC0_DCR_BASE + (UIC_NR(ETH_IRQ_NUM(2)) * 0x10)) -#else #define UIC_BASE_EMAC_B (UIC0_DCR_BASE + (UIC_NR(ETH_IRQ_NUM(0)) * 0x10))#endif
cpu/ppc4xx/cpu_init.c +15 -2
@@ -138,9 +138,10 @@ void reconfigure_pll(u32 new_cpu_freq)void cpu_init_f (void ) { -#if defined(CONFIG_WATCHDOG ) -unsigned long val; +#if defined(CONFIG_WATCHDOG ) || defined(CONFIG_440GX ) +u32 val;#endif +reconfigure_pll (CFG_PLL_RECONFIG );#if (defined(CONFIG_405EP ) || defined (CONFIG_405EX )) && !defined(CFG_4xx_GPIO_TABLE)
@@ -272,6 +273,18 @@ cpu_init_f (void)reset_4xx_watchdog ();#endif /* CONFIG_WATCHDOG */ + +#if defined(CONFIG_440GX ) +/* Take the GX out of compatibility mode +* Travis Sawyer, 9 Mar 2004 +* NOTE: 440gx user manual inconsistency here +* Compatibility mode and Ethernet Clock select are not +* correct in the manual +*/ +mfsdr (sdr_mfr, val); + val &= ~0x10000000 ; +mtsdr (sdr_mfr,val); +#endif /* CONFIG_440GX */ }/*
cpu/ppc4xx/interrupts.c +16 -81
184 lines not on this page · raw message
include/asm-ppc/ppc4xx-uic.h +47 -46
147 lines not on this page · raw message
Signature · 1 line
1.5.6.1