Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Eda driver #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Build-Linux-32b-arm
if: matrix.platform == 'ubuntu-latest'
run: |
GOARCH=arm CGO_ENABLED=0 \
GOARCH=arm CGO_ENABLED=1 \
CC=arm-linux-gnueabihf-gcc \
CC_FOR_TARGET=arm-linux-gnueabihf-gcc \
go install -v ./...
Expand Down
54 changes: 54 additions & 0 deletions eda/alt_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#ifndef __ALT_TYPES_H__
#define __ALT_TYPES_H__

/******************************************************************************
* *
* License Agreement *
* *
* Copyright (c) 2009 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. *
******************************************************************************/

/*
* Don't declare these typedefs if this file is included by assembly source.
*/
#ifndef ALT_ASM_SRC
typedef signed char alt_8;
typedef unsigned char alt_u8;
typedef signed short alt_16;
typedef unsigned short alt_u16;
typedef signed long alt_32;
typedef unsigned long alt_u32;
typedef long long alt_64;
typedef unsigned long long alt_u64;
#endif

#define ALT_INLINE __inline__
#define ALT_ALWAYS_INLINE __attribute__((always_inline))
#define ALT_WEAK __attribute__((weak))

#endif /* __ALT_TYPES_H__ */
115 changes: 115 additions & 0 deletions eda/altera_avalon_fifo_regs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/******************************************************************************
* *
* 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 __ALTERA_AVALON_FIFO_REGS_H__
#define __ALTERA_AVALON_FIFO_REGS_H__

#include <io.h>

#define ALTERA_AVALON_FIFO_OTHER_INFO_REG 1
#define ALTERA_AVALON_FIFO_DATA_REG 0

#define ALTERA_AVALON_FIFO_LEVEL_REG 0
#define ALTERA_AVALON_FIFO_STATUS_REG 1
#define ALTERA_AVALON_FIFO_EVENT_REG 2
#define ALTERA_AVALON_FIFO_IENABLE_REG 3
#define ALTERA_AVALON_FIFO_ALMOSTFULL_REG 4
#define ALTERA_AVALON_FIFO_ALMOSTEMPTY_REG 5

// Read slave
#define IORD_ALTERA_AVALON_FIFO_DATA(base) \
IORD(base, ALTERA_AVALON_FIFO_DATA_REG)

#define IORD_ALTERA_AVALON_FIFO_OTHER_INFO(base) \
IORD(base, ALTERA_AVALON_FIFO_OTHER_INFO_REG)

// Write slave
#define IOWR_ALTERA_AVALON_FIFO_DATA(base, data) \
IOWR(base, ALTERA_AVALON_FIFO_DATA_REG, data)

#define IOWR_ALTERA_AVALON_FIFO_OTHER_INFO(base, data) \
IOWR(base, ALTERA_AVALON_FIFO_OTHER_INFO_REG, data)

// Control slave
#define IORD_ALTERA_AVALON_FIFO_LEVEL(base) \
IORD(base, ALTERA_AVALON_FIFO_LEVEL_REG)

#define IORD_ALTERA_AVALON_FIFO_STATUS(base) \
IORD(base, ALTERA_AVALON_FIFO_STATUS_REG)

#define IORD_ALTERA_AVALON_FIFO_EVENT(base) \
IORD(base, ALTERA_AVALON_FIFO_EVENT_REG)

#define IORD_ALTERA_AVALON_FIFO_IENABLE(base) \
IORD(base, ALTERA_AVALON_FIFO_IENABLE_REG)

#define IORD_ALTERA_AVALON_FIFO_ALMOSTFULL(base) \
IORD(base, ALTERA_AVALON_FIFO_ALMOSTFULL_REG)

#define IORD_ALTERA_AVALON_FIFO_ALMOSTEMPTY(base) \
IORD(base, ALTERA_AVALON_FIFO_ALMOSTEMPTY_REG)

#define IOWR_ALTERA_AVALON_FIFO_EVENT(base, data) \
IOWR(base, ALTERA_AVALON_FIFO_EVENT_REG, data)

#define IOWR_ALTERA_AVALON_FIFO_IENABLE(base, data) \
IOWR(base, ALTERA_AVALON_FIFO_IENABLE_REG, data)

#define IOWR_ALTERA_AVALON_FIFO_ALMOSTFULL(base, data) \
IOWR(base, ALTERA_AVALON_FIFO_ALMOSTFULL_REG, data)

#define IOWR_ALTERA_AVALON_FIFO_ALMOSTEMPTY(base, data) \
IOWR(base, ALTERA_AVALON_FIFO_ALMOSTEMPTY_REG, data)

#define ALTERA_AVALON_FIFO_EVENT_F_MSK (0x01)
#define ALTERA_AVALON_FIFO_EVENT_E_MSK (0x02)
#define ALTERA_AVALON_FIFO_EVENT_AF_MSK (0x04)
#define ALTERA_AVALON_FIFO_EVENT_AE_MSK (0x08)
#define ALTERA_AVALON_FIFO_EVENT_OVF_MSK (0x10)
#define ALTERA_AVALON_FIFO_EVENT_UDF_MSK (0x20)
#define ALTERA_AVALON_FIFO_EVENT_ALL (0x3F)

#define ALTERA_AVALON_FIFO_STATUS_F_MSK (0x01)
#define ALTERA_AVALON_FIFO_STATUS_E_MSK (0x02)
#define ALTERA_AVALON_FIFO_STATUS_AF_MSK (0x04)
#define ALTERA_AVALON_FIFO_STATUS_AE_MSK (0x08)
#define ALTERA_AVALON_FIFO_STATUS_OVF_MSK (0x10)
#define ALTERA_AVALON_FIFO_STATUS_UDF_MSK (0x20)
#define ALTERA_AVALON_FIFO_STATUS_ALL (0x3F)

#define ALTERA_AVALON_FIFO_IENABLE_F_MSK (0x01)
#define ALTERA_AVALON_FIFO_IENABLE_E_MSK (0x02)
#define ALTERA_AVALON_FIFO_IENABLE_AF_MSK (0x04)
#define ALTERA_AVALON_FIFO_IENABLE_AE_MSK (0x08)
#define ALTERA_AVALON_FIFO_IENABLE_OVF_MSK (0x10)
#define ALTERA_AVALON_FIFO_IENABLE_UDF_MSK (0x20)
#define ALTERA_AVALON_FIFO_IENABLE_ALL (0x3F)

#endif /* __ALTERA_AVALON_FIFO_REGS_H__ */
Loading