Changeset 360823ca in mainline


Ignore:
Timestamp:
2012-11-04T12:21:03Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef93167
Parents:
e5e2d73
Message:

rootamdm37x: Use checks instead of ifdefs.

Prevents accidental compile breakage and DCE will get red of the code anyway if not used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/infrastructure/rootamdm37x/rootamdm37x.c

    re5e2d73 r360823ca  
    3737#define _DDF_DATA_IMPLANT
    3838
    39 #define DEBUG_CM
     39#define DEBUG_CM 1
    4040
    4141#include <ddf/driver.h>
     
    6464} amdm37x_t;
    6565
    66 #ifdef DEBUG_CM
    6766static void log(volatile void *place, uint32_t val, volatile void* base, size_t size, void *data, bool write)
    6867{
     
    7069            (place - base) + data, place, val);
    7170}
    72 #endif
    7371
    7472static int amdm37x_hw_access_init(amdm37x_t *device)
     
    102100                return ret;
    103101
    104 #ifdef DEBUG_CM
    105         pio_trace_enable(device->tll, AMDM37x_USBTLL_SIZE, log, (void*)AMDM37x_USBTLL_BASE_ADDRESS);
    106         pio_trace_enable(device->cm.clocks, CLOCK_CONTROL_CM_SIZE, log, (void*)CLOCK_CONTROL_CM_BASE_ADDRESS);
    107         pio_trace_enable(device->cm.core, CORE_CM_SIZE, log, (void*)CORE_CM_BASE_ADDRESS);
    108         pio_trace_enable(device->cm.usbhost, USBHOST_CM_SIZE, log, (void*)USBHOST_CM_BASE_ADDRESS);
    109         pio_trace_enable(device->uhh, AMDM37x_UHH_SIZE, log, (void*)AMDM37x_UHH_BASE_ADDRESS);
    110 #endif
     102        if (DEBUG_CM) {
     103                pio_trace_enable(device->tll, AMDM37x_USBTLL_SIZE, log, (void*)AMDM37x_USBTLL_BASE_ADDRESS);
     104                pio_trace_enable(device->cm.clocks, CLOCK_CONTROL_CM_SIZE, log, (void*)CLOCK_CONTROL_CM_BASE_ADDRESS);
     105                pio_trace_enable(device->cm.core, CORE_CM_SIZE, log, (void*)CORE_CM_BASE_ADDRESS);
     106                pio_trace_enable(device->cm.usbhost, USBHOST_CM_SIZE, log, (void*)USBHOST_CM_BASE_ADDRESS);
     107                pio_trace_enable(device->uhh, AMDM37x_UHH_SIZE, log, (void*)AMDM37x_UHH_BASE_ADDRESS);
     108        }
    111109        return EOK;
    112110}
     
    153151                pio_set_32(&device->cm.usbhost->iclken,
    154152                    USBHOST_CM_ICLKEN_EN_USBHOST, 5);
    155 #ifdef DEBUG_CM
    156         printf("DPLL5 (and everything else) should be on: %"PRIx32" %"PRIx32".\n",
    157             pio_read_32((ioport32_t*)&device->cm.clocks->idlest_ckgen),
    158             pio_read_32((ioport32_t*)&device->cm.clocks->idlest2_ckgen));
    159 #endif
     153
     154                if (DEBUG_CM) {
     155                        printf("DPLL5 (and everything else) should be on: %"
     156                            PRIx32" %"PRIx32".\n",
     157                            pio_read_32((ioport32_t*)&device->cm.clocks->idlest_ckgen),
     158                            pio_read_32((ioport32_t*)&device->cm.clocks->idlest2_ckgen));
     159                }
    160160        } else {
    161161                /* Disable interface and function clock for USB hosts */
Note: See TracChangeset for help on using the changeset viewer.