Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 47bd0f8 in mainline


Ignore:
Timestamp:
2013-01-17T19:56:43Z (9 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master
Children:
28a6190
Parents:
17cc8f4f
Message:

bbone initialization:

  • initialize the DMTIMER0.
  • the bbone_get_memory_extents() function should return the memory start address and size.
  • dispatch exceptions to the appropriate interrupt handler.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mach/beaglebone/beaglebone.c

    r17cc8f4f r47bd0f8  
    4444#include <mm/km.h>
    4545
     46#define BBONE_MEMORY_START       0x80000000      /* physical */
     47#define BBONE_MEMORY_SIZE        0x10000000      /* 256 MB */
     48
    4649static void bbone_init(void);
    4750static void bbone_timer_irq_start(void);
     
    8184
    8285        am335x_irc_init(bbone.irc_addr);
     86
     87        /* Initialize the DMTIMER0 */
     88        am335x_timer_init(&bbone.timer, DMTIMER0, HZ);
    8389}
    8490
     
    127133static void bbone_get_memory_extents(uintptr_t *start, size_t *size)
    128134{
     135        *start = BBONE_MEMORY_START;
     136        *size  = BBONE_MEMORY_SIZE;
    129137}
    130138
    131139static void bbone_irq_exception(unsigned int exc_no, istate_t *istate)
    132140{
     141        const unsigned inum = am335x_irc_inum_get(bbone.irc_addr);
     142        am335x_irc_irq_ack(bbone.irc_addr);
     143
     144        irq_t *irq = irq_dispatch_and_lock(inum);
     145        if (irq) {
     146                /* The IRQ handler was found. */
     147                irq->handler(irq);
     148                spinlock_unlock(&irq->lock);
     149        } else {
     150                printf("Spurious interrupt\n");
     151        }
    133152}
    134153
     
    143162            AM335x_UART0_SIZE);
    144163
    145         if (ok)
     164        if (ok) {
    146165                stdout_wire(&bbone.uart.outdev);
     166                printf("UART Ok\n");
     167        }
    147168}
    148169
Note: See TracChangeset for help on using the changeset viewer.