Ignore:
Timestamp:
2012-10-09T21:31:38Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
954b6458
Parents:
a829a5b
Message:

kernel drivers directory layout reorganization and UART improvements:

  • Put AM335x and AMDM37 specific code under the appropriate directories.

Beaglebone specific changes:

  • Initialize the UART0 when bbone_init() is called.
File:
1 edited

Legend:

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

    ra829a5b r0fb70e1  
    3535#include <arch/exception.h>
    3636#include <arch/mach/beaglebone/beaglebone.h>
    37 #include <genarch/drivers/am335x_irc/am335x_irc.h>
     37#include <genarch/drivers/am335x/irc.h>
     38#include <genarch/drivers/am335x/uart.h>
     39#include <genarch/srln/srln.h>
    3840#include <interrupt.h>
    3941#include <ddi/ddi.h>
     
    5456static struct beaglebone {
    5557        am335x_irc_regs_t *irc_addr;
     58        am335x_uart_t uart;
    5659} bbone;
    5760
    5861struct arm_machine_ops bbone_machine_ops = {
    59         bbone_init,
    60         bbone_timer_irq_start,
    61         bbone_cpu_halt,
    62         bbone_get_memory_extents,
    63         bbone_irq_exception,
    64         bbone_frame_init,
    65         bbone_output_init,
    66         bbone_input_init,
    67         bbone_get_irq_count,
    68         bbone_get_platform_name
     62        .machine_init = bbone_init,
     63        .machine_timer_irq_start = bbone_timer_irq_start,
     64        .machine_cpu_halt = bbone_cpu_halt,
     65        .machine_get_memory_extents = bbone_get_memory_extents,
     66        .machine_irq_exception = bbone_irq_exception,
     67        .machine_frame_init = bbone_frame_init,
     68        .machine_output_init = bbone_output_init,
     69        .machine_input_init = bbone_input_init,
     70        .machine_get_irq_count = bbone_get_irq_count,
     71        .machine_get_platform_name = bbone_get_platform_name,
    6972};
    7073
     
    105108static void bbone_output_init(void)
    106109{
     110        const bool ok = am335x_uart_init(&bbone.uart,
     111            AM335x_UART0_IRQ, AM335x_UART0_BASE_ADDRESS,
     112            AM335x_UART0_SIZE);
     113
     114        if (ok)
     115                stdout_wire(&bbone.uart.outdev);
    107116}
    108117
    109118static void bbone_input_init(void)
    110119{
     120        srln_instance_t *srln_instance = srln_init();
     121        if (srln_instance) {
     122                indev_t *sink = stdin_wire();
     123                indev_t *srln = srln_wire(srln_instance, sink);
     124                am335x_uart_input_wire(&bbone.uart, srln);
     125                am335x_irc_enable(bbone.irc_addr, AM335x_UART0_IRQ);
     126        }
    111127}
    112128
    113129size_t bbone_get_irq_count(void)
    114130{
    115         return 0;
     131        return AM335x_IRC_IRQ_COUNT;
    116132}
    117133
Note: See TracChangeset for help on using the changeset viewer.