LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: György 'nog' Jeney<nog@s...>
    Date: Fri May 20 21:26:10 CEST 2005
    Subject: [openrisc] [or1ksim #90] Make gpio use the new debugging functions
    Top
    Hi,

    Changelog says it all.

    ChangeLog:
    * Make the gpio use the new debugging functions.

    nog.
    -------------- next part --------------
    --- peripheral/gpio.c 2005-05-13 22:05:34.000000000 +0200
    +++ ../or1ksim-ac/peripheral/gpio.c 2005-05-20 21:04:01.000000000 +0200
    @@ -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 @@ void gpio_write32( oraddr_t addr, uint32
    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 @@ void gpio_vapi_read( unsigned long id, u
    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 @@ static void gpio_device_clock( struct gp

    /* 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 @@ static void gpio_device_clock( struct gp

    /* 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 @@ static void gpio_device_clock( struct gp
    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
    --- support/dbchs.h 2005-05-20 20:54:57.000000000 +0200
    +++ ../or1ksim-ac/support/dbchs.h 2005-05-20 21:04:15.000000000 +0200
    @@ -28,3 +28,4 @@ DECLARE_DEBUG_CHANNEL(uart)
    DECLARE_DEBUG_CHANNEL(eth)
    DECLARE_DEBUG_CHANNEL(config)
    DECLARE_DEBUG_CHANNEL(ata)
    +DECLARE_DEBUG_CHANNEL(gpio)

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.