2015-08-06 04:39:27 +08:00
|
|
|
/* i8259.c - Disable Intel 8259A PIC (Programmable Interrupt Controller) */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2010-2015 Wind River Systems, Inc.
|
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2015-04-11 07:44:37 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2015-10-21 00:42:33 +08:00
|
|
|
* DESCRIPTION
|
|
|
|
* This module disables the Intel 8259A PIC (Programmable Interrupt Controller)
|
|
|
|
* to prevent it from generating spurious interrupts.
|
|
|
|
*/
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
#include <nanokernel.h>
|
2015-05-29 01:56:47 +08:00
|
|
|
#include <arch/cpu.h>
|
2015-04-11 07:44:37 +08:00
|
|
|
#include <toolchain.h>
|
|
|
|
#include <sections.h>
|
2015-09-16 00:17:38 +08:00
|
|
|
#include <device.h>
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
#include <drivers/pic.h>
|
|
|
|
#include <board.h>
|
|
|
|
|
2015-07-25 01:46:21 +08:00
|
|
|
#define PIC_DISABLE 0xff /* Disable PIC command */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2015-07-25 01:46:21 +08:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @brief Initialize the Intel 8259A PIC device driver
|
|
|
|
*
|
|
|
|
* This routine disables the 8259A PIC device to prevent it from
|
|
|
|
* generating spurious interrupts.
|
|
|
|
*
|
|
|
|
* @return N/A
|
|
|
|
*/
|
|
|
|
|
2015-09-16 00:17:38 +08:00
|
|
|
int _i8259_init(struct device *unused)
|
2015-07-25 01:46:21 +08:00
|
|
|
{
|
2015-09-16 00:17:38 +08:00
|
|
|
ARG_UNUSED(unused);
|
2015-09-10 23:37:53 +08:00
|
|
|
sys_out8(PIC_DISABLE, PIC_PORT2(PIC_SLAVE_BASE_ADRS));
|
|
|
|
sys_out8(PIC_DISABLE, PIC_PORT2(PIC_MASTER_BASE_ADRS));
|
2015-09-16 00:17:38 +08:00
|
|
|
return 0;
|
2015-07-25 01:46:21 +08:00
|
|
|
}
|