initial changes
This commit is contained in:
@@ -0,0 +1,199 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2006 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ALT_AVALON_JTAG_UART_H__
|
||||
#define __ALT_AVALON_JTAG_UART_H__
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "sys/alt_alarm.h"
|
||||
#include "sys/alt_warning.h"
|
||||
|
||||
#include "os/alt_hooks.h"
|
||||
#include "os/alt_sem.h"
|
||||
#include "os/alt_flag.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* If the user wants all drivers to be small rather than fast then make sure
|
||||
* this one is marked as needing to be small.
|
||||
*/
|
||||
#if defined ALT_USE_SMALL_DRIVERS && !defined ALTERA_AVALON_JTAG_UART_SMALL
|
||||
#define ALTERA_AVALON_JTAG_UART_SMALL
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If the user wants to ignore FIFO full error after timeout
|
||||
*/
|
||||
#if defined ALT_JTAG_UART_IGNORE_FIFO_FULL_ERROR && !defined ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
|
||||
#define ALTERA_AVALON_JTAG_UART_IGNORE_FIFO_FULL_ERROR
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Constants that can be overriden.
|
||||
*/
|
||||
#ifndef ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT
|
||||
#define ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT 10
|
||||
#endif
|
||||
|
||||
#ifndef ALTERA_AVALON_JTAG_UART_BUF_LEN
|
||||
#define ALTERA_AVALON_JTAG_UART_BUF_LEN 2048
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ALT_JTAG_UART_READ_RDY and ALT_JTAG_UART_WRITE_RDY are the bitmasks
|
||||
* that define uC/OS-II event flags that are releated to this device.
|
||||
*
|
||||
* ALT_JTAG_UART_READ_RDY indicates that there is read data in the buffer
|
||||
* ready to be processed. ALT_JTAG_UART_WRITE_RDY indicates that the transmitter is
|
||||
* ready for more data.
|
||||
*/
|
||||
#define ALT_JTAG_UART_READ_RDY 0x1
|
||||
#define ALT_JTAG_UART_WRITE_RDY 0x2
|
||||
#define ALT_JTAG_UART_TIMEOUT 0x4
|
||||
|
||||
/*
|
||||
* State structure definition. Each instance of the driver uses one
|
||||
* of these structures to hold its associated state.
|
||||
*/
|
||||
|
||||
typedef struct altera_avalon_jtag_uart_state_s
|
||||
{
|
||||
unsigned int base;
|
||||
|
||||
#ifndef ALTERA_AVALON_JTAG_UART_SMALL
|
||||
|
||||
unsigned int timeout; /* Timeout until host is assumed inactive */
|
||||
alt_alarm alarm;
|
||||
unsigned int irq_enable;
|
||||
volatile unsigned int host_inactive;
|
||||
|
||||
ALT_SEM (read_lock)
|
||||
ALT_SEM (write_lock)
|
||||
ALT_FLAG_GRP (events)
|
||||
|
||||
/* The variables below are volatile because they are modified by the
|
||||
* interrupt routine. Making them volatile and reading them atomically
|
||||
* means that we don't need any large critical sections.
|
||||
*/
|
||||
volatile unsigned int rx_in;
|
||||
unsigned int rx_out;
|
||||
unsigned int tx_in;
|
||||
volatile unsigned int tx_out;
|
||||
char rx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN];
|
||||
char tx_buf[ALTERA_AVALON_JTAG_UART_BUF_LEN];
|
||||
|
||||
#endif /* !ALTERA_AVALON_JTAG_UART_SMALL */
|
||||
|
||||
} altera_avalon_jtag_uart_state;
|
||||
|
||||
/*
|
||||
* Macros used by alt_sys_init when the ALT file descriptor facility isn't used.
|
||||
*/
|
||||
|
||||
#ifdef ALTERA_AVALON_JTAG_UART_SMALL
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \
|
||||
altera_avalon_jtag_uart_state state = \
|
||||
{ \
|
||||
name##_BASE, \
|
||||
}
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state)
|
||||
|
||||
#else /* !ALTERA_AVALON_JTAG_UART_SMALL */
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state) \
|
||||
altera_avalon_jtag_uart_state state = \
|
||||
{ \
|
||||
name##_BASE, \
|
||||
ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \
|
||||
}
|
||||
|
||||
/*
|
||||
* Externally referenced routines
|
||||
*/
|
||||
extern void altera_avalon_jtag_uart_init(altera_avalon_jtag_uart_state* sp,
|
||||
int irq_controller_id, int irq);
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state) \
|
||||
{ \
|
||||
if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \
|
||||
{ \
|
||||
ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \
|
||||
"You have selected the interrupt driven version of " \
|
||||
"the ALTERA Avalon JTAG UART driver, but the " \
|
||||
"interrupt is not connected for this device. You can " \
|
||||
"select a polled mode driver by checking the 'small " \
|
||||
"driver' option in the HAL configuration window, or " \
|
||||
"by using the -DALTERA_AVALON_JTAG_UART_SMALL " \
|
||||
"preprocessor flag."); \
|
||||
} \
|
||||
else \
|
||||
altera_avalon_jtag_uart_init(&state, \
|
||||
name##_IRQ_INTERRUPT_CONTROLLER_ID, \
|
||||
name##_IRQ); \
|
||||
}
|
||||
|
||||
#endif /* ALTERA_AVALON_JTAG_UART_SMALL */
|
||||
|
||||
/*
|
||||
* Include in case non-direct version of driver required.
|
||||
*/
|
||||
#include "altera_avalon_jtag_uart_fd.h"
|
||||
|
||||
/*
|
||||
* Map alt_sys_init macros to direct or non-direct versions.
|
||||
*/
|
||||
#ifdef ALT_USE_DIRECT_DRIVERS
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, state) \
|
||||
ALTERA_AVALON_JTAG_UART_STATE_INSTANCE(name, state)
|
||||
#define ALTERA_AVALON_JTAG_UART_INIT(name, state) \
|
||||
ALTERA_AVALON_JTAG_UART_STATE_INIT(name, state)
|
||||
|
||||
#else /* !ALT_USE_DIRECT_DRIVERS */
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_INSTANCE(name, dev) \
|
||||
ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, dev)
|
||||
#define ALTERA_AVALON_JTAG_UART_INIT(name, dev) \
|
||||
ALTERA_AVALON_JTAG_UART_DEV_INIT(name, dev)
|
||||
|
||||
#endif /* ALT_USE_DIRECT_DRIVERS */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __ALT_AVALON_JTAG_UART_H__ */
|
||||
@@ -0,0 +1,125 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2007 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ALT_AVALON_JTAG_UART_FD_H__
|
||||
#define __ALT_AVALON_JTAG_UART_FD_H__
|
||||
|
||||
#include "sys/alt_dev.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Externally referenced routines
|
||||
*/
|
||||
extern int altera_avalon_jtag_uart_read_fd (alt_fd* fd, char* ptr, int len);
|
||||
extern int altera_avalon_jtag_uart_write_fd (alt_fd* fd, const char* ptr,
|
||||
int len);
|
||||
|
||||
/*
|
||||
* Device structure definition. This is needed by alt_sys_init in order to
|
||||
* reserve memory for the device instance.
|
||||
*/
|
||||
|
||||
typedef struct altera_avalon_jtag_uart_dev_s
|
||||
{
|
||||
alt_dev dev;
|
||||
altera_avalon_jtag_uart_state state;
|
||||
} altera_avalon_jtag_uart_dev;
|
||||
|
||||
/*
|
||||
* Macros used by alt_sys_init when the ALT file descriptor facility is used.
|
||||
*/
|
||||
|
||||
#ifdef ALTERA_AVALON_JTAG_UART_SMALL
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \
|
||||
static altera_avalon_jtag_uart_dev d = \
|
||||
{ \
|
||||
{ \
|
||||
ALT_LLIST_ENTRY, \
|
||||
name##_NAME, \
|
||||
NULL, /* open */ \
|
||||
NULL, /* close */ \
|
||||
altera_avalon_jtag_uart_read_fd, \
|
||||
altera_avalon_jtag_uart_write_fd, \
|
||||
NULL, /* lseek */ \
|
||||
NULL, /* fstat */ \
|
||||
NULL, /* ioctl */ \
|
||||
}, \
|
||||
{ \
|
||||
name##_BASE, \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) alt_dev_reg (&d.dev)
|
||||
|
||||
#else /* !ALTERA_AVALON_JTAG_UART_SMALL */
|
||||
|
||||
extern int altera_avalon_jtag_uart_close_fd(alt_fd* fd);
|
||||
extern int altera_avalon_jtag_uart_ioctl_fd (alt_fd* fd, int req, void* arg);
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_DEV_INSTANCE(name, d) \
|
||||
static altera_avalon_jtag_uart_dev d = \
|
||||
{ \
|
||||
{ \
|
||||
ALT_LLIST_ENTRY, \
|
||||
name##_NAME, \
|
||||
NULL, /* open */ \
|
||||
altera_avalon_jtag_uart_close_fd, \
|
||||
altera_avalon_jtag_uart_read_fd, \
|
||||
altera_avalon_jtag_uart_write_fd, \
|
||||
NULL, /* lseek */ \
|
||||
NULL, /* fstat */ \
|
||||
altera_avalon_jtag_uart_ioctl_fd, \
|
||||
}, \
|
||||
{ \
|
||||
name##_BASE, \
|
||||
ALTERA_AVALON_JTAG_UART_DEFAULT_TIMEOUT, \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_DEV_INIT(name, d) \
|
||||
{ \
|
||||
ALTERA_AVALON_JTAG_UART_STATE_INIT(name, d.state); \
|
||||
\
|
||||
/* make the device available to the system */ \
|
||||
alt_dev_reg(&d.dev); \
|
||||
}
|
||||
|
||||
#endif /* ALTERA_AVALON_JTAG_UART_SMALL */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __ALT_AVALON_JTAG_UART_FD_H__ */
|
||||
@@ -0,0 +1,73 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ALTERA_AVALON_JTAG_UART_REGS_H__
|
||||
#define __ALTERA_AVALON_JTAG_UART_REGS_H__
|
||||
|
||||
#include "io.h"
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_DATA_REG 0
|
||||
#define IOADDR_ALTERA_AVALON_JTAG_UART_DATA(base) \
|
||||
__IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_DATA_REG)
|
||||
#define IORD_ALTERA_AVALON_JTAG_UART_DATA(base) \
|
||||
IORD(base, ALTERA_AVALON_JTAG_UART_DATA_REG)
|
||||
#define IOWR_ALTERA_AVALON_JTAG_UART_DATA(base, data) \
|
||||
IOWR(base, ALTERA_AVALON_JTAG_UART_DATA_REG, data)
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_DATA_DATA_MSK (0x000000FF)
|
||||
#define ALTERA_AVALON_JTAG_UART_DATA_DATA_OFST (0)
|
||||
#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_MSK (0x00008000)
|
||||
#define ALTERA_AVALON_JTAG_UART_DATA_RVALID_OFST (15)
|
||||
#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_MSK (0xFFFF0000)
|
||||
#define ALTERA_AVALON_JTAG_UART_DATA_RAVAIL_OFST (16)
|
||||
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_REG 1
|
||||
#define IOADDR_ALTERA_AVALON_JTAG_UART_CONTROL(base) \
|
||||
__IO_CALC_ADDRESS_NATIVE(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG)
|
||||
#define IORD_ALTERA_AVALON_JTAG_UART_CONTROL(base) \
|
||||
IORD(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG)
|
||||
#define IOWR_ALTERA_AVALON_JTAG_UART_CONTROL(base, data) \
|
||||
IOWR(base, ALTERA_AVALON_JTAG_UART_CONTROL_REG, data)
|
||||
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_MSK (0x00000001)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_RE_OFST (0)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_MSK (0x00000002)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_WE_OFST (1)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_MSK (0x00000100)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_RI_OFST (8)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_MSK (0x00000200)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_WI_OFST (9)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_MSK (0x00000400)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_AC_OFST (10)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_MSK (0xFFFF0000)
|
||||
#define ALTERA_AVALON_JTAG_UART_CONTROL_WSPACE_OFST (16)
|
||||
|
||||
#endif /* __ALTERA_AVALON_JTAG_UART_REGS_H__ */
|
||||
@@ -0,0 +1,67 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ALTERA_AVALON_PIO_REGS_H__
|
||||
#define __ALTERA_AVALON_PIO_REGS_H__
|
||||
|
||||
#include <io.h>
|
||||
|
||||
#define IOADDR_ALTERA_AVALON_PIO_DATA(base) __IO_CALC_ADDRESS_NATIVE(base, 0)
|
||||
#define IORD_ALTERA_AVALON_PIO_DATA(base) IORD(base, 0)
|
||||
#define IOWR_ALTERA_AVALON_PIO_DATA(base, data) IOWR(base, 0, data)
|
||||
|
||||
#define IOADDR_ALTERA_AVALON_PIO_DIRECTION(base) __IO_CALC_ADDRESS_NATIVE(base, 1)
|
||||
#define IORD_ALTERA_AVALON_PIO_DIRECTION(base) IORD(base, 1)
|
||||
#define IOWR_ALTERA_AVALON_PIO_DIRECTION(base, data) IOWR(base, 1, data)
|
||||
|
||||
#define IOADDR_ALTERA_AVALON_PIO_IRQ_MASK(base) __IO_CALC_ADDRESS_NATIVE(base, 2)
|
||||
#define IORD_ALTERA_AVALON_PIO_IRQ_MASK(base) IORD(base, 2)
|
||||
#define IOWR_ALTERA_AVALON_PIO_IRQ_MASK(base, data) IOWR(base, 2, data)
|
||||
|
||||
#define IOADDR_ALTERA_AVALON_PIO_EDGE_CAP(base) __IO_CALC_ADDRESS_NATIVE(base, 3)
|
||||
#define IORD_ALTERA_AVALON_PIO_EDGE_CAP(base) IORD(base, 3)
|
||||
#define IOWR_ALTERA_AVALON_PIO_EDGE_CAP(base, data) IOWR(base, 3, data)
|
||||
|
||||
|
||||
#define IOADDR_ALTERA_AVALON_PIO_SET_BIT(base) __IO_CALC_ADDRESS_NATIVE(base, 4)
|
||||
#define IORD_ALTERA_AVALON_PIO_SET_BITS(base) IORD(base, 4)
|
||||
#define IOWR_ALTERA_AVALON_PIO_SET_BITS(base, data) IOWR(base, 4, data)
|
||||
|
||||
#define IOADDR_ALTERA_AVALON_PIO_CLEAR_BITS(base) __IO_CALC_ADDRESS_NATIVE(base, 5)
|
||||
#define IORD_ALTERA_AVALON_PIO_CLEAR_BITS(base) IORD(base, 5)
|
||||
#define IOWR_ALTERA_AVALON_PIO_CLEAR_BITS(base, data) IOWR(base, 5, data)
|
||||
|
||||
|
||||
|
||||
/* Defintions for direction-register operation with bi-directional PIOs */
|
||||
#define ALTERA_AVALON_PIO_DIRECTION_INPUT 0
|
||||
#define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1
|
||||
|
||||
#endif /* __ALTERA_AVALON_PIO_REGS_H__ */
|
||||
@@ -0,0 +1,60 @@
|
||||
#ifndef __ALT_AVALON_SYSID_QSYS_H__
|
||||
#define __ALT_AVALON_SYSID_QSYS_H__
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
* Altera does not recommend, suggest or require that this reference design *
|
||||
* file be used in conjunction or combination with any other product. *
|
||||
******************************************************************************/
|
||||
|
||||
#include "alt_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* ALTERA_AVALON_SYSID_QSYS_INSTANCE is the macro used by alt_sys_init() to
|
||||
* allocate any per device memory that may be required. In this case no
|
||||
* allocation is necessary.
|
||||
*/
|
||||
|
||||
#define ALTERA_AVALON_SYSID_QSYS_INSTANCE(name, dev) extern int alt_no_storage
|
||||
#define ALTERA_AVALON_SYSID_QSYS_INIT(name, dev) while (0)
|
||||
|
||||
#ifdef SYSID_BASE
|
||||
alt_32 alt_avalon_sysid_qsys_test(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __ALT_AVALON_SYSID_QSYS_H__ */
|
||||
@@ -0,0 +1,42 @@
|
||||
/******************************************************************************
|
||||
* *
|
||||
* License Agreement *
|
||||
* *
|
||||
* Copyright (c) 2003 Altera Corporation, San Jose, California, USA. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the "Software"), *
|
||||
* to deal in the Software without restriction, including without limitation *
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
|
||||
* and/or sell copies of the Software, and to permit persons to whom the *
|
||||
* Software is furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in *
|
||||
* all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
|
||||
* DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* This agreement shall be governed in all respects by the laws of the State *
|
||||
* of California and by the laws of the United States of America. *
|
||||
* *
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ALTERA_AVALON_SYSID_QSYS_REGS_H__
|
||||
#define __ALTERA_AVALON_SYSID_QSYS_REGS_H__
|
||||
|
||||
#include <io.h>
|
||||
|
||||
#define IOADDR_ALTERA_AVALON_SYSID_QSYS_ID(base) __IO_CALC_ADDRESS_NATIVE(base, 0)
|
||||
#define IORD_ALTERA_AVALON_SYSID_QSYS_ID(base) IORD(base, 0)
|
||||
|
||||
#define IOADDR_ALTERA_AVALON_SYSID_QSYS_TIMESTAMP(base) __IO_CALC_ADDRESS_NATIVE(base, 1)
|
||||
#define IORD_ALTERA_AVALON_SYSID_QSYS_TIMESTAMP(base) IORD(base, 1)
|
||||
|
||||
#endif /* __ALTERA_AVALON_SYSID_QSYS_REGS_H__ */
|
||||
Reference in New Issue
Block a user