diff options
Diffstat (limited to 'board/prodrive')
-rw-r--r-- | board/prodrive/alpr/alpr.c | 27 | ||||
-rw-r--r-- | board/prodrive/alpr/nand.c | 4 | ||||
-rw-r--r-- | board/prodrive/p3mx/p3mx.c | 63 | ||||
-rw-r--r-- | board/prodrive/p3mx/sdram_init.c | 4 | ||||
-rw-r--r-- | board/prodrive/pdnb3/flash.c | 4 |
5 files changed, 76 insertions, 26 deletions
diff --git a/board/prodrive/alpr/alpr.c b/board/prodrive/alpr/alpr.c index 2389561..5abc87d 100644 --- a/board/prodrive/alpr/alpr.c +++ b/board/prodrive/alpr/alpr.c @@ -77,8 +77,12 @@ int board_early_init_f (void) mtdcr (uicb0tr, 0x00000000); /* */ mtdcr (uicb0vr, 0x00000001); /* */ + /* Setup shutdown/SSD empty interrupt as inputs */ + out32(GPIO0_TCR, in32(GPIO0_TCR) & ~(CFG_GPIO_SHUTDOWN | CFG_GPIO_SSD_EMPTY)); + out32(GPIO0_ODR, in32(GPIO0_ODR) & ~(CFG_GPIO_SHUTDOWN | CFG_GPIO_SSD_EMPTY)); + /* Setup GPIO/IRQ multiplexing */ - mtsdr(sdr_pfc0, 0x01a03e00); + mtsdr(sdr_pfc0, 0x01a33e00); return 0; } @@ -105,26 +109,11 @@ int last_stage_init(void) static int board_rev(void) { - int rev; - u32 pfc0; - - /* Setup GPIO14 & 15 as GPIO */ - mfsdr(sdr_pfc0, pfc0); - pfc0 |= CFG_GPIO_REV0 | CFG_GPIO_REV1; - mtsdr(sdr_pfc0, pfc0); - /* Setup as input */ - out32(GPIO0_TCR, in32(GPIO0_TCR) & ~(CFG_GPIO_REV0 | CFG_GPIO_REV0)); - out32(GPIO0_ODR, in32(GPIO0_ODR) & ~(CFG_GPIO_REV0 | CFG_GPIO_REV0)); - - rev = (in32(GPIO0_IR) >> 16) & 0x3; - - /* Setup GPIO14 & 15 as non GPIO again */ - mfsdr(sdr_pfc0, pfc0); - pfc0 &= ~(CFG_GPIO_REV0 | CFG_GPIO_REV1); - mtsdr(sdr_pfc0, pfc0); + out32(GPIO0_TCR, in32(GPIO0_TCR) & ~(CFG_GPIO_REV0 | CFG_GPIO_REV1)); + out32(GPIO0_ODR, in32(GPIO0_ODR) & ~(CFG_GPIO_REV0 | CFG_GPIO_REV1)); - return rev; + return (in32(GPIO0_IR) >> 16) & 0x3; } int checkboard (void) diff --git a/board/prodrive/alpr/nand.c b/board/prodrive/alpr/nand.c index e63c921..d66b088 100644 --- a/board/prodrive/alpr/nand.c +++ b/board/prodrive/alpr/nand.c @@ -154,7 +154,7 @@ static int alpr_nand_dev_ready(struct mtd_info *mtd) return 1; } -void board_nand_init(struct nand_chip *nand) +int board_nand_init(struct nand_chip *nand) { alpr_ndfc = (struct alpr_ndfc_regs *)CFG_NAND_BASE; @@ -169,5 +169,7 @@ void board_nand_init(struct nand_chip *nand) nand->read_buf = alpr_nand_read_buf; nand->verify_buf = alpr_nand_verify_buf; nand->dev_ready = alpr_nand_dev_ready; + + return 0; } #endif diff --git a/board/prodrive/p3mx/p3mx.c b/board/prodrive/p3mx/p3mx.c index 6cebd1a..d54ddaf 100644 --- a/board/prodrive/p3mx/p3mx.c +++ b/board/prodrive/p3mx/p3mx.c @@ -45,6 +45,7 @@ #include "mpsc.h" #include "64460.h" #include "mv_regs.h" +#include "p3mx.h" DECLARE_GLOBAL_DATA_PTR; @@ -79,6 +80,7 @@ extern flash_info_t flash_info[]; void board_prebootm_init (void); unsigned int INTERNAL_REG_BASE_ADDR = CFG_GT_REGS; int display_mem_map (void); +void set_led(int); /* ------------------------------------------------------------------------- */ @@ -246,7 +248,6 @@ int board_early_init_f (void) * that if it's not at the power-on location, it's where we put * it last time. (huber) */ - my_remap_gt_regs (CFG_DFL_GT_REGS, CFG_GT_REGS); #ifdef CONFIG_PCI @@ -287,6 +288,8 @@ int board_early_init_f (void) GT_REG_WRITE (GPP_LEVEL_CONTROL, CFG_GPP_LEVEL_CONTROL); + set_led(LED_RED); + return 0; } @@ -332,6 +335,7 @@ void after_reloc (ulong dest_addr, gd_t * gd) /* display_mem_map(); */ /* now, jump to the main U-Boot board init code */ + set_led(LED_GREEN); board_init_r (gd, dest_addr); /* NOTREACHED */ } @@ -356,15 +360,66 @@ int checkboard (void) return (0); } -/* utility functions */ -void debug_led (int led, int mode) +void set_led(int col) { + int tmp; + int on_pin; + int off_pin; + + /* Program Mpp[22] as Gpp[22] + * Program Mpp[23] as Gpp[23] + */ + tmp = GTREGREAD(MPP_CONTROL2); + tmp &= 0x00ffffff; + GT_REG_WRITE(MPP_CONTROL2,tmp); + + /* Program Gpp[22] and Gpp[23] as output + */ + tmp = GTREGREAD(GPP_IO_CONTROL); + tmp |= 0x00C00000; + GT_REG_WRITE(GPP_IO_CONTROL, tmp); + + /* Program Gpp[22] and Gpp[23] as active high + */ + tmp = GTREGREAD(GPP_LEVEL_CONTROL); + tmp &= 0xff3fffff; + GT_REG_WRITE(GPP_LEVEL_CONTROL, tmp); + + switch(col) { + default: + case LED_OFF : + on_pin = 0; + off_pin = ((1 << 23) | (1 << 22)); + break; + case LED_RED : + on_pin = (1 << 23); + off_pin = (1 << 22); + break; + case LED_GREEN : + on_pin = (1 << 22); + off_pin = (1 << 23); + break; + case LED_ORANGE : + on_pin = ((1 << 23) | (1 << 22)); + off_pin = 0; + break; + } + + /* Set output Gpp[22] and Gpp[23] + */ + tmp = GTREGREAD(GPP_VALUE); + tmp |= on_pin; + tmp &= ~off_pin; + GT_REG_WRITE(GPP_VALUE, tmp); } int display_mem_map (void) { - int i, j; + int i; unsigned int base, size, width; +#ifdef CONFIG_PCI + int j; +#endif /* SDRAM */ printf ("SD (DDR) RAM\n"); diff --git a/board/prodrive/p3mx/sdram_init.c b/board/prodrive/p3mx/sdram_init.c index 176252e..0464860 100644 --- a/board/prodrive/p3mx/sdram_init.c +++ b/board/prodrive/p3mx/sdram_init.c @@ -65,7 +65,7 @@ int mvDmaTransfer (int, ulong, ulong, ulong, ulong); int memory_map_bank (unsigned int bankNo, unsigned int bankBase, unsigned int bankLength) { -#ifdef MAP_PCI +#if defined (MAP_PCI) && defined (CONFIG_PCI) PCI_HOST host; #endif @@ -80,7 +80,7 @@ int memory_map_bank (unsigned int bankNo, memoryMapBank (bankNo, bankBase, bankLength); -#ifdef MAP_PCI +#if defined (MAP_PCI) && defined (CONFIG_PCI) for (host = PCI_HOST0; host <= PCI_HOST1; host++) { const int features = PREFETCH_ENABLE | diff --git a/board/prodrive/pdnb3/flash.c b/board/prodrive/pdnb3/flash.c index d0e5fe7..518ea9c 100644 --- a/board/prodrive/pdnb3/flash.c +++ b/board/prodrive/pdnb3/flash.c @@ -24,6 +24,8 @@ #include <common.h> #include <asm/arch/ixp425.h> +#if !defined(CFG_FLASH_CFI_DRIVER) + /* * include common flash code (for esd boards) */ @@ -83,3 +85,5 @@ unsigned long flash_init(void) return size; } + +#endif /* CFG_FLASH_CFI_DRIVER */ |