]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/kup4k/kup4k.c
Add LED indication for IDE activity on KUP4K board
[karo-tx-uboot.git] / board / kup4k / kup4k.c
index 86e1c812c1e20ba3b0f1cd0969e42577cd9ac573..aeafa6af3c3f9af7c4fbe596a0ff93b7b2cdcdd9 100644 (file)
@@ -288,12 +288,22 @@ int misc_init_r (void)
 {
        DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_STATUS_LED
+       volatile immap_t        *immap = (immap_t *)CFG_IMMR;
+#endif
 #ifdef CONFIG_KUP4K_LOGO
        bd_t *bd = gd->bd;
 
 
        lcd_logo(bd);
 #endif /* CONFIG_KUP4K_LOGO */
+#ifdef CONFIG_IDE_LED
+       /* Configure PA8 as output port */
+       immap->im_ioport.iop_padir |= 0x80;
+       immap->im_ioport.iop_paodr |= 0x80;
+       immap->im_ioport.iop_papar &= ~0x80;
+       immap->im_ioport.iop_padat |= 0x80; /* turn it off */
+#endif
        return(0);
 }
 
@@ -422,3 +432,15 @@ void lcd_logo(bd_t *bd){
 }
 #endif /* CONFIG_KUP4K_LOGO */
 
+#ifdef CONFIG_IDE_LED
+void ide_led (uchar led, uchar status)
+{
+       volatile immap_t        *immap = (immap_t *)CFG_IMMR;
+       /* We have one led for both pcmcia slots */
+       if (status) { /* led on */
+               immap->im_ioport.iop_padat &= ~0x80;
+       } else {
+               immap->im_ioport.iop_padat |= 0x80;
+       }
+}
+#endif