URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 1488 to Rev 1489
- ↔ Reverse comparison
Rev 1488 → Rev 1489
/trunk/or1ksim/peripheral/gpio.c
36,6 → 36,8
#include "debug.h" |
#include "sched.h" |
|
DEFAULT_DEBUG_CHANNEL(gpio); |
|
static void gpio_vapi_read( unsigned long id, unsigned long data, void *dat ); |
static uint32_t gpio_read32( oraddr_t addr, void *dat ); |
static void gpio_write32( oraddr_t addr, uint32_t value, void *dat ); |
103,7 → 105,7
struct gpio_device *gpio = dat; |
|
switch( addr ) { |
case RGPIO_IN: debug( 5, "GPIO: Cannot write to RGPIO_IN\n" ); break; |
case RGPIO_IN: TRACE( "GPIO: Cannot write to RGPIO_IN\n" ); break; |
case RGPIO_OUT: gpio->next.out = value; break; |
case RGPIO_OE: gpio->next.oe = value; break; |
case RGPIO_INTE: gpio->next.inte = value; break; |
121,13 → 123,13
unsigned which; |
struct gpio_device *gpio = dat; |
|
debug( 5, "GPIO: id %08lx, data %08lx\n", id, data ); |
TRACE( "GPIO: id %08lx, data %08lx\n", id, data ); |
|
which = id - gpio->base_vapi_id; |
|
switch( which ) { |
case GPIO_VAPI_DATA: |
debug( 4, "GPIO: Next input from VAPI = 0x%08lx (RGPIO_OE = 0x%08lx)\n", |
TRACE( "GPIO: Next input from VAPI = 0x%08lx (RGPIO_OE = 0x%08lx)\n", |
data, gpio->next.oe ); |
gpio->next.in = data; |
break; |
195,7 → 197,7
|
/* If any outputs changed, notify the world (i.e. vapi) */ |
if ( gpio->next.out != gpio->curr.out ) { |
debug( 4, "GPIO: New output 0x%08lx, RGPIO_OE = 0x%08lx\n", gpio->next.out, |
TRACE( "GPIO: New output 0x%08lx, RGPIO_OE = 0x%08lx\n", gpio->next.out, |
gpio->next.oe ); |
if ( gpio->base_vapi_id ) |
vapi_send( gpio->base_vapi_id + GPIO_VAPI_DATA, gpio->next.out ); |
203,7 → 205,7
|
/* If any inputs changed and interrupt enabled, generate interrupt */ |
if ( gpio->next.in != gpio->curr.in ) { |
debug( 4, "GPIO: New input 0x%08lx\n", gpio->next.in ); |
TRACE( "GPIO: New input 0x%08lx\n", gpio->next.in ); |
|
if ( gpio->next.ctrl & RGPIO_CTRL_INTE ) { |
unsigned changed_bits = gpio->next.in ^ gpio->curr.in; /* inputs that have changed */ |
212,7 → 214,7
unsigned relevant_bits = (gpio->next.ptrig & set_bits) | (~gpio->next.ptrig & cleared_bits); |
|
if ( relevant_bits & gpio->next.inte ) { |
debug( 3, "GPIO: Reporting interrupt %d\n", gpio->irq ); |
TRACE( "GPIO: Reporting interrupt %d\n", gpio->irq ); |
gpio->next.ctrl |= RGPIO_CTRL_INTS; |
gpio->next.ints |= relevant_bits & gpio->next.inte; |
/* Since we can't report an interrupt during a readmem/writemem |
/trunk/or1ksim/support/dbchs.h
28,3 → 28,4
DECLARE_DEBUG_CHANNEL(eth) |
DECLARE_DEBUG_CHANNEL(config) |
DECLARE_DEBUG_CHANNEL(ata) |
DECLARE_DEBUG_CHANNEL(gpio) |