/* gpio_i.h -- Definition of internal types and structures for GPIO code
|
/* gpio_i.h -- Definition of internal types and structures for GPIO code
|
Copyright (C) 2001 Erez Volk, erez@mailandnews.comopencores.org
|
Copyright (C) 2001 Erez Volk, erez@mailandnews.comopencores.org
|
|
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
|
|
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
the Free Software Foundation; either version 2 of the License, or
|
the Free Software Foundation; either version 2 of the License, or
|
(at your option) any later version.
|
(at your option) any later version.
|
|
|
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
GNU General Public License for more details.
|
GNU General Public License for more details.
|
|
|
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
*/
|
*/
|
|
|
#ifndef __OR1KSIM_PERIPHERAL_GPIO_I_H
|
#ifndef __OR1KSIM_PERIPHERAL_GPIO_I_H
|
#define __OR1KSIM_PERIPHERAL_GPIO_I_H
|
#define __OR1KSIM_PERIPHERAL_GPIO_I_H
|
|
|
#include "gpio.h"
|
#include "gpio.h"
|
#include "config.h"
|
#include "config.h"
|
|
|
/*
|
/*
|
* The various VAPI IDs each GPIO device has
|
* The various VAPI IDs each GPIO device has
|
*/
|
*/
|
enum { GPIO_VAPI_DATA = 0,
|
enum { GPIO_VAPI_DATA = 0,
|
GPIO_VAPI_AUX,
|
GPIO_VAPI_AUX,
|
GPIO_VAPI_CLOCK,
|
GPIO_VAPI_CLOCK,
|
GPIO_VAPI_RGPIO_OE,
|
GPIO_VAPI_RGPIO_OE,
|
GPIO_VAPI_RGPIO_INTE,
|
GPIO_VAPI_RGPIO_INTE,
|
GPIO_VAPI_RGPIO_PTRIG,
|
GPIO_VAPI_RGPIO_PTRIG,
|
GPIO_VAPI_RGPIO_AUX,
|
GPIO_VAPI_RGPIO_AUX,
|
GPIO_VAPI_RGPIO_CTRL,
|
GPIO_VAPI_RGPIO_CTRL,
|
GPIO_NUM_VAPI_IDS };
|
GPIO_NUM_VAPI_IDS };
|
|
|
|
|
/*
|
/*
|
* Implementatino of GPIO Code Registers and State
|
* Implementatino of GPIO Code Registers and State
|
*/
|
*/
|
struct gpio_device
|
struct gpio_device
|
{
|
{
|
/* Is peripheral enabled */
|
/* Is peripheral enabled */
|
int enabled;
|
int enabled;
|
|
|
/* Base address in memory */
|
/* Base address in memory */
|
oraddr_t baseaddr;
|
oraddr_t baseaddr;
|
|
|
/* Which IRQ to generate */
|
/* Which IRQ to generate */
|
int irq;
|
int irq;
|
|
|
/* Which GPIO is this? */
|
/* Which GPIO is this? */
|
unsigned gpio_number;
|
unsigned gpio_number;
|
|
|
/* VAPI IDs */
|
/* VAPI IDs */
|
unsigned long base_vapi_id;
|
unsigned long base_vapi_id;
|
|
|
/* Auxiliary inputs */
|
/* Auxiliary inputs */
|
unsigned long auxiliary_inputs;
|
unsigned long auxiliary_inputs;
|
|
|
/* Visible registers */
|
/* Visible registers */
|
struct
|
struct
|
{
|
{
|
unsigned long in;
|
unsigned long in;
|
unsigned long out;
|
unsigned long out;
|
unsigned long oe;
|
unsigned long oe;
|
unsigned long inte;
|
unsigned long inte;
|
unsigned long ptrig;
|
unsigned long ptrig;
|
unsigned long aux;
|
unsigned long aux;
|
unsigned long ctrl;
|
unsigned long ctrl;
|
unsigned long ints;
|
unsigned long ints;
|
|
|
int external_clock;
|
int external_clock;
|
} curr, next;
|
} curr, next;
|
};
|
};
|
|
|
|
|
|
|
|
|
#endif /* __OR1KSIM_PERIPHERAL_GPIO_I_H */
|
#endif /* __OR1KSIM_PERIPHERAL_GPIO_I_H */
|
|
|