]> git.sur5r.net Git - u-boot/blobdiff - board/mpl/common/isa.c
Merge branch 'master' of git://git.denx.de/u-boot-arm into master
[u-boot] / board / mpl / common / isa.c
index 51b2773c71a9ed19c76c3cc88cee384a134995e7..54ec66bd45b04a88fe4ed2bb47a84771c9876f0f 100644 (file)
@@ -2,31 +2,14 @@
  * (C) Copyright 2001
  * Denis Peter, MPL AG Switzerland
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  *
  * TODO: clean-up
  */
 
 #include <common.h>
 #include <asm/processor.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include "isa.h"
 #include "piix4_pci.h"
 #include "kbd.h"
 #define PRINTF(fmt,args...)
 #endif
 
-#ifndef        TRUE
-#define TRUE            1
-#endif
-#ifndef FALSE
-#define FALSE           0
-#endif
-
 #if defined(CONFIG_PIP405)
 
 extern int drv_isa_kbd_init (void);
@@ -113,36 +89,36 @@ const SIO_LOGDEV_TABLE sio_keyboard[] = {
 ********************************************************************************/
 unsigned char open_cfg_super_IO(int address)
 {
-       out8(CFG_ISA_IO_BASE_ADDRESS | address,0x55); /* open config */
-       out8(CFG_ISA_IO_BASE_ADDRESS | address,0x20); /* set address to DEV ID */
-       if(in8(CFG_ISA_IO_BASE_ADDRESS | address | 0x1)==0x40) /* ok Device ID is correct */
-               return TRUE;
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,0x55); /* open config */
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,0x20); /* set address to DEV ID */
+       if(in8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address | 0x1)==0x40) /* ok Device ID is correct */
+               return true;
        else
-               return FALSE;
+               return false;
 }
 
 void close_cfg_super_IO(int address)
 {
-       out8(CFG_ISA_IO_BASE_ADDRESS | address,0xAA); /* close config */
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,0xAA); /* close config */
 }
 
 
 unsigned char read_cfg_super_IO(int address, unsigned char function, unsigned char regaddr)
 {
        /* assuming config reg is open */
-       out8(CFG_ISA_IO_BASE_ADDRESS | address,0x7); /* points to the function reg */
-       out8(CFG_ISA_IO_BASE_ADDRESS | address | 1,function); /* set the function no */
-       out8(CFG_ISA_IO_BASE_ADDRESS | address,regaddr); /* sets the address in the function */
-       return in8(CFG_ISA_IO_BASE_ADDRESS | address | 1);
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,0x7); /* points to the function reg */
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address | 1,function); /* set the function no */
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,regaddr); /* sets the address in the function */
+       return in8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address | 1);
 }
 
 void write_cfg_super_IO(int address, unsigned char function, unsigned char regaddr, unsigned char data)
 {
        /* assuming config reg is open */
-       out8(CFG_ISA_IO_BASE_ADDRESS | address,0x7); /* points to the function reg */
-       out8(CFG_ISA_IO_BASE_ADDRESS | address | 1,function); /* set the function no */
-       out8(CFG_ISA_IO_BASE_ADDRESS | address,regaddr); /* sets the address in the function */
-       out8(CFG_ISA_IO_BASE_ADDRESS | address | 1,data); /* writes the data */
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,0x7); /* points to the function reg */
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address | 1,function); /* set the function no */
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address,regaddr); /* sets the address in the function */
+       out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS | address | 1,data); /* writes the data */
 }
 
 void isa_write_table(SIO_LOGDEV_TABLE *ldt,unsigned char ldev)
@@ -179,7 +155,7 @@ void isa_sio_loadtable(void)
 
 void isa_sio_setup(void)
 {
-       if(open_cfg_super_IO(SIO_CFG_PORT)==TRUE)
+       if (open_cfg_super_IO(SIO_CFG_PORT) == true)
        {
                isa_sio_loadtable();
                close_cfg_super_IO(0x3F0);
@@ -208,12 +184,12 @@ static unsigned int cached_irq_mask = 0xfff9;
 
 #define cached_imr1    (unsigned char)cached_irq_mask
 #define cached_imr2    (unsigned char)(cached_irq_mask>>8)
-#define IMR_1          CFG_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT1_OCW1
-#define IMR_2          CFG_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT2_OCW1
-#define ICW1_1 CFG_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT1_ICW1
-#define ICW1_2 CFG_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT2_ICW1
-#define ICW2_1 CFG_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT1_ICW2
-#define ICW2_2 CFG_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT2_ICW2
+#define IMR_1          CONFIG_SYS_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT1_OCW1
+#define IMR_2          CONFIG_SYS_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT2_OCW1
+#define ICW1_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT1_ICW1
+#define ICW1_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT2_ICW1
+#define ICW2_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT1_ICW2
+#define ICW2_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + PIIX4_ISA_INT2_ICW2
 #define ICW3_1 ICW2_1
 #define ICW3_2 ICW2_2
 #define ICW4_1 ICW2_1
@@ -382,12 +358,12 @@ void init_8259A(void)
 int handle_isa_int(void)
 {
        unsigned long irqack;
-       unsigned char isr1,isr2,irq;
+       unsigned char irq;
        /* first we acknokledge the int via the PCI bus */
        irqack=in32(PCI_INT_ACK_ADDR);
        /* now we get the ISRs */
-       isr2=in8(ISR_2);
-       isr1=in8(ISR_1);
+       in8(ISR_2);
+       in8(ISR_1);
        irq=(unsigned char)irqack;
        irq-=32;
 /*     if((irq==7)&&((isr1&0x80)==0)) {